Method for displaying and writing electrical wiring diagram of high-resolution touch screen
By building a graphics engine with a linked list structure and integrating automatic adsorption functions, multi-level parsing and rendering strategies, combined with status monitoring and preset linkage rules, the complexity and inefficiency of traditional electrical main wiring diagram editing methods are solved, and efficient and flexible electrical wiring diagram editing and display are achieved.
Patent Information
- Application Number
- CN202510952521.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-09-23
AI Technical Summary
The traditional method of editing electrical main wiring diagrams is cumbersome and inefficient. The professional software has a high threshold and cannot meet the diverse needs of modern power systems. File sharing is inconvenient, version control is complex, multi-person collaboration is inefficient, and frequent changes and maintenance of wiring diagrams are time-consuming and labor-intensive.
By building a graphics engine with a linked list structure, modular management of electrical components is achieved, integrating automatic adsorption functions and multi-level parsing and rendering strategies, combining status monitoring with preset linkage rules, supporting collaborative editing, and applying artificial intelligence algorithms to optimize the layout of electrical components.
It significantly improves the editing efficiency and flexibility of electrical wiring diagrams, lowers the technical threshold, and enables non-professionals to complete the production of complex wiring diagrams. It also achieves real-time reflection and intelligent response of equipment status, supports multi-user collaborative editing, and improves on-site work efficiency and flexibility.
Smart Images

Figure CN120687092A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and system for displaying and writing a high-resolution touch screen electrical wiring diagram. Background Art
[0002] With the rapid development of power systems and industrial automation, the demand for LCD displays is increasing. In power monitoring systems in particular, LCD displays of main wiring diagrams, as a key information display interface, require efficient, flexible, and configurable display methods to accommodate diverse engineering and R&D needs. Traditionally, editing of electrical main wiring diagrams relies on local software, requiring specialized editing on a dedicated computer and then transferring the editing to an embedded device. This method is widely used in power systems, graphically displaying the connection relationships and operating status of power equipment, providing operators with an intuitive monitoring view.
[0003] However, traditional display methods suffer from complex configuration and poor flexibility, making them difficult to meet the diverse display device requirements of modern power systems. This approach is not only cumbersome and inefficient, but also requires high barriers to entry for specialized software, limiting the participation of non-professionals. Furthermore, issues such as inconvenient file sharing, complex version control, and inefficient multi-person collaboration significantly impact project implementation efficiency. Especially with the accelerated pace of power system equipment updates, frequent changes and maintenance of wiring diagrams have become a time-consuming and labor-intensive task, severely restricting the flexible application and rapid deployment of power monitoring systems. Summary of the Invention
[0004] The present application provides a high-resolution touch screen electrical wiring diagram display and editing method and system for realizing 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] The present application provides a method for writing and displaying a high-resolution touch screen electrical wiring diagram. The method comprises: constructing a graphics engine, organizing nodes through a linked list structure, each node containing time, state, logic, and event information, to obtain a graphics engine containing circuit breakers, disconnect switches, mutual inductors, and transformer components; developing an editing system based on the graphics engine, and obtaining a wiring diagram editing interface through the interaction of a toolbar, a property editing area, and a graphics editing area; configuring component parameters according to the wiring diagram editing interface, triggering an automatic adsorption function if the distance between components is less than a preset threshold, and obtaining a component parameter set by setting static and dynamic state attributes; inputting the component parameter set into a parsing system for multi-level parsing, locally refreshing the changed area through a layered rendering strategy, and obtaining a display wiring diagram; monitoring the status of the display wiring diagram, executing preset linkage rules through data collection and status determination if the trigger condition is met, and obtaining a dynamic wiring diagram reflecting the device status; importing the dynamic wiring diagram into a storage system for persistent processing, recording version difference data through structured description, and obtaining a data file that supports collaborative editing.
[0006] In the technical solution provided by this application, a graphics engine is constructed by organizing nodes through a linked list structure to achieve modular management and reuse of electrical components, which greatly improves the efficiency of graphics construction. Each node contains time, state, logic and event information, so that each component has complete data processing and interaction capabilities; the editing system developed based on the graphics engine provides an intuitive and easy-to-use operation interface through the organic interaction of the toolbar, property editing area and graphics editing area, which significantly reduces the technical threshold for editing electrical wiring diagrams and enables non-professionals to complete the production of complex wiring diagrams; the automatic adsorption function integrated in the parameter configuration process triggers precise positioning by intelligently calculating the distance between components and comparing it with the preset threshold, which greatly improves the connection accuracy and editing efficiency; the multi-level parsing and layered rendering strategy hierarchically processes component parameters and greatly reduces the local refresh mechanism. It reduces system resource consumption and ensures the smooth display of large and complex wiring diagrams on the touch screen; the status monitoring mechanism is combined with preset linkage rules to realize real-time reflection and intelligent response of equipment status, and enhance the dynamic interactivity and information transmission efficiency of wiring diagrams; structured storage and version difference recording technology realize efficient data persistence and backtracking capabilities, while supporting multi-user collaborative editing, meeting the team collaboration needs in engineering practice; in particular, the present invention applies artificial intelligence algorithms in the field of power monitoring, identifies and optimizes the spatial layout of electrical components through deep learning models, adaptively adjusts connection paths, and realizes intelligent auxiliary design. The intelligent algorithm makes a significant contribution to the overall solution, enabling the system to have learning capabilities, and can automatically propose optimization suggestions based on historical editing habits and wiring specifications, and significantly improves on-site work efficiency and flexibility through direct editing mode on the touch screen. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0008] Figure 1 This is a schematic diagram of an embodiment of a method for displaying and compiling a high-resolution touch screen electrical wiring diagram in an embodiment of the present application. DETAILED DESCRIPTION
[0009] The embodiments of the present application provide a method and system for writing a high-resolution touch screen electrical wiring diagram display. The terms first, second, third, fourth, etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms include or have and any variations thereof are intended to cover non-exclusive inclusions. 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 that are clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products or devices.
[0010] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In one embodiment of the present application, a method for displaying and writing a high-resolution touch screen electrical wiring diagram includes: Step S101: construct a graphics engine, organize nodes through a linked list structure, each node contains time, state, logic and event information, and obtain a graphics engine containing circuit breakers, disconnect switches, mutual inductors and transformer components; Step S102: Developing an editing system based on a graphics engine, obtaining a wiring diagram editing interface through interaction among a toolbar, a property editing area, and a graphics editing area; Step S103: Parameter configuration is performed on the components according to the wiring diagram editing interface. If the distance between the components is less than a preset threshold, the automatic adsorption function is triggered, and the component parameter set is obtained by setting the static state and dynamic state attributes; Step S104: Input the component parameter set into the parsing system for multi-level parsing, and locally refresh the changed area using a layered rendering strategy to obtain a display wiring diagram; Step S105: Monitor the status of the displayed wiring diagram. Through data collection and status determination, if the trigger condition is met, the preset linkage rule is executed to obtain a dynamic wiring diagram reflecting the device status. Step S106: Import the dynamic wiring diagram into the storage system for persistence processing, record the version difference data through structured description, and obtain a data file that supports collaborative editing.
[0011] It is understandable that the execution subject of this application can be a high-resolution touch screen electrical wiring diagram display and editing system, or a terminal or server, which is not limited here. The embodiment of this application is described by taking the server as the execution subject as an example.
[0012] Specifically, a low-level graphics module was designed to implement basic graphics rendering functionality by defining basic primitives such as points, lines, and surfaces. For line drawing, the system defined a set of two-dimensional coordinate points, each containing (x, y) coordinate values and drawing attributes. The basic graphics rendering module was then integrated with the core engine module to establish a resource management mechanism. Graphics resources were then structured as linked list nodes, with each node connected by pointers to form a complete linked list. Each node contained four key information dimensions: the time dimension, which records the timing of state changes, such as the timestamp of a circuit breaker state switch; the state dimension, which records the operating state of electrical components, such as the open or closed state of a circuit breaker; the logic dimension, which defines the relationships between components, such as interlocking logic; and the event dimension, which records interactive response mechanisms. Based on this foundation, a standard component library was constructed, describing the parameters and display characteristics of each component in XML format. This complete library includes components such as circuit breakers, disconnect switches, mutual inductors, and transformers. Component connectivity in the standard component library was managed, and the spatial positional relationships of components were identified using an endpoint matching algorithm. A multi-level rendering mechanism was integrated, and a separate rendering strategy was adopted to improve rendering efficiency, resulting in the graphics engine.
[0013] Multi-touch technology was integrated to capture touch events and accurately map touch coordinates to the display coordinate system. Touch points were mapped to display coordinates using a coordinate transformation algorithm. A toolbar module was then developed to implement component selection, allowing users to select the desired electrical component by clicking the corresponding icon. Next, a property editing area was developed, divided into static and dynamic property editing areas. Static properties include component size, scale, and placement angle, while dynamic properties include associated component information and display state settings. The property editing area was then integrated with the graphic editing area to support drag-and-drop, wiring, and position adjustment. Smart snapping was implemented for interactive operations, automatically triggering snapping when the distance between components falls below a preset threshold. A preview area module was built to update the display through real-time rendering, creating a wiring diagram editing interface. The component property structure was designed, categorized into three categories: component type, static state, and dynamic state. Static property editing was then implemented, allowing users to set scale and angle parameters through direct input or slider controls. For example, a circuit breaker component could be set to a scale of 1.0 and a placement angle of 90°. Dynamic property editing was then integrated, allowing associated information and display states to be set through drop-down selections or pop-up windows. Next, parameter linkage is processed to ensure consistency. The spatial relationship between components is then calculated, including the distance between any two components. This distance is compared to a preset threshold. When the distance falls below the threshold, the adsorption algorithm is triggered, automatically adjusting the component to the nearest connection point. Parameter validation is performed to check that all parameter values are within the valid range. Any out-of-range parameters are corrected to obtain a complete and valid component parameter set.
[0014] The component parameter set is input into the parsing system for processing. First, the parsing engine is initialized, the component parameter set is read, and a memory mapping table is established to prepare the data structure for multi-level parsing. The first level of parsing then processes the static properties of the components, calculating the display coordinates and morphological features. The second level of parsing then processes the dynamic properties of the components, determining the state switching conditions and display rules. The third level of parsing then analyzes the positional relationships between the connection points of the components and constructs the complete circuit topology. A layered rendering strategy is then implemented, dividing the electrical wiring diagram into four independent layers: background, static component, dynamic component, and foreground. Each layer is rendered separately and synthesized into the final image in Z-order. Intelligent local refresh is implemented, establishing a region change mapping table to record the coordinates of the rectangular regions that change with each update. Only the changed regions are redrawn, while the remaining regions remain cached unchanged, resulting in an efficient display of the wiring diagram.
[0015] Perform status monitoring on the displayed wiring diagram. Build a data acquisition module and configure multiple communication protocol interfaces to acquire real-time device status data. Then, design a status determination engine to compare the collected data with preset thresholds and perform multi-conditional composite judgments. For example, determine whether the circuit breaker current value exceeds the rated threshold. Next, build a status cache mechanism to record historical status data and calculate change trends. Then, establish a trigger condition definition module and set multiple trigger methods. Then develop a linkage rule engine to check whether the current state meets the trigger conditions. If so, extract the corresponding linkage rules and perform multi-level linkage chain parsing. Convert the linkage operation sequence into display control commands, set the component visual attributes, and obtain a dynamic wiring diagram that reflects the device status.
[0016] Import the dynamic wiring diagram into the storage system. Design file format specifications, using XML to describe the wiring diagram configuration information and establishing a five-layer hierarchy. Implement persistent storage functionality, ensuring data integrity through transaction processing mechanisms. Next, integrate automatic backup functionality to periodically create copies of the configuration file. Implement version management functionality, creating a version record and calculating differences for each save operation. Then develop a network transmission module to securely transmit the configuration file using an encrypted protocol. Incorporate collaborative editing functionality to allow multiple users to edit different pages simultaneously, implement component locking and conflict resolution strategies, and ultimately create data files that support collaborative editing.
[0017] For example, when editing a substation main wiring diagram, designers first construct components such as circuit breakers and disconnect switches using a graphics engine, organizing each component node using a linked list structure. They then drag busbar sections, circuit breakers, and other components within the editing interface. When the distance between the circuit breaker and the busbar falls below a preset threshold of 5 pixels, the adsorption function triggers automatic alignment. Next, they set the circuit breaker's static properties (scaling ratio 1.0, angle 90°) and dynamic properties (linked input status information) to form a component parameter set. The system performs multi-level parsing of the parameter set and uses layered rendering, updating only the circuit breaker layer with a status change while leaving the background layer unchanged. When a circuit breaker status change is detected, the system executes the preset linkage rules and changes the indicator light color. Finally, the complete wiring diagram is saved as an XML file, supporting collaborative editing and version management.
[0018] In the embodiment of the present application, a graphics engine is constructed by organizing nodes through a linked list structure to achieve modular management and reuse of electrical components, which greatly improves the efficiency of graphics construction. Each node contains time, state, logic and event information, so that each component has complete data processing and interaction capabilities; the editing system developed based on the graphics engine provides an intuitive and easy-to-use operation interface through the organic interaction of the toolbar, property editing area and graphics editing area, which significantly reduces the technical threshold for editing electrical wiring diagrams and enables non-professionals to complete the production of complex wiring diagrams; the automatic adsorption function integrated in the parameter configuration process triggers precise positioning by intelligently calculating the distance between components and comparing it with the preset threshold, which greatly improves the connection accuracy and editing efficiency; the multi-level parsing and layered rendering strategy hierarchically processes component parameters, and greatly reduces the system through the local refresh mechanism. The system resource consumption is reduced, ensuring the smooth display of large and complex wiring diagrams on the touch screen; the status monitoring mechanism is combined with the preset linkage rules to realize the real-time reflection and intelligent response of the equipment status, and enhance the dynamic interactivity and information transmission efficiency of the wiring diagram; the structured storage and version difference recording technology realize the efficient persistence and backtracking capability of the data, and support multi-user collaborative editing, meeting the team collaboration needs in engineering practice; in particular, the present invention applies artificial intelligence algorithms in the field of power monitoring, identifies and optimizes the spatial layout of electrical components through deep learning models, adaptively adjusts the connection path, and realizes intelligent auxiliary design. The intelligent algorithm makes a significant contribution to the overall solution, so that the system has learning ability, and can automatically propose optimization suggestions according to historical editing habits and wiring specifications. The direct editing mode on the touch screen significantly improves the efficiency and flexibility of on-site work.
[0019] In a specific embodiment, the process of executing step S101 may specifically include the following steps: Design the underlying graphics module, and realize the drawing functions of basic graphics elements such as points, lines, and surfaces to obtain a basic graphics rendering module that supports rotation, scaling, and translation operations; Integrate the basic graphics rendering module with the core engine module, and obtain a graphics resource management system through resource management, dynamic rendering control and event response mechanism processing; The graph resource management system is structured into linked list nodes. By defining the node information dimension and data structure, a node structure with complete information of time, state, logic and event dimensions is obtained. A standardized component library is constructed based on the node structure. Component definitions are described in XML format to obtain a standard component library containing circuit breakers, disconnect switches, mutual inductors, and transformer components. Manage the connection relationships of components in the standard component library, identify the spatial position relationship between components through the endpoint matching algorithm, and obtain the component connection rule library; The component connection rule library is integrated with the multi-level rendering mechanism, and the static background layer and the dynamic foreground layer are separated for rendering processing to obtain a graphics engine.
[0020] Specifically, the underlying graphics module defines a basic primitive system, including three types of 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 an attribute set. Surface primitives are defined by multiple vertex coordinates and a fill attribute. The drawing function converts primitives into pixel arrays using a rasterization algorithm. For example, a circuit breaker primitive consists of multiple line segments, each of which is rasterized using the Bresenham algorithm. This algorithm incrementally calculates the coordinates of each point on a line, avoiding floating-point operations and improving efficiency. Rotation operations are performed using a two-dimensional rotation matrix, applying a transformation to each vertex of the primitive. Scaling operations linearly transform coordinates using a scaling factor. Translation operations are performed using coordinate offsets. These transformation operations combine to form the basic graphics rendering module, enabling flexible positioning of electrical components.
[0021] When integrating the basic graphics rendering module with the core engine module, a three-layer architecture was established: a low-level rendering layer, an intermediate resource management layer, and an upper-level event control layer. The resource management mechanism adopts a resource pool design pattern, maintaining a pool of primitive objects, 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 graphics description, storing only differentiated data. Dynamic rendering control utilizes double buffering technology, updating the backend buffer to the foreground display immediately after rendering is complete, avoiding flickering. The event response mechanism adopts a publish-subscribe model, defining types such as touch events, state change events, and update events. The event dispatcher distributes these 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, which then executes the state transition process. The collaborative operation of these mechanisms forms an efficient graphics resource management system.
[0022] When a graphical resource management system is structured as a linked list node, each node represents an electrical component or line segment instance. The node structure consists of a header and four key information dimensions. The header contains the node ID, type identifier, and a pointer to the next node, forming a one-way linked list. The time dimension includes a creation timestamp, an update timestamp list, and a time response function, recording the timing of component state changes. The state dimension includes the current state code, a history of state changes, and a state transition function, managing the component's operating state. The logic dimension includes a set of input conditions, a set of output actions, and logical relationship descriptions, defining the logical connections between components. The event dimension includes event triggering conditions, event response handlers, and event propagation paths, handling interactive events and response mechanisms. This structure ensures that each electrical component not only has a graphical representation but also possesses data processing and logical functions. For example, a circuit breaker node not only displays the on / off state but also responds to control commands and transmits state change events.
[0023] When constructing a standardized component library based on a node structure, the 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 the 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 on / off state; the state definition includes the set of possible states (open, closed, faulted) and the corresponding display styles; event handling includes the processing logic for responding to touch events; and logical relationships describe the connection rules and interlocking conditions between the circuit breaker and other components. Through this structured description, a standard library is formed that includes circuit breakers, disconnectors, transformers, and main transformers. Each component includes a graphical representation and behavior definition.
[0024] The connection relationships of components in the standard component library are managed, and the spatial positional relationships between components are identified using an endpoint matching algorithm. The endpoint matching algorithm first extracts the connection point coordinates and type information of each component. For example, a circuit breaker has two electrical connection points, one at each end. A spatial index structure (such as a kd-tree) is then constructed to accelerate spatial queries. The Euclidean distance between components is then calculated. When the distance is less than a preset threshold (usually 5 pixels), it is determined to be a potential connection. Finally, the connection type compatibility is verified. For example, the output of a circuit breaker can only be connected to the input of a transformer or busbar. The algorithm outputs a connection relationship table, which records the ID, connection point index, and connection attributes of each pair of connected components, such as the connection relationship between busbar section 1 and circuit breaker 2. These connection relationships constitute a component connection rule library, which is used to guide the automatic wiring and logic verification of wiring diagrams.
[0025] The component connection rule library is integrated with a multi-level rendering mechanism to implement layered rendering. This 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 state-variable components such as circuit breakers and disconnects; and the foreground layer contains temporary information such as annotation text and highlights. During rendering, lower layers are drawn first, followed by higher layers, to form a complete image. An efficient local refresh algorithm updates only the areas containing components whose state has changed, avoiding full-screen redraws. For example, when a circuit breaker changes from closed to open, only the rectangular area containing the breaker (typically only a few dozen pixels wide and high) is redrawn, while the remaining area remains cached. This separate rendering strategy ultimately forms a graphics engine that provides the technical foundation for editing and displaying electrical wiring diagrams on high-resolution touchscreens.
[0026] The entire processing flow is illustrated using a 10kV distribution equipment wiring diagram as an example: A busbar segment element is defined, including attributes such as 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 a center point at a preset position. When the user drags the circuit breaker close to the busbar, an endpoint matching algorithm detects that the distance between the top of the circuit breaker and the busbar is less than 5 pixels, triggering automatic adsorption and precisely positioning the circuit breaker at the busbar connection point. Circuit breaker data is organized as linked list nodes, recording information such as time (creation timestamp), state (currently closed), logic (interlocking with adjacent disconnect switches), and events (response to click-to-switch state). When the system detects a change in the actual device state, the circuit breaker state is updated to open, redrawing only the rectangular area containing the circuit breaker while leaving other areas unchanged, effectively 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 the processing chain of the electrical wiring diagram graphics engine.
[0027] In a specific embodiment, the process of executing step S102 may specifically include the following steps: Integrated multi-touch, recognizes user input through the touch event capture module, and obtains a positioning mechanism that maps touch coordinates to the display coordinate system; The toolbar module is developed based on the positioning mechanism, and the component selection is realized by clicking the selection function, thereby obtaining a toolbar interface that provides the electrical component selection function; The toolbar interface is associated with the property editing module. By dividing the static property editing area and the dynamic property editing area, a property editing area that supports component size ratio, placement angle, associated component information and display status settings is obtained. Integrate the attribute editing area and the graphic editing area modules, and obtain the main operation area through drag-and-drop, connection and position adjustment operations. An intelligent adsorption function has been implemented in the main operating area. By calculating the spatial distance between components and comparing it with a preset threshold, an interactive mechanism is obtained that automatically adsorbs to the correct position when the distance is less than the threshold. The preview area module is constructed based on the interactive mechanism, and the wiring diagram editing interface is obtained through real-time rendering and updated display processing.
[0028] Specifically, the touch event capture module recognizes user input. This module receives touch point information from the touchscreen hardware, including touch point identifiers, raw coordinate values, and touch state (pressed, moved, lifted). Each touch point information is passed to the coordinate mapping processor via the event queue, which performs coordinate system conversion. The coordinate mapping processor converts the touchscreen's physical coordinates into display logical coordinates, taking into account screen resolution, display scale, and rotation angle to ensure accurate mapping. For example, when a user touches the screen at position (800, 600), the coordinate mapping processor converts the physical coordinates into logical coordinates, taking into account the current viewport scale of 0.5 and the displacement of (100, 50), resulting in the actual logical coordinates of (500, 350). The touch event dispatcher determines the trigger area based on the mapped coordinates and dispatches the event to the corresponding handler function. Through this process, touch coordinates are accurately mapped 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 quick selection of electrical components. The toolbar is located in a fixed area of the screen, typically at the top or left side, and is divided into several functional areas: commonly used components, line tools, and editing tools. Each component button contains 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. For example, when the touch point falls within the circuit breaker button area and meets the click criteria, the circuit breaker button background color becomes highlighted, and the circuit breaker type information is loaded into the operation context, displaying it as the currently selected tool. This approach allows users to quickly select the desired electrical component, and the toolbar interface provides visual feedback to confirm the selection.
[0030] The toolbar interface is linked to the property editing module to establish a linkage mechanism between component and property editing. The property editing area is typically located on the right or bottom of the screen and is divided into two main sections: static property editing and dynamic property editing. The static property editing area manages fixed component characteristics, including two core parameters: ratio (Ratio) and angle (Angle). When the user selects a component type in the toolbar, the property editing area automatically loads the default static property values for that component type. For example, a circuit breaker has a default ratio of 1.0 and an angle of 0 degrees. The dynamic property editing area manages component behavioral characteristics, including associated element information and display settings. For a circuit breaker, for example, dynamic properties include setting the associated time action (Time) to 0 for instantaneous state tracking and setting the display (Display) to ON for forward-facing image display. Property value modifications are performed using sliders, text input boxes, or drop-down selectors. Value changes immediately trigger a validation process to ensure that the input value is within a valid range, such as limiting the ratio to 0.5-2.0. This association mechanism makes component property configuration intuitive and efficient, and provides parameter support for the subsequent placement and configuration of components in the editing area.
[0031] The property editing area and the graphic editing area modules are integrated to implement core interactive functions. The graphic editing area is located in the center of the screen, occupying the primary display area. It supports three key operations: drag-and-drop, wiring, and repositioning. Drag-and-drop operation flow: After selecting a component from the toolbar, the user touches anywhere in the graphic editing area. The system creates an instance of the component and applies the current property settings. The component moves with the touch point; when the touch ends, the component remains fixed in its current position. Wiring operation flow: After selecting the line tool, the system records the start point of the touch as the starting point and the end point as the end point, creating a line connecting the two points. If the start or end point is close to an existing component connection point, the line automatically snaps to the connection point. Repositioning operation flow: When a placed component is touched, the system determines whether the point is within the component's bounds. If so, the component becomes selected and adjusts its position with the touch; when the touch ends, the component remains fixed in its new position. All operations are managed through touch event sequences. Each touch sequence consists of three phases: press, move, and release. Operation status information remains consistent throughout the sequence. The integrated main operation area provides an intuitive graphic editing experience, allowing users to quickly build electrical wiring diagrams.
[0032] Smart snapping has been implemented in key operating areas to improve connection accuracy. The smart snapping algorithm first extracts the location information of each component's connection points and establishes a spatial index structure to accelerate queries. As 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. This distance is calculated using the Euclidean distance formula, which is the straight-line distance between two points. If the calculated minimum distance value falls below a preset threshold (typically 10 pixels), the snapping mechanism is triggered, automatically adjusting the coordinates of the current operating point to the coordinates of the nearest connection point. A visual cue (such as highlighting or a connection indicator line) indicates the snapping status. For example, if a user drags a circuit breaker close to a busbar, and the calculated distance between the breaker's input terminal and the busbar is 8 pixels, which is less than the 10-pixel threshold, the system automatically adjusts the breaker's input terminal to precisely align with the busbar connection point and displays a connection indicator. In addition to distance requirements, the snapping mechanism also considers connection point type compatibility, such as ensuring that output terminals can only connect to input terminals. Smart snapping significantly improves connection accuracy, ensuring accurate connections between electrical components.
[0033] Based on this interactive mechanism, the preview area module is constructed to achieve real-time visual feedback. The preview area module serves as the visual output layer of the graphics editing area, responsible for rendering and displaying the current editing status in real time. The rendering process first constructs a rendering queue, arranging all visible elements in Z-order. Drawing operations are then performed, rendering the elements into a buffer. Finally, the buffer contents are refreshed to the screen. Rendering updates are triggered in two ways: by element state changes and by scheduled refreshes. When the user completes an editing operation (such as moving a component or modifying properties), the system immediately marks the affected area and triggers a partial redraw. Simultaneously, the system maintains a 30-frame-per-second scheduled refresh mechanism to ensure smooth display of dynamic elements (such as flashing indicators). The partial redraw algorithm updates only the changed areas, calculating the minimum enclosing rectangle that covers all changed elements and redrawing only the contents within that rectangle, conserving computing resources. Through this efficient rendering mechanism, the preview area module provides smooth, real-time visual feedback, ultimately creating a wiring diagram editing interface.
[0034] In a specific embodiment, the process of executing step S103 may specifically include the following steps: Design the component attribute structure and divide it into three categories: component type, static state and dynamic state to obtain the parameter structure framework; Implement static property editing based on the parameter structure framework, set the scaling ratio and angle parameters through direct input or slider control to obtain the static state property configuration of the component; Integrate static state attribute configuration and dynamic attribute editing, set associated components, time extension and display switch parameters 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 together to obtain a consistency guarantee mechanism between the parameters by calculating the dependency relationship between the related parameters. The spatial relationship between components is calculated based on the consistency guarantee mechanism. The Euclidean distance between any two components is calculated and compared with the 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 to obtain accurate component spatial positioning; Parameter verification is performed based on precise component spatial positioning. The component parameter set is obtained by checking whether all parameter values are within the valid range and performing correction algorithms on parameters that are out of range.
[0035] Specifically, the three-level classification principle of component type, static state, and dynamic state is followed. Component type is the highest-level classification, identifying the basic category of components, such as circuit breakers, disconnect switches, and transformers. Each type has specific graphical representations and behavioral characteristics. The static state describes the fixed properties of a component, primarily including two key parameters: the ratio and angle. The ratio controls the display size of the component, typically ranging from 0.5 to 2.0; the angle controls the rotation direction of the component, ranging from 0 to 360 degrees. The dynamic state describes the variable properties of a component, including three core parameters: related components, time widening, and display on. The related component parameter establishes the mapping relationship between the component and the actual device signal; time widening 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 a hierarchical design, organizes all component configuration requirements into an orderly data structure, facilitating subsequent processing and management.
[0036] Implementing static property editing based on the aforementioned parameter structure requires intuitive input methods. The static property editing interface is located in the upper area of the property panel. For the scale parameter, two input methods are available: direct input and slider control. Direct input allows users to precisely enter a value in the text box. For example, entering 1.5 means enlarging the component to 1.5 times its original size. The system immediately verifies the value to ensure it is within the permitted range. Slider control provides visual numeric 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 the approximate value by dragging the slider, making it suitable for rough adjustments. Angle parameters also offer both direct input and slider control. The angle value represents the number of degrees to rotate the component clockwise from its initial orientation. For example, entering 90 means rotating the component 90 degrees clockwise. To improve operational efficiency, the system also provides shortcut buttons for commonly used angles (0°, 90°, 180°, and 270°), allowing users to quickly set settings with a single click. As users modify the scale or angle parameters, the system updates the preview display in real time, allowing users to intuitively evaluate the effects of their settings. Through these interaction mechanisms, users complete the configuration of the static state properties of the component.
[0037] Integrating static state property configuration with dynamic property editing requires designing editing controls tailored to different property types. The dynamic property editing area, located in the lower area of the property panel, uses a drop-down menu for associated component parameters. A list displays all associated device signals in the current system, such as the circuit breaker 1 open state and the disconnector 2 position signal. Users select the specific signal to associate using the drop-down menu. For complex associations, a pop-up window displays a tree-structured list of device signals and detailed filtering options, allowing users to quickly locate the target within a large number of signals. The time widening parameter is set via a numeric input box. The value represents the response delay for state changes in milliseconds, with a default value of 0 for instant response. The display on / off parameter is controlled via a toggle button: ON makes the component visible, and OFF hides it. For circuit breaker components, additional display modes are available, such as forward and reverse, to control the visual representation of the breaker's on / off state. Modifying dynamic properties also triggers a real-time preview update, allowing users to immediately see the effects of the settings. Through the integration of static and dynamic property editing functions, users can fully configure various parameters of components and obtain the dynamic state property configuration of components.
[0038] Static and dynamic state attribute configurations are linked to ensure logical consistency between parameters. Parameter linkage begins by constructing a parameter dependency graph to record the dependencies between parameters. For example, when the component type is a mutual inductor, changes in the angle parameter affect the connection point positions of associated components; when the display switch is set to OFF, other parameter settings are temporarily disabled. A dependency analysis algorithm evaluates the interactions between parameters based on a pre-set rule base. When a parameter value changes, it identifies all other parameters that depend on it and updates them one by one in the order of dependency. For example, when a user adjusts the angle of a circuit breaker from 0 to 90 degrees, the system detects that the connection point position depends on the angle parameter and automatically recalculates the connection point coordinates to ensure correct connections with surrounding components. The linkage mechanism also includes conflict detection and resolution. When conflicting parameter settings arise, the system automatically adjusts the relevant parameters according to pre-defined priority rules or prompts the user to make a choice. By comprehensively considering the interrelationships between parameters, consistency constraints are established for parameter values, ensuring that all parameter settings remain logically sound overall, thus forming a parameter consistency assurance mechanism.
[0039] The spatial relationship between components is calculated based on a consistency assurance mechanism to achieve precise spatial positioning. Spatial relationship calculations first extract key point information for each component, including center points and connection points. For circuit breaker components, these key points include the input connection point, output connection point, and center control point; for line components, these key points include the start point, end point, and control point. The minimum distance between any two components is then calculated—the minimum Euclidean distance between the key points of each component. Euclidean distance calculation uses the distance formula between two points in a plane, taking the square root of the sum of the squared difference between the horizontal and vertical coordinates of the two points. The calculated minimum distance is compared with a preset threshold (typically set to 5 to 10 pixels). If the distance is less than the threshold, the snapping algorithm is triggered. Based on the current operation context and component type, the snapping algorithm selects appropriate reference and target points, automatically adjusting the position of the operated component so that the reference and target points precisely coincide. For example, when the user drags a circuit breaker close to the busbar, the system calculates the distance between the circuit breaker input terminal and the busbar. If the distance is less than the threshold, the circuit breaker position is adjusted so that the input terminal is precisely aligned with the busbar connection point, thereby achieving precise component spatial positioning.
[0040] Parameter validation is performed based on precise component spatial positioning to ensure the validity of all parameter values. Parameter validation includes two steps: range validation and logic validation. Range validation checks whether each parameter value is within the allowable numerical range: the scaling parameter is usually limited to between 0.5 and 2.0. If the user enters 2.5, which exceeds the upper limit, it is automatically corrected to 2.0; the angle parameter is limited to between 0 and 360 degrees. If the input value is -30 degrees, it is automatically corrected to 330 degrees (i.e., 360-30). Logic validation 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 no association, the time widening parameter is invalid. For parameters that exceed the valid range or do not conform to the logical relationship, the system executes a correction algorithm: for numerical parameters, the out-of-range value is truncated to the nearest valid boundary value; for enumeration parameters, the default value or the nearest valid option is selected; for logical relationship conflicts, the relevant parameters are adjusted according to the predetermined priority rules. Through a complete parameter verification and correction mechanism, the final component parameter set is ensured to be numerically valid and logically reasonable, providing a reliable configuration basis for subsequent component rendering and status monitoring.
[0041] In a specific embodiment, the process of executing step S104 may specifically include the following steps: Initialize the parsing engine and obtain the data structure ready for multi-level parsing by reading the component parameter set and establishing a memory mapping table; Perform the first-level analysis of parameters based on the data structure, process the static properties of the component and calculate the display coordinates and morphological characteristics to obtain the basic display morphological data of the component; Perform a second-level analysis based on the basic display form data, processing the dynamic properties of the component and determining the state switching conditions and display rules to obtain the component's behavioral characteristic data; The behavioral characteristic data is input into the third-level analytical processing, and the circuit topology data is obtained by analyzing the position relationship of the connection points between the components and constructing the connection topology diagram; A layered rendering strategy is implemented for 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 executed on each layer to generate a layer buffer, which is then sequentially synthesized into the final image to obtain a complete image. Intelligent local refresh is implemented based on the complete image. By establishing an area change mapping table to record the coordinates of the rectangular area that changes in each update, the difference between the area that needs to be refreshed and the area rendered last time is judged. Only the changed area is redrawn while the cache of other areas remains unchanged to obtain a display wiring diagram.
[0042] Specifically, a data structure is constructed to support the multi-level parsing process. The initialization process begins by reading the component parameter set, which contains all electrical component information 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 each component's parameter data in turn. The memory mapping table is the core data structure of the parsing engine. It is organized as a hash table, with the component ID as the key and the corresponding value as a complete description of the component's parameters and status. For circuit breaker components, the mapping table records information such as the circuit breaker type identifier, location coordinates, scale, rotation angle, associated device signals, and current status. The memory mapping table also records the connections between components, forming an adjacency list structure to facilitate subsequent topological analysis. After the mapping 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 state index table for quickly finding all components in a specific state. With the construction of these data structures, the parsing engine is initialized and ready to execute the multi-level parsing process. Based on the initialized data structure, the first level of parameter parsing is performed to process the static properties of the component. This first level of parsing focuses on the component's geometric characteristics, converting abstract parameters into concrete display data. The processing flow first accesses the memory mapping table to extract static attributes such as the type, position, size ratio, and rotation angle of each component. For line components (such as busbars), the line segment parameters are calculated based on the coordinates of the start and end points. For symbol components (such as circuit breakers), the component's bounding rectangle and constituent point set 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 into screen display coordinates, taking into account the component's own rotation, scaling, and global view translation and scaling factors. Morphological feature calculation determines the component's visual representation based on the component's 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, which is recorded in the parsing result cache and provides input for the second-level parsing.
[0043] The second-level analysis is based on the basic display form data from the first-level analysis to process the component's dynamic properties. The second-level analysis converts static graphical descriptions into interactive objects with behavioral characteristics. The processing flow first retrieves the component's basic display form from the analysis result cache, then extracts the component's dynamic properties, including associated device signals, timing characteristics, and display rules, from the memory map. For circuit breaker components, the associated information identifies the actual monitored device state point, such as the open-closed state of circuit breaker 1; the timing characteristics define the response to state changes, such as 0 milliseconds indicating an instantaneous response; and the display rules specify the visual representation of different states, such as a solid line for the closed state and a gap for the open state. State transition condition analysis, based on the associated information and timing characteristics, constructs a state transition function that defines when and how the component's display state changes. For example, a state transition is triggered when the monitored open-closed signal changes from 0 to 1 and the duration exceeds a set threshold. Display rule processing maps states to specific visual effects, including color, line type, and fill type. The processed data constitutes the component's behavioral characteristic data, recording the state conditions and corresponding display effects, providing input for the third-level analysis.
[0044] The behavioral characteristic data is fed into the third-level parsing process, which analyzes the connectivity between components and constructs the circuit topology. The third-level parsing extends from individual components to the inter-component network, establishing the overall circuit logic. The process first extracts connection point information for each component. Connection points are the locations where a component interconnects with other components, such as the input and output terminals of a circuit breaker. A connection point matching algorithm is then applied to identify pairs of spatially proximal and compatible connection points, typically with a threshold of 5 pixels. The matching results form a connection relationship list, recording the component ID, connection point type, and connection properties for each pair. A topology graph is constructed based on the connection relationship list, using a graph data structure with nodes representing components and edges representing connections. Once the topology graph is constructed, an electrical circuit identification algorithm is applied. Using a depth-first search, all closed circuits and major paths are identified, identifying power supply points, load points, and critical nodes. For example, the power supply path from the main transformer to each outgoing circuit breaker is identified, marking critical connection points and potential fault points. The processed data forms circuit topology data, containing component connectivity, path information, and electrical characteristics, providing the foundation for subsequent rendering and status monitoring.
[0045] A layered rendering strategy is implemented for circuit topology data, achieving efficient image generation. Layered rendering breaks down complex electrical wiring diagrams into multiple independent layers, each containing specific elements of a specific type, and rendering them sequentially from bottom to top. The background layer is the bottom layer and contains fixed content such as the grid, title bar, and legend, typically only redrawn when the view range changes. The static component layer, located above the background layer, contains components that remain unchanged or rarely change, such as busbars, connecting wires, and transformer bodies. These components have relatively fixed positions and shapes. The dynamic component layer contains frequently changing interactive components, such as circuit breakers, disconnects, and indicator lights. The status of these components updates as the device status changes. The foreground layer is the top layer and contains annotation text, highlight selection boxes, temporary tooltips, and other functions to emphasize the current operational focus. The rendering process applies a dedicated rendering algorithm to 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 saved in an independent layer buffer and then synthesized in Z-axis order. The later drawn layers cover the earlier drawn layers 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 based on regional change detection. By recording and comparing the changes in component status in each update, the minimum area that needs to be redrawn is calculated. The regional change mapping table is a list of rectangles that records the coordinate range of the area occupied by each changed component (the coordinates of the upper left and lower right corners). When a component status change is detected, the bounding rectangle information of the component is queried and added to the change mapping table. Rectangle merging optimization is performed before adding. If the new rectangle overlaps 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 area is compared with the last rendered area, and redrawing is performed only when there is a difference. The redraw operation performs the following steps for each changed area: clear the display buffer of the area, redraw the contents of each layer in the area in sequence, and then copy the buffer contents to the display device. For example, when a circuit breaker changes from closed to open, only the small area (approximately 100×100 pixels) containing the circuit breaker 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 a specific embodiment, the process of executing step S105 may specifically include the following steps: Build a data acquisition module, configure multiple communication protocol interfaces, and implement data verification, unit conversion, and outlier processing to obtain real-time device status data; Design a status judgment engine based on real-time device status data. By comparing the collected data with preset thresholds and executing a multi-condition composite judgment algorithm, the current status of the device is determined. The current status determination result of the device is input into the status cache mechanism for processing. By recording historical status data and calculating the status change trend, a status record library is obtained; Build the trigger condition definition module based on the state record library, and obtain the trigger condition set by setting the state change trigger, threshold crossing trigger and time trigger; Develop a linkage rule engine based on the trigger condition set. Check one by one whether the current state meets the conditions in the trigger condition set. If the conditions are met, extract the corresponding linkage rules and perform multi-level linkage chain analysis 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.
[0048] Specifically, the data acquisition module utilizes a multi-protocol adaptation architecture to support common communication protocols in the power industry, including Modbus, IEC61850, DNP3, and OPC. The protocol adaptation layer converts communication data from different protocols into a unified internal data format, eliminating protocol differences. Taking the Modbus protocol as an example, by configuring the device address, register address, data type, and sampling period, a collection point table is established, and device data is periodically polled. Data verification performs three levels of validation on collected data: communication verification confirms data frame integrity, using CRC to detect transmission errors; value range verification determines whether the data is within the physically permitted range, such as voltage values should not be negative; and rate-of-change verification analyzes the rate of change of the data to identify abnormal fluctuations. Unit conversion converts raw device values into standard engineering units, such as mapping a current register value of 0-4095 to an actual current value of 0-100A. Outlier processing utilizes a smoothing filter algorithm to address sudden changes and missing values, including strategies such as previous value retention, linear interpolation, and median filtering. Through this process, the data acquisition module generates clean and reliable real-time device status data, providing the basis for subsequent status assessment.
[0049] A state determination engine is designed based on real-time device status data to achieve intelligent identification of device status. The state determination engine utilizes a hierarchical judgment framework, consisting of three levels: single-point state determination, multi-point correlation determination, and time-series state determination. Single-point state determination is the most basic judgment method, directly comparing a single collected data point with a preset threshold to determine the state. For example, for a circuit breaker position, the collected position signal value is compared with the switch threshold. A value greater than 0.7 indicates a closed state, a value less than 0.3 indicates an open state, and a value between 0.3 and 0.7 indicates an intermediate state. Multi-point correlation determination improves judgment accuracy by comprehensively analyzing multiple relevant data points. For example, when determining the circuit breaker state, in addition to the position signal, the current value and the auxiliary contact status are also considered: a reliable closed state is only confirmed when the position signal indicates a closed state, current is flowing, and the auxiliary contacts are closed. The multi-conditional 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). Time series state determination focuses on the changing process of data, identifying state transitions by analyzing data sequences. For example, if the current suddenly drops from a stable value to zero while the position signal changes, this is considered a circuit breaker trip event. Based on these judgments, the state determination engine outputs the current device state determination result, including information such as the device ID, current state code, confidence level, and timestamp.
[0050] The current device status determination results are input into the state cache mechanism for processing, enabling efficient storage and querying of status data. The state cache mechanism employs a hierarchical storage structure, dividing device status data into three tiers: hot, warm, and cold. Hot data is stored in memory and contains 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 the last 24 hours and supporting moderate-frequency access. Cold data is archived in a historical database, preserving records from longer time periods and primarily used 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 records are processed using a time-segmented storage strategy, consolidating consecutive identical statuses into status duration interval records to reduce storage space usage. State change trend calculation is based on time series analysis. By applying a sliding window algorithm to historical status data, metrics such as state change frequency, average duration, and periodic characteristics are calculated. For example, the number of circuit breaker operations in the last 24 hours can be calculated to identify abnormal patterns of frequent operations. Through this processing, the state cache mechanism builds a state record library, providing data support for subsequent trigger condition definition.
[0051] The trigger condition definition module is constructed based on the state record 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 triggering method, monitoring the transition of a device state from one value to another. For example, a circuit breaker state transition from closed to open is defined as a trigger condition, activating the corresponding linkage rule when the circuit breaker trips. A state change trigger includes a source state, a target state, and an optional transition time constraint, such as transitioning from normal to overload within 10 seconds. A threshold crossing trigger compares a numerical parameter with a threshold, defining an upper limit, lower limit, or range condition. For example, a current value greater than 1.2 times the rated current is set as an overload trigger condition, triggering an alarm when the current continuously exceeds the threshold. Threshold triggering is often combined with a duration constraint, requiring the condition to be met for a certain period of time before triggering, to avoid false triggering caused by transient fluctuations. Time triggering is based on absolute or relative time settings, such as triggering a check at 8:00 AM every day after the switch is closed or after a state has persisted for 30 minutes. Trigger condition definitions support condition combination, using logical operators (AND, OR, and NOT) to construct compound conditions, such as "circuit breaker A is open AND circuit breaker B is closed AND the time is within the operating hours." All defined trigger conditions are organized into trigger condition sets, each of which contains information such as a unique identifier, conditional expression, priority, and associated actions.
[0052] A linkage rule engine was developed based on a set of trigger conditions to implement an intelligent conditional response mechanism. The linkage rule engine utilizes a rule interpretation and execution model to continuously monitor the system state against the trigger conditions. The rule checking process first evaluates the current system state against the conditions in the trigger condition set, one by one, in order of priority. For state change triggers, the current state is compared with the previous state to see if they conform to the specified transition pattern. For threshold crossing triggers, the relationship between the monitored value and the threshold is calculated and the duration is checked. For time triggers, the relationship between the current time and the triggering time is compared. When a condition is met, the rule engine retrieves the corresponding linkage rule from the rule base. A linkage rule defines the sequence of actions to be executed when the condition is met. It is described in XML format and contains information such as the rule ID, trigger condition, execution action, priority, and constraints. Multi-level linkage chain parsing handles the cascading relationships of linkage rules. The completion of one action may trigger the conditions of another rule, forming a linkage chain. For example, a primary circuit breaker tripping triggers a busbar power failure, 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. It uses a depth-first search algorithm to calculate the execution path, while also detecting circular dependencies to avoid infinite loops. The parsing results form a linked operation sequence, arranging multiple operation steps in a temporal order. Each step includes information such as the operation type, target object, parameters, and expected result.
[0053] The linked operation sequence is converted into display control commands, enabling intuitive visualization of device status. The display control conversion module maps abstract operation sequences into specific visual change instructions, defining dedicated visual attribute mapping rules for various electrical components in the wiring diagram. The color attribute is the most intuitive status indicator, distinguishing different operating states by color: green indicates normal operation, red indicates fault or warning, gray indicates power off or disabled, and yellow indicates abnormal or pending status. For example, a circuit breaker component displays the closed state as a solid green line, the open state as a broken red line, and the fault state as flashing yellow. The flashing frequency attribute enhances visual cues for critical states. The frequency value represents the number of flashes per second, with higher frequencies indicating more critical states: 0 indicates no flashing, 1 indicates slow flashing (for general prompts), 2 indicates medium flashing (for warnings), and 3 indicates fast flashing (for severe alarms). The transparency attribute adjusts the visibility of components, distinguishing key elements from background elements: 0% indicates complete transparency (invisible), 50% indicates semi-transparency (for secondary elements), and 100% indicates complete opacity (for key elements). Linked execution monitoring records the execution status of each operation, including start time, completion time, execution results, and related logs, providing operation tracking. Through comprehensive settings of visual attributes, device status is converted into intuitive graphical representations, forming dynamic wiring diagrams that reflect real-time device status.
[0054] In a specific embodiment, the process of executing step S106 may specifically include the following steps: Design a file format specification, describe the wiring diagram configuration information using XML structured description and establish a five-layer hierarchical structure to obtain a standardized file format definition. The five-layer hierarchical structure includes: project information layer, page information layer, component information layer, connection information layer, and linkage rule layer. Implementing persistent storage based on file format definitions, and performing data integrity checks and atomic write operations through transaction processing mechanisms to achieve a local storage mechanism that prevents data loss or corruption. Integrate the local storage mechanism with the automatic backup function to obtain a secure storage system by regularly creating configuration file copies and maintaining a backup index table. Implementing version management for the secure storage system creates a new version record for each save operation and calculates the difference between the previous and next versions, resulting in an incremental storage data structure that only records the changes. Develop a network transmission module based on the incremental storage data structure, securely transmit configuration files between multiple devices through an encrypted transmission protocol, and obtain a data sharing channel; The data sharing channel is combined with the collaborative editing function. The page editing mechanism allows multiple users to edit different pages at the same time. When multiple users are detected editing the same component at the same time, component locking and conflict resolution strategies are implemented to obtain data files that support collaborative editing.
[0055] Specifically, the design of file format specifications is the basis for achieving data persistence and sharing of electrical wiring diagrams. Using XML structured description, various types of wiring diagram information are organized through a tag system to build a five-layer hierarchical structure. The engineering information layer is at the top, containing basic project information. <project>The tag is the root element, and its attributes include ProjectID (project unique identifier), Name (project name), Author (creator), CreateTime (creation time) and LastModifiedTime (last modification time), etc. It also contains project-level configuration parameters and global settings. <page>Tag definition, located below the project information layer, describes each page of the wiring diagram. A project file can contain multiple pages, each with independent ID, name, size, background settings and other attributes, while recording the navigation relationship between pages. <component>Tag description, defines each electrical component in the page, records static properties such as component type, ID, position coordinates, rotation angle, scaling, and dynamic properties such as associated signals and display rules. <connection>Label description, define the connection relationship between components, record the source component ID, target component ID, connection point type, line style and other information of the connection, and build the circuit topology. <rule>Tag descriptions define the linkage operations triggered by state changes, including trigger conditions, execution actions, priorities, and constraints, supporting the expression of complex business logic. This hierarchical structure forms a standardized file format definition, enabling the complete expression and structured storage of wiring diagram configuration information.
[0056] The persistent storage function is implemented based on the aforementioned file format definition, employing a transactional mechanism to ensure data security. The persistent storage process first creates an in-memory data buffer and writes the complete data in the current editing state into the buffer, including project information, page information, component data, connection relationships, and linkage rules. Data integrity checks are performed before writing, including format validation, referential integrity checks, and business rule checks. Format validation ensures that the XML structure conforms to the file format definition, using XML Schema to verify that all required fields exist and have the correct data type. Referential integrity checks ensure that references between elements are valid, such as the existence of component IDs referenced in connection information. Business rule checks verify that the configuration complies with electrical specifications, such as interlocking rules for similar devices. Once these checks pass, an atomic write operation is performed, employing a write-replace strategy to ensure data integrity: data is first written to a temporary file. After the write is complete, an atomic file system operation replaces the target file, preventing file corruption caused by write interruptions. An operation log is maintained during the write process, recording each step and its results to facilitate recovery and auditing in the event of an exception. The application of a transactional mechanism ensures data consistency and integrity, even in unexpected situations such as power outages or system crashes, preventing loss or corruption of wiring diagram configuration information.
[0057] Integrate local storage with automatic backup to build a multi-layered data security system. Automatic backup uses both scheduled and event-triggered methods. Scheduled triggers automatically create backups at preset intervals (e.g., every 30 minutes); event-triggered backups are executed immediately after specific operations (e.g., completing a major modification). Backup file naming uses the original file name followed by timestamp format, ensuring unique identification and chronological order. To prevent unlimited backup file growth, a backup policy is established to manage the backups: retain all backups within the last 24 hours, daily backups for the last seven days, weekly backups for the last four weeks, and monthly backups for the last 12 months, forming a backup archive system. The backup index table is the core data structure for backup management. It uses XML format to record metadata for all backup files, including backup file path, creation time, backup type, associated project ID, and backup content summary, facilitating quick retrieval and restoration of specific backups. The index table itself is also redundantly stored to ensure the security of backup management information. The backup and restore process supports both full and selective restore modes. Full restore restores the entire project to a specific backup point; selective restore restores only selected pages or components, preserving the latest state of the rest. By combining automatic backup with index management, a safe and reliable storage system is formed, effectively preventing data loss caused by human error or system failure.
[0058] Implement version management for the secure storage system to achieve accurate recording and backtracking of configuration changes. Version management adopts an incremental storage strategy. Each save operation does not create a complete copy, but records the difference data with the previous version. The version record creation process first assigns a unique version number to the new version in the format of major version number.minor version number.revision number, such as 2.3.5. The version numbers of different levels increase according to the importance of the change. Then calculate the difference between the current state and the previous version, using the XML difference comparison algorithm (XDiff). The algorithm first builds the DOM tree of the two versions, and then identifies the addition, deletion and modification operations of nodes by comparing the trees. The difference data is used <diff>Tag encapsulation includes the change type (add, modify, delete), change path (expressed using XPath) and change content, such as <diff type="modify" path=" / Project / Page[1] / Component[5] / @Angle"> 90< / diff> This indicates that the angle property of the fifth element on the first page has been modified to 90 degrees. Difference data is stored as a version record along with version metadata (creation time, creator, change description, etc.). Version records are organized in a chain structure, with each version record containing a reference to the previous version, forming a version chain and supporting rapid navigation between any versions. Version recovery 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 in sequence to rebuild the complete state of the target version. This incremental storage method significantly reduces the storage space required for version management while maintaining a historical record of changes.
[0059] A network transmission module was developed based on an incremental storage data structure, enabling efficient and secure transmission of configuration information. This module supports the sharing and synchronization of configuration files across devices, utilizing a client-server architecture. The server centrally stores project files, while the client performs local editing and synchronizes them with the server. The transmission protocol is based on HTTP / HTTPS, implementing specialized transmission formats and security mechanisms at the application layer. To ensure transmission security, a multi-level encryption strategy is employed: First, TLS / SSL is used to encrypt the transmission channel to prevent third-party eavesdropping. The transmitted data itself is then encrypted using the AES-256 algorithm, with the key exchanged over a secure channel. Finally, a digital signature is added, using SHA-256 to generate a digest and RSA signature to ensure data integrity and source authentication. To optimize transmission, an incremental transmission strategy is employed, transmitting only modified portions rather than the entire file, reducing network bandwidth usage. Version synchronization between the client and server utilizes a pull-push model: the client periodically queries the server for version status and pulls the difference data when a new version is found. After completing local edits, the client calculates the difference with the server version and pushes only the difference data. Conflict detection is performed during the push phase. The server checks whether the client's baseline version is the latest version. If not, the server requests the client to first pull the latest version and resolve the conflict. 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] Combining data sharing channels with collaborative editing functions enables an efficient collaborative mode for multiple users to work in parallel. Collaborative editing is based on the Distributed Operational Transformation (DOT) algorithm and supports multiple users editing different parts of the same project at the same time. The paged editing mechanism is the basis of collaborative editing, which breaks down a large wiring diagram project into multiple relatively independent pages, and different users can edit different pages at the same time. Page lock management is coordinated by a central server. When a user opens a page for editing, the server assigns the user an edit lock for the page. Other users can only view the page in read-only mode until the edit lock is released. For component-level collaborative editing within the same page, a component locking mechanism is adopted: when a user chooses to edit a component, the system assigns a component-level lock to the component. 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 baseline to identify potential conflicts. Conflict resolution strategies include automatic merging and manual resolution. For non-conflicting changes (such as changes to different component properties), the system automatically merges them. For conflicting changes (such as multiple users modifying the same property of the same component), the system prompts the user to choose which version to retain or manually merge. A change notification mechanism pushes real-time edit status updates to all relevant users, including lock status changes, component property changes, and version updates. This collaborative editing feature enables multiple users to work concurrently 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, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.< / diff> < / rule> < / connection> < / component> < / page> < / project>
Claims
1. A method for displaying and writing a high-resolution touch screen electrical wiring diagram, characterized in that: The method comprises: The graphics engine is constructed, and nodes are organized through a linked list structure. Each node contains time, state, logic and event information, and a graphics engine containing circuit breakers, isolating switches, mutual inductors and transformer components is obtained; Developing an editing system based on the graphic engine, obtaining a wiring diagram editing interface through the interaction of a toolbar, a property editing area, and a graphic editing area; Component parameters are configured according to the wiring diagram editing interface. If the distance between components is less than a preset threshold, the automatic adsorption function is triggered. The component parameter set is obtained by setting the static state and dynamic state attributes; Input the component parameter set into the parsing system for multi-level parsing, and locally refresh the changed area through a layered rendering strategy to obtain a display wiring diagram; The display wiring diagram is monitored for status, and through data collection and status determination, if the triggering conditions are met, the preset linkage rules are executed to obtain a dynamic wiring diagram reflecting the device status; The dynamic wiring diagram is imported into a storage system for persistence processing, and version difference data is recorded through structured description to obtain a data file that supports collaborative editing.
2. The method for displaying and writing a high-resolution touch screen electrical wiring diagram according to claim 1, characterized in that: The graphic engine is constructed by organizing nodes through a linked list structure, each node containing time, state, logic and event information, and obtaining a graphic engine containing circuit breakers, isolating switches, mutual inductors and transformer components, including: Design the underlying graphics module, and realize the drawing functions of basic graphics elements such as points, lines, and surfaces to obtain a basic graphics rendering module that supports rotation, scaling, and translation operations; Integrate the basic graphics rendering module with the core engine module, and obtain a graphics resource management system through resource management, dynamic rendering control and event response mechanism processing; Performing linked list node structuring processing on the graphic resource management system, and obtaining a node structure containing complete information of time, state, logic and event dimensions by defining node information dimensions and data structures; A standardized component library is constructed based on the node structure, and component definitions are described in XML format to obtain a standard component library including circuit breakers, isolating switches, mutual inductors, and transformer components; Managing the connection relationships of the components in the standard component library, identifying the spatial position relationship between the components through an endpoint matching algorithm, and obtaining a component connection rule library; The component connection rule library is integrated with a multi-level rendering mechanism, and a graphics engine is obtained by performing separate rendering processes of a static background layer and a dynamic foreground layer.
3. The method for displaying and writing a high-resolution touch screen electrical wiring diagram according to claim 1, characterized in that: The editing system is developed based on the graphics engine, and a wiring diagram editing interface is obtained through the interaction of the toolbar, the property editing area and the graphics editing area, including: Integrated multi-touch, recognizes user input through the touch event capture module, and obtains a positioning mechanism that maps touch coordinates to the display coordinate system; Based on the positioning mechanism, a toolbar module is developed to realize component selection through a click selection function, thereby obtaining a toolbar interface that provides an electrical component selection function; Associating the toolbar interface with the property editing module, and obtaining a property editing area that supports component size ratio, placement angle, associated component information, and display status settings by dividing the static property editing area into a dynamic property editing area; Integrate the attribute editing area and the graphic editing area module, and obtain the main operation area through drag and drop, connection and position adjustment operation support; The main operation area is equipped with an intelligent adsorption function. By calculating the spatial distance between components and comparing it with a preset threshold, an interactive mechanism is obtained to automatically adsorb to the correct position when the distance is less than the threshold. A preview area module is constructed based on the interactive mechanism, and a wiring diagram editing interface is obtained through real-time rendering and updated display processing.
4. The method for displaying and writing a high-resolution touch screen electrical wiring diagram according to claim 1, characterized in that: The component parameters are configured according to the wiring diagram editing interface. If the distance between the components is less than a preset threshold, the automatic adsorption function is triggered. By setting the static state and dynamic state attributes, the component parameter set is obtained, including: Design the component attribute structure and divide it into three categories: component type, static state and dynamic state to obtain the parameter structure framework; Implement static property editing based on the parameter structure framework, set the scaling ratio and angle parameters by direct input or slider control, and obtain the static state property configuration of the component; Integrate the static state attribute configuration and dynamic attribute editing, set the associated components, time widening and display switch parameters through drop-down selection or pop-up window mode, and obtain the dynamic state attribute configuration of the component; Performing parameter linkage processing on the static state attribute configuration and the dynamic state attribute configuration, and obtaining a consistency guarantee mechanism between the parameters by calculating the dependency relationship of the relevant parameters; The spatial relationship between components is calculated according to the consistency guarantee mechanism. The Euclidean distance between any two components is calculated and compared 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 to obtain accurate component spatial positioning; Parameter verification is performed based on the precise component spatial positioning, and a component parameter set is obtained by checking whether all parameter values are within a valid range and performing a correction algorithm on parameters that are out of range.
5. The method for displaying and writing a high-resolution touch screen electrical wiring diagram according to claim 1, characterized in that: The component parameter set is input into the parsing system for multi-level parsing, and the changed area is locally refreshed by a layered rendering strategy to obtain a display wiring diagram, including: Initialize the parsing engine and obtain the data structure ready for multi-level parsing by reading the component parameter set and establishing a memory mapping table; Performing a first-level analysis of the parameters based on the data structure, processing the static properties of the component and calculating the display coordinates and morphological features to obtain the basic display morphological data of the component; Performing a second-level analysis based on the basic display form data, processing the dynamic properties of the component and determining the state switching conditions and display rules to obtain the component's behavioral characteristic data; Inputting the behavioral characteristic data into the third-level analysis process, analyzing the positional relationship of connection points between components and constructing a connection topology diagram to obtain circuit topology data; Executing a layered rendering strategy on the circuit topology data, by dividing the electrical wiring diagram into four independent layers: a background layer, a static component layer, a dynamic component layer, and a foreground layer, and executing a rendering algorithm on each layer to generate a layer buffer, which are then sequentially synthesized into a final image to obtain a complete image; Based on the complete image, intelligent local refresh is implemented. By establishing an area change mapping table to record the coordinates of the rectangular area that has changed in each update, the difference between the area that currently needs to be refreshed and the area rendered last time is judged, and only the changed area is redrawn while keeping the cache of other areas unchanged, a display wiring diagram is obtained.
6. The method for displaying and writing a high-resolution touch screen electrical wiring diagram according to claim 1, characterized in that: The state monitoring of the display wiring diagram is performed, through data collection and state determination, and if the trigger condition is met, the preset linkage rule is executed to obtain a dynamic wiring diagram reflecting the device state, including: Build a data acquisition module, configure multiple communication protocol interfaces, and implement data verification, unit conversion, and outlier processing to obtain real-time device status data; Designing a status determination engine based on the real-time device status data to obtain the current status determination result of the device by comparing the collected data with a preset threshold and executing a multi-condition composite determination algorithm; Input the current state determination result of the device into the state cache mechanism for processing, and obtain the state record library by recording historical state data and calculating the state change trend; Constructing a trigger condition definition module based on the state record library, and obtaining a trigger condition set by setting a state change trigger, a threshold crossing trigger, and a time trigger; Developing a linkage rule engine based on the trigger condition set, by checking one by one whether the current state meets the conditions in the trigger condition set, extracting the corresponding linkage rules and performing multi-level linkage chain analysis if the conditions are met, to obtain a linkage operation sequence; The linkage operation sequence is converted into a display control command, and a dynamic wiring diagram reflecting the device status is obtained by setting the visual attributes of the components and recording all linkage events and execution results, wherein the visual attributes include color, flashing frequency and transparency.
7. The method for displaying and writing a high-resolution touch screen electrical wiring diagram according to claim 1, characterized in that: The method of importing the dynamic wiring diagram into a storage system for persistence processing and recording version difference data through structured description to obtain a data file supporting collaborative editing includes: Designing a file format specification, describing wiring diagram configuration information in XML structured form and establishing a five-layer hierarchical structure to obtain a standardized file format definition, wherein the five-layer hierarchical structure includes: a project information layer, a page information layer, a component information layer, a connection information layer, and a linkage rule layer; Implementing a persistent storage function based on the file format definition, performing data integrity checks and atomic write operations through a transaction processing mechanism, and obtaining a local storage mechanism that prevents data loss or damage; Integrate the local storage mechanism with the automatic backup function to obtain a secure storage system by regularly creating configuration file copies and maintaining a backup index table; Implementing a version management function on 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, to obtain an incremental storage data structure that only records the changed content; Develop a network transmission module based on the incremental storage data structure, securely transmit configuration files between multiple devices through an encrypted transmission protocol, and obtain a data sharing channel; The data sharing channel is combined with the collaborative editing function, and a page editing mechanism is used to allow multiple users to edit different pages at the same time. When it is detected that multiple users are editing the same component at the same time, a component locking and conflict resolution strategy is implemented to obtain a data file that supports collaborative editing.