Ladder diagram network processing method and apparatus

By automatically calculating the connection relationships of symbols in a ladder diagram and determining the smallest subnetwork, the problem of low efficiency in manually selecting symbols in ladder diagram programming is solved, and efficient and accurate ladder diagram editing is achieved.

CN116743590BActive Publication Date: 2026-01-20NR ELECTRIC CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310531528.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2026-01-20
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

In ladder diagram programming, manually selecting subnet symbols is inefficient and may not meet syntax rules, leading to editing failure.

Method used

By automatically calculating the connection relationship between two selected symbols, the smallest subnetwork that conforms to the ladder diagram programming syntax is determined, enabling batch copying and deletion of ladder diagrams.

Benefits of technology

It improves the efficiency and accuracy of ladder diagram editing and ensures the correctness of editing operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116743590B_ABST
    Figure CN116743590B_ABST
Patent Text Reader

Abstract

The application provides a ladder diagram network processing method and device. The method comprises the following steps: selecting a first symbol and a second symbol in the ladder diagram network; determining a connection relationship between the first symbol and the second symbol; and determining a minimum sub-network to which the first symbol and the second symbol belong according to the connection relationship. According to the scheme, the connection relationship between the selected two symbols is determined according to the connection relationship, and the minimum sub-network to which the selected symbols belong and which meets the ladder diagram programming syntax is automatically calculated according to the connection relationship. Therefore, correct and efficient editing operations such as batch copying and deleting of the ladder diagram are realized, and the editing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial control, and in particular to a ladder diagram network processing method and apparatus. Background Technology

[0002] The IEC 61131-3 programming language standard is already in use in the industrial control industry. This standard defines five programming languages: function block diagram, ladder diagram, sequential function chart, structured text language, and instruction list. Among them, function block diagram and ladder diagram are widely used due to their intuitiveness and convenience. In ladder diagram programming, it is often necessary to copy and delete existing subnets in the ladder diagram. Using manual symbol selection requires selecting all symbols involved in each subnet one by one, which is inefficient. Furthermore, manually selected subnets may not meet the syntax rules, causing editing failures.

[0003] Therefore, there is a need for a method to automatically calculate the smallest subnetwork to which the two symbols selected by the mouse belong. Summary of the Invention

[0004] To address the problems existing in the prior art, this application provides a ladder diagram network processing method and apparatus. The proposed solution automatically calculates the smallest subnetwork conforming to ladder diagram programming syntax to which the selected two symbols belong, enabling correct and efficient batch copying and deletion of ladder diagrams, thus improving editing efficiency.

[0005] According to the first aspect of this application, a ladder diagram network processing method is proposed, comprising:

[0006] Select the first and second symbols in the ladder diagram network;

[0007] Determine the connection relationship between the first symbol and the second symbol;

[0008] The smallest subnetwork to which the first symbol and the second symbol belong is determined based on the connection relationship.

[0009] According to some embodiments, determining the connection relationship between the first symbol and the second symbol includes:

[0010] Sort the first symbol and the second symbol horizontally from left to right to determine the first leftmost symbol and the first rightmost symbol.

[0011] According to some embodiments, determining the connection relationship between the first symbol and the second symbol further includes:

[0012] If there is a path in the horizontal direction from left to right between the output point of the first leftmost symbol and the first rightmost symbol, the connection relationship between the first symbol and the second symbol is determined to be serial.

[0013] According to some embodiments, determining the connection relationship between the first symbol and the second symbol further includes:

[0014] If there is no path between the output point of the first leftmost symbol and the first rightmost symbol in the horizontal direction from left to right, the connection relationship between the first symbol and the second symbol is determined to be parallel.

[0015] According to some embodiments, determining the minimum subnetwork to which the first symbol and the second symbol belong based on the connection relationship includes:

[0016] Determine the first and second series endpoints;

[0017] The symbols on all paths between the first serial endpoint and the first rightmost symbol form the left endpoint symbol set, and the symbols on all paths between the first leftmost symbol and the second serial endpoint form the right endpoint symbol set;

[0018] The sum of the left endpoint symbol set and the right endpoint symbol set is taken as all the symbols included in the minimum subnetwork.

[0019] According to some embodiments, determining the first serial endpoint and the second serial endpoint includes:

[0020] Step S201: Set the output point of the leftmost position symbol as the current starting point and set the input point of the rightmost position symbol as the current ending point.

[0021] Step S202: Determine the path from the current starting point to the current ending point in the horizontal direction from left to right as the first path;

[0022] Step S203: Determine whether the current starting point or the current ending point satisfies the endpoint determination condition based on the first path;

[0023] Step S204: If the endpoint determination conditions are met, the current starting point is determined as the first serial endpoint, and the current ending point is determined as the second serial endpoint.

[0024] Step S205: If the endpoint determination conditions are not met, update the current starting point or the current ending point according to the first node list, and return to step S202.

[0025] According to some embodiments, determining whether the endpoint determination condition is met based on the first path includes:

[0026] The symbols on all paths between the current starting point and the current ending point are combined into a first set of concatenated symbols.

[0027] The symbols on all branches containing all first-type nodes on the first path are combined into a second set of serial symbols;

[0028] If the first set of serial symbols contains all elements of the second set of serial symbols, then the endpoint determination condition is satisfied.

[0029] According to some embodiments, determining the current starting point as the first serial endpoint and the current ending point as the second serial endpoint when the endpoint determination condition is met includes:

[0030] When the first type of node is a right-converging T node, the current starting point is determined as the first serial endpoint;

[0031] When the first type of node is a left-divergent T node, the current termination point is determined as the second serial endpoint.

[0032] According to some embodiments, when the first type of node is a right-converging T-node, the first node list includes the nearest left-diverging T-node, the middle-left-diverging T-node, and the lower-left T-node connected to the current starting point; when the first type of node is a left-diverging T-node, the first node list includes the nearest right-converging T-node, the middle-right-converging T-node, or the lower-right T-node connected to the current ending point.

[0033] According to some embodiments, determining the minimum subnetwork to which the first symbol and the second symbol belong based on the connection relationship includes:

[0034] Step S301: Sort the first symbol and the second symbol vertically from top to bottom to determine the first top symbol and the first bottom symbol;

[0035] Step S302: Generate a first start point and a first end point based on the first uppermost symbol, and generate a first parallel endpoint and a second parallel endpoint based on the first start point and the first end point;

[0036] Step S303: Generate a second starting point and a second ending point based on the first bottommost symbol; generate a third parallel endpoint and a fourth parallel endpoint based on the second starting point and the second ending point.

[0037] Step S304: The symbols contained in all paths between the first parallel endpoint and the second parallel endpoint are taken as the first parallel symbol set;

[0038] Step S305: Filter the symbols in the first parallel symbol set whose coordinates from bottom to top in the vertical direction are smaller than those of the first parallel endpoint and the third parallel endpoint, to obtain all symbols included in the minimum subnetwork.

[0039] According to some embodiments, generating a first start point and a first end point based on the first uppermost symbol, and generating a first parallel endpoint and a second parallel endpoint based on the first start point and the first end point, includes:

[0040] Step S401: Take the symbol to the left of the input point of the first uppermost symbol as the current starting point;

[0041] Step S402: Set the input point of the first bottommost symbol as a temporary termination point, and determine whether there is a connectable path between the current starting point and the temporary termination point;

[0042] Step S403: If there is a connectable path between the current starting point and the temporary termination point, the current starting point is determined as the first starting point;

[0043] Step S404: If there is no connectable path between the current starting point and the temporary ending point, take the symbol to the left of the input point of the current starting point as the updated current starting point, and return to step S402.

[0044] Step S405: Take the symbol to the right of the output point of the first uppermost symbol as the current termination point;

[0045] Step S406: Set the output point of the first bottommost symbol as a temporary starting point, and determine whether there is a connectable path between the temporary starting point and the current ending point;

[0046] Step S407: If there is a connectable path between the temporary starting point and the current ending point, the current ending point is determined as the first ending point.

[0047] Step S408: If there is no connectable path between the temporary starting point and the current ending point, take the symbol to the right of the output point of the current ending point as the updated current ending point, and return to step S406.

[0048] Step S409: Sort the first termination point and the first starting point vertically from bottom to top, determine the symbol with the smaller vertical coordinate as the first parallel endpoint, and find the symbol with the larger vertical coordinate that is equal to the vertical coordinate of the first parallel endpoint as the second parallel endpoint.

[0049] According to some embodiments, generating a second start point and a second end point based on the first lowest symbol, and generating a third parallel endpoint and a fourth parallel endpoint based on the second start point and the second end point, includes:

[0050] Step S501: Determine the symbol to the left of the input point directly connected to the first bottommost symbol as the temporary starting point;

[0051] Step S502: Determine whether the horizontal coordinates of the temporary starting point and the first parallel endpoint are equal;

[0052] Step S503: If the horizontal coordinates of the temporary starting point and the first parallel endpoint are equal, determine the temporary starting point as the second starting point;

[0053] Step S504: If the horizontal coordinates of the temporary starting point and the first parallel endpoint are not equal, take the symbol on the left side directly connected to the temporary starting point as the updated temporary starting point, and return to step S502.

[0054] Step S505: Determine the symbol to the right of the output point of the first bottommost symbol as a temporary termination point;

[0055] Step S506: Determine whether the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal;

[0056] Step S507: If the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal, determine the temporary termination point as the second termination point.

[0057] Step S508: If the horizontal coordinates of the temporary termination point and the second parallel endpoint are not equal, take the symbol on the right side directly connected to the temporary termination point as the updated temporary termination point, and return to step S506.

[0058] Step S509: Sort the second termination point and the second starting point vertically from bottom to top, determine the symbol with the smaller vertical coordinate as the third parallel endpoint, and find the symbol with the larger vertical coordinate that is equal to the vertical coordinate of the third parallel endpoint as the fourth parallel endpoint.

[0059] According to a second aspect of this application, a ladder diagram network processing apparatus is proposed, comprising a symbol selection module, a connection relationship module, and a sub-network determination module, wherein:

[0060] The symbol selection module is used to select the first and second symbols in the ladder diagram network;

[0061] The connection relationship module is used to determine the connection relationship between the first symbol and the second symbol;

[0062] The subnetwork determination module is used to determine the smallest subnetwork to which the first symbol and the second symbol belong based on the connection relationship.

[0063] According to a third aspect of this application, an electronic device is proposed, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect of this application.

[0064] According to a fourth aspect of this application, a computer-readable storage medium is provided, characterized in that it stores a computer program for electronic data interchange, wherein the computer program causes a computer to perform the method described in the first aspect of this application.

[0065] The proposed solution determines the connection relationship between two selected symbols based on the connection relationship, and automatically calculates the smallest subnetwork that conforms to the ladder diagram programming syntax to which the selected symbol belongs based on the connection relationship. This enables correct and efficient batch copying and deletion of ladder diagrams, thus improving editing efficiency. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings, without exceeding the scope of protection claimed by this application.

[0067] Figure 1 This is a flowchart of the ladder diagram network processing method of this application;

[0068] Figure 2 In the ladder diagram network processing method of this application, when the connection relationship between the first symbol and the second symbol is serial, a flowchart is used to determine the first serial endpoint and the second serial endpoint.

[0069] Figure 3In the ladder diagram network processing method of this application, when the connection relationship between the first symbol and the second symbol is parallel, a flowchart is used to determine the minimum subnetwork to which the first symbol and the second symbol belong based on the connection relationship.

[0070] Figure 4 for Figure 3 Flowchart of step S302;

[0071] Figure 5 for Figure 3 Flowchart of step S303;

[0072] Figure 6 This is a schematic diagram illustrating the types of network nodes in the ladder diagram network processing method of this application;

[0073] Figure 7 This is a schematic diagram of Embodiment 1 of the ladder diagram network processing method of this application, where the connection relationship between the first symbol and the second symbol is in series.

[0074] Figure 8 This is a schematic diagram of Embodiment 2 of the ladder diagram network processing method of this application, where the connection between the first and second symbols is in parallel;

[0075] Figure 9 This is a schematic diagram of the ladder diagram network processing device of this application;

[0076] Figure 10 This is a structural diagram of an electronic device according to this application. Detailed Implementation

[0077] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0078] Figure 1 This is a flowchart of the ladder diagram network processing method of this application. Figure 1 As shown, the ladder diagram network processing method includes the following steps.

[0079] Step S101: Select the first and second symbols in the ladder diagram network.

[0080] In some specific embodiments, the ladder diagram network includes programming symbols, connecting lines, and T-node symbols. In some specific embodiments, the T-node symbols include a left-diverging T-node, a right-converging T-node, a middle-left-diverging T-node, a middle-right-converging T-node, a lower-left T-node, and a lower-right T-node. In some specific embodiments, the programming symbols include input points and output points. In some specific embodiments, different programming symbols are connected by connecting lines. In some specific embodiments, the connecting lines include four pointers, respectively associated with the start symbol, the start symbol output point, the end symbol, and the end symbol input point. In some specific embodiments, a topology network is formed through pointer associations. In some specific embodiments, the ladder diagram network dynamically refreshes the pointer associations during editing, forming a real-time dynamic topology network. In some specific embodiments, the first and second symbols in the ladder diagram network are selected to edit the ladder diagram network. In some specific embodiments, the signal flow in the ladder diagram network is from left to right.

[0081] Step S102: Determine the connection relationship between the first symbol and the second symbol.

[0082] In some specific embodiments, the first and second symbols are sorted horizontally from left to right, and the symbol with the smaller horizontal coordinate from left to right is designated as the first leftmost symbol. In some specific embodiments, the first and second symbols are sorted horizontally from left to right, and the symbol with the larger horizontal coordinate from left to right is designated as the first rightmost symbol. In some specific embodiments, there is a path from the output point of the first leftmost symbol to the first rightmost symbol in the horizontal direction from left to right, and the first and second symbols are connected in series. In some specific embodiments, there is no path from the output point of the first leftmost symbol to the first rightmost symbol in the horizontal direction from left to right, and the first and second symbols are connected in parallel.

[0083] Step S103: Determine the smallest subnetwork to which the first symbol and the second symbol belong based on the connection relationship.

[0084] In some specific embodiments, the first symbol and the second symbol are connected in series. Figure 2 This is a flowchart illustrating the process of determining the first and second series endpoints in the ladder diagram network processing method of this application, where the connection between the first and second symbols is serial. Figure 2 As shown, the process includes the following steps.

[0085] Step S201: Set the output point of the leftmost position symbol as the current starting point and set the input point of the rightmost position symbol as the current ending point.

[0086] In some specific embodiments, the initial starting point is set to the output point of the leftmost position symbol, and the initial ending point is set to the input point of the rightmost position symbol. In some specific embodiments, a path connecting the starting point and the ending point is found.

[0087] Step S202: Determine the uppermost path from the current starting point to the current ending point in the horizontal direction from left to right as the first path.

[0088] In some specific embodiments, there are one or more connectable paths flowing horizontally from left to right between the current starting point and the current ending point. In some specific embodiments, the uppermost path that flows horizontally from left to right between the current starting point and the current ending point is the first path.

[0089] Step S203: Determine whether the current starting point or the current ending point meets the endpoint determination conditions based on the first path.

[0090] Step S204: If the endpoint determination conditions are met, the current starting point is determined as the first serial endpoint and the current ending point is determined as the second serial endpoint.

[0091] Step S205: If the endpoint determination conditions are not met, update the current starting point or the current ending point according to the first node list, and return to step S202.

[0092] In some embodiments, the symbols on all paths from the current starting point to the current ending point constitute a first concatenated symbol set. In some embodiments, the symbols on all branches containing all first-type nodes on the first path constitute a second concatenated symbol set. In some embodiments, the first-type node includes right-converging T-nodes. In some embodiments, the first node type includes left-diverging T-nodes.

[0093] In some specific embodiments, the branch containing the node includes a branch consisting of a programming symbol and a node directly connected to the node's left input point. In some specific embodiments, the branch containing the node includes a branch consisting of a T-node symbol directly connected to the node's left input point and programming symbols directly connected to the T-node symbol. In some specific embodiments, the branch containing the node includes a branch consisting of a programming symbol and a node directly connected to the node's right output point. In some specific embodiments, the branch containing the node includes a branch consisting of a T-node symbol directly connected to the node's right output point and programming symbols directly connected to the T-node symbol.

[0094] In some specific embodiments, the first set of serial symbols contains all elements of the second set of serial symbols, satisfying the endpoint determination condition. In some specific embodiments, the first type of node is a right-converging T-node, and the current starting point is determined as the first serial endpoint. In some specific embodiments, the first node type is a left-diverging T-node, and the current ending point is determined as the second serial endpoint.

[0095] In some specific embodiments, the first set of concatenated symbols does not contain all elements of the second set of concatenated symbols, and therefore does not meet the endpoint determination condition. In some specific embodiments, after updating the current starting point or the current ending point according to the order of the first node list, the process returns to step S202. In some specific embodiments, the first type of node is a right-converging T-node, and the first node list includes the nearest left-diverging T-node, the middle-left-diverging T-node, and the lower-left T-node connected to the current starting point. In some specific embodiments, the first type of node is a left-diverging T-node, and the first node list includes the nearest right-converging T-node, the middle-right-converging T-node, or the lower-right T-node connected to the current ending point.

[0096] In some specific embodiments, the symbols on all paths between the first serial endpoint and the first rightmost symbol form the left endpoint symbol set, and the symbols on all paths between the first leftmost symbol and the second serial endpoint form the right endpoint symbol set. In some specific embodiments, the sum of the left endpoint symbol set and the right endpoint symbol set is taken as all symbols included in the minimum subnetwork.

[0097] In some specific embodiments, the first symbol and the second symbol are connected in parallel. Figure 3 This is a flowchart illustrating how, in the ladder diagram network processing method of this application, when the connection between the first and second symbols is parallel, the smallest subnetwork to which the first and second symbols belong is determined based on the connection relationship. For example... Figure 3 As shown, the process includes the following steps.

[0098] Step S301: Sort the first symbol and the second symbol vertically from top to bottom to determine the first top symbol and the first bottom symbol.

[0099] In some specific embodiments, the first symbol and the second symbol are sorted vertically from top to bottom, and the symbol with the smaller vertical coordinate from top to bottom is determined as the first topmost symbol. In some specific embodiments, the first symbol and the second symbol are sorted vertically from top to bottom, and the symbol with the larger horizontal coordinate from top to bottom is determined as the first bottommost symbol.

[0100] Step S302: Generate a first starting point and a first ending point based on the first uppermost symbol, and generate a first parallel endpoint and a second parallel endpoint based on the first starting point and the first ending point.

[0101] Step S303: Generate a second starting point and a second ending point based on the first bottommost symbol, and generate a third parallel endpoint and a fourth parallel endpoint based on the second starting point and the second ending point.

[0102] Step S304: The symbols contained in all paths between the first parallel endpoint and the second parallel endpoint are taken as the first parallel symbol set.

[0103] Step S305: Filter the symbols in the first parallel symbol set whose coordinates from top to bottom in the vertical direction are smaller than those of the first parallel endpoint and the third parallel endpoint, to obtain all symbols included in the minimum subnetwork.

[0104] In some specific embodiments, the symbols contained in all paths between the first parallel endpoint and the second parallel endpoint constitute a first parallel symbol set. In some specific embodiments, it is determined whether the coordinate of each symbol in the first parallel symbol set in the vertical top-down direction is less than that of the first parallel endpoint and the third parallel endpoint. In some specific embodiments, all symbols in the first parallel symbol set whose coordinates in the vertical top-down direction are greater than those of the first parallel endpoint and the third parallel endpoint constitute all symbols included in the smallest subnetwork to which the first symbol and the second symbol belong.

[0105] Figure 4 for Figure 3 The flowchart for step S302. (See attached flowchart.) Figure 4 As shown, the process includes the following steps.

[0106] Step S401: Take the symbol to the left of the input point of the first uppermost symbol as the current starting point.

[0107] In some specific embodiments, the symbol directly connected to the input point of the first topmost symbol to the left is a left-diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first topmost symbol to the left is a middle-left diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first topmost symbol to the left is a lower-left T-node.

[0108] Step S402: Set the input point of the first bottommost symbol as a temporary termination point, and determine whether there is a connectable path between the current starting point and the temporary termination point.

[0109] Step S403: If there is a connectable path between the current starting point and the temporary termination point, the current starting point is determined as the first starting point.

[0110] In step S404, if there is no connectable path between the current starting point and the temporary ending point, the symbol to the left of the input point of the current starting point is taken as the updated current starting point, and the process returns to step S402.

[0111] In some specific embodiments, the input point of the first lowest symbol is set as a temporary termination point, and the symbol to the left of the input point of the first highest symbol is taken as the current starting point. In some specific embodiments, there is a connectable path between the current starting point and the temporary termination point, and the current starting point is determined as the first starting point. In some specific embodiments, there is no connectable path between the current starting point and the temporary termination point, and the symbol to the left of the current starting point is taken as the updated current starting point, and the existence of a connectable path between the current starting point and the temporary termination point is re-evaluated.

[0112] Step S405: The symbol to the right of the output point of the first uppermost symbol is taken as the current termination point.

[0113] In some specific embodiments, the symbol directly connected to the output point of the first topmost symbol to the right is a right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first topmost symbol to the right is a middle-right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first topmost symbol to the right is a bottom-right T-node.

[0114] Step S406: Set the output point of the first bottommost symbol as a temporary starting point, and determine whether there is a connectable path between the temporary starting point and the current ending point.

[0115] Step S407: If there is a connectable path between the temporary starting point and the current ending point, the current ending point is determined as the first ending point.

[0116] In step S408, if there is no connectable path between the temporary starting point and the current ending point, the symbol to the right of the output point directly connected to the current ending point is taken as the updated current ending point, and the process returns to step S406.

[0117] In some specific embodiments, the output point of the first lowest symbol is set as a temporary starting point, and the symbol to the right of the output point of the first highest symbol is taken as the current ending point. In some specific embodiments, there is a connectable path between the temporary starting point and the current ending point, and the current ending point is determined as the first ending point. In some specific embodiments, there is no connectable path between the temporary starting point and the current ending point, and the symbol to the right of the current ending point is taken as the updated current ending point, and the existence of a connectable path between the temporary starting point and the current ending point is re-evaluated.

[0118] Step S409: Sort the first termination point and the first starting point vertically from bottom to top, determine the symbol with the smaller vertical coordinate as the first parallel endpoint, and find the symbol with the larger vertical coordinate that is equal to the vertical coordinate of the first parallel endpoint as the second parallel endpoint.

[0119] In some specific embodiments, among the first termination point and the first starting point, the coordinates of the first termination point along the vertical direction from bottom to top are relatively smaller. The first termination point is the first parallel endpoint, and the sign of the first starting point along the vertical direction that is equal to the vertical coordinates of the first termination point is the second parallel endpoint. In some specific embodiments, among the first termination point and the first starting point, the coordinates of the first starting point along the vertical direction from bottom to top are relatively smaller. The first starting point is the first parallel endpoint, and the sign of the first termination point along the vertical direction that is equal to the vertical coordinates of the first starting point is the second parallel endpoint.

[0120] Figure 5 for Figure 3 The flowchart for step S303. (See attached flowchart.) Figure 5 As shown, the process includes the following steps.

[0121] Step S501: Determine the symbol to the left of the input point directly connected to the first bottommost symbol as the temporary starting point.

[0122] In some specific embodiments, the symbol directly connected to the input point of the first lowest symbol to the left is a left-diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first lowest symbol to the left is a middle-left diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first lowest symbol to the left is a lower-left T-node.

[0123] Step S502: Determine whether the horizontal coordinates of the temporary starting point and the first parallel endpoint are equal.

[0124] Step S503: If the horizontal coordinates of the temporary starting point are equal to those of the first parallel endpoint, the temporary starting point is determined as the second starting point.

[0125] Step S504: If the horizontal coordinates of the temporary starting point and the first parallel endpoint are not equal, take the symbol on the left side directly connected to the temporary starting point as the updated temporary starting point, and return to step S502.

[0126] Step S505: Determine the symbol to the right of the output point of the first bottommost symbol as a temporary termination point.

[0127] In some specific embodiments, the symbol directly connected to the output point of the first lowest symbol to the right is a right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first lowest symbol to the right is a middle-right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first lowest symbol to the right is a lower-right T-node.

[0128] Step S506: Determine whether the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal.

[0129] Step S507: If the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal, determine the temporary termination point as the second termination point.

[0130] In step S508, if the horizontal coordinates of the temporary termination point and the second parallel endpoint are not equal, the symbol on the right side directly connected to the temporary termination point is taken as the updated temporary termination point, and the process returns to step S506.

[0131] Step S509: Sort the second termination point and the second starting point vertically from bottom to top, determine the symbol with the smaller vertical coordinate as the third parallel endpoint, and find the symbol with the larger vertical coordinate that is equal to the vertical coordinate of the third parallel endpoint as the fourth parallel endpoint.

[0132] The proposed solution determines the connection relationship between two selected symbols based on the connection relationship, and automatically calculates the smallest subnetwork that conforms to the ladder diagram programming syntax to which the selected symbol belongs based on the connection relationship. This enables correct and efficient batch copying and deletion of ladder diagrams, thus improving editing efficiency.

[0133] Figure 6 This is a schematic diagram illustrating the types of network nodes in the ladder diagram network processing method of this application.

[0134] See Figure 6 In some specific embodiments, the T-node symbols include left diverging T-node, right converging T-node, middle left diverging T-node, middle right converging T-node, lower left T-node, and lower right T-node.

[0135] In some specific embodiments, a left diverging T-node includes three endpoints: left, right, and bottom, where the left endpoint is the input and the right and bottom endpoints are the outputs. In some specific embodiments, a right converging T-node includes three endpoints: left, right, and bottom, where the left and bottom endpoints are the inputs and the right endpoint is the output. In some specific embodiments, a middle-left diverging T-node includes three endpoints: top, bottom, and right, where the top endpoint is the input and the bottom and right endpoints are the outputs. In some specific embodiments, a middle-right converging T-node includes three endpoints: left, top, and bottom, where the left and bottom endpoints are the inputs and the top endpoint is the output. In some specific embodiments, a left-bottom T-node includes two endpoints: top and right, where the top endpoint is the input and the right endpoint is the output. In some specific embodiments, a right-bottom T-node includes two endpoints: top and left, where the left endpoint is the input and the top endpoint is the output.

[0136] Figure 7 This is a schematic diagram of an embodiment of the ladder diagram network processing method of this application, where the connection between the first and second symbols is in series.

[0137] See Figure 7 Select A4 and A10, and determine the connection relationship between A4 and A10. In Example 1, A4 and A10 are sorted horizontally from left to right, and A4 is determined to be the first leftmost symbol and A10 to be the first rightmost symbol. Determine whether there is a path between the output point of A4 and the input point of A10 in the horizontal direction from left to right. Figure 7 As shown, in Figure 7 In the ladder diagram network, the connected path A4->C2->C1->A5->C4->C3->D7->D8->D9->A10 can be found in the horizontal direction from left to right. Therefore, A4 and A10 are connected in series.

[0138] A4 and A10 are connected in series. First, determine the first and second series endpoints.

[0139] The output point of A4 is taken as the current starting point, and the input point of A10 is taken as the current ending point. The first path is A4->C2->C1->A5->C4->C3->D7->D8->D9->A10. The symbols on all paths between A4 and A10 form the first cascaded symbol set, including A4, C2, C1, A5, C4, C3, D7, D8, D9, and A10. The first type of node is the right-converging T-node, and the right-converging T-nodes on the first path include C1 and C3. The branches containing C1 include A3-C1 and A4-C2, and the branches containing C3 include A2-C3, A5-C4, A6-C5, and A7-C6. The symbols on all branches containing the right-converging T-nodes on the first path form the second cascaded symbol set, including A3, C1, A4, C2, A2, C3, A5, C4, A6, C5, A7, and C6. The first set of serial symbols does not include A3, A6, C5, A7, and C6 from the second set of serial symbols, therefore A4 cannot be determined as the first serial endpoint.

[0140] The first type of node is the right convergent T node. The list of the first node types includes the nearest left divergent T node D2, the middle left divergent T node D4, and the lower left T node D5 that are connected to the current starting point, A4.

[0141] Using the output point of D4 as the current starting point and the input point of A10 as the current ending point, the symbols on all paths from D4 to A10 form the first cascaded symbol set, including D4, A4, C2, C1, A5, C4, C3, D7, D8, D9, A10, D5, A6, and C5. The first path is D4->A4->C2->C1->A5->C4->C3->D7->D8->D9->A10. The right convergence T nodes on the first path include C1 and C3. The branches containing C1 include A3-C1 and A4-C2, and the branches containing C3 include A2-C3, A5-C4, A6-C5, and A7-C6. The symbols on all branches containing the right convergence T nodes on the first path form the second cascaded symbol set, including A3, C1, A4, C2, A2, C3, A5, C4, A6, C5, A7, and C6. The first set of serial symbols does not include A2, A3, A7, and C6 from the second set of serial symbols, therefore D4 cannot be determined as the first serial endpoint.

[0142] Taking the output point of D2 as the current starting point and the input point of A10 as the current ending point, the symbols on all paths from D2 to A10 form the first series symbol set, including D2, A2, C3, D7, D8, D9, A10, D3, A3, C1, A5, C4, D4, A4, C2, D5, A6, and C5. The first path is D2->A2->C3->D7->D8->D9->A10. The right convergence T node on the first path includes C3, and the branches containing C3 include A2-C3, A5-C4, A6-C5, and A7-C6. The symbols on the branches containing all right convergence T nodes on the first path form the second series symbol set, including A2, C3, A5, C4, A6, C5, A7, and C6. The first series symbols do not include A7 and C6 in the second series symbol set; therefore, D2 cannot be determined as the first series endpoint. Similarly, D5 cannot be determined as the first series endpoint.

[0143] Taking the output point of D4 as the current starting point and the input point of A10 as the current ending point, the first type of node is the right-converging T node. The list of first node types includes the nearest left-diverging T node D2, the middle-left-diverging T node D3, and the lower-left T node D5 connected to the current starting point, i.e., D4. Taking D2, D3, and D5 as the current starting points respectively, we determine whether the first series symbol set includes all symbols in the second series symbol set. It can be seen that D2, D3, and D5 cannot be determined as the first series endpoint.

[0144] The output point of D2 is taken as the current starting point, and the input point of A10 is taken as the current ending point. The first type of node is the right convergent T node. The list of first node types includes the nearest left divergent T node D1, the middle left divergent T node D3, and the lower left T node D5 connected to the current starting point, i.e., D2.

[0145] Taking the output point of D1 as the current starting point and the input point of A10 as the current ending point, the symbols on all paths from D1 to A10 form the first cascaded symbol set, including D1, A1, D2, A2, C3, D7, D8, D9, A10, D3, A3, C1, A5, C4, D4, A4, C2, D5, A6, C5, D6, A7, and C6. The first path is D1->A1->D2->A2->C3->D7->D8->D9->A10. The right convergence T node on the first path includes C3, and the branches containing C3 include A2-C3, A5-C4, A6-C5, and A7-C6. The symbols on all branches containing the right convergence T nodes on the first path form the second cascaded symbol set, including A2, C3, A5, C4, A6, C5, A7, and C6. The first cascade symbol includes all symbols in the second cascade symbol set, therefore D1 is determined as the first cascade endpoint.

[0146] The output point of A4 is taken as the current starting point, and the input point of A10 is taken as the current ending point. The first path is A4->C2->C1->A5->C4->C3->D7->D8->D9->A10. The symbols on all paths between A4 and A10 form the first cascaded symbol set, including A4, C2, C1, A5, C4, C3, D7, D8, D9, and A10. The first type of node is the left-divergent T-node, and the left-divergent T-node on the first path includes D7. The branches containing D7 include D7-A8, D8-A9, D9-A10, and D10-A12. The symbols on the branches containing all left-divergent T-nodes on the first path form the second cascaded symbol set, including D7, A8, D8, A9, D9, A10, D10, and A12. The first cascaded symbol set does not include A8, A9, D10, and A12 in the second cascaded symbol set, therefore A10 cannot be determined as the second cascaded endpoint.

[0147] The first type of node is the left-diverging T node. The second node type list includes the nearest right-converging T node C7, the middle-right-converging T node C10, and the lower-right T node C8 connected to the current termination point, A10. By taking C7, C10, and C8 as the current termination points and determining whether the first series symbol set includes all symbols in the second series symbol set, it can be seen that C7, C10, and C8 cannot be determined as the second series endpoint.

[0148] Taking the output point of A4 as the current starting point and the input point of C7 as the current ending point, the first type of node is a left-diverging T-node. The list of first node types includes the nearest right-converging T-node C9, the middle-right-converging T-node C10, and the lower-right T-node C8 connected to the current ending point, C7. Using C10 and C8 as the current ending points, we determine whether the first series symbol set includes all symbols in the second series symbol set. It can be seen that neither C10 nor C8 can be determined as the second series endpoint.

[0149] Taking the output point of A4 as the current starting point and the input point of C9 as the current ending point, the symbols on all paths between A4 and C9 form the first cascaded symbol set, including A4, C2, C1, A5, C4, C3, D7, A8, C9, D8, A9, C7, A11, C10, D9, A10, C8, D10, A12, and C11. The first path is A4->C2->C1->A5->C4->C3->D7->A8->C9. The left diverging T node on the first path includes D7, and the branches containing D7 include D7-A8, D8-A9, D9-A10, and D10-A12. The symbols on all branches containing the left diverging T nodes on the first path form the second cascaded symbol set, including D7, A8, D8, A9, D9, A10, D10, and A12. The first cascade symbol includes all symbols in the second cascade symbol set, therefore C9 is determined as the second cascade endpoint.

[0150] The left endpoint symbol set is the set of all symbols on all paths between the first serial endpoint D1 and the first rightmost symbol A10, that is, the first serial symbol set when the starting point is D1, including D1, A1, D2, A2, C3, D7, D8, D9, A10, D3, A3, C1, A5, C4, D4, A4, C2, D5, A6, C5, D6, A7, C6. The right endpoint symbol set is the set of all symbols on all paths between the first leftmost symbol A4 and the second serial endpoint C9, that is, the first serial symbol set when the ending point is C9, including A4, C2, C1, A5, C4, C3, D7, A8, C9, D8, A9, C7, A11, C10, D9, A10, C8, D10, A12, C11. The union of the left endpoint symbol set and the right endpoint symbol set is all the symbols included in the smallest subnetwork to which the first symbol A4 and the second symbol A10 belong, including D1, A1, D2, A2, C3, D7, D8, D9, A10, D3, A3, C1, A5, C4, D4, A4, C2, D5, A6, C5, D6, A7, C6, A8, C9, A9, C7, A11, C10, C8, D10, A12, C11.

[0151] Figure 8 This is a schematic diagram of Embodiment 2 of the ladder diagram network processing method of this application, where the connection between the first and second symbols is in parallel.

[0152] See Figure 8Select A4 and A8, and determine the connection relationship between A4 and A8. In Example 2, A4 and A8 are sorted horizontally from left to right. If A4 and A8 have the same horizontal coordinates, A4 is randomly selected as the first leftmost symbol and A8 as the first rightmost symbol. Determine whether there is a path horizontally from left to right between the output point of A4 and the input point of A8. For example... Figure 8 As shown, in Figure 8 In the ladder diagram network, a horizontal path from left to right cannot be found between the output point of A4 and the input point of A8. Therefore, A4 and A8 are in parallel.

[0153] A4 and A8 are connected in parallel. Sort A4 and A8 vertically from top to bottom, and determine that A4, which has the smaller coordinate in the vertical direction, is the first topmost symbol, and A8, which has the larger coordinate in the vertical direction, is the first bottommost symbol.

[0154] Taking the symbol D3, directly connected to A4 on the left, as the current starting point, and the input point of A8 as the temporary ending point, and considering the available path from D3 to A8 (D3->D4->D5->D6->A8), we determine D3 as the first starting point. Taking the output point of A8 as the temporary starting point, and the symbol C2, directly connected to A4 on the right, as the current ending point, we determine C3 as the current ending point. Since there is no available path from A8 to C2, we determine C1, directly connected to C2 on the right, as the current ending point. Since there is no available path from A8 to C1, we determine C6, directly connected to C1 on the right, as the current ending point. Given the available path from A8 to C6 (A8->C4->C8->C7->C6), we determine C6 as the first ending point.

[0155] D3 and C6 are sorted vertically from top to bottom. C6 has a relatively smaller vertical coordinate, so C6 is determined as the first parallel endpoint. D3 searches for D2, which has the same vertical coordinate as C6, as the second parallel endpoint.

[0156] Let D6, the symbol directly connected to A8 on the left, be the temporary starting point. D6's horizontal coordinate is equal to D2's; therefore, D6 is designated as the second starting point. Let C4, the symbol directly connected to A8 on the right, be the temporary ending point. C4's horizontal coordinate from left to right is less than C6's. Let C3, the symbol directly connected to C4 on the right, be the temporary ending point. C3's horizontal coordinate from left to right is less than C6's. Let C8, the symbol directly connected to C3 on the right, be the temporary ending point. C8's horizontal coordinate from left to right is equal to C6's; therefore, C8 is designated as the second ending point.

[0157] D6 and C8 are sorted vertically from top to bottom. C8 has a relatively smaller vertical coordinate, so C8 is determined as the third parallel endpoint. D6 is then searched along the vertical direction for D5, which has the same vertical coordinate as C8, to be the fourth parallel endpoint.

[0158] All paths between the second parallel endpoint D2 and the first parallel endpoint C6 include D2->A2->C1->A3->C6, D2->D3->A4->C2->C1->A3->C6, D2->D3->D4->A5->C6->C6, D2->D3->D4->D5->A6->C3->A7->C8->C7->C6, D2->D3->D4->D6->A8->C4->C3->A7->C8->C7->C6, and D2->D1->A1->C5->C6. If the coordinates of symbols D1, A1, and C5 in the vertical top-down direction are less than those of D2, C6, C8, and D5, then the final determined minimum subnetwork includes all the symbols D2, A2, C1, A3, C6, D3, A4, C2, D4, A5, D5, A6, C3, A7, C8, C7, D6, A8, and C4.

[0159] Figure 9 This is a schematic diagram of the ladder diagram network processing device of this application.

[0160] like Figure 9 As shown, the ladder diagram network processing device includes a symbol selection module, a connection relationship module, and a sub-network determination module.

[0161] The symbol selection module is used to select the first and second symbols in the ladder diagram network.

[0162] In some specific embodiments, the ladder diagram network includes programming symbols, connecting lines, and T-node symbols. In some specific embodiments, the T-node symbols include a left-diverging T-node, a right-converging T-node, a middle-left-diverging T-node, a middle-right-converging T-node, a lower-left T-node, and a lower-right T-node. In some specific embodiments, the programming symbols include input points and output points. In some specific embodiments, different programming symbols are connected by connecting lines. In some specific embodiments, the connecting lines include four pointers, respectively associated with the start symbol, the start symbol output point, the end symbol, and the end symbol input point. In some specific embodiments, a topology network is formed through pointer associations. In some specific embodiments, the ladder diagram network dynamically refreshes the pointer associations during editing, forming a real-time dynamic topology network. In some specific embodiments, the first and second symbols in the ladder diagram network are selected to edit the ladder diagram network. In some specific embodiments, the signal flow in the ladder diagram network is from left to right.

[0163] The connection relationship module is used to determine the connection relationship between the first symbol and the second symbol.

[0164] In some specific embodiments, the first and second symbols are sorted horizontally from left to right, and the symbol with the smaller horizontal coordinate from left to right is designated as the first leftmost symbol. In some specific embodiments, the first and second symbols are sorted horizontally from left to right, and the symbol with the larger horizontal coordinate from left to right is designated as the first rightmost symbol. In some specific embodiments, there is a path from the output point of the first leftmost symbol to the first rightmost symbol in the horizontal direction from left to right, and the first and second symbols are connected in series. In some specific embodiments, there is no path from the output point of the first leftmost symbol to the first rightmost symbol in the horizontal direction from left to right, and the first and second symbols are connected in parallel.

[0165] The subnetwork determination module is used to determine the smallest subnetwork to which the first and second symbols belong based on their connection relationships.

[0166] In some specific embodiments, the first symbol and the second symbol are connected in series.

[0167] In some specific embodiments, the output point of the leftmost position symbol is set as the current starting point, and the input point of the rightmost position symbol is set as the current ending point.

[0168] In some specific embodiments, the initial starting point is set to the output point of the leftmost position symbol, and the initial ending point is set to the input point of the rightmost position symbol. In some specific embodiments, a path connecting the starting point and the ending point is found.

[0169] In some specific embodiments, the uppermost path from the current starting point to the current ending point in the horizontal direction from left to right is determined as the first path.

[0170] In some specific embodiments, there are one or more connectable paths flowing horizontally from left to right between the current starting point and the current ending point. In some specific embodiments, the uppermost path that flows horizontally from left to right between the current starting point and the current ending point is the first path.

[0171] In some specific embodiments, the endpoint determination condition is determined based on the first path to determine whether the current starting point or the current ending point meets the endpoint determination condition.

[0172] In some specific embodiments, if the endpoint determination conditions are met, the current starting point is determined as the first serial endpoint and the current ending point is determined as the second serial endpoint.

[0173] In some specific embodiments, if the endpoint determination conditions are not met, the current starting point or the current ending point is updated according to the first node list, and the current starting point or the current ending point is re-determined according to the first path to see if the endpoint determination conditions are met.

[0174] In some embodiments, the symbols on all paths from the current starting point to the current ending point constitute a first concatenated symbol set. In some embodiments, the symbols on all branches containing all first-type nodes on the first path constitute a second concatenated symbol set. In some embodiments, the first-type nodes include right-converging T-nodes. In some embodiments, the first-type nodes include left-diverging T-nodes.

[0175] In some specific embodiments, the branch containing the node includes a branch consisting of a programming symbol and a node directly connected to the node's left input point. In some specific embodiments, the branch containing the node includes a branch consisting of a T-node symbol directly connected to the node's left input point and programming symbols directly connected to the T-node symbol. In some specific embodiments, the branch containing the node includes a branch consisting of a programming symbol and a node directly connected to the node's right output point. In some specific embodiments, the branch containing the node includes a branch consisting of a T-node symbol directly connected to the node's right output point and programming symbols directly connected to the T-node symbol.

[0176] In some specific embodiments, the first set of serial symbols contains all elements of the second set of serial symbols, satisfying the endpoint determination condition. In some specific embodiments, the first type of node is a right-converging node, determining the current starting point as the first serial endpoint. In some specific embodiments, the first node type is a left-diverging T-node, determining the current ending point as the second serial endpoint.

[0177] In some specific embodiments, the first set of serial symbols does not contain all elements of the second set of serial symbols, and therefore does not meet the endpoint determination condition. In some specific embodiments, after updating the current starting point or the current ending point according to the order of the first node list, the endpoint determination condition is re-determined based on the first path.

[0178] In some specific embodiments, the first type of node is a right-converging T-node, and the first node list includes the nearest left-diverging T-node, middle-left-diverging T-node, and lower-left T-node connected to the current starting point. In some specific embodiments, the first type of node is a left-diverging T-node, and the first node list includes the nearest right-converging T-node, middle-right-converging T-node, or lower-right T-node connected to the current ending point.

[0179] In some specific embodiments, the symbols on all paths between the first serial endpoint and the first rightmost symbol form the left endpoint symbol set, and the symbols on all paths between the first leftmost symbol and the second serial endpoint form the right endpoint symbol set. In some specific embodiments, the sum of the left endpoint symbol set and the right endpoint symbol set is taken as all symbols included in the minimum subnetwork.

[0180] In some specific embodiments, the first symbol and the second symbol are connected in parallel.

[0181] In some specific embodiments, the first symbol and the second symbol are sorted vertically from top to bottom to determine the first topmost symbol and the first bottommost symbol.

[0182] In some specific embodiments, the first symbol and the second symbol are sorted vertically from top to bottom, and the symbol with the smaller vertical coordinate from top to bottom is determined as the first topmost symbol. In some specific embodiments, the first symbol and the second symbol are sorted vertically from top to bottom, and the symbol with the larger horizontal coordinate from top to bottom is determined as the first bottommost symbol.

[0183] In some specific embodiments, a first start point and a first end point are generated based on the first uppermost symbol, and a first parallel endpoint and a second parallel endpoint are generated based on the first start point and the first end point.

[0184] In some specific embodiments, a second start point and a second end point are generated based on the first lowest symbol, and a third parallel endpoint and a fourth parallel endpoint are generated based on the second start point and the second end point.

[0185] In some specific embodiments, the symbols contained in all paths between the first parallel endpoint and the second parallel endpoint are used as the first parallel symbol set.

[0186] In some specific embodiments, symbols in the first parallel symbol set whose coordinates from top to bottom in the vertical direction are smaller than those of the first parallel endpoint and the third parallel endpoint are filtered out to obtain all symbols included in the minimum subnetwork.

[0187] In some specific embodiments, the symbols contained in all paths between the first parallel endpoint and the second parallel endpoint constitute a first parallel symbol set. In some specific embodiments, it is determined whether the coordinate of each symbol in the first parallel symbol set in the vertical top-down direction is less than that of the first parallel endpoint and the third parallel endpoint. In some specific embodiments, all symbols in the first parallel symbol set whose coordinates in the vertical top-down direction are greater than those of the first parallel endpoint and the third parallel endpoint constitute all symbols included in the smallest subnetwork to which the first symbol and the second symbol belong.

[0188] In some specific embodiments, the symbol to the left of the input point directly connected to the first uppermost symbol is taken as the current starting point.

[0189] In some specific embodiments, the symbol directly connected to the input point of the first topmost symbol to the left is a left-diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first topmost symbol to the left is a middle-left diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first topmost symbol to the left is a lower-left T-node.

[0190] In some specific embodiments, the input point of the first bottommost symbol is set as a temporary termination point, and it is determined whether there is a connectable path between the current starting point and the temporary termination point.

[0191] In some specific embodiments, if there is a connectable path between the current starting point and the temporary termination point, the current starting point is determined as the first starting point.

[0192] In some specific embodiments, if there is no connectable path between the current starting point and the temporary ending point, the symbol to the left of the input point of the current starting point is taken as the updated current starting point, and it is re-determined whether there is a connectable path between the current starting point and the temporary ending point.

[0193] In some specific embodiments, the input point of the first lowest symbol is set as a temporary termination point, and the symbol to the left of the input point of the first highest symbol is taken as the current starting point. In some specific embodiments, there is a connectable path between the current starting point and the temporary termination point, and the current starting point is determined as the first starting point. In some specific embodiments, there is no connectable path between the current starting point and the temporary termination point, and the symbol to the left of the current starting point is taken as the updated current starting point, and the existence of a connectable path between the current starting point and the temporary termination point is re-evaluated.

[0194] In some specific embodiments, the symbol to the right of the output point directly connected to the first topmost symbol is taken as the current termination point.

[0195] In some specific embodiments, the symbol directly connected to the output point of the first topmost symbol to the right is a right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first topmost symbol to the right is a middle-right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first topmost symbol to the right is a bottom-right T-node.

[0196] In some specific embodiments, the output point of the first lowest symbol is set as a temporary starting point, and it is determined whether there is a connectable path between the temporary starting point and the current ending point.

[0197] In some specific embodiments, if there is a connectable path between the temporary starting point and the current ending point, the current ending point is determined as the first ending point.

[0198] In some specific embodiments, if there is no connectable path between the temporary starting point and the current ending point, the symbol to the right of the output point of the current ending point is used as the updated current ending point, and it is re-determined whether there is a connectable path between the temporary starting point and the current ending point.

[0199] In some specific embodiments, the output point of the first lowest symbol is set as a temporary starting point, and the symbol to the right of the output point of the first highest symbol is taken as the current ending point. In some specific embodiments, there is a connectable path between the temporary starting point and the current ending point, and the current ending point is determined as the first ending point. In some specific embodiments, there is no connectable path between the temporary starting point and the current ending point, and the symbol to the right of the current ending point is taken as the updated current ending point, and the existence of a connectable path between the temporary starting point and the current ending point is re-evaluated.

[0200] In some specific embodiments, the first termination point and the first starting point are sorted vertically from bottom to top, and the symbol with the smaller vertical coordinate is determined as the first parallel endpoint. The symbol with the larger vertical coordinate is found to be the second parallel endpoint if its vertical coordinate is equal to that of the first parallel endpoint.

[0201] In some specific embodiments, among the first termination point and the first starting point, the coordinates of the first termination point along the vertical direction from bottom to top are relatively smaller. The first termination point is the first parallel endpoint, and the sign of the first starting point along the vertical direction that is equal to the vertical coordinates of the first termination point is the second parallel endpoint. In some specific embodiments, among the first termination point and the first starting point, the coordinates of the first starting point along the vertical direction from bottom to top are relatively smaller. The first starting point is the first parallel endpoint, and the sign of the first termination point along the vertical direction that is equal to the vertical coordinates of the first starting point is the second parallel endpoint.

[0202] In some specific embodiments, the symbol to the left of the input point directly connected to the first bottommost symbol is determined as the temporary starting point.

[0203] In some specific embodiments, the symbol directly connected to the input point of the first lowest symbol to the left is a left-diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first lowest symbol to the left is a middle-left diverging T-node. In some specific embodiments, the symbol directly connected to the input point of the first lowest symbol to the left is a lower-left T-node.

[0204] In some specific embodiments, it is determined whether the horizontal coordinates of the temporary starting point and the first parallel endpoint are equal.

[0205] In some specific embodiments, if the horizontal coordinates of the temporary starting point are equal to those of the first parallel endpoint, the temporary starting point is determined as the second starting point.

[0206] In some specific embodiments, if the horizontal coordinates of the temporary starting point and the first parallel endpoint are not equal, the symbol on the left side directly connected to the temporary starting point is used as the updated temporary starting point, and the horizontal coordinates of the temporary starting point and the first parallel endpoint are re-evaluated.

[0207] In some specific embodiments, the symbol to the right of the output point directly connected to the first bottommost symbol is determined as a temporary termination point.

[0208] In some specific embodiments, the symbol directly connected to the output point of the first lowest symbol to the right is a right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first lowest symbol to the right is a middle-right convergence T-node. In some specific embodiments, the symbol directly connected to the output point of the first lowest symbol to the right is a lower-right T-node.

[0209] In some specific embodiments, it is determined whether the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal.

[0210] In some specific embodiments, if the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal, the temporary termination point is determined to be the second termination point.

[0211] In some specific embodiments, if the horizontal coordinates of the temporary termination point and the second parallel endpoint are not equal, the symbol on the right side directly connected to the temporary termination point is used as the updated temporary termination point, and the horizontal coordinates of the temporary termination point and the second parallel endpoint are re-evaluated.

[0212] In some specific embodiments, the second termination point and the second starting point are sorted vertically from bottom to top, and the symbol with the smaller vertical coordinate is determined as the third parallel endpoint. The symbol with the larger vertical coordinate is found to be the fourth parallel endpoint by matching the vertical coordinate of the third parallel endpoint.

[0213] Figure 10 This application provides a structural diagram of an electronic device, including a processor and a memory. The memory stores computer instructions, which, when executed by the processor, cause the processor to perform the computer instructions to achieve the following: Figures 1 to 5 The method and its detailed scheme are shown.

[0214] It should be understood that the above-described device embodiments are merely illustrative, and the device disclosed in this invention can be implemented in other ways. For example, the division of units / modules described in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, integrated into another system, or some features may be ignored or not executed.

[0215] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of the present invention can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0216] If the integrated unit / module is implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor or chip can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the on-chip cache, off-chip memory, and storage can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.

[0217] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0218] This application embodiment also provides a non-transitory computer storage medium storing a computer program, which, when executed by multiple processors, causes the processors to perform actions such as... Figures 1 to 5 The method and its detailed scheme are shown.

[0219] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. Furthermore, any changes or modifications made by those skilled in the art based on the ideas of this application, and on the specific implementation methods and application scope of this application, are all within the scope of protection of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A ladder diagram network processing method, comprising: Select the first and second symbols in the ladder diagram network; Determining the connection relationship between the first symbol and the second symbol includes: Sort the first symbol and the second symbol horizontally from left to right to determine the first leftmost symbol and the first rightmost symbol; If there is a path in the horizontal direction from left to right between the output point of the first leftmost symbol and the first rightmost symbol, the connection relationship between the first symbol and the second symbol is determined to be serial. If there is no path between the output point of the first leftmost symbol and the first rightmost symbol in the horizontal direction from left to right, the connection relationship between the first symbol and the second symbol is determined to be parallel. Determining the smallest subnetwork to which the first symbol and the second symbol belong based on the connection relationship includes: When the connection between the first symbol and the second symbol is in series, determine the first series endpoint and the second series endpoint; The symbols on all paths between the first serial endpoint and the first rightmost symbol form the left endpoint symbol set, and the symbols on all paths between the first leftmost symbol and the second serial endpoint form the right endpoint symbol set; The sum of the left endpoint symbol set and the right endpoint symbol set is taken as all the symbols included in the minimum subnetwork; When the first symbol and the second symbol are connected in parallel, in step S301, the first symbol and the second symbol are sorted vertically from top to bottom to determine the first uppermost symbol and the first lowermost symbol. Step S302: Generate a first start point and a first end point based on the first uppermost symbol, and generate a first parallel endpoint and a second parallel endpoint based on the first start point and the first end point; Step S303: Generate a second starting point and a second ending point based on the first bottommost symbol; generate a third parallel endpoint and a fourth parallel endpoint based on the second starting point and the second ending point. Step S304: The symbols contained in all paths between the first parallel endpoint and the second parallel endpoint are taken as the first parallel symbol set; Step S305: Filter the symbols in the first parallel symbol set whose coordinates from bottom to top in the vertical direction are smaller than those of the first parallel endpoint and the third parallel endpoint, to obtain all symbols included in the minimum subnetwork.

2. The method as described in claim 1, characterized in that, Determining the first serial endpoint and the second serial endpoint includes: Step S201: Set the output point of the leftmost position symbol as the current starting point and set the input point of the rightmost position symbol as the current ending point. Step S202: Determine the uppermost path from the current starting point to the current ending point in the horizontal direction from left to right as the first path; Step S203: Determine whether the current starting point or the current ending point satisfies the endpoint determination condition based on the first path; Step S204: If the endpoint determination conditions are met, the current starting point is determined as the first serial endpoint, and the current ending point is determined as the second serial endpoint. Step S205: If the endpoint determination conditions are not met, update the current starting point or the current ending point according to the first node list, and return to step S202.

3. The method as described in claim 2, characterized in that, The step of determining whether the endpoint determination condition is met based on the first path includes: The symbols on all paths between the current starting point and the current ending point are combined into a first set of concatenated symbols. The symbols on all branches containing all first-type nodes on the first path are combined into a second set of serial symbols; If the first set of serial symbols contains all elements of the second set of serial symbols, then the endpoint determination condition is satisfied.

4. The method as described in claim 3, characterized in that, The step of determining the current starting point as the first serial endpoint and the current ending point as the second serial endpoint when the endpoint determination conditions are met includes: When the first type of node is a right-converging T node, the current starting point is determined as the first serial endpoint; When the first type of node is a left-divergent T node, the current termination point is determined as the second serial endpoint.

5. The method as described in claim 3, characterized in that, The first node list includes: When the first type of node is a right-converging T node, the first node list includes the nearest left-diverging T node, the middle-left-diverging T node, and the lower-left T node connected to the current starting point; When the first type of node is a left-diverging T-node, the first node list includes the nearest right-converging T-node, middle-right-converging T-node, or lower-right T-node connected to the current termination point.

6. The method as described in claim 1, characterized in that, The step of generating a first start point and a first end point based on the first uppermost symbol, and generating a first parallel endpoint and a second parallel endpoint based on the first start point and the first end point, includes: Step S401: Take the symbol to the left of the input point of the first uppermost symbol as the current starting point; Step S402: Set the input point of the first bottommost symbol as a temporary termination point, and determine whether there is a connectable path between the current starting point and the temporary termination point; Step S403: If there is a connectable path between the current starting point and the temporary termination point, the current starting point is determined as the first starting point; Step S404: If there is no connectable path between the current starting point and the temporary ending point, take the symbol to the left of the input point of the current starting point as the updated current starting point, and return to step S402. Step S405: Take the symbol to the right of the output point of the first uppermost symbol as the current termination point; Step S406: Set the output point of the first bottommost symbol as a temporary starting point, and determine whether there is a connectable path between the temporary starting point and the current ending point; Step S407: If there is a connectable path between the temporary starting point and the current ending point, the current ending point is determined as the first ending point. Step S408: If there is no connectable path between the temporary starting point and the current ending point, take the symbol to the right of the output point of the current ending point as the updated current ending point, and return to step S406. Step S409: Sort the first termination point and the first starting point vertically from bottom to top, determine the symbol with the smaller coordinate in the vertical direction as the first parallel endpoint, and find the symbol with the larger coordinate in the vertical direction that is equal to the vertical coordinate of the first parallel endpoint as the second parallel endpoint.

7. The method as described in claim 1, characterized in that, The step of generating a second start point and a second end point based on the first lowest symbol, and generating a third parallel endpoint and a fourth parallel endpoint based on the second start point and the second end point, includes: Step S501: Determine the symbol to the left of the input point directly connected to the first bottommost symbol as the temporary starting point; Step S502: Determine whether the horizontal coordinates of the temporary starting point and the first parallel endpoint are equal; Step S503: If the horizontal coordinates of the temporary starting point and the first parallel endpoint are equal, determine the temporary starting point as the second starting point; Step S504: If the horizontal coordinates of the temporary starting point and the first parallel endpoint are not equal, take the symbol on the left side directly connected to the temporary starting point as the updated temporary starting point, and return to step S502. Step S505: Determine the symbol to the right of the output point of the first bottommost symbol as a temporary termination point; Step S506: Determine whether the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal; Step S507: If the horizontal coordinates of the temporary termination point and the second parallel endpoint are equal, determine the temporary termination point as the second termination point. Step S508: If the horizontal coordinates of the temporary termination point and the second parallel endpoint are not equal, take the symbol on the right side directly connected to the temporary termination point as the updated temporary termination point, and return to step S506. Step S509: Sort the second termination point and the second starting point vertically from bottom to top, determine the symbol with the smaller coordinate among the second termination point and the second starting point in the vertical direction as the third parallel endpoint, and find the symbol with the larger coordinate among the second termination point and the second starting point in the vertical direction whose vertical coordinate is equal to that of the third parallel endpoint as the fourth parallel endpoint.

8. A ladder diagram network processing apparatus, the ladder diagram network processing apparatus being used to perform the method as described in any one of claims 1-7, the ladder diagram network processing apparatus comprising a symbol selection module, a connection relationship module, and a sub-network determination module, wherein: The symbol selection module is used to select the first and second symbols in the ladder diagram network; The connection relationship module is used to determine the connection relationship between the first symbol and the second symbol; The subnetwork determination module is used to determine the smallest subnetwork to which the first symbol and the second symbol belong based on the connection relationship.

9. An electronic device, comprising: processor; A memory storing a computer program that, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having stored thereon computer-readable instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Network topology graphical display methods and systems

    CN102281154A

  • Self-adaptive construction and decoding method based on random convolution network error correction codes

    CN110460340A