Ladder diagram drawing method, electronic device, storage medium, and program product

By receiving a list of variable relationships on a local terminal device and generating a ladder diagram, the problem of high network bandwidth consumption caused by remote control is solved, and efficient ladder diagram drawing and debugging are achieved.

CN122115609APending Publication Date: 2026-05-29CHINA RAILWAY CONSTR HEAVY IND

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA RAILWAY CONSTR HEAVY IND
Filing Date
2026-01-23
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In distributed industrial scenarios, remote control of PLC ladder diagrams requires the transmission of the entire screen bitmap data, resulting in high network bandwidth consumption and reduced ladder diagram drawing efficiency.

Method used

By receiving a list of variable relationships sent by electronic devices, the variables are classified according to their location information and system identifiers, their location coordinates and connection point coordinates are determined, and a ladder diagram is generated, reducing the reliance on remote control.

Benefits of technology

Generating ladder diagrams on local terminal devices improves debugging efficiency and flexibility, reduces network bandwidth usage, and enhances drawing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115609A_ABST
    Figure CN122115609A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a ladder diagram drawing method, an electronic device, a storage medium and a program product. Relate to computer field. The method comprises: receiving a variable relationship list sent by an electronic device, the variable relationship list comprising parameter information of a plurality of first variables, the parameter information comprising position information and system identification of the plurality of first variables; according to the variable relationship list, classifying the plurality of first variables to obtain a first variable set, the system identification of a plurality of second variables in the first variable set being the same; according to the position information of the plurality of second variables, determining position coordinates and connection point coordinates of the plurality of second variables, the connection point coordinates being used to indicate end point coordinates of a connecting line between two second variables; and generating a ladder diagram corresponding to the first variable set according to the position coordinates and the connection point coordinates of the plurality of second variables. Improve the drawing efficiency of the ladder diagram.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more particularly to a method for drawing ladder diagrams, electronic devices, storage media, and program products. Background Technology

[0002] In industrial production processes, programmable logic controllers (PLCs) ladder diagrams serve as core programming tools to control the operational logic of equipment.

[0003] The development and debugging of PLC ladder diagrams primarily rely on localized programming software tools. In distributed industrial scenarios, engineers may need to view and modify the ladder diagram program in real time via terminal devices to address unexpected equipment failures or process adjustment requirements. Related technologies allow for the viewing and modification of ladder diagrams by transmitting the operating interface to a remote terminal via remote control software.

[0004] However, in the above method, remote control requires the transmission of the entire screen bitmap data, resulting in high network bandwidth consumption and consequently low efficiency in drawing the ladder diagram. Summary of the Invention

[0005] This application provides a method for drawing ladder diagrams, an electronic device, a storage medium, and a program product to improve the efficiency of drawing ladder diagrams.

[0006] In a first aspect, embodiments of this application provide a method for drawing a ladder diagram, comprising:

[0007] Receive a list of variable relationships sent by an electronic device. The list of variable relationships includes parameter information of multiple first variables. The parameter information includes the location information of multiple first variables and the system identifier.

[0008] Based on the variable relationship list, multiple first variables are classified to obtain a set of first variables. Multiple second variables in the first variable set have the same system identifier.

[0009] Based on the position information of multiple second variables, determine the position coordinates and connection point coordinates of multiple second variables. The connection point coordinates are used to indicate the endpoint coordinates of the connecting line between two second variables.

[0010] Generate a trapezoidal diagram corresponding to the set of first variables based on the position coordinates of multiple second variables and the coordinates of connection points.

[0011] In one possible design, for any given second variable; based on the position information of multiple second variables, determine the position coordinates and connection point coordinates of multiple second variables, including:

[0012] Determine the scaling factor and the type of the second variable. The scaling factor is used to indicate the scale of the second variable on the ladder diagram. The type of the second variable includes node type and output type.

[0013] Determine the position coordinates and connection point coordinates of the second variable based on its type.

[0014] In one possible design, the connection point coordinates include the coordinates of a first connection point and a second connection point; the position coordinates and connection point coordinates of the second variable are determined according to the type of the second variable, including:

[0015] When the type of the second variable is output, the first value and the second value are determined according to the position information of the second variable. The first value is used to indicate the position identifier to the left of the second variable, and the second value is used to indicate the row number of the second variable.

[0016] Based on the first value, the second value, and the scaling factor, determine the position coordinates and connection point coordinates of the second variable;

[0017] When the second variable is of type node, determine the third, fourth and fifth values ​​of the second variable. The third value is used to indicate the position marker to the left of the second variable, the fourth value is used to indicate the position marker to the right of the second variable, and the fifth value is used to indicate the row number of the second variable.

[0018] Determine the sixth value of the third variable of type output within the first variable set. The sixth value is used to indicate the row number of the third variable.

[0019] Based on the third, fourth, and fifth values, determine the position coordinates of the second variable, and based on the third, fourth, and sixth values, determine the coordinates of the connection point of the second variable.

[0020] In one possible design, a ladder diagram corresponding to the set of first variables is generated based on the position coordinates and connection point coordinates of multiple second variables, including:

[0021] Based on the parameter information of multiple second variables, determine the instruction type of the multiple second variables;

[0022] Based on the position coordinates and instruction types of multiple second variables, generate path strings for multiple second variables. These path strings are used to indicate how to draw the multiple second variables.

[0023] Based on the position coordinates and connection point coordinates of multiple second variables, generate connection edges for multiple second variables. These connection edges are used to connect two second variables that have a connection relationship.

[0024] Generate a ladder diagram corresponding to the set of first variables based on the path strings and connecting edges of multiple second variables.

[0025] In one possible design, a ladder diagram corresponding to the set of first variables is generated based on the path strings and connecting edges of multiple second variables, including:

[0026] Obtain the number of multiple second variables and the pixel information of the ladder diagram drawing;

[0027] Based on the quantity and pixel information of the drawing, determine the correction factor for the connecting edge. The correction factor is used to adjust the length of the connecting edge.

[0028] The length of the connecting edge is obtained by adjusting the length of the connecting edge according to the correction factor;

[0029] Generate a ladder diagram corresponding to the set of first variables based on the connecting edges, the length of the connecting edges, and the path strings of multiple second variables.

[0030] In one possible design, after generating the ladder diagram corresponding to the first set of variables, the following steps are also included:

[0031] Receive user's modification command for the second variable in the ladder diagram. The modification command is generated when the user clicks on the second variable in the ladder diagram.

[0032] Determine the modification permission for the second variable. If the modification permission indicates that the second variable can be modified, then generate a visual operation pop-up based on the parameter information of the second variable.

[0033] The system receives updated parameter information modified by the user, generates an updated ladder diagram corresponding to the first set of variables based on the updated parameter information, and sends the updated parameter information to the electronic device so that the electronic device can modify the parameter information of the second variable according to the updated parameter information.

[0034] Secondly, embodiments of this application provide a ladder diagram drawing apparatus, comprising: a receiving module, a classification processing module, a determining module, and a generating module, wherein,

[0035] The receiving module is used to receive a variable relationship list sent by an electronic device. The variable relationship list includes parameter information of multiple first variables, and the parameter information includes the location information and system identifier of multiple first variables.

[0036] The classification processing module is used to classify multiple first variables according to the variable relationship list to obtain a set of first variables, and multiple second variables in the set of first variables have the same system identifier;

[0037] The determination module is used to determine the position coordinates and connection point coordinates of multiple second variables based on their position information. The connection point coordinates are used to indicate the coordinates of the endpoints of the connecting line between two second variables.

[0038] The generation module is used to generate a ladder diagram corresponding to the set of first variables based on the position coordinates and connection point coordinates of multiple second variables.

[0039] In one possible design, the module is specifically used for,

[0040] Determine the scaling factor and the type of the second variable. The scaling factor is used to indicate the scale of the second variable on the ladder diagram. The type of the second variable includes node type and output type.

[0041] Determine the position coordinates and connection point coordinates of the second variable based on its type.

[0042] In one possible design, the module is specifically used for,

[0043] When the type of the second variable is output, the first value and the second value are determined according to the position information of the second variable. The first value is used to indicate the position identifier to the left of the second variable, and the second value is used to indicate the row number of the second variable.

[0044] Based on the first value, the second value, and the scaling factor, determine the position coordinates and connection point coordinates of the second variable;

[0045] When the second variable is of type node, determine the third, fourth and fifth values ​​of the second variable. The third value is used to indicate the position marker to the left of the second variable, the fourth value is used to indicate the position marker to the right of the second variable, and the fifth value is used to indicate the row number of the second variable.

[0046] Determine the sixth value of the third variable of type output within the first variable set. The sixth value is used to indicate the row number of the third variable.

[0047] Based on the third, fourth, and fifth values, determine the position coordinates of the second variable, and based on the third, fourth, and sixth values, determine the coordinates of the connection point of the second variable.

[0048] In one possible design, the generation module is specifically used for,

[0049] Based on the parameter information of multiple second variables, determine the instruction type of the multiple second variables;

[0050] Based on the position coordinates and instruction types of multiple second variables, generate path strings for multiple second variables. These path strings are used to indicate how to draw the multiple second variables.

[0051] Based on the position coordinates and connection point coordinates of multiple second variables, generate connection edges for multiple second variables. These connection edges are used to connect two second variables that have a connection relationship.

[0052] Generate a ladder diagram corresponding to the set of first variables based on the path strings and connecting edges of multiple second variables.

[0053] In one possible design, the generation module is specifically used for,

[0054] Obtain the number of multiple second variables and the pixel information of the ladder diagram drawing;

[0055] Based on the quantity and pixel information of the drawing, determine the correction factor for the connecting edge. The correction factor is used to adjust the length of the connecting edge.

[0056] The length of the connecting edge is obtained by adjusting the length of the connecting edge according to the correction factor;

[0057] Generate a ladder diagram corresponding to the set of first variables based on the connecting edges, the length of the connecting edges, and the path strings of multiple second variables.

[0058] In one possible design, the generation module is also used for,

[0059] Receive user's modification command for the second variable in the ladder diagram. The modification command is generated when the user clicks on the second variable in the ladder diagram.

[0060] Determine the modification permission for the second variable. If the modification permission indicates that the second variable can be modified, then generate a visual operation pop-up based on the parameter information of the second variable.

[0061] The system receives updated parameter information modified by the user, generates an updated ladder diagram corresponding to the first set of variables based on the updated parameter information, and sends the updated parameter information to the electronic device so that the electronic device can modify the parameter information of the second variable according to the updated parameter information.

[0062] Thirdly, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to perform the ladder diagram drawing method of the first aspect and various possible designs of the first aspect as described above.

[0063] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the ladder diagram drawing method of the first aspect and various possible designs of the first aspect.

[0064] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, implements the ladder diagram drawing method of the first aspect and various possible designs of the first aspect.

[0065] This application provides a ladder diagram drawing method, electronic device, storage medium, and program product. When viewing or modifying a ladder diagram on a local terminal device, the method can receive a variable relationship list sent by the electronic device. The variable relationship list includes parameter information of multiple first variables, including position information and system identifiers of the multiple first variables. Based on the variable relationship list, the multiple first variables are classified to obtain a set of first variables, where multiple second variables within the set share the same system identifier. Based on the position information of the multiple second variables, the position coordinates and connection point coordinates of the multiple second variables are determined. The connection point coordinates indicate the endpoint coordinates of the connecting lines between two second variables. Based on the position coordinates and connection point coordinates of the multiple second variables, a ladder diagram corresponding to the set of first variables is generated. Thus, this method allows adding position information to the variable relationship list during the ladder diagram design phase, enabling the terminal device to obtain the variable positions and generate the ladder diagram. Furthermore, it allows for drawing graphics on a local terminal device without remote control, improving debugging efficiency and flexibility. Attached Figure Description

[0066] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0067] Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of this application;

[0068] Figure 2 A flowchart illustrating a method for drawing a ladder diagram provided in an embodiment of this application;

[0069] Figure 3 A schematic diagram illustrating the position information of the first variable provided in an embodiment of this application;

[0070] Figure 4 A schematic diagram illustrating the process of determining the position coordinates of any second variable and the coordinates of the connection point provided in the embodiments of this application;

[0071] Figure 5 A schematic diagram illustrating the process of generating a ladder diagram corresponding to the first set of variables, as provided in an embodiment of this application;

[0072] Figure 6 A schematic diagram of a ladder diagram drawing device provided in this application embodiment;

[0073] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0074] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize or refuse.

[0077] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.

[0078] It should be noted that the ladder diagram drawing method, electronic device, storage medium and program product provided in this application can be used in the computer field, or in any field other than the computer field. The application field of the ladder diagram drawing method, electronic device, storage medium and program product in this application is not limited.

[0079] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0080] To facilitate understanding, the technical terms involved in the embodiments of this application will be explained first.

[0081] PLC ladder diagram: PLC ladder diagram is a graphical programming language designed specifically for programmable logic controllers (PLCs). PLC ladder diagrams can mimic the electrical schematics of traditional relay and contactor control systems. Using ladders as the basic unit, each ladder includes a left busbar, a logic input section consisting of normally open / normally closed contacts, a logic output section consisting of coils or function blocks, and a right busbar. Following the scanning execution principle from top to bottom and from left to right, it simulates logic operations by switching energy flow on and off, realizing the start-up, shutdown, sequence, and interlocking control of industrial equipment or production lines. It has the characteristics of being intuitive and easy to understand, convenient for debugging, and flexible for modification, and is one of the most widely used PLC programming methods in the field of industrial automation.

[0082] The following is combined with Figure 1 The system architecture applicable to the embodiments of this application will be described.

[0083] Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of this application. Please refer to [link / reference]. Figure 1 This includes terminal devices and electronic devices. Terminal devices can be front-end devices operated locally by debugging personnel, such as mobile phones, tablets, and computers. Electronic devices can be devices with on-device computing capabilities, such as back-end servers. When performing local debugging, debugging personnel can request a list of variable relationships for the ladder diagram from the electronic device via the terminal device. Based on this list, they can then render and generate the ladder diagram locally. Debugging personnel can also modify the generated ladder diagram and send the incremental modifications back to the electronic device via the terminal device for consistency updates.

[0084] The development and debugging of PLC ladder diagrams primarily rely on localized programming software tools. In distributed industrial scenarios, engineers may need to view and modify the ladder diagram program in real time via terminal devices to address unexpected equipment failures or process adjustment requirements. In related technologies, the ladder diagram can be viewed and modified by transmitting the operating interface to a remote terminal via remote control software. However, in this method, remote control requires transmitting the entire screen bitmap data, resulting in high network bandwidth consumption and consequently low ladder diagram drawing efficiency.

[0085] To address the aforementioned technical problems, in this embodiment, when it is necessary to view or modify a ladder diagram on a local terminal device, a variable relationship list sent by an electronic device can be received. This list includes parameter information for multiple first variables, with the parameter information including position information and system identifiers. Based on the variable relationship list, the multiple first variables are categorized to obtain a set of first variables, where multiple second variables within the set share the same system identifier. Based on the position information of the multiple second variables, the position coordinates and connection point coordinates of these second variables are determined. The connection point coordinates indicate the endpoint coordinates of the connecting lines between two second variables. Based on the position coordinates and connection point coordinates of the multiple second variables, a ladder diagram corresponding to the set of first variables is generated. Thus, this method allows adding position information to the variable relationship list during the ladder diagram design phase, enabling the terminal device to obtain the variable positions and generate the ladder diagram. Furthermore, graphical drawing can be performed on the local terminal device without remote control, improving debugging efficiency and flexibility.

[0086] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0087] Figure 2 This is a flowchart illustrating a method for drawing a ladder diagram according to an embodiment of this application. Please refer to... Figure 2 As shown, the method may include the following steps:

[0088] S201, Receive the variable relationship list sent by the electronic device.

[0089] The execution entity in this application embodiment can be a terminal device, which can be a local device of the debugging personnel, such as a mobile phone, tablet, or computer. It can also be a ladder diagram drawing device installed in the terminal device. The ladder diagram drawing device can be implemented through software or through a combination of software and hardware.

[0090] Electronic devices can be backend server devices, or, understandably, upstream business devices, such as servers equipped with PLC programming software, industrial control configuration software, etc. Electronic devices can store pre-configured lists of variable relationships.

[0091] The variable relationship list can be the original structured data set used to draw the ladder diagram, that is, the data information determined during the ladder diagram design phase. The variable relationship list can be represented in JSON format.

[0092] The variable relationship list can include parameter information for multiple first variables. The parameter information can be used to describe the first variables. The parameter information can include the location information and system identifier of multiple first variables, as well as the name, comments, instruction type, etc. of the first variables.

[0093] The first variable can be a basic building block of the ladder diagram, corresponding to various control variables in the PLC ladder diagram. For example, the first variable can be a normally open contact, a normally closed contact, an output coil, a numerical comparison instruction, etc. It can be understood that the first variable is the original variable without any processing.

[0094] The location information can be used to describe the logical position of the first variable on the ladder diagram. It can be understood that the location information can be information determined during the ladder diagram design stage and used to determine the position of each variable when the ladder diagram is generated on the local terminal device. For example, the location information can be that the first variable is located in the second position of the first row.

[0095] In one possible implementation, the position information of the first variable can be represented in the form kmn, where k can indicate the row number of the first variable, m can indicate the position marker to the left of the first variable, and n can indicate the position marker to the right of the first variable. For example...

[0096] Below, in conjunction with Figure 3 The location information of the first variable is explained through specific examples.

[0097] Figure 3 For a schematic diagram of the location information of the first variable provided in the embodiments of this application, please refer to [link / reference]. Figure 3 This includes multiple first variables, namely first variable a, first variable b, first variable c, and first variable d. First variable a is located in the first row, with its left position labeled 1 and its right position labeled 2, so its position information can be represented as 1-1-2. First variable b is located in the first row, with its left position labeled 3 and its right position labeled 4, so its position information can be represented as 1-3-4. First variable c is located in the second row, with its left position labeled 2 and its right position labeled 4, so its position information can be represented as 2-2-4. First variable d is the output variable, located in the first row, with its left position labeled 4 and no right position label, so its position information can be represented as 1-4.

[0098] The system identifier can be used to indicate the system to which the first variable belongs. For example, when the system identifier is 001, it can indicate that the first variable belongs to the propulsion system; when the system identifier is 002, it can indicate that the first variable belongs to the cutter head system; and when the system identifier is 003, it can indicate that the first variable belongs to the screw conveyor system.

[0099] Instruction types can be used to operate contacts and coils in traditional relay control systems, implementing basic logic operations such as AND, OR, and NOT, as well as common control circuits such as self-locking and interlocking. For example, instruction types may include normally open instructions, normally closed instructions, reset instructions, output instructions, and end instructions.

[0100] Understandably, when debugging personnel need to view or modify the ladder diagram, they can send a variable relationship list request to the electronic device through the terminal device. After the electronic device authenticates the terminal device, it will send the variable relationship list to the terminal device in response to the successful authentication. The terminal device can then receive the variable relationship list sent by the electronic device and generate the ladder diagram based on the variable relationship list.

[0101] S202. Based on the variable relationship list, classify the multiple first variables to obtain the first variable set.

[0102] Classification processing can refer to the operation of grouping multiple primary variables based on system identifiers, that is, grouping multiple primary variables with the same system identifier into one group.

[0103] The first variable set can be any set of variables obtained after classification, or it can be the set of variables corresponding to the target system identifier required by the debugger. Understandably, multiple second variables in the first variable set have the same system identifier. For example, multiple second variables in the first variable set have the same system identifier of 001.

[0104] For example, suppose there are multiple first variables including first variable 1, first variable 2, first variable 3 and first variable 4, where the system identifier of first variable 1 is 001, the system identifier of first variable 2 is 002, the system identifier of first variable 3 is 001 and the system identifier of first variable 4 is 001. Then first variable 1, first variable 3 and first variable 4 can be determined as the set of first variables.

[0105] S203. Based on the position information of multiple second variables, determine the position coordinates of multiple second variables and the coordinates of connection points.

[0106] The position coordinates of the second variable can refer to the pixel coordinates of the second variable in the trapezoidal canvas. The position coordinates can be represented in the form of two-dimensional coordinates. For example, the position coordinates of the second variable can be represented as (x, y), where x can be the horizontal coordinate of the second variable and y can be the vertical coordinate of the second variable. For example, the position coordinates of the second variable are (13, 14).

[0107] Connector point coordinates can be used to indicate the endpoint coordinates of the connecting line between two second variables. In other words, connector point coordinates can be the anchor point coordinates used by a second variable to connect to other variables. Connector point coordinates can include the coordinates of the first connector point on the left and the second connector point on the right. Using connector point coordinates ensures that the connecting lines between second variables are precisely aligned. For example, the first connector point coordinates of a second variable can be represented as (x1, y1), and the second connector point coordinates of a second variable can be represented as (x2, y2). For instance, the first connector point coordinates of a second variable could be (3, 5), and the second connector point coordinates of a second variable could be (6, 5).

[0108] In one possible implementation, for any second variable, the position coordinates and connection point coordinates of the second variable can be determined as follows: determine the scaling factor and the type of the second variable; determine the position coordinates and connection point coordinates of the second variable based on the type of the second variable.

[0109] The scaling factor can be used to indicate the proportional size of the second variable on the ladder diagram. That is, the scaling factor can be used to convert the logical position of the variable into pixel coordinates, thereby adapting to different sizes of ladder diagram canvases and realizing adaptive scaling of the ladder diagram. For example, when the scaling factor is 10, it can represent that 1 logical unit corresponds to 10 pixel units.

[0110] The type of the second variable can include node type and output type. Node type can refer to ordinary instructions, such as normally open, normally closed, numerical comparison, etc., while output type can refer to output instructions, such as output coil, etc.

[0111] S204. Generate a ladder diagram corresponding to the set of first variables based on the position coordinates and connection point coordinates of multiple second variables.

[0112] The ladder diagram corresponding to the first set of variables can refer to an independent ladder diagram generated on the basis of the first set of variables. It can be understood that the ladder diagram corresponding to the first set of variables can correspond to an industrial control system (i.e., the same system identifier).

[0113] The ladder diagram corresponding to the first set of variables can be drawn using Scalable Vector Graphics (SVG) on the terminal device. Understandably, the drawn ladder diagram can be in the form of an interactive webpage, that is, an interactive ladder diagram in HTML5 format can be generated. The ladder diagram supports hovering the mouse to view variable details, clicking to modify variable parameters, dynamically refreshing variable status, etc., making it suitable for web-based debugging and remote monitoring scenarios.

[0114] In this embodiment, when it is necessary to view or modify the ladder diagram on a local terminal device, a variable relationship list sent by an electronic device can be received. The variable relationship list includes parameter information of multiple first variables. The parameter information includes the position information and system identifier of multiple first variables, and may also include the name, comments, instruction type, etc. of the first variables. According to the variable relationship list, the multiple first variables are classified to obtain a set of first variables. The classification process can refer to the operation of grouping multiple first variables based on the system identifier. The set of first variables can be any set of variables obtained after classification, or it can be the set of variables corresponding to the target system identifier required by the debugging personnel. According to the position information of multiple second variables, the position coordinates and connection point coordinates of multiple second variables are determined. The position coordinates of the second variables can refer to the pixel coordinates of the second variables in the ladder diagram canvas, and the position coordinates can be represented in the form of two-dimensional coordinates. According to the position coordinates and connection point coordinates of multiple second variables, a ladder diagram corresponding to the set of first variables is generated. The ladder diagram corresponding to the set of first variables can refer to an independent ladder diagram generated on a unit basis of the set of first variables. In this way, by using the above method, position information can be added to the variable relationship list during the ladder diagram design stage, so that the terminal device can obtain the position of the variable and generate the ladder diagram. At the same time, the graphics can be drawn on the local terminal device without relying on the remote control of dedicated industrial control equipment, which improves the efficiency and flexibility of debugging.

[0115] Based on any of the above embodiments, the following, in conjunction with Figure 4 The process of determining the position coordinates of any second variable and the coordinates of the connection point is explained in detail.

[0116] Figure 4 This is a schematic diagram illustrating the process of determining the position coordinates of any second variable and the coordinates of the connection point provided in the embodiments of this application. Please refer to... Figure 3 The method may include:

[0117] S401. Determine the scaling factor and the type of the second variable.

[0118] Scaling factors can be used to indicate the scale of the second variable on the ladder diagram. For example, scaling factors can be 5, 10, 20, etc.

[0119] In one possible implementation, the scaling factor can be a value determined at the time of design of the ladder diagram. That is, in scenarios where there are specific requirements for the size of the ladder diagram, such as ladder diagrams with fixed printing sizes or standardized ladder diagrams for training, the scaling factor can be fixed in advance.

[0120] In another possible implementation, the width and height of the trapezoidal diagram canvas can be obtained. Based on the position information of multiple second variables, the maximum number of rows and the maximum number of variables horizontally can be determined. Based on the height of the trapezoidal diagram canvas and the maximum number of rows, a first scaling factor can be determined. The first scaling factor can be used to ensure that the multiple second variables vertically can be fully displayed within the canvas. Based on the length of the trapezoidal diagram canvas and the maximum number of variables horizontally, a second scaling factor can be determined. The second scaling factor can be used to ensure that the multiple second variables horizontally can be fully displayed within the canvas. The smaller value of the first scaling factor and the second scaling factor is determined as the final scaling factor.

[0121] In another possible implementation, a preset scaling factor determined during the design of the ladder diagram can be obtained, along with the number of multiple second variables. When the number of multiple second variables is greater than or equal to a first preset value, the preset scaling factor can be reduced to decrease the scale and avoid crowding among the multiple second variables. When the number of multiple second variables is less than or equal to a second preset value, the preset scaling factor can be enlarged to increase the scale and improve the clarity of the ladder diagram. When the number of multiple second variables is less than the first preset value but greater than the second preset value, the preset scaling factor remains unchanged to ensure the basic scale.

[0122] The type of the second variable can include node type and output type. Node type can refer to ordinary control instructions without output function; for example, the second variable of node type can include normally open, normally closed, numerical comparison, etc. Output type can refer to instructions with output control function; for example, the second variable of output type can be an output coil.

[0123] In one possible implementation, the type of the second variable can be determined based on its position information. For example, when the position information of the second variable includes both the left and right position identifiers, the type of the second variable can be considered as a node type. When the position information of the second variable only includes the right position identifier, the type of the second variable can be considered as an output type.

[0124] S402. Determine the position coordinates and connection point coordinates of the second variable based on the type of the second variable.

[0125] When the second variable is of type output, the position coordinates and connection point coordinates of the second variable can be determined as follows: determine the first value and the second value based on the position information of the second variable; determine the position coordinates and connection point coordinates of the second variable based on the first value, the second value, and the scaling factor.

[0126] The first value indicates the position marker to the left of the second variable, and the second value indicates the row number of the second variable.

[0127] In one possible implementation, assuming the first value is m, the second value is k, and the scaling factor is scale, the position coordinates (x, y) of the second variable can be represented as:

[0128]

[0129] For example, assuming the scaling factor is 10, the position information of the second variable is represented as 3-2, that is, the position identifier to the left of the second variable is 2, and the row number of the second variable is 3, then the first value m of the second variable can be determined as 2, the second value k of the second variable is 3, and the position coordinates of the second variable can be determined as (30, 3).

[0130] In one possible implementation, assuming the first value is m, the second value is k, and the scaling factor is scale, the coordinates of the connection point (x1, y1) of the second variable can be represented as:

[0131]

[0132] When the second variable is of type node, the position coordinates and connection point coordinates of the second variable can be determined as follows: determine the third, fourth, and fifth values ​​of the second variable; determine the sixth value of the third variable of type output within the first variable set; determine the position coordinates of the second variable based on the third, fourth, and fifth values; and determine the connection point coordinates of the second variable based on the third, fourth, and sixth values.

[0133] The third value indicates the position marker to the left of the second variable, the fourth value indicates the position marker to the right of the second variable, the fifth value indicates the row number of the second variable, and the sixth value indicates the row number of the third variable.

[0134] In one possible implementation, assuming the third value is m, the fourth value is n, the fifth value is k, and the scaling factor is scale, then the position coordinates (x, y) of the second variable can be represented as:

[0135]

[0136] In one possible implementation, assuming the third value is m, the fourth value is n, the sixth value is p, and the scaling factor is scale, then the coordinates of the first connection point (x1, y1) and the second connection point (x2, y2) of the second variable can be expressed as follows:

[0137]

[0138]

[0139] exist Figure 4 In the illustrated embodiment, when it is necessary to determine the position coordinates and connection point coordinates of any second variable, a scaling factor and the type of the second variable can be determined. The scaling factor can be used to indicate the proportional size of the second variable on the ladder diagram. The type of the second variable can include node type and output type. Based on the type of the second variable, the position coordinates and connection point coordinates of the second variable are determined. When the type of the second variable is output type, a first value and a second value are determined based on the position information of the second variable. The position coordinates and connection point coordinates of the second variable are then determined based on the first value, the second value, and the scaling factor. When the type of the second variable is node type, a third value, a fourth value, a fifth value, and a sixth value are determined. The position coordinates of the second variable are determined based on the third value, the fourth value, and the sixth value. Thus, by arranging the variables in different ways according to different variable types, the layout of ladder diagram variables can be accurately achieved. Furthermore, by configuring the scaling factor, it can adapt to various canvas sizes and usage scenarios, improving the flexibility of ladder diagram drawing.

[0140] Based on any of the above embodiments, the following, in conjunction with Figure 5 The process of generating the ladder diagram corresponding to the first set of variables is explained in detail.

[0141] Figure 5 This is a schematic diagram illustrating the process of generating a ladder diagram corresponding to the first set of variables, as provided in an embodiment of this application. Please refer to... Figure 5 The method may include:

[0142] S501. Determine the instruction type of the multiple second variables based on the parameter information of the multiple second variables.

[0143] Instruction types can be used to operate contacts and coils in traditional relay control systems, implementing basic logic operations such as AND, OR, and NOT, as well as common control circuits such as self-locking and interlocking. For example, instruction types may include normally open instructions, normally closed instructions, reset instructions, output instructions, less than comparison instructions, addition instructions, and end instructions.

[0144] The instruction type of the second variable can be determined by parsing the parameter information of the second variable. In one possible implementation, for any second variable, a field indicating the instruction type can be determined in the parameter information of the second variable, and the field value corresponding to the field can be determined as the instruction type of the second variable.

[0145] S502. Generate path strings for multiple second variables based on their position coordinates and instruction types.

[0146] The path string can be used to indicate the drawing of multiple second variables. The path string can refer to an SVG string. The movement path can refer to the pen movement trajectory when the terminal device's drawing engine draws the variable icon. The shape of the variable icon can be drawn according to the movement path.

[0147] Understandably, different instruction types can correspond to different variable icon shapes; that is, any instruction type can correspond to a path string.

[0148] For any given second variable, the drawing position of the path string can be determined based on the position coordinates of that second variable.

[0149] S503. Generate connecting edges for multiple second variables based on their position coordinates and connection point coordinates.

[0150] Connecting edges can be used to connect two second variables that have a connection relationship, that is, the visual connecting lines between variables in a ladder diagram. It can be understood that the essence of connecting edges is SVG line segments or polyline elements, used to present the logical control relationship between two variables.

[0151] Connection relationships can refer to the industrial control logic association between two second variables. For example, the left articulated hydraulic cylinder stroke monitoring controls the start and stop output of the propulsion motor. It is understandable that connection relationships are a prerequisite for generating connection edges.

[0152] Based on the position coordinates of the second variable, the relative position of the variables can be determined, and the direction of the connecting edge can be identified, such as horizontal, vertical, or polygonal, thus avoiding confusing connecting lines. For example, if the x-coordinates of two connected second variables are the same, the connecting edge will be vertical; if the y-coordinates are the same, the connecting edge will be horizontal; and if both x- and y-coordinates are different, a polygonal connecting edge will be generated.

[0153] In one possible implementation, the connecting edges of each second variable can be converted into line segment data and stored in the terminal device as an array, thereby providing structured data for subsequent batch rendering and realizing adaptive connections for different topological relationships.

[0154] S504. Generate a ladder diagram corresponding to the set of first variables based on the path strings and connecting edges of multiple second variables.

[0155] The ladder diagram corresponding to the first set of variables can refer to an independent visual ladder diagram generated on the basis of a single first set of variables. The ladder diagram can be viewed and modified individually.

[0156] In one possible implementation, the path strings and connecting edges of multiple second variables can be rendered using an Enterprise Charts (ECharts) library to generate a trapezoidal diagram corresponding to the set of first variables.

[0157] In one possible implementation, the ladder diagram corresponding to the first set of variables can be generated as follows: obtain the number of multiple second variables and the drawing pixel information of the ladder diagram; determine the correction coefficient of the connecting edge based on the number and drawing pixel information; adjust the length of the connecting edge according to the correction coefficient to obtain the connecting edge length; generate the ladder diagram corresponding to the first set of variables based on the connecting edge, the connecting edge length, and the path strings of multiple second variables.

[0158] The correction coefficient can be used to adjust the length of the connecting edge, that is, to adjust the proportional constant of the connecting edge length. The core function of the correction coefficient is to adapt to the number of the second variable and the canvas size of the trapezoidal diagram, thereby avoiding layout chaos caused by connecting edges that are too long or too short.

[0159] In one possible implementation, when the number of the second variable is greater than or equal to the first preset value, the preset first correction coefficient can be determined as the correction coefficient; when the number of the second variable is less than or equal to the second preset value, the preset second correction coefficient can be determined as the correction coefficient, and the first correction coefficient is less than the second correction coefficient.

[0160] In one possible implementation, after generating the ladder diagram corresponding to the first set of variables, the method further includes: receiving a user's modification instruction for a second variable within the ladder diagram; determining the modification permission for the second variable; if the modification permission indicates that the second variable is allowed to be modified, generating a visual operation pop-up window based on the parameter information of the second variable; receiving the updated parameter information modified by the user; generating an updated ladder diagram corresponding to the first set of variables based on the updated parameter information; and sending the updated parameter information to the electronic device so that the electronic device can modify the parameter information of the second variable based on the updated parameter information.

[0161] The modification command can be generated by the user clicking on the second variable within the ladder diagram.

[0162] Modification permissions can be determined by obtaining the parameter information of the second variable. Modification permissions can include allowing modification and disallowing modification. When the modification permission is disallowed, an error message can be generated. When modification is allowed, a visual operation pop-up window can be generated for the user to make modifications. Optionally, the visual operation pop-up window can include information such as the name, address, and command type of the second variable, as well as an editable input box.

[0163] Updating parameter information can refer to the parameter information of the second variable modified by the user, that is, only the incremental data of the modification is included. In this way, only the local coordinates of the variable modified by the user and its adjacent nodes are recalculated, rather than the entire ladder diagram is refreshed globally. This can reduce the computational complexity and rendering time when drawing the ladder diagram, and avoid the interface lag problem caused by a full refresh.

[0164] exist Figure 5 In the illustrated embodiment, when it is necessary to generate a ladder diagram corresponding to the first set of variables, path strings for multiple second variables can be generated based on their position coordinates; instruction types for multiple second variables can be determined based on their parameter information; icons corresponding to multiple second variables can be determined based on their instruction types; connecting edges for multiple second variables can be generated based on their position coordinates and connection point coordinates, and these connecting edges can be used to connect two second variables with a connection relationship; and the ladder diagram corresponding to the first set of variables can be generated based on the path strings and connecting edges. Thus, using the above method, drawing and graphics rendering can be performed using path strings, eliminating the need for remote control to generate the ladder diagram, allowing it to be generated on the debugger's local terminal device. Furthermore, when the debugger modifies the second variables within the ladder diagram, modification permissions can be verified first, thereby improving the reliability of the ladder diagram. Simultaneously, incremental updates are used, adjusting only the modified parts and synchronizing the modified parts to the electronic device, thus avoiding interface lag issues caused by full refreshes and improving real-time responsiveness.

[0165] Figure 6 This is a schematic diagram of a ladder diagram drawing device provided in an embodiment of this application. Please refer to... Figure 6 The ladder diagram drawing device 10 includes: a receiving module 11, a classification processing module 12, a determining module 13, and a generating module 14, wherein,

[0166] The receiving module 11 is used to receive a variable relationship list sent by the electronic device. The variable relationship list includes parameter information of multiple first variables. The parameter information includes the position information and system identifier of multiple first variables.

[0167] The classification processing module 12 is used to classify multiple first variables according to the variable relationship list to obtain a set of first variables, and multiple second variables in the set of first variables have the same system identifier;

[0168] The determination module 13 is used to determine the position coordinates and connection point coordinates of the multiple second variables based on the position information of the multiple second variables. The connection point coordinates are used to indicate the endpoint coordinates of the connecting line between two second variables.

[0169] The generation module 14 is used to generate a ladder diagram corresponding to the set of first variables based on the position coordinates and connection point coordinates of multiple second variables.

[0170] The method for drawing a ladder diagram provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0171] In one possible design, module 13 is specifically used for,

[0172] Determine the scaling factor and the type of the second variable. The scaling factor is used to indicate the scale of the second variable on the ladder diagram. The type of the second variable includes node type and output type.

[0173] Determine the position coordinates and connection point coordinates of the second variable based on its type.

[0174] In one possible design, module 13 is specifically used for,

[0175] When the type of the second variable is output, the first value and the second value are determined according to the position information of the second variable. The first value is used to indicate the position identifier to the left of the second variable, and the second value is used to indicate the row number of the second variable.

[0176] Based on the first value, the second value, and the scaling factor, determine the position coordinates and connection point coordinates of the second variable;

[0177] When the second variable is of type node, determine the third, fourth and fifth values ​​of the second variable. The third value is used to indicate the position marker to the left of the second variable, the fourth value is used to indicate the position marker to the right of the second variable, and the fifth value is used to indicate the row number of the second variable.

[0178] Determine the sixth value of the third variable of type output within the first variable set. The sixth value is used to indicate the row number of the third variable.

[0179] Based on the third, fourth, and fifth values, determine the position coordinates of the second variable, and based on the third, fourth, and sixth values, determine the coordinates of the connection point of the second variable.

[0180] In one possible design, the generation module 14 is specifically used for,

[0181] Based on the parameter information of multiple second variables, determine the instruction type of the multiple second variables;

[0182] Based on the position coordinates and instruction types of multiple second variables, generate path strings for multiple second variables. These path strings are used to indicate how to draw the multiple second variables.

[0183] Based on the position coordinates and connection point coordinates of multiple second variables, generate connection edges for multiple second variables. These connection edges are used to connect two second variables that have a connection relationship.

[0184] Generate a ladder diagram corresponding to the set of first variables based on the path strings and connecting edges of multiple second variables.

[0185] In one possible design, the generation module 14 is specifically used for,

[0186] Obtain the number of multiple second variables and the pixel information of the ladder diagram drawing;

[0187] Based on the quantity and pixel information of the drawing, determine the correction factor for the connecting edge. The correction factor is used to adjust the length of the connecting edge.

[0188] The length of the connecting edge is obtained by adjusting the length of the connecting edge according to the correction factor;

[0189] Generate a ladder diagram corresponding to the set of first variables based on the connecting edges, the length of the connecting edges, and the path strings of multiple second variables.

[0190] In one possible design, the generation module 14 is also used for,

[0191] Receive user's modification command for the second variable in the ladder diagram. The modification command is generated when the user clicks on the second variable in the ladder diagram.

[0192] Determine the modification permission for the second variable. If the modification permission indicates that the second variable can be modified, then generate a visual operation pop-up based on the parameter information of the second variable.

[0193] The system receives updated parameter information modified by the user, generates an updated ladder diagram corresponding to the first set of variables based on the updated parameter information, and sends the updated parameter information to the electronic device so that the electronic device can modify the parameter information of the second variable according to the updated parameter information.

[0194] The method for drawing a ladder diagram provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0195] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 60 may include: a transceiver 61, a processor 62, and a memory 63.

[0196] Processor 62 executes computer execution instructions stored in memory, causing processor 62 to perform the scheme in the above embodiments. Processor 62 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0197] The memory 63 is connected to the processor 62 via the system bus and completes communication between them. The memory 63 is used to store computer program instructions.

[0198] Transceiver 61 can be used to obtain the task to be run and its configuration information.

[0199] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0200] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.

[0201] This application also provides a chip for executing instructions, which is used to execute the technical solution of the ladder diagram drawing method in the above embodiments.

[0202] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the ladder diagram drawing method described in the above embodiments.

[0203] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the ladder diagram drawing method in the above embodiments.

[0204] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0205] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0206] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0207] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0208] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0209] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0210] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0211] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0212] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0213] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0214] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for drawing a trapezoidal diagram, characterized in that, include: Receive a variable relationship list sent by an electronic device, the variable relationship list including parameter information of multiple first variables, the parameter information including the location information and system identifier of multiple first variables; According to the variable relationship list, the multiple first variables are classified to obtain a first variable set, and the system identifiers of multiple second variables in the first variable set are the same; Based on the position information of the plurality of second variables, determine the position coordinates and connection point coordinates of the plurality of second variables, wherein the connection point coordinates are used to indicate the endpoint coordinates of the connecting line between two second variables; Based on the position coordinates and connection point coordinates of the multiple second variables, a trapezoidal diagram corresponding to the first variable set is generated.

2. The method according to claim 1, characterized in that, For any given second variable; based on the position information of the plurality of second variables, determine the position coordinates and connection point coordinates of the plurality of second variables, including: Determine the scaling factor and the type of the second variable, wherein the scaling factor is used to indicate the scale of the second variable on the ladder diagram, and the type of the second variable includes node type and output type; Based on the type of the second variable, determine the position coordinates and connection point coordinates of the second variable.

3. The method according to claim 2, characterized in that, The connection point coordinates include the first connection point coordinates and the second connection point coordinates; determining the position coordinates and connection point coordinates of the second variable according to the type of the second variable includes: When the type of the second variable is output type, a first value and a second value are determined according to the position information of the second variable. The first value is used to indicate the position identifier to the left of the second variable, and the second value is used to indicate the row number of the second variable. Based on the first value, the second value, and the scaling factor, determine the position coordinates and connection point coordinates of the second variable; When the type of the second variable is a node type, determine the third, fourth and fifth values ​​of the second variable. The third value is used to indicate the position identifier to the left of the second variable, the fourth value is used to indicate the position identifier to the right of the second variable, and the fifth value is used to indicate the row number of the second variable. Determine the sixth value of the third variable of type output within the first variable set, wherein the sixth value is used to indicate the row number of the third variable; The position coordinates of the second variable are determined based on the third, fourth, and fifth values, and the coordinates of the connection point of the second variable are determined based on the third, fourth, and sixth values.

4. The method according to any one of claims 1-3, characterized in that, Based on the position coordinates and connection point coordinates of the plurality of second variables, a trapezoidal diagram corresponding to the first variable set is generated, including: Based on the parameter information of the plurality of second variables, determine the instruction type of the plurality of second variables; Based on the position coordinates of the plurality of second variables and the instruction type of the plurality of second variables, a path string for the plurality of second variables is generated, and the path string is used to instruct the drawing of the plurality of second variables; Based on the position coordinates and connection point coordinates of the plurality of second variables, a connection edge is generated for the plurality of second variables, and the connection edge is used to connect two second variables that have a connection relationship; Based on the path strings of the multiple second variables and the connecting edges, a trapezoidal graph corresponding to the first variable set is generated.

5. The method according to claim 4, characterized in that, Based on the path strings of the plurality of second variables and the connecting edges, a ladder diagram corresponding to the first variable set is generated, including: Obtain the quantity of the plurality of second variables and the drawing pixel information of the trapezoidal diagram; Based on the quantity and the pixel information of the drawing, a correction coefficient for the connecting edge is determined, and the correction coefficient is used to adjust the length of the connecting edge; The length of the connecting edge is adjusted according to the correction coefficient to obtain the length of the connecting edge; Based on the connecting edge, the length of the connecting edge, and the path strings of the plurality of second variables, a trapezoidal diagram corresponding to the first variable set is generated.

6. The method according to any one of claims 1-3, characterized in that, After generating the ladder diagram corresponding to the first set of variables, the process also includes: Receive a user's modification instruction for the second variable within the ladder diagram, the modification instruction being generated by the user clicking on the second variable within the ladder diagram; Determine the modification permission of the second variable. If the modification permission indicates that the second variable is allowed to be modified, then generate a visual operation pop-up window based on the parameter information of the second variable. The system receives the updated parameter information modified by the user, generates an updated ladder diagram corresponding to the first variable set based on the updated parameter information, and sends the updated parameter information to the electronic device so that the electronic device can modify the parameter information of the second variable based on the updated parameter information.

7. A device for drawing trapezoidal diagrams, characterized in that, include: The module consists of a receiving module, a classification processing module, a determining module, and a generating module. The receiving module is used to receive a variable relationship list sent by an electronic device. The variable relationship list includes parameter information of multiple first variables, and the parameter information includes the location information and system identifier of the multiple first variables. The classification processing module is used to classify the plurality of first variables according to the variable relationship list to obtain a first variable set, wherein the system identifiers of the plurality of second variables in the first variable set are the same; The determining module is used to determine the position coordinates and connection point coordinates of the plurality of second variables based on the position information of the plurality of second variables, wherein the connection point coordinates are used to indicate the endpoint coordinates of the connecting line between two second variables; The generation module is used to generate a trapezoidal diagram corresponding to the first variable set based on the position coordinates and connection point coordinates of the plurality of second variables.

8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.