Industrial visual inspection system and method based on multi-mode dynamic switching
Through the industrial vision detection system with multi-mode dynamic switching, the contradiction between detection accuracy and speed is solved, efficient visual detection is achieved, adapting to the needs of different industrial scenarios, and improving detection efficiency and accuracy.
Patent Information
- Application Number
- CN202510625463.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-15
Smart Images

Figure CN120495254A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent manufacturing technology, and in particular to an industrial vision inspection system and method based on multi-mode dynamic switching. Background Art
[0002] Driven by the innovative application of next-generation information technology, end-products are increasingly demanding higher performance indicators for PCBs. This trend presents unprecedented technical challenges for quality inspection during the production process, particularly in high-end manufacturing. Modern inspection technologies require a breakthrough solution to a critical problem: achieving extremely high inspection accuracy to meet product quality requirements while ensuring inspection speeds that keep pace with modern production lines. This places enormous pressure on traditional inspection methods, necessitating an urgent need for innovative technical solutions. Driven by the deepening national strategy for the digital transformation of manufacturing, intelligent manufacturing technologies are reshaping traditional industrial production models. As a crucial component of intelligent manufacturing, industrial automation equipment and technologies demonstrate strong development potential. Within this process, machine vision inspection technology, due to its unique technical advantages, is increasingly becoming a core supporting technology for intelligent PCB production. By introducing intelligent vision inspection systems, PCB manufacturers can significantly improve production efficiency while establishing a comprehensive quality traceability system that provides a solid data foundation for process optimization and quality control.
[0003] In automated PCB production systems, the inspection technology used for key equipment such as board unloaders and conveyor systems directly impacts overall production efficiency. Traditional photoelectric sensor-based inspection solutions have inherent limitations: First, discrete sensors capture limited information, making them incapable of meeting complex inspection requirements. Second, fixed-threshold detection mechanisms lack the necessary flexibility to adapt to the diverse product inspection requirements. These technical limitations are particularly pronounced in flexible manufacturing scenarios. With advances in visual inspection technology, intelligent camera systems are gradually replacing traditional sensors in PCB production lines. However, existing visual inspection systems still face several key technical bottlenecks in practical application. Current mainstream visual inspection systems generally utilize a single operating mode design, which suffers from significant adaptability limitations. Specifically, while synchronous inspection mode ensures accuracy, it struggles to meet high-speed inspection requirements. While asynchronous mode offers rapid response, its use of historical data can compromise accuracy. This single-mode limitation severely restricts the system's effectiveness in diverse production scenarios. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to propose an industrial visual inspection system and method based on dynamic switching of multiple modes, so as to solve the contradiction between detection accuracy and speed and improve detection efficiency and accuracy by dynamically switching multiple modes.
[0005] In order to solve the above technical problems, the present invention provides an industrial visual inspection system based on multi-mode dynamic switching, including: A video acquisition module, configured to acquire video detection data using a multi-mode acquisition method, wherein the multi-mode includes a synchronous mode, an asynchronous mode, and a real-time mode; The intelligent processing module is used to perform visual detection of moving targets and fixed areas according to the current working mode, obtain detection results, and analyze continuous frame sequences through a recurrent neural network to obtain dynamic tracking results; The control interface module is used to receive and decode standardized instructions, interact with the PLC control system according to the decoded standardized instructions, and implement a multi-level fault-tolerant strategy.
[0006] In order to solve the above technical problems, the present invention provides an industrial visual inspection method based on multi-mode dynamic switching, including: Receiving a standardized mode switching instruction from a PLC control system through an industrial control interface, wherein the standardized mode switching instruction includes target mode information and a detection number; Verifying the instruction format compliance, target mode resource availability, and device status in the standardized mode switching instruction; If the verification passes, the context information of the current working mode is saved and the configuration parameters of the target mode are loaded; Switching from the current working mode to a target mode based on the context information and the configuration parameters, and performing visual inspection processing based on the target mode.
[0007] The embodiment of the present invention provides an industrial visual inspection system and method based on multi-mode dynamic switching. The system includes: a video acquisition module for collecting video detection data through a multi-mode acquisition method, wherein the multi-mode includes a synchronous mode, an asynchronous mode and a real-time mode; an intelligent processing module for performing visual detection on moving targets and fixed areas according to the current working mode to obtain detection results, and analyzing continuous frame sequences through a recurrent neural network to obtain dynamic tracking results; a control interface module for receiving and decoding standardized instructions, interacting with a PLC control system according to the decoded standardized instructions, and executing a multi-level fault-tolerant strategy. The embodiment of the present invention realizes dynamic switching of three detection modes: synchronous, asynchronous and real-time through the collaborative work of the video acquisition module, the intelligent processing module and the control interface module, thereby improving the detection speed while ensuring the detection accuracy. It has the advantages of resolving the contradiction between detection accuracy and speed by dynamically switching multiple modes, and improving detection efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0009] Figure 1 Schematic diagram of an industrial visual inspection system based on multi-mode dynamic switching provided by an embodiment of the present application; Figure 2 This is a schematic diagram of the structure of the video acquisition module provided in an embodiment of the present application; Figure 3 is a structural diagram of the intelligent processing module provided in an embodiment of the present application; Figure 4 is a schematic structural diagram of a control interface module provided in an embodiment of the present application; Figure 5 This is a flowchart of the implementation process of the industrial visual inspection method based on multi-mode dynamic switching provided by the embodiment of the present application; Figure 6 This is a flowchart of a sub-process in the industrial visual inspection method based on multi-mode dynamic switching provided by an embodiment of the present application; Figure 7 This is another implementation flowchart of a sub-process in the industrial visual inspection method based on multi-mode dynamic switching provided in an embodiment of the present application. DETAILED DESCRIPTION
[0010] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0011] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0012] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0013] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0014] Please refer to Figure 1 , this application provides an embodiment of an industrial visual inspection system based on multi-mode dynamic switching. Figure 1 As shown, the industrial visual inspection system based on multi-mode dynamic switching of this embodiment includes: a video acquisition module 10, an intelligent processing module 20 and a control interface module 30, wherein: The video acquisition module 10 is used to collect video detection data through a multi-mode acquisition method, wherein the multi-mode includes a synchronous mode, an asynchronous mode and a real-time mode; the intelligent processing module 20 is used to perform visual detection of moving targets and fixed areas according to the current working mode, obtain detection results, and analyze continuous frame sequences through a recurrent neural network to obtain dynamic tracking results; the control interface module 30 is used to receive and decode standardized instructions, interact with the PLC control system according to the decoded standardized instructions, and execute a multi-level fault-tolerant strategy.
[0015] Specifically, the data processed by the embodiments of this application originates from video streams and image data in industrial visual inspection systems, primarily including PLC control signals and visual inspection signals. PLC control signals are input and output via standardized location mapping (e.g., #X=Y format), including instructions such as heartbeat packets (#1=101) and mode switching (#2=103). Visual inspection data refers to real-time video streams from industrial cameras, used to detect the status of targets such as robotic arms and PCBs (e.g., "Board present at NG station" and "Neutral pressure on robotic arm").
[0016] The industrial visual inspection system based on multi-mode dynamic switching provided in the embodiment of the present application is a virtual AI chip architecture concept, which abstracts the AI visual inspection function into a standardized industrial control unit through modular design. Among them, the virtual AI chip is an artificial intelligence acceleration module based on a programmable hardware architecture, which uses FPGA or ASIC as the hardware basis and provides AI acceleration function through the hardware abstraction layer. This module realizes data interaction through a specific address mapping method in the PLC control system. Typical interaction instructions include instruction input in the format of #1=101 and status output in the format of #1=0 or #1=1. It supports three programmable working modes: synchronous processing, asynchronous processing and real-time processing, and strictly follows the industrial interface standards to ensure that the output signal never appears in the zero value state.
[0017] A PLC control system is a type of industrial automation control equipment that utilizes a programmable logic controller as its core control unit. This device executes user-programmed control programs to perform logical operations, sequential control, timing operations, counting functions, and data processing. It is equipped with digital and analog input / output interfaces, as well as various communication interfaces, for precise control of mechanical equipment and industrial production processes. This system integrates self-relay control technology, blending modern computer technology with industrial communication technologies. It boasts high reliability and strong anti-interference properties, making it widely applicable in a variety of industrial fields, including precise control of robotic arms, process industry production management, and infrastructure automation systems.
[0018] Industrial visual inspection is an industrial automation inspection method based on computer vision technology, used to identify and determine the status of target objects on the production line in real time. This embodiment uses image acquisition equipment to acquire visual information about target objects (including but not limited to PCBs and robotic arms) in industrial scenarios. It then employs image processing algorithms to detect the following typical industrial scenarios: the presence of a printed circuit board at an unloaded workstation, the presence of a printed circuit board at a DM station, and the negative pressure status of a robotic arm.
[0019] Multimodal visual inspection refers to an industrial visual inspection system architecture that integrates synchronous, asynchronous, and real-time working modes and supports dynamic switching to meet the differentiated requirements of different industrial scenarios for detection accuracy, response speed, and continuous monitoring.
[0020] In the embodiments of the present application, three operating modes (synchronous mode, asynchronous mode, and real-time mode) are implemented based on a unified hardware architecture, and dynamic switching of operating states is achieved through programmable instructions. Each processing module forms a collaborative processing pipeline through a high-speed interconnect bus, and adopts an intelligent resource scheduling mechanism to achieve dynamic optimization configuration of computing resources: synchronous mode prioritizes processing accuracy, asynchronous mode adopts a load balancing strategy, and real-time mode focuses on optimizing response speed. This flexible resource allocation architecture significantly improves overall energy efficiency while ensuring industrial-grade system reliability. Among them, dynamic switching refers to an intelligent industrial visual inspection system working mode conversion mechanism that can achieve fast and seamless switching between synchronous mode, asynchronous mode, and real-time mode. Triggered by standardized instructions, the system automatically executes processes such as saving the current mode context, loading new configuration parameters, and status feedback to ensure that the switching process is efficient and reliable.
[0021] See also Figure 2 , Figure 2 FIG. 1 shows a schematic diagram of the structure of the video acquisition module 10. The video acquisition module 10 includes a synchronous mode acquisition unit 101, an asynchronous mode acquisition unit 102, and a real-time mode acquisition unit 103, wherein: The synchronous mode acquisition unit 101 is used to acquire the latest video detection data in a triggered manner; the asynchronous mode acquisition unit 102 is used to acquire the video detection data through a dynamically updated frame buffer queue; and the real-time mode acquisition unit 103 is used to acquire the video detection data through a parallel pipeline architecture.
[0022] Specifically, the video acquisition module 10 serves as the data input end of the system, and it adopts an adaptive multi-mode acquisition strategy to collect video detection data. In synchronous mode, the latest video frame is acquired by triggering, thereby ensuring strict synchronization of the data. In asynchronous mode, the video detection data is collected through a dynamically updated frame buffer queue to achieve dynamic frame buffer management, taking into account both response speed and resource efficiency. In real-time mode, a parallel pipeline architecture is established to collect the video detection data to achieve uninterrupted acquisition and processing. In the embodiment of the present application, the video acquisition module 10 integrates an intelligent environmental adaptation mechanism, which can automatically compensate for changes in light intensity and mechanical vibrations of the equipment, and achieve extremely low-latency image capture through dedicated hardware acceleration.
[0023] See also Figure 3 , Figure 3 FIG. 2 shows a schematic diagram of the structure of the intelligent processing module 20, which includes a dynamic recognition unit 201, a static recognition unit 202 and a timing analysis unit 203, wherein: The dynamic recognition unit 201 is used to use the dynamic recognition engine to perform visual detection on the moving target based on the current working mode to obtain a dynamic detection result; the static recognition unit 202 is used to use the static recognition engine to perform visual detection on the fixed area based on the current working mode to obtain a static detection result; the timing analysis unit 203 is used to analyze the continuous frame sequence through the recurrent neural network to obtain the dynamic tracking result.
[0024] Specifically, the intelligent processing module 20 serves as the computing core of the system and integrates three types of dedicated processing engines. The dynamic recognition engine uses an optimized target detection architecture to handle real-time detection of high-speed moving targets such as robotic arms. The static recognition engine is based on an improved deep convolutional network and is specially optimized for fixed area detection such as PCB board status, supporting parallel recognition of multiple industrial scenarios. The timing analysis unit 203 introduces a recurrent neural network to accurately track dynamic processes such as conveyor belt speed through continuous frame sequence analysis. All engines achieve efficient collaborative computing through a unified hardware acceleration platform to ensure that the real-time requirements of industrial scenarios are met. In the embodiment of the present application, the intelligent processing module 20 can perform visual inspection processing on the processing model (such as moving targets, fixed areas, and continuous frames) based on the current working mode of different processing engines to obtain visual inspection results. At the same time, the sub-timing analysis unit 203 will accurately track dynamic processes such as conveyor belt speed, obtain visual inspection results during the tracking process, and thus obtain dynamic tracking results.
[0025] See also Figure 4 , Figure 4 The schematic diagram of the structure of the control interface module 30 is shown. The control interface module 30 includes an instruction parsing unit 301, a state feedback unit 302 and an exception handling unit 303, wherein: The instruction parsing unit 301 is used to receive the standardized instruction and decode the standardized instruction to obtain the decoded standardized instruction; the state feedback unit 302 is used to return a heartbeat signal and a switching confirmation signal to the PLC control system based on the decoded standardized instruction through a site mapping mechanism; the exception handling unit 303 is used to execute the multi-level fault-tolerant strategy.
[0026] Specifically, the control interface module 30 adopts an industrial-grade reliable interactive design and realizes stable communication based on a three-layer fault-tolerant architecture. The instruction parsing unit 301 realizes instant decoding of standardized instructions through programmable hardware. It receives the standardized instructions and decodes the standardized instructions to obtain the decoded standardized instructions. The state feedback unit 302 adopts a data buffering mechanism to ensure the integrity of information during mode switching. It is used to return a heartbeat signal and a switching confirmation signal to the PLC control system based on the decoded standardized instructions through a site mapping mechanism. The exception handling unit 303 integrates a multi-level fault-tolerant strategy, including communication redundancy switching, algorithm adaptive degradation and hardware safety protection mechanism, which is used to execute the multi-level fault-tolerant strategy. The control interface module 30 in the embodiment of the present application complies with international industrial control standards and supports plug-and-play connection with mainstream PLC systems.
[0027] Site mapping refers to a standardized signal mapping method used in industrial control systems. It establishes a correspondence between logic signals and specific storage locations using a predefined #X=Y instruction format. This method uses 16-bit integers as input and output data formats, with typical instructions including the #2=103 mode switch instruction. To ensure system scalability, four reserved sites are set, and the principle of non-zero AI output is adhered to to ensure control signal reliability. This technology accurately maps detection results to specific binary bits in programmable logic controller registers, with each bit corresponding to an independent status signal.
[0028] Furthermore, after the state feedback unit 302, the system also includes an instruction receiving unit, an instruction verification unit, a context information storage unit and a visual detection unit, wherein: the instruction receiving unit is used to receive a standardized mode switching instruction from the PLC control system, wherein the standardized mode switching instruction includes target mode information and a detection number; the instruction verification unit is used to verify the instruction format compliance, target mode resource availability and device status in the standardized mode switching instruction; the context information storage unit is used to save the context information of the current working mode and load the configuration parameters of the target mode if the verification is passed; the visual detection unit is used to switch from the current working mode to the target mode based on the context information and the configuration parameters, and perform visual detection processing based on the target mode.
[0029] The embodiments of this application implement dynamic switching between synchronous, asynchronous, and real-time operating modes, as well as security verification during the dynamic switching process. Dynamic switching refers to an intelligent mechanism for converting operating modes in industrial visual inspection systems, enabling rapid and seamless switching between synchronous, asynchronous, and real-time modes. This technology is triggered by standardized instructions, and the system automatically executes processes such as saving the current mode context, loading new configuration parameters, and providing status feedback, ensuring an efficient and reliable switching process.
[0030] Specifically, when the system receives a standardized mode switching instruction sent by the PLC control system, the instruction receiving unit first parses the target mode information and detection number in the instruction. For example, the target mode information may include an identification code for synchronous mode, asynchronous mode, or real-time mode. Subsequently, the instruction verification unit performs a compliance check on the instruction format, such as verifying whether the data packet length complies with the protocol definition, and further checking whether the camera and processor resources required for the target mode are not occupied by other tasks. At the same time, the device status verification module detects the real-time status of the motion control unit and image acquisition module, such as confirming that the device is fault-free by reading the error code register of the motor driver. If all the above verifications are passed, the context information storage unit saves the detection threshold, task queue, and device configuration parameters in the current working mode to the flash memory, for example, using a differential backup method to only save the changed data to reduce storage overhead. After the save is completed, the system loads the detection algorithm, frame processing rate, and communication protocol parameters corresponding to the target mode from the configuration parameter library, such as setting the frame buffer queue size in asynchronous mode to 256 frames. The visual inspection unit then initializes the detection environment of the target mode based on the saved context information, and starts the corresponding detection process according to the loaded parameters, such as starting the parallel pipeline acquisition architecture when switching to real-time mode. The embodiment of the present application solves the problem of switching failure caused by illegal instructions, resource conflicts or equipment abnormalities when the industrial visual inspection system switches between multiple modes, and avoids the interruption of the inspection task caused by mode switching. The complete preservation of context information and the accurate loading of configuration parameters ensure that the system can immediately perform visual processing based on the detection logic of the target mode after switching, and maintain the consistency and continuity of the inspection results. The standardized instruction verification mechanism further improves the reliability of the interaction between the system and the PLC control system, and prevents system state disorder caused by erroneous instructions.
[0031] A standardized mode switch instruction refers to a mode switch request issued by a PLC control system that complies with a predefined communication protocol. This can be implemented using a structured data packet containing the target mode code and detection number. For example, the packet format can include a header identifier, a mode code field, and a checksum field, thereby ensuring the standardization of the instruction source and content. Instruction format compliance means that the communication protocol and data structure of the switch instruction must meet pre-set standards. Specifically, a protocol parsing engine can be used to verify the header identifier, field length, and checksum of the instruction to prevent illegal instruction input. Target mode resource availability refers to whether the hardware resources or software modules corresponding to the target mode are available. Specifically, the resource status table can be used to query the camera, processor, and storage resource usage required for the target mode. For example, the resource status table can record the real-time occupancy flags of each module. Device status verification ensures that the device is in a stable operating state when executing a mode switch. Specifically, a device self-test program can be used to check whether the operating parameters of key components are within thresholds. Context information preservation involves storing the detection parameters, device configuration, and task progress data for the current mode in non-volatile memory. For example, snapshot technology can be used to completely back up the operating status in memory to ensure that critical data is not lost during the switch. Configuration parameter loading refers to reading the detection algorithm parameters, communication protocol settings, and resource allocation strategies corresponding to the target mode from a preset configuration library. For example, the configuration library can store parameter sets under different modes in the form of key-value pairs.
[0032] In one specific embodiment, the mode switching process adopts a four-stage security mechanism: in the instruction triggering stage, the PLC control system sends a standardized instruction containing the target mode and detection content parameters; the system then enters the verification stage to comprehensively check the legitimacy of the instruction and resource availability; after passing the verification, the system will save the current processing context and load the new configuration parameters in the state transition stage; finally, in the confirmation feedback stage, it returns a #2=1 signal to ensure data continuity and business losslessness throughout the entire switching process.
[0033] Furthermore, the visual detection unit includes a mode switching subunit, a synchronous mode detection subunit, an asynchronous mode detection subunit and a real-time mode detection subunit, wherein: A mode switching subunit is used to switch from the current working mode to the target mode based on the context information and the configuration parameters using a unified control interface; a synchronous mode detection subunit is used to obtain the latest frame video detection data based on the detection instruction if the target mode is the synchronous mode, and perform visual detection based on the latest frame video detection data, and return the visual detection result through MQTT; an asynchronous mode detection subunit is used to obtain the current cached video frame from the cached video frame based on the detection instruction if the target mode is the asynchronous mode, and perform visual detection based on the current cached video frame, and return the visual detection result through MQTT; a real-time mode detection subunit is used to continuously collect and detect video stream detection data if the target mode is the real-time mode, and update the PLC register if the detection result changes.
[0034] Among them, the unified control interface refers to a standardized communication protocol interface, which is used to eliminate protocol differences when switching between different modes. Context information refers to the system operating status data in the current mode, which can be saved using memory snapshot technology to ensure the integrity of parameter transmission when switching modes. Configuration parameters refer to the set of operating parameters required for the target mode, which can be loaded through an XML configuration file to achieve rapid adaptation to different detection scenarios. The MQTT protocol refers to a message queue telemetry transmission protocol, which can adopt a QoS level 1 transmission mechanism to ensure the reliability of the transmission of detection results. Cached video frames refer to a dynamically updated image data queue, which can be implemented using a ring buffer structure to balance data processing speed and resource usage.
[0035] Specifically, when the system receives a mode switch command, the mode switch subunit parses context information and configuration parameters through a unified control interface to complete hardware resource allocation and software state migration. In synchronous mode, the system captures sensor trigger signals through an interrupt mechanism, immediately obtains the latest video frames captured by the industrial camera for real-time analysis, and pushes the detection results to the monitoring terminal via the MQTT protocol. In asynchronous mode, the system maintains a video frame buffer queue of a preset length and dynamically selects the optimal time point for defect recognition based on the detection command, avoiding the computational pressure caused by directly processing high-speed data streams. In real-time mode, the system establishes a continuous video stream processing channel. When a PCB board position offset or defect signature is detected, the status flag of the PLC control system is immediately updated through a register mapping mechanism. This application achieves seamless and adaptive switching between different detection modes, matching different production speed requirements while ensuring detection accuracy. The collaborative working mechanism of the buffer queue and real-time stream processing effectively balances the contradiction between data processing speed and computing resource utilization. The real-time status update mechanism based on register mapping enables the PLC control system to instantly obtain production line anomaly information, reducing the response latency of traditional systems from seconds to milliseconds.
[0036] In the embodiments of the present application, multi-mode visual inspection can be achieved. Among them, the synchronous mode adopts a standard request-response working mechanism. When the PLC control system sends a standard detection instruction containing parameters such as the detection number, the system will immediately obtain the current latest video frame and execute the complete target detection and state recognition process, and finally accurately write the structured detection results into the specified register. The synchronous mode ensures the highest detection accuracy by forcing the use of real-time image data. Although the processing timeliness is relatively low, it can effectively avoid various types of misjudgment risks that may be caused by the use of non-real-time image data. It is particularly suitable for industrial quality inspection links that require extremely high detection accuracy.
[0037] Asynchronous mode utilizes an intelligent cache management mechanism to maintain a dynamically updated image frame buffer in the background. Upon receiving a trigger command from the PLC control system, the system immediately analyzes and processes the most recently cached video frame, significantly reducing the time required to capture new frames. This design significantly improves response speed while maintaining reasonable accuracy, making it particularly suitable for scenarios such as robotic arm positioning that require a balance between real-time performance and accuracy. The system automatically manages the lifecycle of cached frames to ensure that historical data remains within the valid time window.
[0038] Real-time mode utilizes a continuous processing pipeline architecture to continuously analyze video stream detection data. It implements a change-triggered update mechanism based on an intelligent interpolation algorithm, updating PLC registers only when detection results change. This mode supports flexible storage location settings via dedicated configuration instructions (e.g., #2=104) and offers the lowest end-to-end latency, making it particularly suitable for industrial scenarios requiring immediate response, such as conveyor belt monitoring / gating, and anomaly detection. The system's dynamic resource scheduling mechanism ensures stable processing performance even under high data throughput conditions.
[0039] Furthermore, the above three working modes achieve seamless switching through a unified control interface. All three working modes use the standardized #X=Y instruction format for full-duplex control and status feedback, share the same underlying detection algorithm engine to ensure result consistency, support dynamic switching during runtime without interrupting business processes, and have a unified exception handling and data consistency guarantee mechanism across modes. Among them, each working mode has been specially optimized for industrial scenarios: the synchronous mode strengthens the image preprocessing module and algorithm accuracy compensation; the asynchronous mode optimizes the cache update strategy and fast response mechanism, and the real-time mode improves the change detection sensitivity and resource scheduling algorithm. The multi-mode collaborative architecture adopted in the embodiment of the present application enables the system to intelligently adapt to diverse industrial vision needs from precision detection to high-speed monitoring, and the processing flow can be reconstructed through simple instruction switching, which greatly improves the applicability and flexibility of the equipment. All modes follow the same non-zero output principle and exception handling specifications to ensure reliable operation in industrial environments.
[0040] Efficient multi-mode operation is inseparable from deep collaboration with industrial control systems.
[0041] Furthermore, the PLC interface corresponding to the control interface module 30 adopts a partitioned control architecture, which includes a heartbeat packet area, an instruction reading area, an instruction writing area and a real-time data area, wherein the heartbeat packet area is used to periodically send a 0 / 1 alternating signal, the instruction reading area is used to receive mode switching instructions and parameter configuration instructions, the instruction writing area is used to feedback the system status and switching confirmation signal, and the real-time data area is used to allocate the detection result storage location through a dynamic mapping algorithm.
[0042] Specifically, the system employs an innovative four-zone partitioning scheme, dividing the PLC interface into four functionally independent and logically isolated dedicated areas: the heartbeat packet area is responsible for system activity detection and implements periodic link maintenance via command #1=101; the command read area serves as a dedicated channel for the PLC to send control commands to the AI, processing all control signals, including command #2=103 mode switch; the command write area is used by the AI to provide feedback on system status and response results to the PLC; and the real-time data area is dedicated to transmitting continuously updated detection data. A key feature of this architecture lies in its abstract numbered addressing scheme. All areas are accessed using standardized numbers such as #1 and #2, with specific PLC physical address mapping implemented by an external MQTT communication module and MC protocol conversion layer. The control signal area is precisely located at locations 1-4, with #1 dedicated to heartbeat packet commands, #2 processing core control commands such as mode switch, and #3 and #4 transmitting detection number and mode code parameters, respectively. The data exchange area intelligently occupies locations 5-16. A dynamic mapping algorithm allocates independent communication channels to each detection task, ensuring signal isolation and data integrity during multi-task parallel processing. The embodiment of the present application not only maintains the simplicity of the interface protocol, but also achieves compatibility and adaptation with various PLC devices through the external address translation layer.
[0043] Specifically, the embodiments of this application utilize efficient communication protocol specifications. The system uses the standard format #X=Y to construct a streamlined and efficient instruction system, where X represents the target site number and Y represents the set parameter value. To fully demonstrate the protocol design details, the following Table 1 lists the complete instruction set specifications and their functional definitions:
[0044] The efficient communication protocol specification provided in the embodiment of the present application can reserve sufficient expansion space for system function upgrades while maintaining the simplicity of the instruction set, perfectly adapting to the dual requirements of the industrial automation field for communication protocol reliability and flexibility.
[0045] Furthermore, the embodiment of the present application constructs a multi-level abnormality protection system to ensure stable operation under complex working conditions in industrial environments. In the basic protection layer, the system maintains the health of the communication link through continuous heartbeat monitoring, uses 0 / 1 alternating signals for activity detection, and automatically triggers a system reset when response timeouts occur continuously. The data interaction layer implements strict quality control, including multiple protection mechanisms such as non-zero value verification, instruction format compliance check, and operation permission interception. As the senior management level of exception handling, the upper computer collaborative management and control system achieves more flexible permission control and resource scheduling through deep integration with three working modes. When an abnormal situation occurs, the system will immediately start the intelligent recovery process: first, it will automatically fall back to the preset safe operation mode to ensure basic functions, and at the same time record the abnormal log in detail including timestamps, error codes, environmental parameters and other information, and support engineers to perform fault analysis through the remote diagnostic interface.
[0046] In an embodiment of the present application, a video acquisition module 10 is used to collect video detection data through a multi-mode acquisition method, wherein the multi-mode includes a synchronous mode, an asynchronous mode, and a real-time mode; an intelligent processing module 20 is used to perform visual detection of moving targets and fixed areas according to the current working mode, obtain detection results, and analyze continuous frame sequences through a recurrent neural network to obtain dynamic tracking results; a control interface module 30 is used to receive and decode standardized instructions, interact with the PLC control system according to the decoded standardized instructions, and execute a multi-level fault-tolerant strategy. The embodiment of the present invention realizes dynamic switching of the three detection modes of synchronous, asynchronous, and real-time through the coordinated work of the video acquisition module 10, the intelligent processing module 20, and the control interface module 30, thereby improving the detection speed while ensuring the detection accuracy. It has the advantages of resolving the contradiction between detection accuracy and speed by dynamically switching multiple modes, and improving detection efficiency and accuracy.
[0047] The embodiments of the present application realize the intelligent coordination and seamless switching of three working modes: synchronous, asynchronous and real-time in the field of industrial visual inspection, so that a single system can perfectly adapt to the needs of diversified industrial scenarios from high-precision detection to high-speed monitoring, and significantly improve the comprehensive use efficiency of the equipment. Dynamic switching of working modes can be achieved through standardized PLC instructions without the need for shutdown or reconfiguration, which greatly improves the flexibility and adaptability of the production line and meets the needs of flexible manufacturing. The embodiments of the present application adopt a partitioned control architecture and communication protocol design to ensure system stability during multi-tasking parallel processing and mode switching, effectively avoid signal conflicts and data loss, and ensure the reliability of continuous production. The embodiments of the present application adopt an intelligent resource scheduling mechanism to automatically optimize the configuration of computing resources according to different modes, significantly improving the system energy efficiency while ensuring performance, and reducing overall operating costs.
[0048] See also Figure 5 , Figure 5A specific implementation of the industrial visual inspection method based on multi-mode dynamic switching is shown. The industrial visual inspection method based on multi-mode dynamic switching is implemented by the above-mentioned industrial visual inspection system based on multi-mode dynamic switching.
[0049] It should be noted that the method of the present invention is not limited to the method of Figure 1 The process sequence shown is limited to the following steps: S1: receiving a standardized mode switching instruction from a PLC control system through an industrial control interface, wherein the standardized mode switching instruction includes target mode information and a detection number; S2: Verify the instruction format compliance, target mode resource availability and device status in the standardized mode switching instruction; S3: If the verification is successful, the context information of the current working mode is saved and the configuration parameters of the target mode are loaded; S4: Switching from the current working mode to the target mode based on the context information and the configuration parameters, and performing visual detection processing based on the target mode.
[0050] Specifically, when the PLC control system sends a command containing a target mode code, the industrial control interface first verifies that the command structure complies with length requirements and field definition rules, filtering out malformed packets. It then checks whether the image processing algorithm corresponding to the target mode has been loaded into memory, confirming that the camera device is ready and eliminating resource conflicts. During the device status verification phase, sensor data and device self-test reports are read to confirm that key indicators such as robotic arm positioning accuracy and light source stability meet the mode switching conditions. Once verified, operating status information, including the progress parameters and cached frame index of the current image analysis thread, is stored in non-volatile memory. Detection parameters, such as exposure parameters and ROI settings, corresponding to the target mode are retrieved from the configuration library. During the mode switching process, an interrupt shielding mechanism protects critical processes, and double buffering technology is employed to achieve seamless switching of detection strategies. In synchronous mode, the system prioritizes acquiring the latest video frame triggered by the sensor and performs defect detection after pre-processing using histogram equalization. In asynchronous mode, video frames within a specified time window are extracted from the ring buffer and motion compensation algorithms are used to eliminate image jitter. In real-time mode, a video stream processing pipeline is established, dynamically tracking target changes using inter-frame differencing.
[0051] Among them, the detection number refers to the unique identifier associated with the detection task, which can be implemented by a hash value generated based on the timestamp and production line number, and is used to verify the matching of the instruction with the current production task. Instruction format compliance verification refers to checking the integrity of the data structure, which can be implemented by comparing with predefined templates to prevent illegal instruction injection. Target mode resource availability verification refers to confirming that the system has the hardware resources and software configuration required to execute the target mode, which can be implemented by resource occupancy status query and dependency library detection to avoid mode switching failure. Context information preservation refers to recording the parameter set of the current operating status, which can be implemented by memory snapshot and register transfer technology to ensure that the original detection process can be restored when the mode is rolled back. Dynamic loading of configuration parameters refers to initializing system parameters according to the target mode requirements, which can be implemented by a combination of configuration files and dynamic link library calls to achieve rapid switching of detection strategies.
[0052] Compared with existing technologies, traditional visual inspection systems only support manual mode switching and lack a verification mechanism, which poses the risk of system crashes due to misoperation. Existing methods directly overwrite operating parameters when switching inspection modes, which can easily lead to data loss and logical errors. This solution establishes a standardized instruction parsing process, adopts a triple verification mechanism to effectively isolate illegal operations, and maintains system state continuity through context preservation technology. Compared to single-mode inspection systems that can only use historical frames or real-time frames, this method can dynamically select the optimal data source based on production needs, improving response speed while ensuring inspection accuracy.
[0053] The embodiments of the present application address the problem of traditional visual inspection systems being unable to balance detection accuracy and response speed due to their single operating mode. A dynamic switching mechanism enables the system to automatically adapt to different inspection scenarios. For example, synchronous mode is enabled during precision welding processes to ensure detection accuracy, while asynchronous mode is switched during material sorting to improve processing efficiency. Standardized verification processes effectively prevent equipment downtime due to erroneous instructions, and context preservation technology avoids data loss during mode switching, enabling the system to quickly switch between multiple inspection strategies while maintaining operational stability.
[0054] Please refer to Figure 6. Figure 6 A specific implementation of step S2 is shown, which is described in detail as follows: S21: Performing compliance verification on the instruction format in the standardized mode switching instruction; S22: Checking whether the target mode information in the standardized mode switching instruction corresponds to a target mode code within a preset range to verify the target mode resource availability; S23: Verify the matching between the detection number in the standardized mode switching instruction and the current detection task, and verify the device status.
[0055] Specifically, during the mode switching instruction processing, the system first filters out abnormal instructions that do not conform to the communication protocol through instruction format compliance verification to avoid system parsing anomalies caused by data packet errors. The target mode code is then validated to ensure that the system has preloaded the algorithm model and hardware resources required for that mode, preventing resource conflicts during the switching process. Finally, the matching of the detection number and the current detection task is verified, combined with real-time monitoring of equipment operating parameters and sensor status, to ensure that the mode switching request matches the production line's current production task and equipment operating status, avoiding switching operations when the equipment is abnormal or under high load.
[0056] Among them, instruction format compliance verification refers to the inspection of instruction syntax structure and field arrangement rules, which can be implemented by regular expression matching or predefined template comparison to exclude illegal instruction input with incorrect format. Target mode code preset range verification refers to confirming that the mode identifier specified in the instruction belongs to the system's configured mode set. This can be achieved by querying the system mode registry to ensure that the target mode switching has available resource support. Detection number matching verification refers to checking the consistency of the task identifier contained in the instruction with the currently executed detection task number. This can be achieved by querying the memory mapping table, combined with the inspection of the sensor working status and system load in the device status verification, to ensure that the switching operation is compatible with the real-time operating environment.
[0057] Traditional mode switching verification methods usually only focus on instruction format verification or single-dimensional inspection of device status, and lack comprehensive verification of target mode resource availability and task context relevance. Problems existing in the prior art such as switching failures caused by unready resources and detection interruptions caused by task mismatches are systematically solved by introducing a multi-level verification mechanism. The embodiments of the present application effectively prevent system anomalies caused by format-error instructions, avoid invalid switching operations to unconfigured modes, eliminate interruptions in the detection process caused by task context mismatches, ensure that the mode switching process is synchronized with the real-time status of the equipment and production task requirements, and realize reliable mode switching of industrial visual inspection systems under complex working conditions.
[0058] See also Figure 7 , Figure 7 A specific implementation of step S4 is shown, which is described in detail as follows: S41: Switching from the current working mode to the target mode based on the context information and the configuration parameters using a unified control interface; S42: If the target mode is the synchronous mode, obtaining the latest frame video detection data based on the detection instruction, performing visual detection based on the latest frame video detection data, and returning the visual detection result via MQTT; S43: If the target mode is the asynchronous mode, obtaining a current cached video frame from the cached video frames based on the detection instruction, performing visual detection based on the current cached video frame, and returning a visual detection result via MQTT; S44: If the target mode is the real-time mode, the video stream detection data is continuously collected and detected, and if the detection result changes, the PLC register is updated.
[0059] Specifically, when the system receives a mode switch command, it parses context information and configuration parameters through a unified control interface to complete hardware resource allocation and software state migration. In synchronous mode, the system captures sensor trigger signals through an interrupt mechanism, immediately obtains the latest video frames captured by the industrial camera for real-time analysis, and pushes the detection results to the monitoring terminal via the MQTT protocol. In asynchronous mode, the system maintains a video frame cache queue of a preset length and dynamically selects the cache frame at the optimal time point according to the detection command to perform defect recognition, avoiding the computational pressure caused by directly processing high-speed data streams. In real-time mode, the system establishes a continuous video stream processing channel. When a PCB board position offset or defect feature is detected, the status flag of the PLC control system is immediately updated through a register mapping mechanism. This application achieves seamless connection and adaptive switching between different detection modes, matching different production speed requirements while ensuring detection accuracy. Through the collaborative working mechanism of the cache queue and real-time stream processing, the contradiction between data processing speed and computing resource utilization is effectively balanced. The real-time status update mechanism based on register mapping enables the PLC control system to instantly obtain production line anomaly information, reducing the response delay of traditional systems from seconds to milliseconds.
[0060] In the embodiments of the present application, multi-mode visual inspection can be achieved. Among them, the synchronous mode adopts a standard request-response working mechanism. When the PLC control system sends a standard detection instruction containing parameters such as the detection number, the system will immediately obtain the current latest video frame and execute the complete target detection and state recognition process, and finally accurately write the structured detection results into the specified register. The synchronous mode ensures the highest detection accuracy by forcing the use of real-time image data. Although the processing timeliness is relatively low, it can effectively avoid various types of misjudgment risks that may be caused by the use of non-real-time image data. It is particularly suitable for industrial quality inspection links that require extremely high detection accuracy.
[0061] Asynchronous mode utilizes an intelligent cache management mechanism to maintain a dynamically updated image frame buffer in the background. Upon receiving a trigger command from the PLC control system, the system immediately analyzes and processes the most recently cached video frame, significantly reducing the time required to capture new frames. This design significantly improves response speed while maintaining reasonable accuracy, making it particularly suitable for scenarios such as robotic arm positioning that require a balance between real-time performance and accuracy. The system automatically manages the lifecycle of cached frames to ensure that historical data remains within the valid time window.
[0062] Real-time mode utilizes a continuous processing pipeline architecture to continuously analyze video stream detection data. It implements a change-triggered update mechanism based on an intelligent interpolation algorithm, updating PLC registers only when detection results change. This mode supports flexible storage location settings via dedicated configuration instructions (e.g., #2=104) and offers the lowest end-to-end latency, making it particularly suitable for industrial scenarios requiring immediate response, such as conveyor belt monitoring / gating, and anomaly detection. The system's dynamic resource scheduling mechanism ensures stable processing performance even under high data throughput conditions.
[0063] Furthermore, these three operating modes enable seamless switching through a unified control interface. All three modes utilize a standardized #X=Y instruction format for full-duplex control and status feedback, share the same underlying detection algorithm engine to ensure consistent results, support dynamic switching during runtime without interrupting business processes, and feature unified exception handling and data consistency mechanisms across all modes.
[0064] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of this application.
[0065] Furthermore, context information is stored in a non-volatile memory to ensure that data can be recovered after a power outage; configuration parameters are dynamically bound to PLC registers through site mapping technology. In a specific embodiment, exception handling is constructed during the visual inspection process, which includes: periodically sending a heartbeat packet instruction #1=101, and alternately outputting a 0 / 1 status signal every 0.5 seconds; automatically falling back to a preset safety mode when the heartbeat packet times out or a hardware failure is detected; and recording an exception log containing a timestamp, error code, and environmental parameters. The embodiment of the present application can achieve a dynamic balance between real-time monitoring and rapid response, and can realize immediate capture and hierarchical handling of exceptions through high-frequency polling and a multi-level early warning mechanism.
[0066] In an embodiment of the present application, a standardized mode switching instruction is received from a PLC control system through an industrial control interface, wherein the standardized mode switching instruction includes target mode information and a detection number; The instruction format compliance, target mode resource availability and device status in the standardized mode switching instruction are verified; if the verification is passed, the context information of the current working mode is saved and the configuration parameters of the target mode are loaded; based on the context information and the configuration parameters, the current working mode is switched to the target mode, and visual inspection processing is performed based on the target mode. The embodiment of the present application realizes intelligent coordination and seamless switching of the three working modes of synchronous, asynchronous and real-time, so that a single system can perfectly adapt to the needs of diversified industrial scenarios from high-precision detection to high-speed monitoring, significantly improving the comprehensive use efficiency of the equipment; at the same time, while ensuring the detection accuracy, the detection speed is improved, and it has the advantages of resolving the contradiction between detection accuracy and speed by dynamically switching multiple modes, and improving detection efficiency and accuracy.
[0067] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of protection of the present application.
Claims
1. An industrial visual inspection system based on multi-mode dynamic switching, characterized in that: include: A video acquisition module, configured to acquire video detection data using a multi-mode acquisition method, wherein the multi-mode includes a synchronous mode, an asynchronous mode, and a real-time mode; The intelligent processing module is used to perform visual detection of moving targets and fixed areas according to the current working mode, obtain detection results, and analyze continuous frame sequences through a recurrent neural network to obtain dynamic tracking results; The control interface module is used to receive and decode standardized instructions, interact with the PLC control system according to the decoded standardized instructions, and implement a multi-level fault-tolerant strategy.
2. The industrial visual inspection system based on multi-mode dynamic switching according to claim 1 is characterized in that: The video acquisition module includes: Synchronous mode acquisition unit, used to collect the latest video detection data through triggering; an asynchronous mode acquisition unit, configured to acquire the video detection data via a dynamically updated frame buffer queue; A real-time mode acquisition unit is used to acquire the video detection data through a parallel pipeline architecture.
3. The industrial visual inspection system based on multi-mode dynamic switching according to claim 1 is characterized in that: The intelligent processing module includes: A dynamic recognition unit, configured to perform visual detection on the moving target based on the current working mode using a dynamic recognition engine to obtain a dynamic detection result; a static recognition unit, configured to perform visual detection on the fixed area based on the current working mode using a static recognition engine to obtain a static detection result; A timing analysis unit is used to analyze the continuous frame sequence through the recurrent neural network to obtain the dynamic tracking result.
4. The industrial visual inspection system based on multi-mode dynamic switching according to claim 1 is characterized in that: The control interface module includes: an instruction parsing unit, configured to receive the standardized instruction and decode the standardized instruction to obtain the decoded standardized instruction; A state feedback unit, configured to return a heartbeat signal and a switching confirmation signal to the PLC control system based on the decoded standardized instruction through a site mapping mechanism; The exception handling unit is used to execute the multi-level fault tolerance strategy.
5. The industrial visual inspection system based on multi-mode dynamic switching according to claim 4 is characterized in that: After the state feedback unit, the system further includes: An instruction receiving unit, configured to receive a standardized mode switching instruction from the PLC control system, wherein the standardized mode switching instruction includes target mode information and a detection number; An instruction verification unit, configured to verify instruction format compliance, target mode resource availability, and device status in the standardized mode switching instruction; A context information saving unit, configured to save the context information of the current working mode and load the configuration parameters of the target mode if the verification is successful; A visual detection unit is configured to switch from the current working mode to a target mode based on the context information and the configuration parameters, and perform visual detection processing based on the target mode.
6. The industrial visual inspection system based on multi-mode dynamic switching according to claim 5 is characterized in that: The visual detection unit includes: a mode switching subunit, configured to switch from the current working mode to a target mode based on the context information and the configuration parameters using a unified control interface; a synchronization mode detection subunit, configured to, if the target mode is the synchronization mode, obtain the latest frame video detection data based on the detection instruction, perform visual detection based on the latest frame video detection data, and return the visual detection result via MQTT; an asynchronous mode detection subunit, configured to, if the target mode is the asynchronous mode, obtain a current cached video frame from the cached video frames based on the detection instruction, perform visual detection based on the current cached video frame, and return a visual detection result via MQTT; The real-time mode detection subunit is used to continuously collect and detect video stream detection data if the target mode is the real-time mode, and update the PLC register if the detection result changes.
7. The industrial visual inspection system based on multi-mode dynamic switching according to claim 1 is characterized in that: The PLC interface corresponding to the control interface module adopts a partitioned control architecture, which includes a heartbeat packet area, an instruction reading area, an instruction writing area and a real-time data area. The heartbeat packet area is used to periodically send a 0 / 1 alternating signal, the instruction reading area is used to receive mode switching instructions and parameter configuration instructions, the instruction writing area is used to feedback the system status and switching confirmation signal, and the real-time data area is used to allocate the detection result storage location through a dynamic mapping algorithm.
8. An industrial visual inspection method based on multi-mode dynamic switching, characterized in that: include: Receiving a standardized mode switching instruction from a PLC control system through an industrial control interface, wherein the standardized mode switching instruction includes target mode information and a detection number; Verifying the instruction format compliance, target mode resource availability, and device status in the standardized mode switching instruction; If the verification passes, the context information of the current working mode is saved and the configuration parameters of the target mode are loaded; Switching from the current working mode to a target mode based on the context information and the configuration parameters, and performing visual inspection processing based on the target mode.
9. The industrial visual inspection method based on multi-mode dynamic switching according to claim 8, characterized in that: The switching from the current working mode to the target mode based on the context information and the configuration parameters, and performing visual detection processing based on the target mode, includes: Using a unified control interface to switch from the current working mode to a target mode based on the context information and the configuration parameters; If the target mode is the synchronous mode, the latest frame video detection data is obtained based on the detection instruction, and visual detection is performed based on the latest frame video detection data, and the visual detection result is returned through MQTT; If the target mode is the asynchronous mode, obtaining a current cached video frame from the cached video frame based on the detection instruction, performing visual detection based on the current cached video frame, and returning a visual detection result via MQTT; If the target mode is real-time mode, the video stream detection data is continuously collected and detected, and if the detection result changes, the PLC register is updated.
10. The industrial visual inspection method based on multi-mode dynamic switching according to claim 8, characterized in that: The verifying of the instruction format compliance, target mode resource availability, and device status in the standardized mode switching instruction includes: Performing compliance verification on the instruction format in the standardized mode switching instruction; Checking whether the target mode information in the standardized mode switching instruction corresponds to a target mode code within a preset range to verify the target mode resource availability; Verify the matching between the detection number in the standardized mode switching instruction and the current detection task, and verify the device status.