Visual inspection process conditional execution control method and control system
By generating task lists, creating conditional control modules and editing execution control conditions, the conditional branch control of the visual inspection process is realized, which solves the problems of high development difficulty and long development cycle caused by relying on text programming in the existing technology, and improves the development of the visual inspection process. Efficiency and intuitiveness.
Patent Information
- Application Number
- CN202110556364.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-21
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-05-21
AI Technical Summary
Existing vision software based on visual graphics programming relies on text programming in the logic control of the inspection process and fails to give full play to the advantages of visual programming, resulting in high development difficulty and long development cycle.
By generating task lists, creating conditional control modules, editing execution control conditions, inserting internal function modules and executing conditional control modules, modular graphic controls are used to achieve logical control, and combined with task creation, editing and management modules, visual control of conditional branches is achieved .
It reduces the development difficulty of the visual inspection process, shortens the development cycle, gives full play to the advantages of visual programming, and improves the efficiency and intuitiveness of logic control.
Smart Images

Figure CN113312043B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision detection, and in particular to a visual detection process conditional execution control method and a control system thereof. Background Art
[0002] Machine vision inspection technology has been widely used in the field of intelligent manufacturing. Machine vision inspection has the advantages of non-contact, fast speed, high precision and good stability. Compared with traditional manual visual inspection, machine vision inspection has huge advantages.
[0003] In the field of machine vision software development, modularizing visual algorithm functions and editing visual inspection processes through a visual graphical interface can reduce the difficulty of visual software development and significantly shorten the development cycle.
[0004] At present, visual software based on visual graphic programming still mostly uses scripts to implement logical control of the detection process. Therefore, it still relies on text programming to a certain extent and cannot give full play to the advantages of visual programming. Summary of the invention
[0005] The purpose of the present invention is to provide a conditional execution control method for a visual inspection process to solve the technical problem existing in the prior art that visual software based on visual graphic programming relies on text programming and cannot give full play to the advantages of visual programming.
[0006] The present invention provides a visual inspection process conditional execution control method, comprising the following steps:
[0007] S1, generate task list
[0008] The task list is used to record the functional modules included in the visual inspection process;
[0009] S2, create conditional control module
[0010] Create a conditional control module and insert it into the task list, then set the number of branch nodes as needed;
[0011] S3, edit execution control conditions
[0012] In the parameter configuration interface, edit the execution control conditions of each branch node;
[0013] S4, insert internal function module
[0014] Insert the visual inspection function module that needs to be controlled and executed under the corresponding branch node as the internal function module of the branch;
[0015] S5, execution condition control module
[0016] Execute the conditional control module. Each branch node judges the control condition in turn, and decides whether the functional module in the branch is executed based on the control condition. When the execution reaches the end node, the conditional control module is completed.
[0017] Furthermore, in step S1, the function module includes a condition control module and a common function module, and the execution order of the tasks is set to be executed from top to bottom according to the position of the function module in the list. The task list has three editing functions: adding, deleting and moving.
[0018] Further, in step S2, the condition control module initially includes a first branch node and an end node.
[0019] Further, in step S2, new branch nodes are added or designated branch nodes are removed through instructions as needed;
[0020] The newly added branch node is automatically inserted into the previous position of the end node;
[0021] The remove command will remove the specified branch node and all internal functional modules of the branch;
[0022] The number of branches of the conditional control module is at least one, and the first branch node cannot be removed.
[0023] Furthermore, in step S3, for any branch node, the corresponding parameter configuration interface is called through instructions to edit the execution control conditions of the branch;
[0024] The execution control condition is a logical expression, which returns true or false status values when executing the judgment.
[0025] Further, in step S4, the function module to be controlled is inserted into the corresponding branch through the adding and moving editing functions of the task list in step S1;
[0026] The internal functional modules of a branch refer to all the functional modules between the branch node and the next branch node in the task list. When any functional module is inserted or moved between a branch node and the next branch node of the branch node, it becomes the internal functional module of the branch.
[0027] Further, in step S5, when the condition control module receives the execution instruction, it determines the execution control condition starting from the first branch node:
[0028] If the control condition is true, the internal function modules of the branch are executed in sequence;
[0029] If the control condition is false, skip the current branch and execute the next branch;
[0030] When the execution reaches the end node, the conditional control module is completed.
[0031] Furthermore, in step S5, the branch to which the functional module belongs is determined according to the branch node of the conditional control module and the index number of each functional module in the task list, thereby controlling the execution of the functional module.
[0032] The present invention also provides a control system for a visual inspection process conditional execution control method, the control system is used to implement the above control method, and includes a task creation module, a task editing module and an operation management module;
[0033] The task creation module is used to create corresponding icons or texts for the task list and various functional modules, and display them in the interactive interface;
[0034] The task editing module is used to complete the insertion, deletion, and movement of the task list, and the addition and removal of nodes and parameter configuration of the conditional control module.
[0035] The operation management module is used to complete the execution logic of each functional module in the task list: for the conditional control module, it is responsible for reading and parsing the logical expressions of branch nodes and making conditional judgments; for the ordinary functional modules, it is responsible for data input and output, and calls the corresponding algorithm interface to implement its function.
[0036] Furthermore, it also includes a task saving module;
[0037] The task saving module is used to implement the saving and loading methods of the visual inspection process. It can save the edited visual inspection process as a project file, and can automatically reconstruct this process by reading the project file.
[0038] The present invention provides a method for conditional execution control of a visual inspection process, which sequentially adopts the steps of generating a task list; creating a conditional control module; editing execution control conditions; inserting an internal function module; and executing the conditional control module, adopts modular graphic controls to realize logic control functions; adopts a visual editing method to perform logic control on the visual inspection process, and gives full play to the advantages of visual programming.
[0039] The present invention provides a control system for a conditional execution control method of a visual inspection process, which adopts a task creation module, a task editing module and an operation management module to modularize the conditional branch control, and can quickly implement and adjust the conditional execution control of the visual inspection process, reduce the development difficulty of visual applications, and shorten the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A flowchart of a method for conditional execution control of a visual inspection process provided by an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a task list interface and interactive functions provided by an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of the execution logic of the conditional control module provided in an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of the structure of a control system for a visual inspection process conditional execution control method provided in an embodiment of the present invention.
[0045] icon:
[0046] 100-task creation module; 200-task editing module;
[0047] 300-operation management module; 400-task saving module;
[0048] 101-task list; 102-condition control module;
[0049] 103-Interactive function menu. DETAILED DESCRIPTION
[0050] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0052] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0053] like Figure 1 As shown, a visual inspection process conditional execution control method provided by the present invention comprises the following steps:
[0054] S1, generate task list
[0055] The task list is used to record the functional modules included in the visual inspection process;
[0056] Furthermore, in step S1, the function module includes a condition control module and a common function module, and the execution order of the tasks is set to be executed from top to bottom according to the position of the function module in the list. The task list has three editing functions: adding, deleting and moving.
[0057] Adding means adding a new functional module to the end of the task list;
[0058] Delete means removing the selected function module from the list;
[0059] Move means moving the selected functional module to the specified location.
[0060] S2, create conditional control module
[0061] Create a conditional control module and insert it into the task list, then set the number of branch nodes as needed;
[0062] Further, in step S2, the condition control module initially includes a first branch node and an end node.
[0063] Further, in step S2, new branch nodes are added or designated branch nodes are removed through instructions as needed;
[0064] The newly added branch node is automatically inserted into the previous position of the end node;
[0065] The remove command will remove the specified branch node and all internal functional modules of the branch;
[0066] The number of branches of the conditional control module is at least one, and the first branch node cannot be removed.
[0067] S3, edit execution control conditions
[0068] In the parameter configuration interface, edit the execution control conditions of each branch node;
[0069] Furthermore, in step S3, for any branch node, the corresponding parameter configuration interface is called through instructions to edit the execution control conditions of the branch;
[0070] The execution control condition is a logical expression, which returns true or false status values when executing the judgment.
[0071] The editing of the task list in steps S1 to S3, the addition and deletion of branch nodes in the conditional control module, and the calling of the parameter configuration interface can all be achieved through the interactive function of the task list interface.
[0072] S4, insert internal function module
[0073] Insert the visual inspection function module that needs to be controlled and executed under the corresponding branch node as the internal function module of the branch;
[0074] Further, in step S4, the function module to be controlled is inserted into the corresponding branch through the adding and moving editing functions of the task list in step S1;
[0075] The internal functional modules of a branch refer to all the functional modules between the branch node and the next branch node in the task list. When any functional module is inserted or moved between a branch node and the next branch node of the branch node, it becomes the internal functional module of the branch.
[0076] S5, execution condition control module
[0077] Execute the conditional control module. Each branch node judges the control condition in turn, and decides whether the functional module in the branch is executed based on the control condition. When the execution reaches the end node, the conditional control module is completed.
[0078] Further, in step S5, when the condition control module receives the execution instruction, it determines the execution control condition starting from the first branch node:
[0079] If the control condition is true, the internal function modules of the branch are executed in sequence;
[0080] If the control condition is false, skip the current branch and execute the next branch;
[0081] When the execution reaches the end node, the conditional control module is completed.
[0082] Furthermore, in step S5, the branch to which the functional module belongs is determined according to the branch node of the conditional control module and the index number of each functional module in the task list, thereby controlling the execution of the functional module.
[0083] The above-mentioned visual inspection process conditional execution control method of the present invention adopts a visual editing method to perform conditional branch control on the visual inspection process, thereby reducing the dependence on complex programming languages and reducing the difficulty of visual software development.
[0084] Specifically, Figure 2 As shown, 101 is the task list, which records all the functional modules included in the visual inspection process; 102 is the conditional control module, which includes branch nodes and internal functional modules. The conditional control module is considered as a functional module as a whole; 103 is the interactive function menu of the task list, which is generally opened by right-clicking the mouse. The implementation of the interactive function is as follows:
[0085] To add a module, open the interactive function menu 103 at any location in the interface of the task list 101, select "Add module", and select a function module in the pop-up toolbox interface and add it to the bottom of the task list;
[0086] Delete module, select an item in the task list 101 and open the interactive function menu 103, select "Delete module" to remove the functional module of the selected item; if the selected item is the first branch node of the conditional control module 102, the conditional control module 102 and its internal functional modules will all be removed; if the selected item is other branch nodes of the conditional control module 102, the "Delete module" option is not available.
[0087] Moving module, the movement of functional modules is achieved through the drag interaction function of the task list 101. After selecting an item, drag it to the target position and place it there to complete the movement of the functional module; if the selected item is the first branch node of the conditional control module 102, the conditional control module 102 and its internal functional modules will all be moved; if the selected item is other branch nodes of the conditional control module 102, the dragging function is not available.
[0088] To add a branch node, select the first branch node of the condition control module 102, open the interactive function menu 103, and select "add branch node" to add a new branch node and insert it into the previous line of the end node.
[0089] To remove a branch node, select a branch node of the condition control module 102, open the interactive function menu 103, and select "Remove branch node" to remove the selected branch node and all internal function modules of the branch. When the selected item is the first branch node or the end node, the "Remove branch node" option is not available.
[0090] Parameter configuration, select the branch node of the condition control module 102, double-click the node to open the parameter editing interface to edit the control conditions; the control conditions are represented by logical expressions, and after editing, they are saved in the module memory in a string data structure.
[0091] The task list format adopted in this embodiment can concisely and intuitively display the control logic of the conditional control module on the functional modules in the visual inspection process, and at the same time integrates friendly visual interaction functions to quickly edit and configure the control process.
[0092] like Figure 3 As shown, for the above step S5, the method of controlling the execution of the function module in this embodiment is: all the function modules or branch nodes in the task list are numbered in the order of execution (from top to bottom) as their indexes. The condition control module maintains a table to record the index values of all branch nodes. When executing, the range of each branch is determined according to the index table, thereby controlling the execution of each branch. The details are as follows:
[0093] When the conditional control module is executed, first, the current node is set as the first branch node;
[0094] When the control condition of the branch node is true, all function modules whose index values in the task list are between the branch node index and the next branch node index are executed;
[0095] When the control condition of the branch node is false, the current node index is directly pointed to the next branch node to continue the judgment.
[0096] When the current node index points to the end node, the conditional control module is executed.
[0097] like Figure 4 As shown, the present invention also provides a control system for a visual inspection process conditional execution control method, the control system is used to implement the visual inspection process conditional execution control method, and includes a task creation module 100, a task editing module 200 and an operation management module 300;
[0098] The task creation module 100 is used to create corresponding icons or texts for the task list and various functional modules, and display them on the interactive interface;
[0099] The task editing module 200 is used to complete the interactive functions (editing operations) of inserting, deleting, and moving the task list, adding nodes, removing nodes, and parameter configuration of the condition control module.
[0100] The operation management module 300 is used to complete the execution logic of each functional module in the task list: for the conditional control module, it is responsible for reading and parsing the logical expression of the branch node and performing conditional judgment; for the ordinary functional module, it is responsible for data input and output and calls the corresponding algorithm interface to implement its function.
[0101] Furthermore, it also includes a task saving module 400;
[0102] The task saving module 400 is used to implement a method for saving and loading a visual inspection process, and can save the edited visual inspection process as a project file, and can automatically reconstruct the process by reading the project file.
[0103] This embodiment uses extensible markup language (XML) to save and load the visual inspection process. The types, parameters and positions of all functional modules in the task list are recorded according to the XML language specification, and a project file is generated and saved in a storage device. When the same inspection process needs to be used again, the corresponding project file is read, and the task list and functional modules are regenerated according to the tag information of the file. At the same time, the generated project file can be encrypted using a custom code to ensure its security.
[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A visual inspection process conditional execution control method, characterized in that: The steps include: S1, generate task list The task list is used to record the functional modules included in the visual inspection process; S2, create conditional control module Create a conditional control module and insert it into the task list, then set the number of branch nodes as needed; S3, edit execution control conditions In the parameter configuration interface, edit the execution control conditions of each branch node; S4, insert internal function module Insert the visual inspection function module that needs to be controlled and executed under the corresponding branch node as the internal function module of the branch; S5, execution condition control module Execute the conditional control module. Each branch node judges the control condition in turn. According to the control condition, it is decided whether the function module in the branch is executed. When the execution reaches the end node, the conditional control module is completed. In step S1, the function module includes a condition control module and a common function module, and the execution order of the tasks is set to be executed in order from top to bottom according to the position of the function module in the list, and the task list has three editing functions: adding, deleting and moving; In the step S2, the condition control module initially includes a first branch node and an end node; In the step S2, new branch nodes are added or designated branch nodes are removed through instructions as needed; The newly added branch node is automatically inserted into the previous position of the end node; The remove command will remove the specified branch node and all internal functional modules of the branch; The number of branches of the conditional control module is at least one, and the first branch node cannot be removed; In step S3, for any branch node, the corresponding parameter configuration interface is called through instructions to edit the execution control conditions of the branch; The execution control condition is a logical expression, which returns true or false status values when executing judgment; In step S4, the function modules to be controlled are inserted into the corresponding branches through the adding and moving editing functions of the task list in step S1; The internal functional modules of the branch refer to all functional modules between the branch node and the next branch node in the task list. When any functional module is inserted or moved between a branch node and the next branch node of the branch node, it becomes the internal functional module of the branch.
2. The visual inspection process conditional execution control method according to claim 1, characterized in that: In step S5, when the condition control module receives the execution instruction, it determines the execution control condition starting from the first branch node: If the control condition is true, the internal function modules of the branch are executed in sequence; If the control condition is false, skip the current branch and execute the next branch; When the execution reaches the end node, the condition control module is completed.
3. The visual inspection process conditional execution control method according to claim 2, characterized in that: In the step S5, the branch to which the functional module belongs is determined according to the branch node of the condition control module and the index number of each functional module in the task list, thereby controlling the execution of the functional module.
4. A control system for a visual inspection process conditional execution control method, characterized in that: The control system is used to implement the control method described in any one of claims 1 to 3, and comprises a task creation module (100), a task editing module (200) and an operation management module (300); The task creation module (100) is used to create corresponding icons or texts for the task list and various functional modules, and display them on the interactive interface; The task editing module (200) is used to complete the insertion, deletion and movement of the task list, the addition and removal of nodes and parameter configuration of the condition control module; The operation management module (300) is used to complete the execution logic of each functional module in the task list: for the condition control module, it is responsible for reading and parsing the logical expression of the branch node and performing condition judgment; For common functional modules, they are responsible for data input and output, and call corresponding algorithm interfaces to implement their functions; Also includes a task saving module (400); The task saving module (400) is used to implement a method for saving and loading a visual inspection process, and can save the edited visual inspection process as a project file, and can automatically reconstruct the process by reading the project file.
