A ladder diagram intelligent recognition and management method based on tag depth matching

By constructing a multi-level predefined label nesting structure based on the method of deep matching of labels, the problems of structured management and rapid positioning in ladder diagram programming are solved, and efficient, humanized management and clear logical structure of ladder diagram programs are realized.

CN114527708BActive Publication Date: 2025-08-08WUXI XINJIE ELECTRICAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210183283.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2025-08-08
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

The existing ladder diagram programming language cannot achieve effective structured management and rapid positioning in electrical engineering, resulting in low programming efficiency and scattered program structure, making it difficult to clearly overview the logical structure.

Method used

Using a method based on label depth matching, a folding module is built through predefined label editing module, ladder diagram loop identification module, label node analysis module, label tree structure navigation module and ladder diagram expansion module to build a multi-level predefined label nesting structure to realize intelligent identification and management of ladder diagram loop programs, and support fast navigation, switching and positioning.

Benefits of technology

It realizes the rapid search, navigation and positioning of ladder diagram programs, improves operation efficiency and structured management, avoids messy program structure, and enhances the programming experience of electrical engineers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114527708B_ABST
    Figure CN114527708B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of software development, and specifically to a ladder diagram intelligent recognition and management method based on deep label matching. The method comprises a predefined label editing module, a ladder diagram loop recognition module, a ladder diagram loop label node parsing module, a ladder diagram loop common node parsing module, a label tree structure navigation module, and a ladder diagram expansion and collapse module. By means of a ladder diagram loop program containing predefined paired labels, a structured ladder diagram loop program that supports multi-level predefined label nesting and additional label custom descriptions is organized, and a ladder diagram loop project label tree is flexibly constructed and mapped. Electrical engineers can quickly navigate and locate matching ladder diagram loop programs by clicking on project label tree labels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a ladder diagram intelligent recognition and management method based on tag depth matching. Background Art

[0002] Ladder diagram, one of the International Electrotechnical Commission's programmable controller programming language standards, is the most commonly used graphical programming language for electrical engineers in program design. Evolving from simplified symbols based on relay and contactor logic control, ladder diagrams are simple to use, intuitive, and easily understood by electrical engineers. Ladder diagrams allow for flexible and convenient descriptions of the logical relationships between electrical symbols. However, when programming ladder diagrams, electrical engineers face difficulties in user-friendly management and quick location of ladder diagram circuits, as well as in effective structural organization. During editing, they must drag the scroll bar in the visual area to view the ladder diagram circuits at a specific location. The entire ladder diagram program structure is disorganized and lacks hierarchical relationships, making browsing and editing extremely inefficient and time-consuming. Matching the desired ladder diagram program requires visual comparison. This inefficient management model causes significant trouble and inconvenience for electrical engineers during programming, and also prevents them from clearly viewing the entire program structure.

[0003] Therefore, a new technology is urgently needed to solve this technical problem. Summary of the Invention

[0004] The purpose of the present invention is to overcome the problems of the above-mentioned prior art and provide a ladder diagram intelligent recognition and management method based on deep label matching, which realizes the deep and effective integration of the ladder diagram loop program value chain from horizontal to vertical in an all-round and multi-dimensional manner, and innovatively and humanely designs a modular ladder diagram loop program that supports a complex and flexible nested structure of multiple layers of predefined labels; it can realize the intelligent recognition of ladder diagram loop programs containing predefined labels and list all ladder diagram loops in a tree-like nested structure and map them to the project label tree, so that electrical engineers can quickly navigate and locate the ladder diagram program to the visual area editing range, and can intuitively and vividly overview the program organization structure, with structural flexibility, rapid positioning, efficient management, and value collaboration.

[0005] The above objectives are achieved through the following technical solutions:

[0006] A ladder diagram intelligent recognition and management method based on tag depth matching, comprising:

[0007] Predefined tag editing module, used for predefined tag structured multi-level nested editing;

[0008] Ladder diagram circuit recognition module, used for scanning and identifying two-dimensional matrix ladder diagram circuits;

[0009] Ladder diagram loop label node parsing module, used to scan and parse the ladder diagram loop label node tree;

[0010] Ladder diagram circuit common node parsing module, used to scan and parse the ladder diagram circuit common node tree;

[0011] The tag tree structure navigation module is used to freely navigate, switch and locate the ladder diagram circuit program that matches the tag, and scroll the first line of the matching ladder diagram circuit program to the visual editing area;

[0012] The ladder diagram expansion and collapse module is used to control the display and hiding of the ladder diagram rows under the label node;

[0013] Editing predefined labels through the predefined label editing module and embedding ladder diagram program loops in the labels;

[0014] The ladder diagram program loop is identified by the ladder diagram loop identification module, and the two-dimensional matrix rows and columns of nodes in the ladder diagram program loop are scanned, and the ladder diagram loop label node parsing module and the ladder diagram loop common node parsing module are used to perform node parsing, including: judging whether it is a label node according to the attributes of the node by the ladder diagram loop label node parsing module, and if so, constructing the label node into a label node multi-branch tree with a logical nested hierarchical relationship; judging whether it is an ordinary node according to the attributes of the node by the ladder diagram loop common node parsing module, and if so, constructing the ordinary node into multiple ordinary node multi-branch trees with a logical nested hierarchical relationship;

[0015] The ladder diagram loop label node parsing module is used to map label nodes to matching program loop lines, calculate the range of label node program lines, and implement free navigation, switching and positioning matching of ladder diagram loop program lines through the label tree navigation module;

[0016] The ladder diagram expansion and folding module is used to realize personalized display and hiding of the ladder diagram loop program.

[0017] Furthermore, the predefined tag includes a start tag name GROUP and an end tag name GROUPE, and the start tag name GROUP and the end tag name GROUPE serve as paired tags; the predefined tag supports single-layer or multi-layer nesting, and can be freely folded and expanded to control the display and hiding of the ladder diagram through the ladder diagram expansion and folding module.

[0018] Furthermore, the ladder diagram program loop must be contained within the paired tag.

[0019] Furthermore, the two-dimensional matrix row and column scanning of nodes in the ladder diagram program loop is specifically the ladder diagram loop identification module scanning horizontally and vertically and analyzing the entire two-dimensional matrix ladder diagram program of independent nodes.

[0020] Furthermore, the analysis of the ladder diagram loop label node parsing module is specifically as follows: if the outermost label node parsed is a parent label, the entire label structure is a tree data structure; if a labeled node is parsed internally, the child label node is added to the root of the matching parent label node, and the label node needs to be recursively traversed and parsed from the inside to the outside, eventually forming a label tree with a multi-level nested structure.

[0021] Furthermore, the analysis of the ladder diagram loop common node analysis module is specifically as follows: the common nodes of a ladder diagram loop program form a multi-branch tree with real nodes and virtual nodes coexisting. The real nodes are common nodes that actually exist objectively, and the virtual nodes are relationship nodes that do not actually exist in order to indicate the association relationship between common nodes. The node scanning adopts a horizontal and vertical recursive traversal method in order to construct a common node multi-branch tree with a clear logical hierarchical relationship.

[0022] Furthermore, the ladder diagram expansion and collapse module is used to realize personalized display and hiding of the ladder diagram loop program, specifically: by traversing all common child node attributes in order from the multi-branch tree root node to obtain the minimum and maximum values of the ladder diagram loop program row where the label node is located, calculating the range interval of the row where the matching ladder diagram loop program is located, and setting whether the program row range is visible can control display or hiding, thereby realizing expansion and collapse of the ladder diagram loop program.

[0023] Beneficial effects

[0024] The present invention provides a ladder diagram intelligent recognition and management method based on tag depth matching, which has the following advantages:

[0025] 1. The ladder diagram loop program with matching tags in the project tag tree can be displayed or hidden according to personal preferences by expanding and collapsing the tags, thereby expanding the visual area of the ladder diagram editing.

[0026] 2. By clicking any tab in the project tab tree, the ladder diagram editor can directly navigate and locate the first line of the ladder diagram loop program that matches the selected tab, allowing for quick search, navigation, and positioning of ladder diagram loop programs.

[0027] 3. By operating the labels of the ladder diagram project label tree, you can quickly copy, paste, delete, browse, edit and other precise operations of the ladder diagram circuit, which greatly saves operation time and improves operation efficiency, and the operation method is humanized.

[0028] 4. Through predefined tags, you can organize and establish structured ladder diagram loop programs that support tag nesting and clear hierarchical relationships, avoiding a disorganized program structure and achieving structured, orderly and modular management of ladder diagram loop programs.

[0029] 5. The predefined labels of the ladder diagram circuit can be customized according to the semantics of the label description. The label description is also mapped to the project label tree structure. The project label tree can be used to intuitively and vividly overview the logical hierarchy of the entire ladder diagram circuit program. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a schematic diagram of the structure of a ladder diagram intelligent recognition and management method based on tag depth matching;

[0031] Figure 2 This is a workflow principle diagram of a ladder diagram intelligent recognition and management method based on tag depth matching;

[0032] Figure 3 A predefined tag editing module diagram for a ladder diagram intelligent recognition and management method based on tag depth matching;

[0033] Figure 4 This is a ladder diagram circuit recognition module diagram of a ladder diagram intelligent recognition and management method based on label depth matching;

[0034] Figure 5 A ladder diagram loop label node parsing module diagram for a ladder diagram intelligent recognition and management method based on label depth matching;

[0035] Figure 6 A ladder diagram circuit common node parsing module diagram for a ladder diagram intelligent recognition and management method based on label depth matching;

[0036] Figure 7 This is a label tree structure navigation module diagram of a ladder diagram intelligent recognition and management method based on label depth matching;

[0037] Figure 8 The present invention is a ladder diagram expansion and collapse module diagram of a ladder diagram intelligent recognition and management method based on label depth matching. DETAILED DESCRIPTION

[0038] The present invention will be further described in detail below with reference to the figures and embodiments.

[0039] like Figure 1 As shown, a ladder diagram intelligent recognition and management method based on tag depth matching includes:

[0040] Predefined tag editing module, used for predefined tag structured multi-level nested editing;

[0041] Ladder diagram circuit recognition module, used for scanning and identifying two-dimensional matrix ladder diagram circuits;

[0042] Ladder diagram loop label node parsing module, used to scan and parse the ladder diagram loop label node tree;

[0043] Ladder diagram circuit common node parsing module, used to scan and parse the ladder diagram circuit common node tree;

[0044] The tag tree structure navigation module is used to freely navigate, switch and locate the ladder diagram circuit program that matches the tag, and scroll the first line of the matching ladder diagram circuit program to the visual editing area;

[0045] The ladder diagram expansion and collapse module is used to control the display and hiding of the ladder diagram rows under the label node;

[0046] Working methods such as Figure 2 As shown:

[0047] Editing predefined labels through the predefined label editing module and embedding ladder program loops in the labels;

[0048] The ladder diagram program loop is identified by the ladder diagram loop identification module, and the two-dimensional matrix rows and columns of nodes in the ladder diagram program loop are scanned, and the ladder diagram loop label node parsing module and the ladder diagram loop common node parsing module are used to perform node parsing, including: judging whether it is a label node according to the attributes of the node by the ladder diagram loop label node parsing module, and if so, constructing the label node into a label node multi-branch tree with a logical nested hierarchical relationship; judging whether it is an ordinary node according to the attributes of the node by the ladder diagram loop common node parsing module, and if so, constructing the ordinary node into multiple ordinary node multi-branch trees with a logical nested hierarchical relationship;

[0049] The ladder diagram loop label node parsing module is used to map label nodes to matching program loop lines, calculate the range of label node program lines, and implement free navigation, switching and positioning matching of ladder diagram loop program lines through the label tree navigation module;

[0050] The ladder diagram expansion and folding module is used to realize personalized display and hiding of the ladder diagram loop program.

[0051] Specifically, editing predefined label steps and label embedded ladder program loop steps is achieved through the "predefined label editing module";

[0052] The ladder diagram program loop identification step and the node two-dimensional matrix row and column scanning step are implemented through the "ladder diagram loop scanning module";

[0053] The label type node, label node tree structure generation step, a label node multi-branch tree step, label node program loop line range interval calculation step, and label node and matching program loop line mapping step are implemented through the "label node parsing module";

[0054] The steps of common type nodes, common node tree structure generation, and multiple common node multi-branch trees are implemented through the "common node parsing module";

[0055] The node parsing step includes the "label node parsing module" and the "normal node parsing module";

[0056] Ladder diagram programs can be nested and support expansion and folding steps belonging to the "ladder diagram expansion and folding module".

[0057] The steps of quick navigation of the tag tree structure and positioning the ladder diagram editing visual area are realized through the "tag tree structure navigation module".

[0058] In this embodiment, the modules complement each other and coordinate efficiently. This method can achieve rapid navigation, scrolling and positioning to the target desired ladder diagram program loop line, thereby realizing all-round modularization, refined and effective management of the ladder diagram program, and realizing deep integration of horizontal and vertical value of ladder diagram management.

[0059] As a further explanation of this embodiment, the following is provided:

[0060] The predefined tags include the start tag name GROUP and the end tag name GROUPE. The GROUP and GROUPE predefined tags must be defined in pairs. Tag descriptions can be given according to actual semantics. The corresponding descriptions are mapped while the project tag tree structure is generated. The ladder diagram program loop can be positioned arbitrarily according to the tag descriptions.

[0061] The ladder diagram program loop must be contained within a paired tag. Tags support single-layer or multi-layer nesting and can be freely folded and expanded to control the display and hiding of the ladder diagram.

[0062] The ladder diagram nodes are scanned in rows and columns in a two-dimensional matrix. The attributes of each node can be used to determine whether it is a label node or an ordinary node, and corresponding processing can be performed.

[0063] The label node can calculate the matching ladder program loop line range and scroll to the first line during navigation.

[0064] By defining tag nodes, the program structure can be well organized, and different ladder diagram program loops can be quickly switched through the project tag tree.

[0065] like Figure 3As shown, as an optimization of the predefined tag editing module described in this embodiment, predefined tags must be defined in pairs and support multi-level nesting. Tags can be given meaningful descriptions. After the tag editing is completed, all tags need to pass the syntax check to confirm whether the editing is incorrect. If it is illegal, a humanized error prompt will be given. The tag description can be mapped to the project tag tree according to the hierarchical structure. Paired tags can display a tree-like connection diagram. The intuitive and vivid display hierarchy facilitates the folding and hiding of ladder diagram loop programs. Ladder diagram program loops must be contained within the definition tags. The hierarchical nesting of tags can effectively organize the structured ladder diagram program, making the program structure clearer and more organized.

[0066] Specifically, you can add tags to customize comments based on actual semantics to facilitate understanding. The predefined tag names are the start tag name GROUP and the end tag name GROUPE.

[0067] Predefined tags must include the desired one or more ladder diagram circuit programs between the matching first and last tags. Clicking the project tag tree to select a tag allows you to quickly locate the first line of the matching ladder diagram circuit program to the ladder diagram editing visible area.

[0068] Tags support nested definitions of any multiple layers of complex structures. Parent tags can contain child tags, and tag relationships are mapped to the project tag tree structure. It is especially suitable for complex structured program design, with a clear logical structure and convenient humanized management.

[0069] like Figure 4 As shown, as an optimization of the ladder diagram loop recognition module in this embodiment, the ladder diagram loop recognition module horizontally and vertically scans and analyzes the entire two-dimensional matrix ladder diagram program of independent nodes, mainly including label nodes and ordinary nodes.

[0070] If a label node is scanned, the label is constructed into a label multi-branch tree with a logical nested hierarchical relationship;

[0071] If a common node is scanned, a tree data structure with logical relationships such as and or is constructed based on the graphical node connection line association relationship.

[0072] By scanning and organizing multiple independent ladder diagram program nodes, the entire isolated ladder diagram node can be converted into a tree data structure with a logical relationship and multiple ladder diagram loop programs. Each ladder diagram loop is a rung, a tree represents a ladder diagram loop, and multiple ladder diagram loops form a forest. By traversing the forest, any single ladder diagram node can be routed.

[0073] like Figure 4As shown in the figure, as an optimization of the ladder diagram loop label node parsing module described in this embodiment, the label node includes a label header (GROUP) and a label tail (GROUPE). The label must be completely paired and defined. A complete label node is first parsed from the label header to the label tail. When scanning a node, it can be determined whether it is a label node based on the node's attributes. The label structure supports multi-level nesting. The outermost label node that is parsed first is the parent label. The entire label structure is a tree data structure.

[0074] If a labeled node is found internally, the child label node is added to the root of the matching parent label node. The label node needs to be recursively traversed and parsed from the inside out, eventually forming a label tree with a multi-level nested structure, which is convenient for the effective and unified management of labels in the future.

[0075] The label node is mapped to the matching ladder diagram program loop, and the line range can be calculated to realize the navigation of the ladder diagram loop program line, which is convenient for fast switching and positioning.

[0076] like Figure 6 As shown, as the optimization of the ladder diagram circuit common node parsing module in this embodiment, you can refer to Figure 4 The ladder diagram in the ladder diagram circuit recognition module maps its relationships into multiple multi-branch trees.

[0077] Ordinary nodes are judged as ordinary nodes based on node attributes, and are selectively included in label nodes. Ordinary nodes of a ladder diagram loop program form a multi-branch tree with real nodes and virtual nodes. Real nodes are ordinary nodes that actually exist objectively, and virtual nodes are relationship nodes that do not actually exist in order to indicate the association relationship between ordinary nodes. Node scanning uses horizontal and vertical recursive traversal in order to construct a multi-branch tree of ordinary nodes with a clear logical hierarchy.

[0078] The common node attributes include the program line where the node is located. A mapping relationship is established between the common node and the matching label node, that is, the range of the ladder diagram circuit program line where the label node matches can be calculated.

[0079] like Figure 7As shown, the optimized tag tree structure navigation module of the tag tree structure navigation module described in this embodiment can freely navigate, switch and locate the ladder diagram loop program with matching tags. When the program editor pairs the predefined tags, it is necessary to check the syntax of the predefined tags to see if they are legal. Only after the legal predefined tags are edited can the relationship mapping be automatically performed and the project tag tree be formed. The tag tree node name is a meaningful tag description that is easy to understand, and illegal tags are given humanized error prompts. The entire ladder diagram loop program structure can be overviewed through the project tag tree. The nested relationship of the tag structure is distinct, which is conducive to the realization of structured flexible programs and helps electrical engineers optimize and organize program structures. Through the navigation of the tag tree, the first line of the matching ladder diagram loop program will be scrolled to the visual editing area, which is convenient for users to copy, paste, edit and browse the ladder diagram program, and is easy and efficient to manage.

[0080] like Figure 8 As shown, as an optimization of the ladder diagram expansion and collapse module described in this embodiment, the ladder diagram expansion and collapse module can personalize the display and hiding of the ladder diagram loop program, obtain the minimum and maximum values of the ladder diagram loop program row where the label node is located by traversing all common child node attributes in order from the multi-branch tree root node, calculate the range interval of the row where the matching ladder diagram loop program is located, and set whether the program row range is visible to control display or hiding, thereby achieving the purpose of expanding and collapsing the ladder diagram loop program.

[0081] Each tag node has a built-in + / - symbol folding function. Clicking the symbol controls whether the tag matching program is folded or not. The nested tag hierarchy is displayed as a tree-like connection. The folding and expanding module can expand the visual editing area, which helps improve the logical hierarchy.

[0082] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be conceived by anyone skilled in the art within the technical scope disclosed by the present invention are also included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A ladder diagram intelligent recognition and management method based on tag depth matching, characterized in that: include: Predefined label editing module, ladder diagram circuit identification module, ladder diagram circuit label node parsing module, ladder diagram circuit common node parsing module, label tree structure navigation module and ladder diagram expansion and collapse module; The predefined tag is edited by the predefined tag editing module, and a ladder program loop is embedded in the tag; the predefined tag includes a start tag name GROUP and an end tag name GROUPE, and the start tag name GROUP and the end tag name GROUPE serve as paired tags; the predefined tags support single-layer or multi-layer nesting, and can be freely folded and unfolded to control the display and hiding of the ladder diagram through the ladder diagram expansion and collapse module; the ladder program loop must be contained within the paired tags; The ladder diagram program loop is identified by the ladder diagram loop identification module, and the two-dimensional matrix rows and columns of the nodes in the ladder diagram program loop are scanned, and the ladder diagram loop label node parsing module and the ladder diagram loop common node parsing module are used to perform node parsing, including: the ladder diagram loop label node parsing module determines whether it is a label node according to the attributes of the node, and if so, constructs the label node into a label node multi-branch tree with a logical nested hierarchical relationship; the ladder diagram loop common node parsing module determines whether it is an ordinary node according to the attributes of the node, and if so, constructs the ordinary node into multiple ordinary node multi-branch trees with a logical nested hierarchical relationship; The ladder diagram loop label node parsing module realizes the mapping between label nodes and matching program loop lines, calculates the range interval of label node program loop lines, and realizes the free navigation, switching and positioning matching of ladder diagram program loop lines through the label tree structure navigation module; The ladder diagram expansion and folding module is used to realize personalized display and hiding of the ladder diagram program loop.

2. The method for intelligent recognition and management of ladder diagrams based on tag depth matching according to claim 1, characterized in that: The two-dimensional matrix row and column scanning of nodes in the ladder diagram program loop is specifically the ladder diagram loop identification module horizontally and vertically scanning and analyzing the entire two-dimensional matrix ladder diagram program of independent nodes.

3. The method for intelligent recognition and management of ladder diagrams based on tag depth matching according to claim 1, characterized in that: The analysis of the ladder diagram loop label node analysis module is specifically as follows: if the outermost label node analyzed is the parent label, the entire label structure is a tree data structure; if a labeled node is analyzed internally, the child label node is added to the root of the matching parent label node, and the label node needs to be recursively traversed and analyzed from the inside to the outside, eventually forming a label tree with a multi-level nested structure.

4. The method for intelligent recognition and management of ladder diagrams based on tag depth matching according to claim 1, characterized in that: The analysis of the ladder diagram loop common node analysis module is specifically as follows: the common nodes of a ladder diagram loop program form a multi-branch tree with real nodes and virtual nodes coexisting. The real nodes are common nodes that actually exist objectively, and the virtual nodes are relationship nodes that do not actually exist in order to indicate the association relationship between common nodes. The node scanning adopts a horizontal and vertical recursive traversal method in order to construct a common node multi-branch tree with a clear logical hierarchical relationship.

5. The method for intelligent recognition and management of ladder diagrams based on tag depth matching according to claim 1, characterized in that: The ladder diagram expansion and collapse module is used to realize personalized display and hiding of the ladder diagram loop program, specifically: by traversing all common child node attributes in order from the multi-branch tree root node, the minimum and maximum values of the ladder diagram loop program row where the label node is located are obtained, the range interval of the row where the matching ladder diagram loop program is located is calculated, and the visible attribute of the program row range is set to control display or hiding, thereby realizing expansion and collapse of the ladder diagram loop program.

Citation Information

Patent Citations

  • Method for designing ladder diagram editing software of embedded PLC (Programmable Logic Controller)

    CN102508654A

  • Ladder program display program and ladder program display device

    CN105074591A