Methods, systems, electronic equipment, and computer program products for 2D and 3D visualization of substation secondary systems
By constructing a two-dimensional and three-dimensional visualization method based on SPD configuration files, and utilizing file upload interfaces, asynchronous parsing queues, and globally unique device IDs, the system achieves the same-source linkage between two-dimensional loop topology and three-dimensional entity scene in the substation secondary system. This solves the problems of data fragmentation and low operation and maintenance efficiency, and reduces the cost of model iteration and update.
Patent Information
- Application Number
- CN202611272640.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-17
AI Technical Summary
The inability to link and interact between two-dimensional drawings and three-dimensional models of substation secondary systems leads to low operation and maintenance efficiency, severe data fragmentation, and high costs for model iteration and updates, making it difficult to adapt to substation technical transformation scenarios.
By constructing a two-dimensional and three-dimensional visualization implementation method based on SPD configuration files, and utilizing file upload interfaces, asynchronous parsing queues, database associations, and globally unique device IDs, the method achieves the same-source linkage between two-dimensional loop topology and three-dimensional entity scenes.
It achieves a unified database and globally unique device ID for 2D topology and 3D scene, solving the data fragmentation problem, improving operation and maintenance efficiency, and reducing the cost of model iteration and update.
Smart Images

Figure CN123115494A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of power system technology, and in particular relates to methods, systems, electronic devices and computer program products for realizing two-dimensional and three-dimensional visualization of substation secondary systems. Background Technology
[0002] The substation secondary system is a crucial component for the safe and stable operation of the power system. It contains numerous lightning protection SPDs (Special Purpose Devices), protection cabinets, communication boards, control cables, signal circuits, and grounding circuits. SPD configuration files (typically in standardized XML format) comprehensively record the physical installation and logical relationships of the entire substation, including bay division, cabinet layout, board configuration, cable connections, cable core allocation, secondary equipment parameters, and wiring circuits. This serves as the core source of data for lightning protection detection, secondary circuit maintenance, fault diagnosis, and digital twin modeling.
[0003] With the rapid development of smart grid and digital twin technologies, the operation and maintenance management of substation secondary systems is gradually evolving from traditional two-dimensional drawings and manual ledgers to visualization and digitalization.
[0004] In existing technologies, substation secondary systems are usually constructed independently based on two-dimensional drawings (or topology diagrams) and three-dimensional models, with different data sources and a lack of unified identification, which makes it impossible for the two to achieve linkage and interaction. Maintenance personnel need to switch between the two systems repeatedly for comparison, which seriously affects fault location and maintenance efficiency. Summary of the Invention
[0005] This application provides a method, system, electronic device, and computer program product for realizing 2D and 3D visualization of substation secondary systems. It solves the technical problem of how to achieve co-source linkage visualization between 2D loop topology and 3D physical scene in a substation secondary system based on SPD configuration files. It can be used for scenarios such as substation lightning protection SPD device detection, secondary loop maintenance, panel cabinet cable routing display, construction of a full-station digital twin scene, and 2D / 3D linkage operation and maintenance.
[0006] In a first aspect, embodiments of this application provide a method for implementing two-dimensional and three-dimensional visualization of a substation secondary system, including: S1: Receive the SPD configuration file of the substation through the file upload interface, perform format verification on the SPD configuration file, cache the files that pass the verification and generate a parsing task, and push the parsing task to the asynchronous parsing queue. S2: Obtain the parsing task from the asynchronous parsing queue, recursively traverse all business nodes of the SPD configuration file through the backend parsing engine, and extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data layer by layer; assign a globally unique device ID to each extracted cabinet, board, SPD device, cable, and loop; write the extracted business data and the corresponding globally unique device ID into the database according to the preset association relationship, wherein the cabinet data and the interval data are associated through the interval to which the cabinet belongs, the board data and the cabinet data are associated through the slot in the cabinet, the SPD device data and the board data are associated through the board binding relationship, the cable data is associated with the cabinet data through the starting cabinet ID and the ending cabinet ID, and the cable core and loop data is associated with the SPD device data through the loop ID; S3: In response to the front-end data correction operation, obtain the globally unique device ID and logic loop data corresponding to the cabinet, board, SPD device and cable stored in the database, supplement the three-dimensional spatial location data corresponding to each cabinet, board, SPD device and cable, and associate the supplemented three-dimensional spatial location data with the corresponding globally unique device ID to update the database; S4: In response to the data query request from the two-dimensional front end, obtain structured loop data containing the globally unique device ID of each device and the corresponding three-dimensional spatial location data from the database, automatically draw a two-dimensional loop topology containing cabinet elements, board elements, SPD elements and two-dimensional connecting lines based on the structured loop data, and bind the corresponding globally unique device ID to each drawn element. S5: In response to the modeling data retrieval request from the 3D client, obtain the 3D spatial modeling dataset containing the globally unique device ID of each device and the corresponding logical loop data from the database, match the standardized 3D model library according to the 3D spatial modeling dataset, automatically instantiate the cabinet, board and SPD components according to the hierarchical coordinates, and automatically generate 3D cable entities according to the cable parameters, and bind the corresponding globally unique device ID to each instantiated 3D entity. S6: In response to a trigger operation on a target primitive in a two-dimensional loop topology, obtain the globally unique device ID bound to the target primitive, and send the globally unique device ID to the three-dimensional client. The three-dimensional client locates and highlights the corresponding three-dimensional entity based on the received globally unique device ID. In response to a trigger operation on a target three-dimensional entity in a three-dimensional scene, obtain the globally unique device ID bound to the target three-dimensional entity, and send the globally unique device ID to the two-dimensional front end. The two-dimensional front end locates and highlights the corresponding primitive based on the received globally unique device ID.
[0007] The technical advantages of this application are as follows: By constructing a workflow scheme from file parsing, database association, coordinate supplementation, 2D rendering, 3D modeling to bidirectional linkage, it enables 2D topology and 3D scene to share a unified database and globally unique device ID, fundamentally solving the technical problems of data fragmentation and lack of interactive linkage between 2D and 3D. S1-S2 construct a shared structured relational database for 2D and 3D, eliminating human error; S2 assigns globally unique device IDs, establishing an identity foundation for cross-platform mapping; S3 integrates logical data with spatial coordinates, enabling spatial mapping between 2D and 3D; S4-S5 drive 2D topology rendering and 3D entity instantiation from the same data source, binding the same ID to primitives and entities, establishing a one-to-one correspondence in the display layer; S6 achieves bidirectional communication based on IDs, enabling the linkage effect of clicking on 2D primitives to locate 3D entities and clicking on 3D entities to retrieve 2D primitives. Each step is interconnected and progressively advances, jointly solving the single core technical problem of "data fragmentation and lack of linkage," thus improving operational efficiency.
[0008] In one embodiment of the first aspect, step S2, which involves the layered extraction of interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data, includes: Extract the interval number, voltage level, interval name, and associated bus as the interval data; Extract the cabinet number, cabinet type, cabinet size, and slot level as the cabinet data; Extract the board model, slot number, and terminal block number as the board data; Extract the model number, continuous operating voltage, protection level, and installation location of the SPD device as the SPD device data; Extract the cable number, cable specifications, starting cabinet ID, ending cabinet ID, and laying path as the cable data; Extract the core wire number, terminal numbers at both ends, loop number, and loop function as the cable core and loop data.
[0009] The technical effect of this embodiment is that it limits the specific fields of multiple types of business data, making the parsing results more granular and comprehensive, and ensuring that the associated information stored in the database fully supports the drawing of two-dimensional lines and the generation of three-dimensional cables.
[0010] In one embodiment of the first aspect, in step S2, the preset association relationship is established by establishing a foreign key association through the cabinet ID in the cabinet data, the device ID in the SPD device data, and the loop ID in the cable core and loop data.
[0011] In one embodiment of the first aspect, the three-dimensional spatial location data includes the world coordinates of the cabinet in the main control room, the relative installation coordinates of the SPD devices and boards in the cabinet, and cable routing parameters.
[0012] In one embodiment of the first aspect, in step S4, the two-dimensional connecting line is drawn with differentiated line colors according to the loop function type in the cable core and loop data, with power loop, signal loop and SPD grounding lightning protection loop corresponding to different colors respectively; When the mouse hover operation is triggered on the two-dimensional loop topology, a floating information label is displayed that corresponds to the device number, SPD lightning protection parameters, cable core number, and loop purpose of the globally unique device ID bound to the element.
[0013] In one embodiment of the first aspect, in step S5, the types of three-dimensional models built into the standardized three-dimensional model library include: cabinet model, various models of SPD surge protectors, communication board model, terminal block model, circuit breaker model, cable tray model, and cable prefabrication model. The step of matching a standardized 3D model library based on the 3D spatial modeling dataset includes: Based on the globally unique device ID and corresponding device model of each device in the database, the corresponding 3D model is matched from the standardized 3D model library; The instantiation of cabinets, boards, and SPD components according to hierarchical coordinates includes: The cabinet body is generated based on the world coordinates of the main control room of the cabinet in the three-dimensional spatial modeling dataset. The corresponding board model and SPD device model are generated inside the cabinet body based on the relative installation coordinates of the boards and SPD devices inside the cabinet. The automatic generation of a three-dimensional cable entity based on cable parameters includes: The three-dimensional spatial coordinates and laying path parameters corresponding to the terminals at both ends of the cable core in the cable core and circuit data are read to generate a continuous three-dimensional cable model, and the two ends of the three-dimensional cable model are respectively attached to the corresponding terminal three-dimensional models.
[0014] In one embodiment of the first aspect, step S1, which involves performing format validation on the SPD configuration file, caching the validated files and generating a parsing task, and pushing the parsing task to an asynchronous parsing queue, includes: Verify the validity of the file extension, XML root node, and SPD lightning protection standard node of the SPD configuration file; If the verification passes, the SPD configuration file is cached in a temporary storage directory, and the parsing task is pushed to the asynchronous parsing queue.
[0015] Secondly, embodiments of this application also provide a two-dimensional and three-dimensional visualization system for substation secondary systems, comprising: The file access and upload module is used to receive SPD configuration files and perform format verification, cache files that pass verification and generate parsing tasks, and push the parsing tasks to the asynchronous parsing queue. The backend parsing service module is used to obtain the parsing task from the asynchronous parsing queue, recursively traverse all business nodes of the SPD configuration file through the parsing engine, extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data in layers, assign a globally unique device ID to each extracted cabinet, board, SPD device, cable and loop, and write the extracted business data and the corresponding globally unique device ID into the database according to the preset association relationship; The database persistence module is used to uniformly store the various business data, the corresponding globally unique device IDs, and the three-dimensional spatial location data, serving as the sole data source for the two-dimensional front-end and the three-dimensional client. The two-dimensional visualization module is used to obtain structured loop data containing the globally unique device ID of each device from the database persistence module, automatically draw a two-dimensional loop topology including cabinet elements, board elements, SPD elements and two-dimensional connection lines, and bind the corresponding globally unique device ID to each drawn element. The 3D rendering client module is used to obtain a 3D spatial modeling dataset containing the globally unique device ID of each device from the database persistence module, match it with the built-in standardized 3D model library, automatically instantiate cabinets, boards and SPD components according to hierarchical coordinates, and automatically generate 3D cable entities according to cable parameters, and bind the corresponding globally unique device ID to each instantiated 3D entity. The linkage and interaction module is used to respond to the triggering operation of the graphic elements in the two-dimensional loop topology, obtain the corresponding globally unique device ID and send it to the three-dimensional client to locate and highlight the corresponding three-dimensional entity, and respond to the triggering operation of the entity in the three-dimensional scene, obtain the corresponding globally unique device ID and send it to the two-dimensional front end to locate and highlight the corresponding graphic element.
[0016] Thirdly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.
[0017] Fourthly, this application also provides a computer program product, which stores a computer program, and when the computer program is executed by an electronic device, it performs the method described in the first aspect above.
[0018] For the technical effects of the second to fourth aspects mentioned above, please refer to the description of the technical effects of the first aspect of the above-mentioned method for realizing two-dimensional and three-dimensional visualization of substation secondary systems, which will not be repeated here. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating an embodiment of a two-dimensional or three-dimensional visualization method for a substation secondary system provided in this application; Figure 2 A schematic diagram of a Vue front-end interface provided for an embodiment of this application; Figure 3 This application provides a 3D automatically generated rendering of a substation main control room cabinet scene. Figure 4 This application provides a structural block diagram of an embodiment of a two-dimensional visualization implementation system for a substation secondary system. Detailed Implementation
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0022] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0023] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0024] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), unless otherwise expressly and specifically defined.
[0025] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0027] It should be noted that currently, the industry mainly uses the following methods to implement the design and operation and maintenance management of substation secondary systems: (1) Two-dimensional design method based on CAD drawings: Designers use computer-aided design (CAD) software to draw the cabinet layout diagram, cable list and circuit wiring diagram of the substation secondary system, and deliver them to the operation and maintenance unit in the form of static drawings. During actual maintenance and troubleshooting, operation and maintenance personnel obtain circuit information and equipment connection relationships by referring to paper or electronic CAD drawings.
[0028] (2) Single-point data reading method based on power special tools: Some power operation and maintenance tools support reading a single lightning protection parameter or single device information in the SPD configuration file, but lack the ability to systematically parse the entire configuration file in batches. The data reading operation depends on manual execution one by one.
[0029] (3) Manual modeling of cabinets based on 3D modeling software: In the field of digital twins, some substations have tried to use 3D modeling software (such as 3ds Max, Blender, etc.) or 3D configuration platforms (such as Unity, Unreal Engine, etc.) to manually build cabinet models. The modelers manually drag and drop to generate cabinets, components and cables based on on-site photos or design drawings.
[0030] (4) Web-based two-dimensional loop display method: Some Web visualization platforms support embedding CAD drawings or loop data into web pages as static images or simple graphics for maintenance personnel to browse online.
[0031] The aforementioned existing technical solutions have the following prominent defects in practical applications, and these defects are precisely the technical problems that this invention aims to solve: Defect 1: The SPD configuration file lacks a standardized automatic parsing process, and data extraction heavily relies on manual operation. Existing power operation and maintenance tools only support reading single lightning protection parameters or single device information (such as the model and continuous operating voltage of a single SPD) from SPD configuration files. They lack an automated parsing architecture based on a standardized file upload interface, making it impossible to batch parse all business nodes in XML-formatted SPD configuration files. In actual projects, maintenance personnel still need to manually extract interval information, cabinet parameters, cable details, core wire allocation, and circuit relationships line by line and manually enter them into the ledger system or database. This manual processing method suffers from serious problems such as data errors, omissions, and lost circuit relationships (e.g., reversing the starting and ending cabinet records of cables, or omitting the core wire number of a certain SPD grounding circuit). The parsed data cannot be automatically stored in the database to form a standardized relational data table, leading to a break in upstream and downstream wiring logic and severely restricting the availability of data for subsequent visualization. The root cause is that existing technology lacks a complete automated data link of "file reception → format verification → asynchronous parsing → structured database entry," making it impossible to achieve fully automated conversion of SPD configuration files from raw files to database relational records.
[0032] Defect 2: Data separation between 2D and 3D visualization systems prevents interactive linkage. In existing technical solutions, 2D drawing systems and 3D model systems are typically two independent systems, each using different data sources and storage methods. The web-based 2D interface can only statically import CAD drawings or fix graphics on a canvas, lacking the dynamic rendering capability driven by SPD source file data and unable to automatically update the topology structure based on configuration file changes. 3D cabinet models rely on manual drag-and-drop construction in 3D software; cable routing and terminal connections must be manually drawn one by one, making the modeling process completely disconnected from SPD configuration data. More critically, there is a lack of unified, globally unique identification and mapping mechanisms between the elements in the 2D system and the models in the 3D system. When maintenance personnel click on a device on the 2D circuit diagram, they cannot locate the corresponding actual device model in the 3D scene; similarly, when selecting a physical device in the 3D scene, they cannot retrieve its corresponding wiring element on the 2D drawing. This fragmented state of 2D and 3D data sources forces maintenance personnel to repeatedly switch between the two systems and manually compare data, severely impacting the efficiency of fault location and lightning protection verification.
[0033] Defect 3: Poor 3D scene rendering; lack of display of internal details and circuit connections within the cabinet. In existing 3D modeling solutions, manual modeling can only display the external outline of the cabinet, failing to fully reproduce crucial details such as the one-to-one correspondence between cable cores and terminals recorded in the SPD configuration file, the detailed routing of cross-screen interconnection cables, and the complete path of the SPD's dedicated grounding circuit. Information such as cable routing paths, core numbering, and lightning protection circuit coupling relationships are completely lost in the 3D model. The screen display is limited to the cabinet exterior and a few visible devices; the internal board layout, SPD installation locations, and terminal block wiring relationships cannot be intuitively presented. Maintenance personnel cannot view the complete wiring chain using such 3D models. When lightning overvoltage or secondary equipment failure occurs, it is difficult to quickly trace the faulty circuit, severely impacting the efficiency of lightning protection verification and equipment maintenance.
[0034] Defect 4: High cost of model iteration and updates, making it difficult to adapt to substation technical transformation scenarios. Substations frequently undergo technical changes during operation, including renovations, expansions, SPD device replacements, and secondary circuit modifications. Each change generates a new SPD configuration file to reflect the actual site conditions. Under current technological conditions, after a new file is generated, the system requires personnel to re-analyze the data, manually update 2D ledgers and drawings, and 3D modelers to readjust or rebuild the 3D cable model. The entire process can take several days to weeks. The root cause is the lack of a unified data transfer and synchronization mechanism between the backend analysis system, the 2D frontend display platform, and the 3D engine. Data synchronization relies on manually exporting and importing Excel files or intermediate tables, making it impossible to effectively guarantee data consistency between systems. This high-cost iterative model makes it difficult to update the digital twin model in a timely manner, often lagging behind actual changes on-site and gradually losing its reference value.
[0035] Example 1 Firstly, to address the aforementioned technical deficiencies, this application provides a method for realizing two-dimensional and three-dimensional visualization of a substation secondary system. This method, based on the same data source driving the two-dimensional topology and three-dimensional scene, achieves a unified and interconnected display of the lightning protection circuits and cabinet connections of the secondary system. (Reference) Figure 1 This method, from file access, backend parsing, database storage, 2D rendering, 3D modeling to final bidirectional linkage, includes the following steps S1 to S6: Step S1 (SPD configuration file upload and parsing task generation): Receive the SPD configuration file from the substation through the file upload interface, perform format verification on the SPD configuration file, cache the verified files and generate a parsing task, and push the parsing task to the asynchronous parsing queue.
[0036] For example, this step builds a standardized file upload interface based on the Spring Boot framework; operations and maintenance personnel can access it through the Vue front-end interface (see reference). Figure 2 Select the standard XML format SPD lightning protection configuration file and upload it to the backend via MultipartFile. Upon receiving the file, the backend immediately performs format validation; this validation includes at least: verifying that the file extension is ".xml", verifying that the root node of the XML document conforms to the SPD standard specification, and verifying the existence of the SPD lightning protection standard core node. Only if all three validations pass is the file considered compliant. For files that fail validation, the system returns an error log to the Vue frontend in real time, including the specific error reason (such as "missing SPD lightning protection standard node" or "invalid file extension"). After successful verification, the system caches the SPD configuration file in a temporary storage directory (which can be located on the server or on the local device) and generates a parsing task containing the file name, upload time, and substation identifier. This parsing task is pushed to the backend asynchronous parsing queue, and its parsing status is marked as "pending parsing". The Vue frontend can display the parsing progress of this task in real time through a polling interface, such as "pending parsing", "parsing in progress", "parsing completed", or "parsing failed".
[0037] Step S2 (Hierarchical parsing and data import of SPD configuration file): Obtain the parsing task from the asynchronous parsing queue, recursively traverse all business nodes of the SPD configuration file through the backend parsing engine, and extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data hierarchically; assign a globally unique device ID to each extracted cabinet, board, SPD device, cable, and loop; and write the extracted business data and the corresponding globally unique device ID into the database according to the preset association relationship.
[0038] Specifically, the backend integrates the DOM4J XML parsing engine, which consumes parsing tasks from an asynchronous queue. This engine recursively traverses all business nodes in the SPD configuration file and performs layered extraction.
[0039] In a preferred embodiment of the present invention, the specific fields extracted in the hierarchical manner include: Extract the interval number, voltage level, interval name, and associated bus as the interval data; Extract the cabinet number, cabinet type (such as protection cabinet, monitoring and control cabinet or SPD lightning protection cabinet), cabinet dimensions (length, width and height) and slot level as the cabinet data; Extract the board model, slot number, and terminal block number as the board data; Extract the model number, continuous operating voltage, protection level, and installation location of the SPD device as the SPD device data; Extract the cable number, cable specifications, starting cabinet ID, ending cabinet ID, and laying path as the cable data; Extract the core wire number, terminal numbers at both ends, loop number, and loop function as the cable core and loop data.
[0040] The above extraction process completely preserves the original wiring logic in the SPD file; While extracting the above types of data, the system assigns a globally unique device ID (GUID) to each extracted cabinet, board, SPD device, cable, and secondary circuit. This ID serves as the unique identifier of the device or logical entity in the entire system.
[0041] Subsequently, the system writes the extracted business data and corresponding globally unique device IDs into a database according to a preset association relationship. This database is a relational database (e.g., MySQL). In one specific implementation of this invention, the preset association relationship is established using foreign keys: the cabinet ID in the cabinet data, the device ID in the SPD device data, and the loop ID in the cable core and loop data. Specifically, interval data is written to the interval information table, cabinet data to the cabinet basic table, board data to the board information table, SPD device data to the SPD device ledger table, cable data to the cable master information table, and cable core and loop data to the cable core details table and the secondary loop association table. Forced associations are established between the data tables through foreign keys (such as cabinet ID, device ID, and loop ID), thereby completely restoring the complex topological relationships between intervals and cabinets, cabinets and boards, boards and SPD devices, cabinets and cables, and loops and SPD devices at the database level.
[0042] Step S3 (Data Correction and 3D Spatial Location Supplement): In response to the front-end data correction operation, obtain the globally unique device ID and logic loop data corresponding to the cabinet, board, SPD device and cable stored in the database, supplement the 3D spatial location data corresponding to each cabinet, board, SPD device and cable, and associate the supplemented 3D spatial location data with the corresponding globally unique device ID to update the database. This step is understandably crucial for connecting logical data with 3D spatial data. Since the original SPD configuration file typically doesn't include the physical coordinates of the devices in the control room or their relative installation coordinates within the cabinet, it needs to be supplemented through front-end interaction. The Vue front-end retrieves the globally unique IDs and logical loop data of the cabinets, boards, SPD devices, and cables stored in the database by calling the full CRUD RESTful interface provided by the back-end. Maintenance personnel then input or import 3D spatial location data into the Vue front-end interface based on the actual site layout. In a preferred embodiment of the present invention, the three-dimensional spatial location data includes the world coordinates (X, Y, Z) of the cabinet in the main control room, the relative installation coordinates (x, y, z) of the SPD devices and boards within the cabinet, and cable routing parameters (such as the coordinates of the cable tray inflection points). After data entry, the system associates this three-dimensional spatial location data with the corresponding globally unique device ID and updates the MySQL database. Thus, a unified and complete dataset of "logical loop data + three-dimensional spatial location data" is formed in the database, providing a unified data source for subsequent two-dimensional and three-dimensional rendering.
[0043] Step S4 (Automatic rendering of 2D loop topology): In response to the data query request from the 2D front end, the structured loop data containing the globally unique device ID of each device and the corresponding 3D spatial location data are obtained from the database. Based on the structured loop data, the 2D loop topology containing cabinet elements, board elements, SPD elements and 2D connecting lines is automatically drawn, and the corresponding globally unique device ID is bound to each drawn element.
[0044] As an example, the Vue 2D frontend calls the lightweight data distribution interface provided by the Spring Boot backend via an HTTP request to obtain structured loop data for a specific interval or cabinet. This data contains the globally unique ID of each device and its logical relationships. The Vue frontend can use HTML5 Canvas or SVG technology to automatically draw the 2D loop topology on the canvas. After drawing, each drawn primitive (including cabinets, boards, and SPD devices) is bound to its corresponding globally unique device ID in memory. In a preferred embodiment of the present invention, the two-dimensional connecting lines are drawn with differentiated line colors according to the loop function type in the cable core and loop data. Power loops, signal loops, and SPD grounding and lightning protection loops correspond to different colors (e.g., red, blue, and yellow). When the two-dimensional loop topology is triggered by a mouse hover operation, the system captures the hover event and retrieves the device number, SPD lightning protection parameters, cable core number, and loop purpose corresponding to the globally unique device ID bound to the element, either by calling the backend interface or from the local cache. This information is then displayed on the canvas as a floating information label.
[0045] Step S5 (Automatic Modeling and Entity Generation of 3D Scene): In response to the modeling data retrieval request from the 3D client, obtain the 3D spatial modeling dataset containing the globally unique device ID of each device and the corresponding logical loop data from the database. Match the standardized 3D model library according to the 3D spatial modeling dataset, automatically instantiate the cabinet, board and SPD components according to the hierarchical coordinates, and automatically generate 3D cable entities according to the cable parameters. Bind the corresponding globally unique device ID to each instantiated 3D entity.
[0046] As an example, after the Unreal Engine (UE) 3D client starts, it establishes an HTTP / TCP dual-link connection with the Spring Boot backend. The UE client sends a modeling data pull request to the backend to obtain a 3D spatial modeling dataset containing the globally unique IDs of each device. This dataset includes, but is not limited to: the world coordinates of the control room of the cabinet, the cabinet size, the relative installation coordinates of the boards / SPD devices inside the cabinet, the coordinates of the cable start and end points, and the wiring path parameters.
[0047] As a preferred embodiment of the present invention, the types of three-dimensional models built into the standardized three-dimensional model library include: cabinet models, SPD surge protector models of various models, communication board models, terminal block models, circuit breaker models, cable tray models, and cable prefabrication models.
[0048] The step of matching the standardized 3D model library based on the 3D spatial modeling dataset may specifically include: hashing and matching the corresponding 3D mesh resources from the standardized 3D model library based on the globally unique device ID and corresponding device model (such as SPD model, board model) of each device in the database.
[0049] Accordingly, the step of instantiating the cabinet, boards, and SPD components according to hierarchical coordinates can specifically include: generating the cabinet body based on the world coordinates of the cabinet's main control room in the 3D spatial modeling dataset; and generating corresponding board models and SPD device models inside the cabinet body based on the relative installation coordinates of the boards and SPD devices within the cabinet. This process completely replicates the actual slot layout of the cabinet on-site.
[0050] Accordingly, the step of automatically generating a three-dimensional cable entity based on cable parameters can specifically include: reading the three-dimensional spatial coordinates and laying path parameters corresponding to the terminals at both ends of the cable core in the cable core and loop data; generating a smooth and continuous three-dimensional cable model based on Catmull-Rom spline curve or Bézier curve algorithms; and attaching both ends of the three-dimensional cable model to the corresponding terminal three-dimensional models to achieve precise connection between the cable and the terminals. Finally, a globally unique device ID is bound to each instantiated cabinet, board, SPD, and cable entity.
[0051] Step S6 (Two-dimensional and three-dimensional bidirectional linkage interaction): In response to a trigger operation on a target primitive in the two-dimensional loop topology, obtain the globally unique device ID bound to the target primitive, and send the globally unique device ID to the three-dimensional client. The three-dimensional client locates and highlights the corresponding three-dimensional entity based on the received globally unique device ID. In response to a trigger operation on a target three-dimensional entity in the three-dimensional scene, obtain the globally unique device ID bound to the target three-dimensional entity, and send the globally unique device ID to the two-dimensional front end. The two-dimensional front end locates and highlights the corresponding primitive based on the received globally unique device ID.
[0052] In this embodiment, when an operations and maintenance personnel click on a cabinet element or cable connection on the Vue 2D canvas, the front-end JavaScript captures the click event, reads the globally unique ID bound to the element, and sends the ID to the back-end via WebSocket or HTTP interface. The back-end then pushes the ID to the UE 3D client. After receiving the ID, the UE client traverses its scene tree (World Outliner) to search for 3D entities bound to the same ID. Once found, it controls the virtual camera to smoothly focus (Zoom To) on the entity and triggers its material highlighting or flashing effects. Conversely, when an operations and maintenance personnel click on a physical device in the UE's 3D scene, the UE client captures the click event, obtains the globally unique ID bound to that entity, and sends this ID to the backend via a TCP link. The backend then forwards it to the Vue frontend. Upon receiving the ID, the Vue frontend refers to... Figure 3The system searches for elements bound to the same ID on a two-dimensional canvas, centers them, changes their border color, or adds pulsating animations, thereby achieving precise positioning from three-dimensional to two-dimensional. This completes the entire process of two-dimensional and three-dimensional bidirectional interactive linkage based on a globally unique device ID.
[0053] For example, refer to Figure 3 , Figure 3 The system automatically generates 3D renderings of substation main control room cabinets for Unreal Engine; it displays 3D cabinets of multi-faceted protection screens and SPD lightning protection screens, automatically arranges SPDs, communication boards, and terminal modules within the screens, shows complete 3D cable routing across screens, and highlights floating information tags for selected devices.
[0054] Furthermore, as an extension of the method of this invention, when a substation undergoes renovation or expansion, SPD device replacement, or secondary circuit modification, a new version of the SPD configuration file will be generated. At this time, simply repeat steps S1 and S2 above, i.e., re-upload and parse the new file into the database. Since both the Vue 2D front-end and the UE 3D client pull the latest data from the MySQL database in real time, after the file is re-parsed, the 2D front-end can refresh the canvas using the "one-click reload" function, and the UE client can re-instantiate all devices and cables using the "reload scene" command. The entire process requires no manual modification of the 2D drawings or 3D model, enabling rapid iterative updates of the model and effectively reducing operation and maintenance costs.
[0055] The technical advantages of this application's embodiments are as follows: First, steps S1 and S2 recursively traverse and extract layer by layer from the SPD configuration file using a backend asynchronous parsing engine, and establish foreign key associations in the database. This solves the problems of errors and loop breaks caused by manual copying in the original technical solution, directly resulting in the generation of a complete and logically rigorous core dataset. Second, step S3 supplements the dataset with three-dimensional spatial coordinates, ensuring that the same set of data simultaneously possesses logical connection relationships and physical spatial attributes, laying a unique foundation for subsequent accurate mapping between two-dimensional and three-dimensional data. Based on this, steps S4 and S5 extract data from this unified database. Since both use the exact same globally unique device ID and association relationship, the two-dimensional topology rendered in step S4 and the three-dimensional scene generated in step S5 are necessarily completely consistent with the SPD source file in terms of device type, quantity, and connection relationship, achieving a "same source" effect from the source. Finally, step S6 uses the globally unique device ID bound to each primitive and entity in the above steps as "signaling" to achieve precise control of the three-dimensional scene by two-dimensional operations and reverse retrieval of the two-dimensional image by three-dimensional operations. This two-way linkage effect cannot be achieved simply by adding communication interfaces; it requires a unified ID identification system established in steps S2 to S5 that spans the entire data lifecycle. In summary, this method, through constructing a closed-loop solution encompassing file parsing, data association, coordinate completion, 2D / 3D source rendering, and two-way linkage, significantly improves the operational efficiency and data consistency of the substation's secondary system lightning protection circuits and cabinet connections. This effect is unattainable by the sum of the functions of each individual step, demonstrating outstanding substantive features and significant progress.
[0056] Example 2 Secondly, this embodiment provides a two-dimensional and three-dimensional visualization system for substation secondary systems, which is used to execute the methods described in Embodiment 1 and its preferred embodiments. For example... Figure 4 The system adopts a five-layer architecture with front-end and back-end separation and dual 2D and 3D rendering engines. Real-time data interaction and synchronization between layers are achieved through RESTful interfaces, database connections, and WebSocket / HTTP bidirectional communication. The system includes: a file access and upload module 01, a back-end parsing service module 02, a database persistence module 03, a 2D visualization module 04, a 3D rendering client module 05, and a linkage and interaction module 06.
[0057] The file access and upload module 01 is used to receive the SPD configuration file and perform format verification, cache the verified files and generate a parsing task, and push the parsing task to the asynchronous parsing queue.
[0058] Specifically, this module is built on the MultipartFile interface of the Spring Boot framework, providing web-based single file upload and batch compressed file upload functionality. The front-end interface provides components for file selection, drag-and-drop upload, and upload progress display (see [link]). Figure 2 This module integrates an XML format validation engine, performing triple validation on uploaded files: verifying if the file extension is ".xml"; verifying if the root node of the XML document conforms to the SPD configuration file standard specification; and verifying the presence of SPD lightning protection standard core nodes (such as...). <spdprotection> 、 <surgeprotectivedevice>(etc.). For files that fail validation, the module returns an error log containing the specific reason for the error to the front end in real time; for files that pass validation, the module caches them in the server's temporary storage directory and generates a parsing task containing the file name, upload time, substation identifier, and parsing status (initially "pending parsing"), and then pushes the task to the asynchronous parsing queue.
[0059] This module also includes an asynchronous parsing task management submodule, which uses multi-threaded asynchronous queue technology to record the status transitions of each parsing task (pending parsing → parsing in progress → parsing completed / parsing failed). The Vue frontend can display the parsing progress of each task in real time by calling the status query interface provided by this module. For tasks that fail to be parsed, this module outputs detailed logs of missing fields or abnormal nodes and supports one-click re-upload parsing.
[0060] The backend parsing service module 02 is used to obtain the parsing task from the asynchronous parsing queue, recursively traverse all business nodes of the SPD configuration file through the parsing engine, extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data in layers, assign a globally unique device ID to each extracted cabinet, board, SPD device, cable and loop, and write each extracted business data and the corresponding globally unique device ID into the database according to the preset association relationship.
[0061] Specifically, this module is the core backend service layer of the system, which integrates the DOM4J XML parsing engine. This engine consumes parsing tasks from an asynchronous parsing queue and recursively traverses all business nodes of the SPD configuration file using a depth-first traversal algorithm.
[0062] In a preferred embodiment of the present invention, the layered extraction includes: extracting the interval number, voltage level, interval name, and associated busbar as the interval data; extracting the cabinet number, cabinet type, cabinet size, and slot level as the cabinet data; extracting the board model, slot number, and terminal block number as the board data; extracting the SPD device model, continuous operating voltage, protection level, and installation location as the SPD device data; extracting the cable number, cable specification, starting cabinet ID, ending cabinet ID, and laying path as the cable data; and extracting the core wire number, terminal numbers at both ends, loop number, and loop function as the cable core and loop data. During the extraction process, this module calls a globally unique ID generator (such as one based on the Snowflake algorithm or UUID) for each extracted business entity (cabinet, board, SPD device, cable, loop) to assign a globally unique device ID. Subsequently, this module uses a persistence layer framework such as JDBC or MyBatis to write the extracted business data and the corresponding globally unique device IDs into the database according to a preset association relationship.
[0063] In a preferred embodiment of the present invention, the preset association relationship is established through foreign key associations using the cabinet ID in the cabinet data, the device ID in the SPD device data, and the loop ID in the cable core and loop data. Specifically, the primary key (interval ID) of the interval information table is used as a foreign key to associate with the cabinet base table; the primary key (cabinet ID) of the cabinet base table is used as a foreign key to associate with the board information table and the cable master information table; the primary key (board ID) of the board information table is used as a foreign key to associate with the SPD device ledger table; the primary key (cable ID) of the cable master information table is used as a foreign key to associate with the cable core details table; and the secondary loop association table is associated with the SPD device ledger table and the cable core details table through the loop ID.
[0064] In addition, this backend parsing service module can also include a data verification and business maintenance sub-module. After parsing, this sub-module automatically performs data integrity verification, including but not limited to: verifying loop terminal matching (i.e., whether both ends of the loop have valid terminals), verifying cable start and end cabinet logic (i.e., whether both the starting and ending cabinets exist in the cabinet table), and verifying SPD slot installation conflicts (i.e., whether the same slot is occupied by multiple devices). For abnormal data detected during verification, this sub-module marks it and pushes it to the Vue frontend for display and notification. Simultaneously, this sub-module provides a full CRUDRESTful interface, supporting manual addition of missing spatial coordinates, correction of SPD lightning protection parameters, and addition or deletion of loop records by the frontend; all modifications are synchronized to the database in real time. This module also provides dedicated data query interfaces (lightweight data distribution interfaces) for both the 2D frontend and 3D clients, returning topology drawing data or 3D modeling coordinate data as needed to reduce network transmission redundancy.
[0065] The database persistence module 03 is used to uniformly store the various business data, the corresponding globally unique device IDs, and the three-dimensional spatial location data, serving as the sole data source for both the two-dimensional front-end and the three-dimensional client.
[0066] Specifically, this module is implemented using a MySQL relational database. The pre-created data tables in this module include, but are not limited to: a bay information table (storing bay ID, bay number, voltage level, bay name, and associated busbar), a cabinet basic table (storing cabinet ID, cabinet number, cabinet type, cabinet dimensions (length, width, and height), main control room world coordinates (X / Y / Z), and slot level (JSON)), a board information table (storing board ID, board model, slot number, terminal block number, and associated cabinet ID), an SPD equipment ledger table (storing device ID, model, continuous operating voltage, protection level, installation location, material code, and associated board ID), a cable master information table (storing cable ID, cable number, cable specifications, starting cabinet ID, ending cabinet ID, laying path parameters (JSON), and cable purpose), a cable core details table (storing core wire ID, core wire number, associated cable ID, and terminal numbers at both ends), and a secondary circuit association table (storing circuit ID, circuit number, circuit function, associated device ID, and SPD grounding circuit binding identifier).
[0067] This database persistence module handles three main functions: data persistence, bidirectional synchronization, and index optimization. For persistence, it stores the original parsed fields of the SPD (Surface Mount Device), manually entered world coordinates of the cabinet, relative coordinates within the board / SPD screen, 2D model mapping IDs, cable routing parameters, and loop relationships. For bidirectional synchronization, after the Spring Boot backend modifies data through this module, the Vue 2D frontend and UE 3D client obtain the latest dataset via real-time retrieval or WebSocket push. When a new version of the SPD file is re-parsed and loaded into the database, the 2D and 3D scenes can reload the latest data with a single click through this module. For index optimization, this module establishes a multi-field composite index using cabinet ID, loop ID, and cable ID, significantly improving the response speed for batch queries of loops and cables during 3D rendering.
[0068] In a preferred embodiment of the present invention, the three-dimensional spatial location data includes the world coordinates of the cabinet in the main control room, the relative installation coordinates of the SPD devices and boards within the cabinet, and cable routing parameters. This data is entered by the front end and then written to this module via a RESTful interface.
[0069] The two-dimensional visualization module 04 is used to obtain structured loop data containing the globally unique device ID of each device from the database persistence module, automatically draw a two-dimensional loop topology including cabinet elements, board elements, SPD elements and two-dimensional connecting lines, and bind the corresponding globally unique device ID to each drawn element.
[0070] As an example, this module is implemented based on the Vue front-end framework and HTML5 Canvas / SVG technology; this 2D visualization module 04 can contain the following core sub-modules: Hierarchical Tree Navigation Submodule: This submodule automatically generates a hierarchical tree directory on the left side of the page, displaying the complete logical hierarchy of "Substation → Voltage Level → Bay → Panel → Board → SPD Equipment / Cable / Secondary Circuit," completely replicating the original logical structure of the SPD configuration file. This submodule also provides a fuzzy search function, supporting keyword searches by circuit number, cable number, or SPD model. When the user selects a node in the tree directory, this submodule automatically filters the corresponding data on the canvas, displaying only that node and its subordinate devices.
[0071] The 2D topology rendering submodule retrieves structured loop data containing globally unique IDs for each device from the persistent database module. It automatically draws the outline of the 2D cabinet on the canvas and, according to the slot hierarchy information in the cabinet data, sequentially arranges board elements, SPD elements, and terminal block elements within the cabinet elements. Simultaneously, this submodule reads the terminal association data at both ends of the cable core and generates smooth 2D connection lines on the canvas.
[0072] In a preferred embodiment of the present invention, the two-dimensional connection lines are drawn with differentiated line colors according to the loop function type in the cable core and loop data, wherein power loops, signal loops, and SPD grounding and lightning protection loops correspond to different colors (such as red, blue, and yellow). When the two-dimensional loop topology is triggered by a mouse hover operation, this submodule captures the hover event, obtains the globally unique device ID bound to the graphic element, and calls the backend interface or reads the corresponding device number, SPD lightning protection parameters, cable core number, and loop purpose from the local cache, displaying them on the canvas in the form of floating information labels. This submodule also supports box selection operations and can batch export complete loop links to an Excel format ledger.
[0073] Operation and Maintenance Assistance Submodule: This submodule provides filtering and highlighting functions such as individual filtering of SPD grounding lightning protection circuits, cable path tracing, and red highlighting of abnormal circuits. It can also export circuit ledgers and SPD equipment lists in Excel format for use in substation lightning protection testing and secondary maintenance operations.
[0074] The 3D rendering client module 05 is used to obtain a 3D spatial modeling dataset containing the globally unique device ID of each device from the database persistence module, match it with the built-in standardized 3D model library, automatically instantiate cabinets, boards and SPD components according to hierarchical coordinates, and automatically generate 3D cable entities according to cable parameters, and bind the corresponding globally unique device ID to each instantiated 3D entity.
[0075] In its implementation, this module can be developed based on Unreal Engine and run as a standalone 3D client application. This module establishes a connection with the backend Spring Boot service via HTTP / TCP dual links, pulling the 3D spatial modeling dataset from the persistent database module in real time. The 3D rendering client module 05 may include the following sub-modules: Data retrieval and scene construction submodule: This submodule establishes a connection with the backend upon startup and reads the 3D modeling dataset of the specified interval or cabinet as needed, including the world coordinates of the cabinet's main control room, cabinet dimensions, relative installation coordinates of the internal boards / SPDs, coordinates of the cable start and end terminals, cable routing path parameters, and 3D model mapping ID. Standardized 3D Model Library Submodule: This module contains a standardized 3D resource library for substations. As a preferred embodiment of the present invention, the types of 3D models built into the standardized 3D model library include: cabinet models, SPD surge protector models of various models, communication board models, terminal block models, circuit breaker models, cable tray models, and prefabricated cable models.
[0076] The 3D automatic generation submodule performs the instantiation of cabinets, boards, and SPD components according to hierarchical coordinates. Specifically, it generates the cabinet body based on the world coordinates of the main control room in the 3D spatial modeling dataset, and generates corresponding board models and SPD device models inside the cabinet body based on the relative installation coordinates of the boards and SPD devices within the cabinet. This submodule also performs the automatic generation of 3D cable entities based on cable parameters. Specifically, it reads the 3D spatial coordinates and laying path parameters corresponding to the terminals at both ends of the cable core from the cable core and loop data, generates a continuous 3D cable model, and attaches both ends of the 3D cable model to the corresponding terminal 3D models. This submodule also includes a standardized main control room scene preset environment, with built-in prefabricated models of anti-static flooring, cable trenches, cable trays, and lighting, supporting scene saving and reloading.
[0077] 3D Interaction and Information Visualization Submodule 05: This submodule automatically attaches floating text labels to all SPDs, boards, and cables, displaying the device number, lightning protection parameters, circuit number, and cable specifications. This submodule supports free-view roaming and first-person viewing of cabinet interior details. When a 2D linkage signal is received, this submodule controls the scene camera to automatically focus on the highlighted target entity and triggers a highlight flashing effect on the target entity and its associated cables.
[0078] The linkage interaction module 06 is used to respond to the triggering operation of the graphic elements in the two-dimensional loop topology, obtain the corresponding globally unique device ID and send it to the three-dimensional client to locate and highlight the corresponding three-dimensional entity, and respond to the triggering operation of the entity in the three-dimensional scene, obtain the corresponding globally unique device ID and send it to the two-dimensional front end to locate and highlight the corresponding graphic element.
[0079] Specifically, this module is implemented through a two-way communication mechanism using WebSocket or HTTP. When a user clicks on a primitive in the loop topology of the 2D visualization module, the module captures the click event, reads the globally unique device ID bound to that primitive, and sends it to the 3D rendering client module via a backend relay service. Upon receiving the ID, the 3D rendering client module traverses its scene tree to find a 3D entity bound to the same ID, locates it, focuses the camera view on that entity, and triggers material highlighting or blinking animations. Conversely, when a user clicks on a 3D entity in the 3D scene, the module captures the click event, reads the globally unique device ID bound to that entity, and sends it to the 2D visualization module via a backend relay service. Upon receiving the ID, the 2D visualization module searches for a primitive bound to the same ID in the canvas, centers it, changes its border color, or adds a pulse animation, achieving reverse positioning from 3D to 2D.
[0080] The interactive module also supports bidirectional synchronous display of device information tags, meaning that when the same device is triggered in two dimensions and three dimensions, both display the same device parameter information (such as SPD model, continuous operating voltage, protection level, etc.).
[0081] Example 3 Thirdly, embodiments of this application also provide an electronic device for performing the methods described in Embodiment 1 and its preferred embodiments.
[0082] In one specific embodiment of the present invention, the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method described in Embodiment 1.
[0083] Specifically, the processor can be an electronic device with data processing and computing capabilities, such as a central processing unit (CPU), graphics processing unit (GPU), digital signal processor (DSP), or application-specific integrated circuit (ASIC). The memory can be high-speed random access memory (RAM), non-volatile memory (such as flash memory, hard disk, solid-state drive SSD, optical disk, etc.), or a combination thereof. The computer program is stored in the memory in any form, such as source code, compiled code, machine code, or microinstructions.
[0084] When the processor executes the computer program, the electronic device performs the following operations: First, the SPD configuration file of the substation is received through the file upload interface. The format of the SPD configuration file is validated. Files that pass the validation are cached and parsing tasks are generated. The parsing tasks are pushed to the asynchronous parsing queue (corresponding to step S1 in embodiment one).
[0085] Next, the parsing task is obtained from the asynchronous parsing queue, and all business nodes of the SPD configuration file are recursively traversed through the backend parsing engine to extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data in layers; a globally unique device ID is assigned to each extracted cabinet, board, SPD device, cable, and loop; and the extracted business data and the corresponding globally unique device ID are written into the database according to the preset association relationship (corresponding to step S2 in embodiment one).
[0086] Then, in response to the data correction operation at the front end, the globally unique device IDs and logic loop data corresponding to the cabinets, boards, SPD devices and cables stored in the database are obtained, the three-dimensional spatial location data corresponding to each cabinet, board, SPD device and cable are supplemented, and the supplemented three-dimensional spatial location data is associated with the corresponding globally unique device ID and updated to the database (corresponding to step S3 in embodiment one).
[0087] Next, in response to the data query request from the two-dimensional front end, the structured loop data containing the globally unique device ID of each device and the corresponding three-dimensional spatial location data are obtained from the database. Based on the structured loop data, a two-dimensional loop topology containing cabinet elements, board elements, SPD elements and two-dimensional connecting lines is automatically drawn, and each drawn element is bound to the corresponding globally unique device ID (corresponding to step S4 in embodiment one).
[0088] Next, in response to the modeling data retrieval request from the 3D client, a 3D spatial modeling dataset containing the globally unique device ID of each device and the corresponding logical loop data are obtained from the database. The standardized 3D model library is matched according to the 3D spatial modeling dataset, and the cabinet, board and SPD components are automatically instantiated according to the hierarchical coordinates. A 3D cable entity is automatically generated according to the cable parameters, and the corresponding globally unique device ID is bound to each instantiated 3D entity (corresponding to step S5 in embodiment one).
[0089] Finally, in response to a trigger operation on a target primitive in a two-dimensional loop topology, the globally unique device ID bound to the target primitive is obtained, and the globally unique device ID is sent to the three-dimensional client. The three-dimensional client locates and highlights the corresponding three-dimensional entity based on the received globally unique device ID. In response to a trigger operation on a target three-dimensional entity in a three-dimensional scene, the globally unique device ID bound to the target three-dimensional entity is obtained, and the globally unique device ID is sent to the two-dimensional front end. The two-dimensional front end locates and highlights the corresponding primitive based on the received globally unique device ID (corresponding to step S6 in Embodiment 1).
[0090] In some optional embodiments of this example, the electronic device further includes a network interface for communicating with external devices, including but not limited to receiving SPD configuration files uploaded by the user, sending topology data to the front-end interface, sending modeling data to the 3D client, and relaying globally unique device ID signals between the 2D front-end and the 3D client.
[0091] In some optional embodiments of this example, the electronic device further includes a display interface for connecting to a display device to present a Vue 2D visualization interface or an Unreal Engine 3D rendered image. When the electronic device is deployed as a server, it can provide data services to front-end devices and 3D client devices via a network interface without needing to directly connect to a display device.
[0092] In some optional embodiments of this example, when the processor executes the computer program, it also implements the specific implementations of the preferred solutions in Example 1, which will not be repeated here.
[0093] In addition, this application also provides a computer program product, which stores a computer program, and when the computer program is executed by an electronic device, it runs the steps of the methods in Embodiment 1.
[0094] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0095] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.< / surgeprotectivedevice> < / spdprotection>
Claims
1. A method for realizing two-dimensional and three-dimensional visualization of a substation secondary system, characterized in that, include: S1: Receive the SPD configuration file of the substation through the file upload interface, perform format verification on the SPD configuration file, cache the files that pass the verification and generate a parsing task, and push the parsing task to the asynchronous parsing queue. S2: Obtain the parsing task from the asynchronous parsing queue, recursively traverse all business nodes of the SPD configuration file through the backend parsing engine, and extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data layer by layer; assign a globally unique device ID to each extracted cabinet, board, SPD device, cable, and loop; write the extracted business data and the corresponding globally unique device ID into the database according to the preset association relationship, wherein the cabinet data and the interval data are associated through the interval to which the cabinet belongs, the board data and the cabinet data are associated through the slot in the cabinet, the SPD device data and the board data are associated through the board binding relationship, the cable data is associated with the cabinet data through the starting cabinet ID and the ending cabinet ID, and the cable core and loop data is associated with the SPD device data through the loop ID; S3: In response to the front-end data correction operation, obtain the globally unique device ID and logic loop data corresponding to the cabinet, board, SPD device and cable stored in the database, supplement the three-dimensional spatial location data corresponding to each cabinet, board, SPD device and cable, and associate the supplemented three-dimensional spatial location data with the corresponding globally unique device ID to update the database; S4: In response to the data query request from the two-dimensional front end, obtain structured loop data containing the globally unique device ID of each device and the corresponding three-dimensional spatial location data from the database, automatically draw a two-dimensional loop topology containing cabinet elements, board elements, SPD elements and two-dimensional connecting lines based on the structured loop data, and bind the corresponding globally unique device ID to each drawn element. S5: In response to the modeling data retrieval request from the 3D client, obtain the 3D spatial modeling dataset containing the globally unique device ID of each device and the corresponding logical loop data from the database, match the standardized 3D model library according to the 3D spatial modeling dataset, automatically instantiate the cabinet, board and SPD components according to the hierarchical coordinates, and automatically generate 3D cable entities according to the cable parameters, and bind the corresponding globally unique device ID to each instantiated 3D entity. S6: In response to a trigger operation on a target primitive in a two-dimensional loop topology, obtain the globally unique device ID bound to the target primitive, and send the globally unique device ID to the three-dimensional client. The three-dimensional client locates and highlights the corresponding three-dimensional entity based on the received globally unique device ID. In response to a trigger operation on a target three-dimensional entity in a three-dimensional scene, obtain the globally unique device ID bound to the target three-dimensional entity, and send the globally unique device ID to the two-dimensional front end. The two-dimensional front end locates and highlights the corresponding primitive based on the received globally unique device ID.
2. The method as described in claim 1, characterized in that, In step S2, the layered extraction of interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data includes: Extract the interval number, voltage level, interval name, and associated bus as the interval data; Extract the cabinet number, cabinet type, cabinet size, and slot level as the cabinet data; Extract the board model, slot number, and terminal block number as the board data; Extract the model number, continuous operating voltage, protection level, and installation location of the SPD device as the SPD device data; Extract the cable number, cable specifications, starting cabinet ID, ending cabinet ID, and laying path as the cable data; Extract the core wire number, terminal numbers at both ends, loop number, and loop function as the cable core and loop data.
3. The method as described in claim 1, characterized in that, In step S2, the preset association relationship is established by establishing a foreign key association through the cabinet ID in the cabinet data, the device ID in the SPD device data, and the loop ID in the cable core and loop data.
4. The method as described in claim 1, characterized in that, The three-dimensional spatial location data includes the world coordinates of the cabinet in the main control room, the relative installation coordinates of the SPD devices and boards in the cabinet, and the cable routing parameters.
5. The method as described in claim 1, characterized in that, In step S4, the two-dimensional connection line is drawn with different line colors according to the circuit function type in the cable core and circuit data. The power circuit, signal circuit and SPD grounding lightning protection circuit correspond to different colors respectively. When the mouse hover operation is triggered on the two-dimensional loop topology, a floating information label is displayed that corresponds to the device number, SPD lightning protection parameters, cable core number, and loop purpose of the globally unique device ID bound to the element.
6. The method as described in claim 1, characterized in that, In step S5, the types of three-dimensional models built into the standardized three-dimensional model library include: cabinet model, various models of SPD surge protectors, communication board model, terminal block model, circuit breaker model, cable tray model, and cable prefabrication model. The step of matching a standardized 3D model library based on the 3D spatial modeling dataset includes: Based on the globally unique device ID and corresponding device model of each device in the database, the corresponding 3D model is matched from the standardized 3D model library; The instantiation of cabinets, boards, and SPD components according to hierarchical coordinates includes: The cabinet body is generated based on the world coordinates of the main control room of the cabinet in the three-dimensional spatial modeling dataset. The corresponding board model and SPD device model are generated inside the cabinet body based on the relative installation coordinates of the boards and SPD devices inside the cabinet. The automatic generation of a three-dimensional cable entity based on cable parameters includes: The three-dimensional spatial coordinates and laying path parameters corresponding to the terminals at both ends of the cable core in the cable core and circuit data are read to generate a continuous three-dimensional cable model, and the two ends of the three-dimensional cable model are respectively attached to the corresponding terminal three-dimensional models.
7. The method as described in claim 1, characterized in that, In step S1, the step of performing format validation on the SPD configuration file, caching the validated files and generating a parsing task, and pushing the parsing task to the asynchronous parsing queue includes: Verify the validity of the file extension, XML root node, and SPD lightning protection standard node of the SPD configuration file; If the verification passes, the SPD configuration file is cached in a temporary storage directory, and the parsing task is pushed to the asynchronous parsing queue.
8. A two-dimensional and three-dimensional visualization system for a substation secondary system, characterized in that, include: The file access and upload module is used to receive SPD configuration files and perform format verification, cache files that pass verification and generate parsing tasks, and push the parsing tasks to the asynchronous parsing queue. The backend parsing service module is used to obtain the parsing task from the asynchronous parsing queue, recursively traverse all business nodes of the SPD configuration file through the parsing engine, extract interval data, cabinet data, board data, SPD device data, cable data, and cable core and loop data in layers, assign a globally unique device ID to each extracted cabinet, board, SPD device, cable and loop, and write the extracted business data and the corresponding globally unique device ID into the database according to the preset association relationship; The database persistence module is used to uniformly store the various business data, the corresponding globally unique device IDs, and the three-dimensional spatial location data, serving as the sole data source for the two-dimensional front-end and the three-dimensional client. The two-dimensional visualization module is used to obtain structured loop data containing the globally unique device ID of each device from the database persistence module, automatically draw a two-dimensional loop topology including cabinet elements, board elements, SPD elements and two-dimensional connection lines, and bind the corresponding globally unique device ID to each drawn element. The 3D rendering client module is used to obtain a 3D spatial modeling dataset containing the globally unique device ID of each device from the database persistence module, match it with the built-in standardized 3D model library, automatically instantiate cabinets, boards and SPD components according to hierarchical coordinates, and automatically generate 3D cable entities according to cable parameters, and bind the corresponding globally unique device ID to each instantiated 3D entity. The linkage and interaction module is used to respond to the triggering operation of the graphic elements in the two-dimensional loop topology, obtain the corresponding globally unique device ID and send it to the three-dimensional client to locate and highlight the corresponding three-dimensional entity, and respond to the triggering operation of the entity in the three-dimensional scene, obtain the corresponding globally unique device ID and send it to the two-dimensional front end to locate and highlight the corresponding graphic element.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
10. A computer program product, said computer program product storing a computer program, characterized in that, When the computer program is executed by an electronic device, it performs the method as described in any one of claims 1 to 7.
