A method for displaying and writing a high-resolution touch screen electrical wiring diagram
By constructing a linked list-structured graphics engine and using intelligent algorithms to optimize the layout of electrical components, the problem of cumbersome operation and poor flexibility in traditional electrical main wiring diagram editing methods has been solved, achieving efficient and flexible electrical wiring diagram editing and display, and supporting multi-user collaborative work.
Patent Information
- Application Number
- CN202510952521.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2045-07-10
AI Technical Summary
Traditional methods of editing electrical main wiring diagrams are cumbersome, lack flexibility, have high barriers to entry for professional software, are inconvenient for file sharing, have complex version control, and are inefficient for multi-person collaboration, making it difficult to meet the diverse needs of modern power systems.
By constructing a linked list-structured graphical engine, modular management of electrical components is achieved. The system integrates the interaction of toolbar, attribute editing area and graphical editing area, automatic snapping function, multi-level parsing and layered rendering strategy, and artificial intelligence algorithm to optimize the layout of electrical components. It also supports status monitoring and collaborative editing.
It significantly lowers the technical threshold for editing electrical wiring diagrams, improves connection accuracy and editing efficiency, realizes real-time reflection and dynamic interaction of wiring diagrams, supports multi-user collaborative editing, and improves on-site work efficiency and flexibility.
Smart Images

Figure CN120687092B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method and system for displaying and writing electrical wiring diagrams on a high-resolution touchscreen. Background Technology
[0002] With the rapid development of power systems and industrial automation, the requirements for LCD display devices are increasing. Especially in power monitoring systems, LCD main wiring diagrams serve as a crucial information display interface, requiring efficient, flexible, and configurable display methods to adapt to different engineering and R&D needs. Traditional electrical main wiring diagram editing typically relies on local software, requiring specialized software on a dedicated computer for editing, followed by transmission to an embedded device. This method is widely used in power systems, graphically displaying the connection relationships and operating status of power equipment, providing maintenance personnel with an intuitive monitoring view.
[0003] However, traditional display methods suffer from complex configurations and poor flexibility, making it difficult to meet the diverse display device requirements of modern power systems. This approach is not only cumbersome to operate but also inefficient, with high barriers to entry for specialized software, limiting the participation of non-professionals. Furthermore, inconvenient file sharing, complex version control, and low efficiency in multi-person collaboration significantly impact project implementation efficiency. Especially against the backdrop of rapid equipment upgrades in power systems, frequent changes and maintenance of wiring diagrams have become time-consuming and labor-intensive tasks, severely restricting the flexible application and rapid deployment of power monitoring systems. Summary of the Invention
[0004] This application provides a high-resolution touchscreen electrical wiring diagram display and editing method and system, which enables online interactive editing, parameterized configuration, real-time parsing and rendering, status monitoring and collaborative editing of electrical main wiring diagrams, thereby improving the efficiency and flexibility of wiring diagram editing and display.
[0005] This application provides a method for displaying and writing high-resolution touchscreen electrical wiring diagrams. The method includes: constructing a graphics engine by organizing nodes using a linked list structure, with each node containing time, status, logic, and event information, resulting in a graphics engine containing circuit breaker, isolator, transformer, and other components; developing an editing system based on the graphics engine, obtaining a wiring diagram editing interface through interaction between a toolbar, attribute editing area, and graphics editing area; configuring component parameters according to the wiring diagram editing interface, triggering an automatic snapping function if the distance between components is less than a preset threshold, and obtaining a component parameter set through static and dynamic state attribute settings; inputting the component parameter set into a parsing system for multi-level parsing, and locally refreshing the changing areas using a layered rendering strategy to obtain a displayed wiring diagram; monitoring the status of the displayed wiring diagram, executing preset linkage rules if trigger conditions are met through data acquisition and status determination to obtain a dynamic wiring diagram reflecting the equipment status; and importing the dynamic wiring diagram into a storage system for persistent processing, recording version difference data through structured descriptions to obtain a data file supporting collaborative editing.
[0006] The technical solution provided in this application organizes nodes into a linked list structure to build a graphical engine, realizing modular management and reuse of electrical components, which greatly improves the efficiency of graphical construction. Each node contains time, status, logic, and event information, enabling each component to have complete data processing and interaction capabilities. The editing system developed based on this graphical engine provides an intuitive and easy-to-use interface through the organic interaction of the toolbar, attribute editing area, and graphical editing area, significantly reducing the technical threshold for electrical wiring diagram editing and enabling non-professionals to complete the creation of complex wiring diagrams. The automatic snapping function integrated during parameter configuration triggers precise positioning by intelligently calculating the distance between components and comparing it with a preset threshold, greatly improving connection accuracy and editing efficiency. A multi-level parsing and layered rendering strategy performs hierarchical processing of component parameters and greatly reduces the impact of local refresh mechanisms. This invention minimizes system resource consumption and ensures smooth display of large and complex wiring diagrams on the touchscreen. The combination of a status monitoring mechanism and preset linkage rules enables real-time reflection and intelligent response of equipment status, enhancing the dynamic interactivity and information transmission efficiency of the wiring diagrams. Structured storage and version difference recording technology achieve efficient data persistence and traceability, while supporting multi-user collaborative editing to meet the team collaboration needs in engineering practice. In particular, this invention applies artificial intelligence algorithms in the field of power monitoring, using deep learning models to identify and optimize the spatial layout of electrical components, adaptively adjusting connection paths to achieve intelligent assisted design. The intelligent algorithm makes a significant contribution to the overall solution, enabling the system to learn and automatically propose optimization suggestions based on historical editing habits and wiring specifications. The direct editing mode via the touchscreen significantly improves on-site work efficiency and flexibility. Attached Figure Description
[0007] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0008] Figure 1 This is a schematic diagram of one embodiment of the high-resolution touchscreen electrical wiring diagram display and writing method in this application. Detailed Implementation
[0009] This application provides a high-resolution touchscreen electrical wiring diagram display and writing method and system. The terms first, second, third, fourth, etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms include or have, and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0010] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the high-resolution touchscreen electrical wiring diagram display and writing method in this application includes: Step S101: Construct the graphics engine by organizing nodes through a linked list structure. Each node contains time, status, logic, and event information, resulting in a graphics engine containing circuit breaker, isolator, transformer, and transformer components. Step S102: Develop the editing system based on the graphics engine, and obtain the wiring diagram editing interface through the interaction of the toolbar, attribute editing area and graphics editing area; Step S103: Configure the parameters of the components according to the wiring diagram editing interface. If the distance between the components is less than the preset threshold, the automatic adsorption function is triggered. The component parameter set is obtained by setting the static and dynamic state attributes. Step S104: Input the component parameter set into the parsing system for multi-level parsing, and refresh the changing areas locally through a layered rendering strategy to obtain the display wiring diagram; Step S105: Monitor the status of the displayed wiring diagram. Through data acquisition and status determination, if the triggering conditions are met, execute the preset linkage rules to obtain a dynamic wiring diagram reflecting the status of the equipment. Step S106: Import the dynamic wiring diagram into the storage system for persistent processing, record version difference data through structured description, and obtain a data file that supports collaborative editing.
[0011] It is understood that the executing entity of this application can be a high-resolution touchscreen electrical wiring diagram display and writing system, or it can be a terminal or a server; the specific implementation is not limited here. This application's embodiment uses a server as an example for illustration.
[0012] Specifically, the underlying graphics module is designed to implement basic graphics rendering functions by defining basic primitives such as points, lines, and surfaces. Taking line drawing as an example, the system defines a set of two-dimensional coordinate points, each containing (x, y) coordinate values and drawing attributes. The basic graphics rendering module is then integrated with the core engine module to establish a resource management mechanism. Next, the graphics resources are structured using linked list nodes. Each node is connected by pointers to form a complete linked list, containing four key information dimensions: a time dimension recording the timing information of state changes, such as the timestamp of circuit breaker state switching; a state dimension recording the working state of electrical components, such as the open / closed state of circuit breakers; a logic dimension defining the relationships between components, such as interlocking logic; and an event dimension recording the interaction response mechanism. Based on this, a standard component library is built, describing the parameters and display characteristics of each component in XML format, forming a complete library containing components such as circuit breakers, isolators, transformers, and other transformers. The connection relationships of components in the standard component library are managed, and the spatial positional relationships of components are identified through an endpoint matching algorithm. A multi-layered rendering mechanism is integrated, and a separate rendering strategy is adopted to improve rendering efficiency, thus obtaining the graphics engine.
[0013] Integrating multi-touch technology, touch events are captured, and touch coordinates are precisely mapped to the display coordinate system. For example, touch points are mapped to display coordinates using a coordinate transformation algorithm. A toolbar module is then developed to implement component selection; users can select the desired electrical component by clicking the corresponding icon. Next, an attribute editing area is developed, divided into static and dynamic attribute editing areas. Static attributes include component size ratios and placement angles, while dynamic attributes include associated component information and display status settings. The attribute editing area is then integrated with the graphic editing area, supporting drag-and-drop, connection, and position adjustment operations. A smart snap-in function is implemented in the interactive operation, automatically triggering snap-in when the distance between components is less than a preset threshold. A preview area module is built, updating the display effect through real-time rendering to form the wiring diagram editing interface. The component attribute structure is designed, divided into three categories: component type, static state, and dynamic state. Static attribute editing is then implemented, allowing users to set scaling ratios and angle parameters through direct input or slider control. For example, setting the scaling ratio of a circuit breaker component to 1.0 and the placement angle to 90°. Finally, dynamic attribute editing is integrated, allowing users to set associated information and display status through drop-down selection or pop-up windows. Next, the parameter linkage relationships are processed to ensure consistency between parameters. Then, the spatial relationships between components are calculated. The distance between any two components is calculated and compared with a preset threshold. When the distance is less than the threshold, the adsorption algorithm is triggered, automatically adjusting the component to the nearest connection point. Parameter verification is performed to check whether all parameter values are within the valid range. Parameters that are out of range are corrected to obtain a complete and valid set of component parameters.
[0014] The component parameter set is input into the parsing system for processing. First, the parsing engine is initialized, reading the component parameter set and establishing a memory mapping table to prepare the data structure for multi-level parsing. Then, the first level of parsing is performed, processing the static attributes of components and calculating display coordinates and morphological features. Next, the second level of parsing is executed, processing the dynamic attributes of components and determining state switching conditions and display rules. Following this, the third level of parsing is performed, analyzing the positional relationships of connection points between components and constructing a complete circuit topology. Afterward, a layered rendering strategy is implemented, dividing the electrical wiring diagram into four independent layers: a background layer, a static component layer, a dynamic component layer, and a foreground layer. Each layer is rendered separately and then composited into the final image in Z-axis order. Intelligent local refresh is implemented, establishing a region change mapping table to record the coordinates of the rectangular regions that change during each update. Only the changed areas are redrawn, while other areas remain cached, resulting in an efficiently displayed wiring diagram.
[0015] The status of the displayed wiring diagram is monitored. A data acquisition module is built, configuring multiple communication protocol interfaces to obtain real-time device status data. Then, a status judgment engine is designed to compare the acquired data with preset thresholds and perform multi-condition composite judgments. For example, it determines whether the circuit breaker current value exceeds the rated threshold. Next, a status caching mechanism is built to record historical status data and calculate the trend of change. Subsequently, a trigger condition definition module is established to set multiple trigger methods. Then, a linkage rule engine is developed to check whether the current status meets the trigger conditions. If it does, the corresponding linkage rule is extracted and a multi-level linkage chain is parsed. The linkage operation sequence is converted into display control commands, and the visual attributes of the components are set to obtain a dynamic wiring diagram reflecting the device status.
[0016] The dynamic wiring diagram is imported into the storage system. A file format specification is designed, using an XML structure to describe the wiring diagram configuration information, establishing a five-layer hierarchical structure. Persistent storage is then implemented, ensuring data integrity through transaction processing. Automatic backup functionality is then integrated, creating a copy of the configuration file periodically. Version management is then implemented, creating a version record for each save operation and calculating differences. A network transmission module is subsequently developed to securely transmit the configuration file using an encrypted protocol. Combined with collaborative editing functionality, multiple users can simultaneously edit different pages, implementing component locking and conflict resolution strategies to obtain a data file that supports collaborative editing.
[0017] For example, in editing the main wiring diagram of a substation, designers first construct components such as circuit breakers and isolating switches using a graphics engine, organizing each component node using a linked list structure. Then, they drag components such as busbar segments and circuit breakers in the editing interface. When the distance between the circuit breaker and the busbar is less than a preset threshold of 5 pixels, the snap-in function is triggered for automatic alignment. Next, the static attributes (scaling ratio 1.0, angle 90°) and dynamic attributes (associated with input status information) of the circuit breaker are set, forming a component parameter set. The system performs multi-level parsing of the parameter set and uses layered rendering, updating only the circuit breaker layer whose status changes while keeping the background layer unchanged. When a change in circuit breaker status is detected, the system executes preset linkage rules, changing the indicator light color. Finally, the complete wiring diagram is saved as an XML format file, supporting multi-user collaborative editing and version management.
[0018] In this embodiment, a linked list structure is used to organize nodes to build a graphics engine, enabling modular management and reuse of electrical components, significantly improving graphics construction efficiency. Each node contains time, status, logic, and event information, giving each component complete data processing and interaction capabilities. The editing system developed based on this graphics engine provides an intuitive and easy-to-use interface through the organic interaction of the toolbar, attribute editing area, and graphics editing area, significantly lowering the technical threshold for electrical wiring diagram editing and enabling non-professionals to create complex wiring diagrams. The automatic snapping function integrated during parameter configuration triggers precise positioning by intelligently calculating the distance between components and comparing it with a preset threshold, greatly improving connection accuracy and editing efficiency. A multi-level parsing and layered rendering strategy performs hierarchical processing of component parameters, and a local refresh mechanism greatly reduces system latency. The system minimizes resource consumption, ensuring smooth display of large and complex wiring diagrams on the touchscreen. The combination of a status monitoring mechanism and preset linkage rules enables real-time reflection and intelligent response of equipment status, enhancing the dynamic interactivity and information transmission efficiency of the wiring diagrams. Structured storage and version difference recording technology achieve efficient data persistence and traceability, while supporting multi-user collaborative editing to meet the team collaboration needs in engineering practice. In particular, this invention applies artificial intelligence algorithms in the field of power monitoring, using deep learning models to identify and optimize the spatial layout of electrical components, adaptively adjusting connection paths to achieve intelligent assisted design. The intelligent algorithm makes a significant contribution to the overall solution, enabling the system to learn and automatically propose optimization suggestions based on historical editing habits and wiring specifications. The direct editing mode via the touchscreen significantly improves on-site work efficiency and flexibility.
[0019] In one specific embodiment, the process of performing step S101 may specifically include the following steps: The underlying graphics module is designed and implemented using the drawing functions of basic primitives such as points, lines, and surfaces, resulting in a basic graphics rendering module that supports rotation, scaling, and translation operations. By integrating the basic graphics rendering module with the core engine module and processing it through resource management, dynamic rendering control and event response mechanisms, a graphics resource management system is obtained. The graphic resource management system is processed by linking node structuring. By defining the node information dimensions and data structure, a node structure containing complete information including time, status, logic and event dimensions is obtained. A standardized component library is constructed based on a node structure. The component definitions are described in XML format, resulting in a standard component library containing circuit breakers, disconnectors, instrument transformers, and transformers. The connection relationships of components in the standard component library are managed, and the spatial positional relationships between components are identified through the endpoint matching algorithm to obtain the component connection rule library; By integrating the component connection rule base with the multi-layer rendering mechanism, and separating the rendering processes of the static background layer and the dynamic foreground layer, a graphics engine is obtained.
[0020] Specifically, the underlying graphics module defines a basic primitive system, including three types of basic primitives: points, lines, and surfaces. Point primitives are defined by coordinates and a set of attributes, including display characteristics such as color, thickness, and style. Line primitives are defined by start and end coordinates and a set of attributes. Surface primitives are defined by multiple vertex coordinates and fill attributes. The drawing function converts primitives into pixel arrays using a rasterization algorithm. Taking a circuit breaker primitive as an example, a circuit breaker consists of multiple line segments. Each line segment is rasterized using the Bresenham algorithm, which calculates the coordinates of points on the line incrementally, avoiding floating-point operations and improving efficiency. Rotation operations are handled using a two-dimensional rotation matrix, applying transformations to each vertex of the primitive. Scaling operations use scaling factors to linearly transform the coordinates, and translation operations are achieved through coordinate offsets. These transformation operations combine to form the basic graphics rendering module, enabling electrical components to perform flexible orientation adjustments.
[0021] When integrating the basic graphics rendering module with the core engine module, a three-layer architecture was established: a bottom rendering layer, a middle resource management layer, and an upper event control layer. The resource management mechanism adopts a resource pool design pattern, maintaining a primitive object pool, a texture cache pool, and a transformation matrix pool to avoid frequent object creation and destruction. For example, circuit breaker primitives of the same type share a basic graphic description, storing only differentiated data. Dynamic rendering control employs double buffering technology, updating the foreground display all at once after rendering is completed in the background buffer, avoiding flickering issues. The event response mechanism adopts a publish-subscribe pattern, defining types such as touch events, state change events, and update events, with the event dispatcher distributing events to the corresponding processing functions. For example, when a user touches a circuit breaker primitive, a touch event is triggered, and the engine dispatches the event to the circuit breaker's response function to perform state switching processing. Through the collaborative work of these mechanisms, a highly efficient graphics resource management system is formed.
[0022] When performing linked list node structuring on a graphical resource management system, each node represents an instance of an electrical component or line segment. The node structure consists of header information and four key information dimensions. The header information includes the node ID, type identifier, and a pointer to the next node, forming a singly linked list. The time dimension includes creation timestamps, update timestamp lists, and time response functions, used to record the timing information of component state changes. The state dimension includes the current state code, state change history, and state transition functions, used to manage the component's working state. The logic dimension includes a set of input conditions, a set of output actions, and a description of logical relationships, used to define the logical connections between components. The event dimension includes event triggering conditions, event response processors, and event propagation paths, used to handle interactive events and response mechanisms. This structure allows each electrical component to not only have a graphical representation but also data processing and logical functions; for example, a circuit breaker node not only displays the switch status but can also respond to control commands and transmit state change events.
[0023] When constructing a standardized component library based on a node structure, XML format is used to describe the definition information of each component. The XML document includes five main parts: basic component information, graphical description, state definition, event handling, and logical relationships. Taking a circuit breaker component as an example, the basic information includes the component type (Breaker), name, and classification; the graphical description includes the set of point, line, and surface primitives that make up the graphic, describing the circuit breaker's switching state; the state definition includes the possible state sets (open, closed, fault) and their corresponding display styles; the event handling includes the processing logic for responding to touch events; and the logical relationships describe the connection rules and interlocking conditions between the circuit breaker and other components. Through this structured description, a standard library containing circuit breakers, disconnectors, transformers, and main transformers is formed, each component including a graphical representation and behavioral definition.
[0024] The algorithm manages the connection relationships of components in the standard component library, identifying spatial relationships between components using an endpoint matching algorithm. The endpoint matching algorithm first extracts the connection point coordinates and type information of each component (e.g., a circuit breaker has two electrical connection points, located at opposite ends). Then, it constructs a spatial index structure (e.g., a kd-tree) to accelerate spatial queries. Next, it calculates the Euclidean distance between components; when the distance is less than a preset threshold (usually 5 pixels), it is considered a potential connection. Finally, it verifies connection type compatibility; for example, the output of a circuit breaker can only be connected to the input of a transformer or a busbar. The algorithm outputs a connection relationship table, recording the ID, connection point index, and connection attributes of each pair of connected components, such as the connection relationship between busbar segment 1 and circuit breaker 2. These connection relationships form a component connection rule base, used to guide automatic wiring and logic verification of wiring diagrams.
[0025] By integrating a component connection rule base with a multi-layered rendering mechanism, layered rendering processing is achieved. The rendering mechanism divides the wiring diagram into four independent layers: a static background layer, a static component layer, a dynamic component layer, and a foreground layer. The static background layer contains fixed content such as grid lines and title bars; the static component layer contains unchanging components such as busbars and connecting lines; the dynamic component layer contains variable-state components such as circuit breakers and isolators; and the foreground layer contains temporary information such as annotation text and highlights. During rendering, lower layers are drawn first, followed by higher layers, forming a complete image. An efficient local refresh algorithm updates only the areas containing components whose states have changed, avoiding full-screen redraws. For example, when a circuit breaker changes from closed to open, only the rectangular area containing the circuit breaker (usually only a few tens of pixels wide and high) needs to be redrawn, while the remaining areas remain cached. This separate rendering strategy ultimately forms the graphics engine, providing the technical foundation for editing and displaying electrical wiring diagrams on high-resolution touchscreens.
[0026] Taking a 10kV power distribution equipment wiring diagram as an example, the entire processing flow is illustrated as follows: A busbar segment element is defined, including a start point, an end point, and a line width of 5 pixels. A circuit breaker element is then defined, consisting of multiple line segments forming a switch symbol, with the center point located at a preset position. When the user drags the circuit breaker close to the busbar, the endpoint matching algorithm detects that the distance between the top of the circuit breaker and the busbar is less than 5 pixels, triggering automatic snapping to precisely position the circuit breaker at the busbar connection point. The circuit breaker data is organized into linked list nodes, recording time (creation timestamp), status (currently closed), logic (interlocked with adjacent isolating switches), and event (responding to clicks to switch status) information. When the system detects a change in the actual equipment status, the circuit breaker status is updated to open, and only the rectangular area containing the circuit breaker is redrawn, while other areas remain unchanged, thus efficiently completing the status update display. The entire process, from basic element drawing to advanced component management, and then to intelligent connection and status monitoring, forms a processing chain for the electrical wiring diagram graphics engine.
[0027] In one specific embodiment, the process of performing step S102 may specifically include the following steps: It integrates multi-touch and identifies user input through a touch event capture module to obtain a positioning mechanism that maps touch coordinates to the display coordinate system; The toolbar module was developed based on the positioning mechanism. Components can be selected by clicking, resulting in a toolbar interface that provides electrical component selection functionality. The toolbar interface and the attribute editing module are linked. By dividing the static attribute editing area and the dynamic attribute editing area, an attribute editing area that supports setting the component size ratio, placement angle, associated component information and display status is obtained. The attribute editing area and the graphics editing area modules are integrated, and the main operation area is obtained through drag-and-drop, connection and position adjustment operations. Intelligent adsorption function is implemented in the main operating area. By comparing the spatial distance between the components with the preset threshold, an interactive mechanism is obtained that automatically adsorbs to the accurate position when the distance is less than the threshold. The preview area module is built based on an interactive mechanism, and the wiring diagram editing interface is obtained through real-time rendering and updating of the display.
[0028] Specifically, user input is identified through a touch event capture module. This module receives touch point information from the touchscreen hardware, including touch point identifiers, original coordinate values, and touch states (press, move, release). Each touch point information is passed to a coordinate mapping processor via an event queue, where coordinate system transformation is performed. The coordinate mapping processor converts the touchscreen physical coordinates into display logical coordinates, taking into account screen resolution, display ratio, and rotation angle to ensure accurate mapping. For example, when the user touches the screen position (800, 600), the coordinate mapping processor converts the physical coordinates into logical coordinates, taking into account the current viewport scaling ratio of 0.5 and displacement (100, 50), resulting in actual logical coordinates (500, 350). The touch event dispatcher determines the trigger area based on the mapped coordinates and dispatches the event to the corresponding processing function. Through this processing flow, touch coordinates achieve precise mapping from physical input to the display coordinate system, laying the foundation for subsequent interactive operations.
[0029] Based on the aforementioned positioning mechanism, a toolbar module was developed to enable rapid selection of electrical components. The toolbar is located in a fixed area of the screen, typically at the top or left, and is divided into several functional zones: a commonly used component zone, a line tool zone, and an editing tool zone. Each component button includes an icon and identification information, and the button area has a fixed touch response range. The click selection algorithm first determines whether the touch point falls within the button area. If the start and end points of the touch event both fall within the same button area and the time interval is less than 500 milliseconds, it is considered a valid click. When a click occurs, the type information of the selected component is loaded into the current operation context, and the button's visual state changes to indicate the selection effect. For example, when the touch point falls within the circuit breaker button area and meets the click conditions, the circuit breaker button's background color becomes highlighted, and the circuit breaker type information is loaded into the operation context, displaying it as the currently selected tool. This method allows users to quickly select the required electrical components, and the toolbar interface provides visual feedback to confirm the selection result.
[0030] The toolbar interface and attribute editing module are linked to establish a mechanism for interaction between components and attribute editing. The attribute editing area is typically located on the right or bottom of the screen and consists of two main parts: a static attribute editing area and a dynamic attribute editing area. The static attribute editing area manages the fixed characteristics of components, including two core parameters: size ratio and placement angle. When a user selects a component type in the toolbar, the attribute editing area automatically loads the default static attribute values for that component type. For example, the default size ratio for a circuit breaker is 1.0, and the default placement angle is 0 degrees. The dynamic attribute editing area manages the behavioral characteristics of components, including associated component information (Element) and display status settings. Taking a circuit breaker as an example, dynamic attributes include setting the input associated time action (Time) to 0 for instantaneous status tracking, and setting the display status (Display) to ON for positive image display. Attribute values can be modified via sliders, text input boxes, or drop-down selectors. Value changes immediately trigger a verification process to ensure that the input values are within a valid range, such as limiting the size ratio to between 0.5 and 2.0. This association mechanism makes component attribute configuration intuitive and efficient, providing parameter support for the subsequent placement and configuration of components in the editing area.
[0031] The attribute editing area and graphic editing area modules are integrated to realize core interactive functions. The graphic editing area is located in the center of the screen, occupying the main display area, and supports three key operations: drag and drop, connection, and position adjustment. Drag and drop operation process: After the user selects a component from the toolbar, they touch any position in the graphic editing area. The system creates an instance of that component and applies the current attribute settings, moving with the touch point; when the touch ends, the component is fixed in the current position. Connection operation process: After selecting the line tool, the system records the touch start point as the starting point and the touch end point as the ending point, creating a line segment connecting these two points; if the start or end point is close to an existing component connection point, it automatically snaps to the connection point. Position adjustment operation process: Touching a placed component, the system determines whether the point is within the component's range; if so, the component enters the selected state and adjusts its position with the touch; when the touch ends, it is fixed in the new position. All operations are managed through touch event sequences. Each touch sequence includes three stages: press, move, and release, and the operation status information remains consistent throughout the sequence. The integrated main operation area supports an intuitive graphic editing experience, enabling users to quickly build electrical wiring diagrams.
[0032] Intelligent adsorption functionality is implemented in key operating areas to improve connection accuracy. The intelligent adsorption algorithm first extracts the connection point location information of each component, establishing a spatial index structure to accelerate lookups. When the user drags a component or draws a line, the algorithm calculates the spatial distance between the current operating point and all potential connection points in real time. The distance calculation uses the Euclidean distance formula, i.e., the straight-line distance between two points. If the calculated minimum distance value is less than a preset threshold (usually set to 10 pixels), the adsorption mechanism is triggered, automatically adjusting the coordinates of the current operating point to the coordinates of the nearest connection point, while simultaneously displaying visual cues (such as highlighting or connection indicator lines) to indicate the adsorption status. For example, when the user drags a circuit breaker close to the busbar, if the calculated distance between the circuit breaker input and the busbar is 8 pixels, less than the 10-pixel threshold, the system automatically adjusts the circuit breaker position so that its input is precisely aligned with the busbar connection point, and displays a connection indicator mark. In addition to distance conditions, the adsorption mechanism also considers connection point type compatibility, such as ensuring that the output can only connect to the input. Intelligent adsorption significantly improves connection accuracy, ensuring accurate connections between electrical components.
[0033] Based on the aforementioned interaction mechanism, the preview area module is constructed to achieve real-time visual feedback. The preview area module is the visual output layer of the graphics editing area, responsible for rendering and displaying the current editing state in real time. The rendering process first constructs a rendering queue, arranging all visible elements in Z-axis order; then, it performs drawing operations, rendering the elements to the buffer; finally, it refreshes the buffer content to the screen. Rendering updates are triggered in two ways: element state change triggering and timed refresh. When the user completes an editing operation (such as moving elements or modifying attributes), the system immediately marks the affected area and triggers a local redraw; simultaneously, the system maintains a timed refresh mechanism of 30 frames per second to ensure smooth display of dynamic elements (such as flashing indicators). The local redraw algorithm only updates the changed area, calculating the minimum bounding rectangle to cover all changed elements, and only redrawing the content of this rectangular area, saving computational resources. Through this efficient rendering mechanism, the preview area module provides smooth real-time visual feedback, ultimately forming the wiring diagram editing interface.
[0034] In one specific embodiment, the process of performing step S103 may specifically include the following steps: The component attribute structure is designed by dividing it into three categories: component type, static state, and dynamic state, resulting in a parameter structure framework; The static attribute editing is implemented based on the parameter structure framework. The scaling ratio and angle parameters are set by direct input or slider control to obtain the static state attribute configuration of the component. The configuration of static state attributes and the editing of dynamic attributes are integrated. The associated components, time extension and display switch parameters are set through drop-down selection or pop-up window to obtain the dynamic state attribute configuration of the component. By linking static and dynamic state attribute configurations together, and calculating the dependencies between related parameters, a consistency guarantee mechanism is obtained. The spatial relationship between components is calculated based on the consistency guarantee mechanism. By calculating the Euclidean distance between any two components and comparing it with a preset threshold, if the distance value is less than the threshold, the adsorption algorithm is triggered to automatically adjust the component to the nearest connection point, thereby obtaining accurate spatial positioning of the components. Parameter verification is performed based on precise component spatial positioning. By checking whether all parameter values are within the valid range and performing correction algorithms on parameters that are out of range, the component parameter set is obtained.
[0035] Specifically, the classification follows a three-tiered principle: component type, static state, and dynamic state. Component type is the highest-level classification, identifying the basic category of the component, such as circuit breakers, isolating switches, and current transformers. Each type has specific graphical representations and behavioral characteristics. Static state describes the fixed attributes of the component, mainly including two key parameters: scaling ratio and angle. The scaling ratio controls the display size of the component, typically ranging from 0.5 to 2.0; the angle parameter controls the rotation direction of the component, ranging from 0 to 360 degrees. Dynamic state describes the variable attributes of the component, including three core parameters: related components, time broadening, and display on. The related components parameter establishes the mapping relationship between the component and the actual equipment signal; time broadening controls the response speed of state changes; and the display on determines whether the component is visible on the screen. This parameter structure framework, through hierarchical design, organizes all configuration requirements of the components into an ordered data structure, facilitating subsequent processing and management.
[0036] To implement the static attribute editing function based on the above parameter structure framework, an intuitive input method is required. The static attribute editing interface is located in the upper area of the attribute panel. For scaling parameters, two input methods are provided: direct input and slider control. Direct input allows users to precisely enter values in the text box; for example, entering 1.5 indicates scaling the element to 1.5 times its original size. The system immediately verifies the validity of the input to ensure the value is within the allowed range. Slider control provides visual numerical adjustment; the left end of the slider corresponds to the minimum value of 0.5, and the right end corresponds to the maximum value of 2.0. Users can quickly set approximate values by dragging the slider, suitable for rough adjustments. For angle parameters, both direct input and slider control are also provided. The angle value represents the degree of clockwise rotation of the element from its initial direction; for example, entering 90 indicates rotating the element 90 degrees clockwise. To improve operational efficiency, the system also presets shortcut buttons for commonly used angles (0°, 90°, 180°, 270°), which users can quickly set by clicking. When the user modifies the scaling ratio or angle parameter, the system updates the preview display in real time, allowing the user to intuitively evaluate the setting effect. Through these interaction mechanisms, users can configure the static state attributes of components.
[0037] Integrating static state attribute configuration and dynamic attribute editing requires designing editing controls suitable for different attribute types. The dynamic attribute editing area is located at the bottom of the attribute panel. For parameters of associated components, a drop-down selection method is used, displaying a list of all associatable device signals in the current system, such as the on / off state of circuit breaker 1 and the position signal of isolator 2. Users select the specific signal to be associated via the drop-down list. For complex associations, a pop-up window is provided, containing a tree-structured list of device signals and detailed filtering options, allowing users to quickly locate the target among a large number of signals. The time extension parameter is set via a numerical input box, where the value represents the response delay time for state changes in milliseconds; the default value is 0, indicating an immediate response. The display switch parameter is controlled by a switch button; the ON state indicates the component is visible, and the OFF state indicates the component is hidden. When the component type is a circuit breaker, additional display mode selection is provided, such as forward display and reverse display, controlling the visual appearance of the circuit breaker's on / off state. Modifications to dynamic attributes also trigger real-time preview updates, allowing users to immediately see the effects of the settings. By integrating static and dynamic attribute editing functions, users can comprehensively configure various parameters of components and obtain dynamic state attribute configurations for components.
[0038] The static and dynamic state attribute configurations are linked to ensure logical consistency between parameters. The linkage mechanism first constructs a parameter dependency graph, recording the dependencies between parameters. For example, when the component type is a current transformer, changes in the angle parameter affect the connection point position of related components; when the display switch is set to OFF, other parameter settings are temporarily invalidated. The dependency analysis algorithm evaluates the mutual influence between parameters based on a preset rule base. When a parameter value changes, all other parameters that depend on it are identified and updated one by one according to the dependency order. For example, when a user adjusts the circuit breaker angle from 0 degrees to 90 degrees, the system detects that the connection point position depends on the angle parameter, automatically recalculates the connection point coordinates, and ensures that the connection relationship with surrounding components remains correct. The linkage mechanism also includes conflict detection and resolution. When parameter settings conflict, the system automatically adjusts relevant parameters according to predetermined priority rules or prompts the user to make a selection. By comprehensively considering the interrelationships between parameters, consistency constraints on parameter values are established to ensure that all parameter settings remain logically reasonable overall, forming a consistency guarantee mechanism between parameters.
[0039] The spatial relationships between components are calculated based on a consistency guarantee mechanism to achieve precise spatial positioning of components. The spatial relationship calculation first extracts key point information for each component, including the center point and connection points. For circuit breaker components, key points include the input connection point, output connection point, and center control point; for line components, key points include the start point, end point, and control point. Then, the minimum distance between any two components is calculated, i.e., the minimum Euclidean distance between the key points of each component. The Euclidean distance calculation uses the formula for the distance between two points in a plane, taking the square root of the sum of the squares of the differences in the x-coordinates and y-coordinates of the two points. The calculated minimum distance is compared with a preset threshold (usually set to 5 to 10 pixels). If the distance is less than the threshold, the snap-in algorithm is triggered. The snap-in algorithm selects appropriate reference and target points based on the current operation context and component type, automatically adjusting the position of the operated component to ensure precise overlap between the reference and target points. For example, when a user drags a circuit breaker close to the busbar, the system calculates the distance between the circuit breaker's input terminal and the busbar. If the distance is less than a threshold, the circuit breaker's position is adjusted so that the input terminal is precisely aligned with the busbar connection point, thereby achieving precise spatial positioning of the component.
[0040] Parameter verification is performed based on precise component spatial positioning to ensure the validity of all parameter values. Parameter verification includes two steps: range verification and logic verification. Range verification checks whether each parameter value is within the allowed numerical range: scaling parameters are typically limited to 0.5 to 2.0; if the user inputs 2.5, exceeding the upper limit, it is automatically corrected to 2.0; angle parameters are limited to 0 to 360 degrees; if the input value is -30 degrees, it is automatically corrected to 330 degrees (i.e., 360-30). Logic verification checks whether the logical relationship between parameters is reasonable: for example, when the component type is a circuit breaker, the time widening parameter must be greater than or equal to 0; when the associated component is set to unassociated, the time widening parameter is invalid. For parameters that exceed the valid range or do not conform to logical relationships, the system executes a correction algorithm: for numerical parameters, values exceeding the range are truncated to the nearest valid boundary value; for enumerated parameters, the default value or the nearest valid option is selected; for logical relationship conflicts, the relevant parameters are adjusted according to predetermined priority rules. Through a robust parameter verification and correction mechanism, the final generated component parameter set is ensured to be numerically valid and logically reasonable, providing a reliable configuration foundation for subsequent component rendering and status monitoring.
[0041] In one specific embodiment, the process of executing step S104 may specifically include the following steps: The parsing engine is initialized by reading the component parameter set and establishing a memory mapping table to obtain the data structure ready for multi-level parsing. The parameters are parsed at the first level based on the data structure. By processing the static attributes of the components and calculating the display coordinates and shape features, the basic display shape data of the components is obtained. The second level of analysis is performed based on the basic display form data. By processing the dynamic attributes of the components and determining the state switching conditions and display rules, the behavioral characteristic data of the components are obtained. The behavioral characteristic data is input into the third-level parsing process. By analyzing the positional relationship of the connection points between components and constructing the connection topology diagram, the circuit topology data is obtained. A layered rendering strategy is applied to the circuit topology data. The electrical wiring diagram is divided into four independent layers: background layer, static component layer, dynamic component layer and foreground layer. A rendering algorithm is applied to each layer to generate a layer buffer. The layers are then combined in sequence to form the final image and obtain a complete image. Intelligent local refresh is implemented based on the complete image. By establishing a region change mapping table to record the coordinates of the rectangular regions that change in each update, the difference between the region that needs to be refreshed now and the region that was rendered last time is determined. Only the regions that have changed are redrawn while the cache of other regions remains unchanged, resulting in the display wiring diagram.
[0042] Specifically, a data structure is constructed to support a multi-level parsing process. The initialization process begins by reading the component parameter set, which contains information about all electrical components configured during the editing phase, including parameters such as type, location, size, angle, and associated information. The reading process uses a sequential traversal approach, processing the parameter data of each component in turn. The memory-mapped table is the core data structure of the parsing engine, organized in a hash table format, with component IDs as keys and corresponding values representing a complete description of the component's parameters and status. For circuit breaker components, the map table records information including the circuit breaker type identifier, location coordinates, scaling ratio, rotation angle, associated device signals, and current status. Furthermore, the memory-mapped table records the connection relationships between components, forming an adjacency list structure for subsequent topology analysis. After the map table is created, the parsing engine also establishes auxiliary index structures, such as a spatial index tree for quickly locating components within a specified area and a status index table for quickly finding all components in a specific state. Through the construction of these data structures, the parsing engine completes initialization and is ready to execute multi-level parsing processing. Based on the initialized data structure, the first level of parameter parsing is performed, processing the static attributes of the components. The first level of parsing focuses on the geometric characteristics of the components, converting abstract parameters into concrete display data. The processing flow first accesses the memory-mapped table to extract static attributes such as type, position, size ratio, and rotation angle for each component. For line-type components (such as busbars), line segment parameters are calculated based on the start and end coordinates; for symbol-type components (such as circuit breakers), the boundary rectangle and constituent point set of the component are calculated based on the center point, size ratio, and rotation angle. Display coordinate calculation uses a coordinate transformation matrix to convert the component's local coordinates to screen display coordinates, considering the component's own rotation and scaling, as well as the translation and scaling factors of the global view. Morphological feature calculation determines the component's visual appearance based on its type and static attributes, such as the circuit breaker's on / off status symbol, line thickness, and style. The calculated display coordinates and morphological features constitute the component's basic display morphological data, recorded in the parsing result cache, providing input for the second-level parsing.
[0043] The second level of analysis, based on the basic display form data from the first level, processes the dynamic attributes of the components. This second level transforms the static graphical description into interactive objects with behavioral characteristics. The processing flow first retrieves the basic display form of the component from the analysis result cache, then extracts the component's dynamic attributes from the memory mapping table, including associated device signals, time characteristics, and display rules. For circuit breaker components, the associated information identifies the actual monitored device state point, such as the open state of circuit breaker 1; the time characteristics define the response method to state changes, such as 0 milliseconds indicating an immediate response; and the display rules specify the visual appearance under different states, such as a solid line connection in the closed state and a gap in the open state. State switching condition analysis, based on the associated information and time characteristics, constructs a state transition function to define when and how the component's display state changes. For example, when an incoming signal changes from 0 to 1 and the duration exceeds a set threshold, a state switch is triggered. Display rule processing maps the state to specific visual effects, including color, line type, and fill method. The processed data constitutes the component's behavioral characteristic data, recording the state conditions and corresponding display effects, providing input for the third level of analysis.
[0044] Behavioral characteristic data is input into the third-level parsing process to analyze the connection relationships between components and construct the circuit topology. The third-level parsing expands from individual components to the network of relationships between components, establishing the overall circuit logic. The processing flow first extracts the connection point information of each component; connection points are the locations where components interconnect with other components, such as the input and output terminals of a circuit breaker. Then, a connection point matching algorithm is executed to identify pairs of connection points that are spatially close and of compatible types; the threshold is typically set to 5 pixels. The matching results form a connection relationship list, recording the component ID, connection point type, and connection attributes of each pair of connections. A topology graph is constructed based on this connection relationship list, represented using a graph data structure where nodes represent components and edges represent connections. After the topology graph is constructed, an electrical loop identification algorithm is executed, using depth-first search to find all closed loops and main paths, identifying power supply points, load points, and critical nodes. For example, it identifies the power supply path from the main transformer to each outgoing circuit breaker, marking critical connection points and potential fault points. The processed data constitutes the circuit topology data, containing the connection relationships between components, path information, and electrical characteristics, providing a foundation for subsequent rendering and status monitoring.
[0045] A layered rendering strategy is applied to the circuit topology data to achieve efficient image generation. Layered rendering decomposes complex electrical wiring diagrams into multiple independent layers, each containing specific types of elements, rendered sequentially from bottom to top. The background layer is the bottom layer, containing fixed content such as grid lines, title bars, and legends, which typically only need to be redrawn when the view range changes. The static component layer sits above the background layer, containing unchanging or rarely changing components such as busbars, connecting lines, and transformer bodies; the positions and shapes of these components are relatively fixed. The dynamic component layer contains frequently changing interactive components such as circuit breakers, isolating switches, and indicator lights; the states of these components update as the device status changes. The foreground layer is the top layer, containing annotation text, highlighted selection boxes, and temporary tooltips to emphasize the current focus. The rendering process executes a dedicated rendering algorithm for each layer: the background layer uses a grid drawing algorithm; the static component layer uses an efficient line rendering algorithm; the dynamic component layer uses a state-sensitive symbol rendering algorithm; and the foreground layer uses text rendering and special effects processing. The rendering results of each layer are stored in an independent layer buffer, and then composited in Z-axis order. The layers drawn later overwrite the layers drawn earlier to form a wiring diagram image.
[0046] Based on the complete image generated by layered rendering, an intelligent local refresh strategy is implemented to improve display efficiency. The local refresh mechanism is built on region change detection. By recording and comparing changes in component states during each update, the minimum region requiring redrawing is calculated. The region change map is a list of rectangles that records the coordinate range (coordinates of the top-left and bottom-right corners) of the region occupied by each changed component. When a change in component state is detected, the boundary rectangle information of that component is queried and added to the change map. Before adding, rectangle merging optimization is performed. If the new rectangle overlaps with or is very close to an existing rectangle in the table, it is merged into a larger rectangle to reduce the number of redraw operations. Before redrawing, the current changed region is compared with the previously rendered region; redrawing is only performed if there are differences. The redraw operation performs the following steps for each changed region: clear the display buffer of the region, redraw the content of each layer within the region in sequence, and then copy the buffer content to the display device. For example, when a circuit breaker changes from closed to open, only a small area containing the circuit breaker (approximately 100×100 pixels) needs to be redrawn, rather than the entire screen (e.g., 1920×1080 pixels), significantly reducing the computational and display burden. This intelligent local refresh mechanism maintains efficient and smooth display even with complex wiring diagrams and frequent status updates.
[0047] In one specific embodiment, the process of executing step S105 may specifically include the following steps: The data acquisition module is constructed, and real-time device status data is obtained by configuring multiple communication protocol interfaces and implementing data verification, unit conversion and outlier handling. The status determination engine is designed based on real-time device status data. The current status determination result of the device is obtained by comparing the collected data with the preset threshold and executing a multi-condition composite judgment algorithm. The current state determination result of the device is input into the state caching mechanism for processing. By recording historical state data and calculating the state change trend, a state record library is obtained. The trigger condition definition module is constructed based on the state record library. By setting state change trigger, threshold overrun trigger, and time trigger, the trigger condition set is obtained. The linkage rule engine is developed based on the trigger condition set. By checking whether the current state meets the conditions in the trigger condition set one by one, if the conditions are met, the corresponding linkage rule is extracted and multi-level linkage chain parsing is performed to obtain the linkage operation sequence. The linkage operation sequence is converted into display control commands. By setting the visual attributes of the components and recording all linkage events and execution results, a dynamic wiring diagram reflecting the status of the equipment is obtained. The visual attributes include color, flashing frequency, and transparency.
[0048] Specifically, the data acquisition module adopts a multi-protocol adaptation architecture, supporting commonly used communication protocols in the power industry, including Modbus, IEC61850, DNP3, and OPC. The protocol adaptation layer is responsible for converting communication data from different protocols into a unified internal data format, eliminating protocol differences. Taking the Modbus protocol as an example, a data acquisition point table is established by configuring device addresses, register addresses, data types, and sampling periods, and device data is periodically polled. Data verification processing performs three levels of verification on the acquired data: communication verification confirms the integrity of data frames and uses CRC checksums to detect transmission errors; numerical range verification determines whether the data is within the physically permissible range, such as voltage values should not be negative; and rate of change verification analyzes the rate of data change and identifies abnormal fluctuations. Unit conversion processing converts the original device values into standard engineering units, such as mapping current register values of 0-4095 to actual current values of 0-100A. Outlier handling employs a smoothing filtering algorithm to process abrupt changes and missing values, including strategies such as preserving previous values, linear interpolation, and median filtering. Through the above processing flow, the data acquisition module generates clean and reliable real-time device status data, providing a foundation for subsequent status determination.
[0049] A status determination engine is designed based on real-time device status data to achieve intelligent identification of device status. The engine employs a hierarchical judgment framework, including three levels: single-point status determination, multi-point correlation determination, and time-series status determination. Single-point status determination is the most basic method, directly comparing a single collected data point with a preset threshold to determine the status. Taking the circuit breaker position status as an example, the collected position signal value is compared with the switch threshold; a value greater than 0.7 indicates a closed state, less than 0.3 indicates an open state, and values between 0.3 and 0.7 indicate an intermediate state. Multi-point correlation determination improves accuracy by comprehensively analyzing multiple related data points. For example, when determining the circuit breaker status, in addition to the position signal, the current value and auxiliary contact status are also considered: a reliable closed state is confirmed only when the position signal shows closure, current flows, and the auxiliary contact is closed. The multi-condition composite judgment algorithm is implemented using a rule engine. Rules consist of conditional expressions and logical operators, such as position > 0.7 AND current > 5A OR (auxiliary contact = 1 AND time > 2s). The timing-based status determination focuses on the data change process, identifying state transitions by analyzing the data sequence. For example, if the current suddenly drops from a stable value to zero while the position signal changes, it is determined to be a circuit breaker tripping event. Based on the above judgment results, the status determination engine outputs the current device status determination result, including device ID, current status code, confidence level, and timestamp.
[0050] The current device status determination result is input into the status caching mechanism for processing, achieving efficient storage and retrieval of status data. The status caching mechanism adopts a hierarchical storage structure, dividing device status data into three levels: hot data, warm data, and cold data. Hot data is stored in memory, containing the most recent status records, typically retaining data from the last hour, supporting high-frequency writes and fast access; warm data is stored in a local database, covering status records from the last 24 hours, supporting medium-frequency access; cold data is archived to a historical database, storing records for longer time periods, primarily for historical queries and trend analysis. Status data is organized in a time-series format, with each record containing a device ID, status code, timestamp, and additional information. Historical status record processing employs a time-segmented storage strategy, merging consecutive identical states into status duration interval records to reduce storage space usage. Status change trend calculation is based on time-series analysis, applying a sliding window algorithm to historical status data to calculate indicators such as status change frequency, average duration, and periodic characteristics. For example, calculating the number of circuit breaker operations in the last 24 hours identifies abnormal patterns of frequent operations. Through the above processing, the status caching mechanism constructs a status record library, providing data support for subsequent trigger condition definitions.
[0051] The trigger condition definition module is constructed based on the state log library to establish a flexible event triggering mechanism. The trigger condition definition module adopts the Event-Condition-Action (ECA) model and supports three main triggering methods. State change triggering is the most commonly used method, monitoring the transition of equipment state from one value to another. For example, defining a circuit breaker state changing from closed to open as the trigger condition activates the corresponding linkage rule when the circuit breaker trips. State change triggering includes the source state, target state, and optional transition time constraints, such as changing from normal to overload within 10 seconds. Threshold overrun triggering is based on comparing numerical parameters with thresholds, defining upper, lower, or range conditions. For example, setting a current value greater than 1.2 times the rated current as an overload trigger condition triggers an alarm when the current continuously exceeds the threshold. Threshold triggering is usually combined with duration limits, requiring the condition to be met continuously for a certain period before triggering, avoiding false triggers caused by instantaneous fluctuations. Time triggering is based on absolute or relative time settings, such as triggering a check after the switch is closed at 8:00 AM daily or after the state has lasted for 30 minutes. Trigger condition definitions support condition combinations, constructing compound conditions using logical operators (AND, OR, NOT), such as A circuit breaker open AND B circuit breaker closed AND time during working hours. All defined trigger conditions are organized into trigger condition sets, with each condition containing a unique identifier, condition expression, priority, and associated action information.
[0052] A linkage rule engine was developed based on a set of trigger conditions to achieve an intelligent condition response mechanism. The linkage rule engine employs a rule interpretation and execution model, continuously monitoring the matching between system states and trigger conditions. The rule checking process first evaluates whether the current system state meets the conditions in the trigger condition set, according to priority. For state change trigger conditions, it compares whether the current state conforms to the specified transition pattern with the previous state; for threshold overrun trigger conditions, it calculates the relationship between the monitored value and the threshold and checks the duration; for time trigger conditions, it compares the relationship between the current time and the trigger time. When a condition is met, the rule engine retrieves the corresponding linkage rule from the rule base. Linkage rules define the sequence of operations to be executed after a condition is met, described in XML format, including rule ID, trigger condition, execution action, priority, and constraints. Multi-level linkage chain parsing handles the cascading relationship of linkage rules; the completion of one action may trigger the condition of another rule, forming a linkage chain. For example, a primary circuit breaker tripping triggers a bus de-energization state, which in turn triggers the activation of the backup power supply. Linkage chain parsing uses a directed graph structure to represent the relationships between rules, employs a depth-first search algorithm to calculate the execution path, and detects circular dependencies to avoid infinite loops. The parsing result forms a sequence of linked operations, arranging multiple operation steps according to temporal relationships. Each step includes information such as operation type, target object, parameters, and expected result.
[0053] The linkage operation sequence is converted into display control commands, enabling an intuitive and visual representation of the equipment status. The display control conversion module maps abstract operation sequences to specific visual effect change instructions, defining dedicated visual attribute mapping rules for various electrical components in the wiring diagram. Color attributes are the most intuitive way to indicate status, distinguishing different operating states through color: green indicates normal operation, red indicates fault or warning, gray indicates power failure or shutdown, and yellow indicates abnormal or pending confirmation. Taking a circuit breaker component as an example, the closed state is displayed as a solid green line, the open state as a broken red line, and the fault state as a flashing yellow line. The flashing frequency attribute enhances the visual cues of emergency states. The frequency value represents the number of flashes per second, with higher frequencies indicating more urgent states: 0 indicates no flashing, 1 indicates slow flashing (suitable for general prompts), 2 indicates medium-speed flashing (suitable for warnings), and 3 indicates rapid flashing (suitable for severe alarms). The transparency attribute adjusts the visibility of components, used to distinguish key elements from background elements: 0% indicates completely transparent (invisible), 50% indicates semi-transparent (minor elements), and 100% indicates completely opaque (key elements). The system tracks and records the execution of each step of the operation, including start time, completion time, execution result, and related logs, providing operation tracking. Through comprehensive settings of visual attributes, the device status is transformed into an intuitive graphical representation, forming a dynamic wiring diagram reflecting the real-time device status.
[0054] In one specific embodiment, the process of executing step S106 may specifically include the following steps: The file format specification is designed by describing the wiring diagram configuration information through XML structure and establishing a five-layer hierarchical structure to obtain a standardized file format definition. The five-layer hierarchical structure includes: engineering information layer, page information layer, component information layer, connection information layer and linkage rule layer. The persistent storage function is implemented based on the file format definition. Data integrity verification and atomic write operations are performed through the transaction processing mechanism to obtain a local storage mechanism that prevents data loss or corruption. By integrating local storage mechanisms with automatic backup functionality, a secure storage system is achieved by periodically creating copies of configuration files and maintaining a backup index table. Implement version management functionality for the secure storage system. By creating a new version record for each save operation and calculating the differences between versions, an incremental storage data structure that only records the changed content is obtained. The network transmission module was developed based on the incremental storage data structure. It securely transmits configuration files between multiple devices through an encrypted transmission protocol, thus obtaining a data sharing channel. By combining data sharing channels with collaborative editing functions, a paginated editing mechanism allows multiple users to edit different pages simultaneously. When multiple users are detected editing the same element at the same time, a component locking and conflict resolution strategy is implemented to obtain a data file that supports collaborative editing.
[0055] Specifically, designing file format specifications is fundamental to achieving persistent and shared electrical wiring diagram data. An XML structured description method is adopted, using a tag system to organize various information in the wiring diagram, constructing a five-layer hierarchical structure. The engineering information layer is at the top level, containing basic project information, and uses... <project>The `<project>` tag serves as the root element, and its attributes include ProjectID (unique project identifier), Name (project name), Author (creator), CreateTime (creation time), and LastModifiedTime (last modification time), while also containing project-level configuration parameters and global settings. The page information layer uses... <page>Tag definitions, located below the project information layer, describe the various pages of the wiring diagram. A project file can contain multiple pages, each with unique attributes such as ID, name, size, and background settings, and also records the navigation relationships between pages. The component information layer uses... <component>Tag descriptions define the various electrical components on the page, recording static attributes such as component type, ID, position coordinates, rotation angle, and scaling ratio, as well as dynamic attributes such as associated signals and display rules. The connection information layer uses... <connection>Tag descriptions define the connection relationships between components, recording information such as the source component ID, target component ID, connection point type, and line style to construct the circuit topology. This is used in the linkage rule layer. <rule>Tag description, which defines linkage operations triggered by state changes, including trigger conditions, execution actions, priority levels, and constraint conditions, supporting complex business logic expression. Through this hierarchical structure, a standardized file format definition is formed, enabling complete representation and structured storage of wiring diagram configuration information.
[0056] The persistent storage function is implemented based on the above file format definition, and a transaction processing mechanism is adopted to ensure data security. The persistent storage process first creates a memory data buffer, and writes the complete data in the current editing state into the buffer, including engineering information, page information, component data, connection relationships, and linkage rules. Data integrity verification is performed before writing, including format verification, referential integrity verification, and business rule verification. Format verification ensures that the XML structure conforms to the file format definition, using XML Schema to verify that all required fields exist and the data types are correct; referential integrity verification ensures that the reference relationships between elements are valid, such as the component ID referenced in the connection information must exist; business rule verification verifies whether the configuration complies with electrical specifications, such as interlocking rules for similar devices. After the verification is passed, an atomic write operation is performed, and a write-replace strategy is adopted to ensure data integrity: first, the data is written to a temporary file, and after the writing is completed, the target file is replaced through an atomic operation of the file system, avoiding file corruption caused by writing interruption. An operation log is maintained during the writing process, recording each step of the operation and its result, facilitating recovery and audit in abnormal situations. Through the application of the transaction processing mechanism, even in unexpected situations such as power failure or system crash, the consistency and integrity of data can be guaranteed, preventing the loss or corruption of wiring diagram configuration information.
[0057] The system integrates local storage with automatic backup to build a multi-layered data security system. Automatic backup employs two methods: scheduled and event-triggered. Scheduled backups are created automatically at preset intervals (e.g., every 30 minutes); event-triggered backups are executed immediately after a specific operation (e.g., important modifications). Backup files are named using the original filename_timestamp format to ensure unique identification and clear chronological order. To prevent unlimited growth of backup files, a backup strategy is implemented: all backups from the most recent 24 hours are retained; one backup per day retains the most recent 7 days; one backup per week retains the most recent 4 weeks; and one backup per month retains the most recent 12 months, forming a backup archive system. The backup index table is the core data structure for backup management, using XML format to record metadata about all backup files, including file path, creation time, backup type, associated project ID, and backup content summary, facilitating quick retrieval and recovery of specific backups. The index table itself is also redundantly stored to ensure the security of backup management information. The backup recovery process supports two modes: full recovery and selective recovery. Full recovery restores the entire project to a specific backup point; selective recovery allows recovery of only certain pages or components, preserving the latest state of other parts. By combining automatic backup with index management, a secure and reliable storage system is formed, effectively preventing data loss caused by human error or system failure.
[0058] Version management is implemented in the secure storage system to achieve accurate recording and rollback of configuration changes. Version management employs an incremental storage strategy; each save operation does not create a complete copy, but instead records the differences from the previous version. The version record creation process first assigns a unique version number to the new version, using the format major version number.minor version number.revision number, such as 2.3.5, with different version numbers increasing in order of change importance. Then, the differences between the current state and the previous version are calculated using an XML difference comparison algorithm (XDiff). This algorithm first constructs DOM trees for both versions, and then identifies node additions, deletions, and modifications through tree comparison. The difference data is used... <diff>The tag encapsulates the change type (add, modify, delete), the change path (represented using XPath), and the change content, such as... <diff type="modify" path=" / Project / Page[1] / Component[5] / @Angle"> 90< / diff> This indicates that the angle attribute of the fifth element on the first page has been changed to 90 degrees. Difference data, along with version metadata (creation time, creator, change description, etc.), is stored as a version record. The version record is organized in a chained structure, with each record containing a reference to the previous version, forming a version chain that supports quick navigation between any versions. Version restoration is achieved by applying or rolling back differences. Along the path from the target version to the current version, the difference data of each version is applied or rolled back sequentially, reconstructing the complete state of the target version. This incremental storage method significantly reduces the storage space requirements for version management while maintaining the change history.
[0059] The network transmission module is developed based on an incremental storage data structure to achieve efficient and secure transmission of configuration information. The module supports the sharing and synchronization of configuration files across different devices, employing a client-server architecture. The server centrally stores project files, while the client handles local editing and synchronization with the server. The transmission protocol is designed based on HTTP / HTTPS, implementing a dedicated transmission format and security mechanism at the application layer. To ensure transmission security, a multi-level encryption strategy is adopted: first, TLS / SSL encryption is used to encrypt the transmission channel to prevent data eavesdropping by third parties; then, the transmitted data itself is encrypted using the AES-256 algorithm, with the key exchanged through a secure channel; finally, a digital signature is added, using SHA-256 to generate a data digest and RSA to sign it, ensuring data integrity and source authentication. For transmission optimization, an incremental transmission strategy is adopted, transmitting only the changed parts rather than the entire file, reducing network bandwidth consumption. Version synchronization between the client and server uses a pull-push model: the client periodically queries the server's version status and pulls the difference data when a new version is found; after completing local editing, the client calculates the differences between the client and server versions and only pushes the difference data. Conflict detection is performed during the push phase. The server checks if the client's baseline version is the latest version; if not, the client is required to fetch the latest version and resolve conflicts. Through these mechanisms, the network transmission module establishes a secure and efficient data sharing channel, supporting the sharing of wiring diagram configuration information in a distributed environment.
[0060] By combining data sharing channels with collaborative editing functionality, a highly efficient collaborative mode for multi-user parallel work is achieved. Collaborative editing is implemented based on the Distributed Operational Transformation (DOT) algorithm, supporting multiple users to simultaneously edit different parts of the same project. A paginated editing mechanism is the foundation of collaborative editing, decomposing a large wiring diagram project into multiple relatively independent pages, allowing different users to edit different pages simultaneously. Page locking management is coordinated by a central server. When a user opens a page for editing, the server assigns an editing lock to that user, and other users can only view the page in read-only mode until the editing lock is released. For component-level collaborative editing within the same page, a component locking mechanism is used: when a user selects to edit a component, the system assigns a component-level lock to that component, while other users can still edit other unlocked components on the same page. Conflict detection is performed when a user attempts to submit changes; the system compares the submitted version with the current version as a baseline to identify potential conflicts. The conflict resolution strategy includes two methods: automatic merging and manual resolution. For non-conflicting modifications (such as changes to the attributes of different components), the system automatically merges them. For conflicting modifications (such as multiple users modifying the same attribute of the same component), the system prompts the user to choose which version of the modification to keep or to manually merge them. A change notification mechanism pushes real-time updates to all relevant users, including changes in lock status, changes to component attributes, and version updates. Through the implementation of collaborative editing, multiple users can work in parallel on the same electrical wiring diagram project, significantly improving team efficiency while ensuring data consistency and integrity.
[0061] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / diff> < / rule> < / connection> < / component> < / page> < / project>
Claims
1. A method for displaying and writing electrical wiring diagrams on a high-resolution touchscreen, characterized in that, The method includes: A graphics engine is constructed by organizing nodes using a linked list structure. Each node contains time, state, logic, and event information, resulting in a graphics engine containing circuit breaker, isolator, transformer, and transformer components. This includes: designing the underlying graphics module, implementing drawing functions for basic point, line, and surface primitives to obtain a basic graphics rendering module supporting rotation, scaling, and translation operations; integrating the basic graphics rendering module with the core engine module, processing through resource management, dynamic rendering control, and event response mechanisms to obtain a graphics resource management system; performing linked list node structuring on the graphics resource management system, defining node information dimensions and data structures to obtain a node structure containing complete information on time, state, logic, and event dimensions; constructing a standardized component library based on the node structure, describing component definitions using XML format to obtain a standard component library containing circuit breaker, isolator, transformer, and transformer components; managing the connection relationships of components in the standard component library, identifying spatial positional relationships between components using an endpoint matching algorithm to obtain a component connection rule library; and integrating the component connection rule library with a multi-layered rendering mechanism, separating static background layers and dynamic foreground layers for rendering processing to obtain the graphics engine. The editing system was developed based on the aforementioned graphics engine, and the wiring diagram editing interface was obtained through the interaction of the toolbar, attribute editing area and graphics editing area; Configure the parameters of the components according to the wiring diagram editing interface. If the distance between the components is less than the preset threshold, the automatic adsorption function is triggered. The component parameter set is obtained by setting the static and dynamic state attributes. The component parameter set is input into the parsing system for multi-level parsing. A layered rendering strategy is used to locally refresh changing areas to obtain a display wiring diagram. This includes: initializing the parsing engine by reading the component parameter set and establishing a memory mapping table to obtain a data structure ready for multi-level parsing; performing a first-level parsing based on the data structure by processing static component attributes and calculating display coordinates and morphological features to obtain basic display morphology data of the component; performing a second-level parsing based on the basic display morphology data by processing dynamic component attributes and determining state switching conditions and display rules to obtain behavioral characteristic data of the component; and inputting the behavioral characteristic data into a third-level parsing process. The connection point relationships between components are analyzed and a connection topology diagram is constructed to obtain circuit topology data. A layered rendering strategy is applied to the circuit topology data, dividing the electrical wiring diagram into four independent layers: background layer, static component layer, dynamic component layer, and foreground layer. A rendering algorithm is executed separately for each layer to generate a layer buffer, which is then sequentially synthesized into a final image to obtain a complete image. Intelligent local refresh is implemented based on the complete image. By establishing a region change mapping table to record the coordinates of the rectangular regions that change in each update, the difference between the region that needs to be refreshed now and the region that was rendered last time is determined. Only the regions that have changed are redrawn while the buffers of other regions remain unchanged, resulting in a display wiring diagram. The status of the displayed wiring diagram is monitored. Through data acquisition and status determination, if the triggering conditions are met, the preset linkage rules are executed to obtain a dynamic wiring diagram reflecting the status of the equipment. The dynamic wiring diagram is imported into the storage system for persistent processing. Version difference data is recorded through structured description to obtain a data file that supports collaborative editing.
2. The high-resolution touchscreen electrical wiring diagram display and writing method according to claim 1, characterized in that, The development of the editing system based on the graphics engine, through the interaction of the toolbar, attribute editing area, and graphics editing area, yields a wiring diagram editing interface, including: It integrates multi-touch and identifies user input through a touch event capture module to obtain a positioning mechanism that maps touch coordinates to the display coordinate system; Based on the aforementioned positioning mechanism, the toolbar module was developed, and the component selection function was implemented through click selection, resulting in a toolbar interface that provides electrical component selection functionality; The toolbar interface is associated with the attribute editing module. By dividing the static attribute editing area and the dynamic attribute editing area, an attribute editing area that supports setting component size ratio, placement angle, associated component information and display status is obtained. The attribute editing area and the graphics editing area module are integrated, and the main operation area is obtained through drag-and-drop, connection and position adjustment operations. The main operating area is equipped with an intelligent adsorption function. By comparing the spatial distance between the components with a preset threshold, an interactive mechanism is obtained that automatically adsorbs to the accurate position when the distance is less than the threshold. Based on the aforementioned interaction mechanism, the preview area module is constructed, and the wiring diagram editing interface is obtained through real-time rendering and updating of the display.
3. The high-resolution touchscreen electrical wiring diagram display and writing method according to claim 1, characterized in that, The component parameters are configured according to the wiring diagram editing interface. If the distance between components is less than a preset threshold, an automatic adsorption function is triggered. The component parameter set is obtained by setting static and dynamic state attributes, including: The component attribute structure is designed by dividing it into three categories: component type, static state, and dynamic state, resulting in a parameter structure framework; The static attribute editing is implemented based on the aforementioned parameter structure framework. The scaling ratio and angle parameters are set by direct input or slider control to obtain the static state attribute configuration of the component. The static state attribute configuration and dynamic attribute editing are integrated, and the associated components, time extension and display switch parameters are set through drop-down selection or pop-up window to obtain the dynamic state attribute configuration of the component; The static state attribute configuration and the dynamic state attribute configuration are linked by parameter processing. By calculating the dependency relationship between relevant parameters, a consistency guarantee mechanism between parameters is obtained. The spatial relationship between components is calculated according to the consistency guarantee mechanism. By calculating the Euclidean distance between any two components and comparing it with a preset threshold, if the distance value is less than the threshold, the adsorption algorithm is triggered to automatically adjust the component to the nearest connection point, thereby obtaining accurate spatial positioning of the components. Based on the precise spatial positioning of the components, parameter verification is performed. By checking whether all parameter values are within the valid range and performing a correction algorithm on parameters that are out of range, a set of component parameters is obtained.
4. The high-resolution touchscreen electrical wiring diagram display and writing method according to claim 1, characterized in that, The step of monitoring the status of the displayed wiring diagram, through data acquisition and status determination, involves executing preset linkage rules if trigger conditions are met to obtain a dynamic wiring diagram reflecting the device status, including: The data acquisition module is constructed, and real-time device status data is obtained by configuring multiple communication protocol interfaces and implementing data verification, unit conversion and outlier handling. The status determination engine is designed based on the real-time device status data. The current status determination result of the device is obtained by comparing the collected data with the preset threshold and executing a multi-condition composite judgment algorithm. The current state determination result of the device is input into the state caching mechanism for processing. By recording historical state data and calculating the state change trend, a state record library is obtained. The trigger condition definition module is constructed based on the state record library. By setting state change trigger, threshold overrun trigger, and time trigger, a set of trigger conditions is obtained. The linkage rule engine is developed based on the trigger condition set. By checking whether the current state meets the conditions in the trigger condition set one by one, if the conditions are met, the corresponding linkage rule is extracted and multi-level linkage chain parsing is performed to obtain the linkage operation sequence. The linkage operation sequence is converted into display control commands. By setting the visual attributes of the components and recording all linkage events and execution results, a dynamic wiring diagram reflecting the device status is obtained. The visual attributes include color, flashing frequency, and transparency.
5. The high-resolution touchscreen electrical wiring diagram display and writing method according to claim 1, characterized in that, The process of importing the dynamic wiring diagram into the storage system for persistent processing, recording version difference data through structured descriptions, and obtaining a data file that supports collaborative editing includes: The file format specification is designed by describing the wiring diagram configuration information through XML structure and establishing a five-layer hierarchical structure to obtain a standardized file format definition. The five-layer hierarchical structure includes: engineering information layer, page information layer, component information layer, connection information layer and linkage rule layer. Based on the file format definition, persistent storage functionality is implemented, and data integrity verification and atomic write operations are performed through a transaction processing mechanism to obtain a local storage mechanism that prevents data loss or corruption. By integrating the local storage mechanism with the automatic backup function, a secure storage system is obtained by periodically creating copies of the configuration file and maintaining a backup index table. Version management is implemented in the secure storage system. By creating a new version record for each save operation and calculating the difference data between the previous and next versions, an incremental storage data structure that only records the changed content is obtained. The network transmission module is developed based on the incremental storage data structure, and a data sharing channel is obtained by securely transmitting configuration files between multiple devices through an encrypted transmission protocol. By combining the data sharing channel with the collaborative editing function, a paginated editing mechanism is used to allow multiple users to edit different pages simultaneously. When multiple users are detected editing the same element at the same time, a component locking and conflict resolution strategy is implemented to obtain a data file that supports collaborative editing.
Citation Information
Patent Citations
Semiconductor device rendering method and device, equipment and storage medium
CN115328607A
Extensible power system wiring diagram interface modeling method and system
CN115981625A
