A discrete rendering method for power grid equipment model, electronic device and storage medium
By splitting and parameterizing the grid equipment model, the target parameter data is sent to the GPU for rendering, solving the problem of large amounts of data interacting between the CPU and GPU, and achieving load balancing and improved rendering efficiency.
Patent Information
- Application Number
- CN202410033026.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-01-09
AI Technical Summary
In the existing technology, during the rendering process of the power grid equipment model, the amount of interactive data between the CPU and the GPU is large, which limits the CPU computing power and makes it impossible to fully utilize the parallel computing power advantages of the GPU, thereby reducing rendering efficiency.
The CPU is used to perform primitive decomposition and parameterization on the power grid equipment model to generate target parameter data, which is then sent to the GPU for geometric discretization and primitive rendering, reducing the amount of interactive data between the CPU and GPU and fully utilizing the GPU computing power.
It achieves load balancing between the CPU and GPU, avoids CPU computing power limitation, and improves rendering efficiency and frame rate.
Smart Images

Figure CN117786913B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design, and in particular to a discrete rendering method for a power grid equipment model, an electronic device, and a storage medium. Background Art
[0002] Due to the complex technologies, multiple stakeholders, and vast amounts of information involved in power grid engineering, power grid equipment models are complex in structure and size, and their scale is enormous. Furthermore, the diverse 3D representations of various specialized models make integration into a single platform difficult.
[0003] To ensure full compatibility with user device configurations and performance, mainstream power grid modeling software currently utilizes memory reuse to fully utilize video memory. This traditional approach primarily involves the application (CPU) independently allocating a fixed amount of video memory. The software's geometry engine then consumes CPU resources to perform visibility culling and geometric discretization on the required display entities to generate triangular facet data. This triangular facet data is then pushed from the CPU to the GPU for display in batches, based on the allocated video memory.
[0004] In the traditional solutions described above, processing geometric shapes relies on computational geometry algorithms to discretize geometric data into triangular facets on the CPU side. These triangular facet data is then passed to the rendering pipeline for rendering and display. This process is primarily performed by the CPU, and complex shapes require a large amount of computation. The CPU parsing discrete geometric data not only consumes a large amount of CPU computing power, but the geometric triangular facet data also takes up a large amount of memory and consumes significant bandwidth when pushing and rendering data. The GPU only performs rendering and display-related tasks, wasting CPU performance while failing to fully utilize the GPU's parallel computing power, thereby reducing the rendering frame rate and performance of the power grid engineering modeling software. Summary of the Invention
[0005] The present invention provides a discrete rendering method for a power grid equipment model, an electronic device, and a storage medium, which reduce the amount of interactive data between the CPU and the GPU, fully utilize the GPU computing power, achieve dual-end load balancing, avoid the situation where the CPU computing power is limited, and improve rendering efficiency.
[0006] According to one aspect of the present invention, a method for discrete rendering of a power grid device model is provided. The method is executed by a CPU and includes:
[0007] Acquire a power grid equipment model, and perform primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive;
[0008] Extracting parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid equipment model; wherein the target parameter data is used to represent the power grid equipment model;
[0009] The target parameter data is sent to the GPU, so that the GPU performs geometric discretization and primitive rendering according to the target parameter data.
[0010] Optionally, obtaining a power grid equipment model and performing primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive includes:
[0011] Obtaining a power grid device model, and classifying the device model according to the node name and drive parameters of the power grid device model to obtain a preliminary classification result of the device model;
[0012] Taking the preliminary classification result as a unit, the component parts of each power grid equipment model in the preliminary classification result are split into primitives to obtain at least one target basic body primitive.
[0013] Optionally, before sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, the method further includes:
[0014] Instantiate the power grid device model according to the target parameter data to obtain model entity parameters corresponding to the instantiated model;
[0015] Sending the target parameter data to a GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, including:
[0016] In response to discrete rendering requests for multiple target power grid device models under the same entity, target model entity parameters corresponding to the multiple target power grid device models and individual parameter data corresponding to each target power grid device model are sent to the GPU;
[0017] The GPU is used to perform geometric discretization and primitive rendering according to the target model entity parameters and each individual parameter data.
[0018] Optionally, the method further includes:
[0019] Determine a GPU memory space occupancy value of a single individual parameter data and a GPU memory space occupancy starting value of each individual parameter data corresponding to a plurality of target power grid device models under the same entity;
[0020] In response to the update of the target power grid device model, determining the occupancy of each GPU memory space according to the GPU memory space occupancy value and the GPU memory space occupancy start value;
[0021] When the GPU memory space occupancy meets the preset occupancy conditions, the GPU is instructed to perform memory compaction.
[0022] Optionally, when the GPU memory space occupancy meets a preset occupancy condition, the GPU is instructed to perform memory compaction, including:
[0023] When the occupancy rate of the GPU video memory space is less than the preset effective usage rate and the occupancy of the GPU video memory space is not updated within the preset time, the GPU is instructed to perform video memory compaction.
[0024] According to one aspect of the present invention, a method for discrete rendering of a power grid device model is provided. The method is executed by a GPU and includes:
[0025] Obtain the target parameter data sent by the CPU, and perform geometric discretization based on the target parameter data through the optional rendering pipeline shader to obtain triangle surface data;
[0026] According to the triangular surface data, rendering is performed through a conventional rendering pipeline shader to obtain a display result of the power grid equipment model.
[0027] Optionally, the method further includes:
[0028] Obtaining a video memory compaction indication sent by the CPU; wherein the video memory compaction indication is obtained by the CPU based on the determined occupancy of each video memory space of the GPU;
[0029] Perform video memory compaction according to the video memory compaction instruction.
[0030] According to one aspect of the present invention, a method for discrete rendering of a power grid device model is provided, the method comprising:
[0031] The CPU obtains a power grid equipment model, and performs primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive;
[0032] The CPU extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model;
[0033] The CPU sends the target parameter data to the GPU;
[0034] The GPU performs geometric discretization according to the target parameter data through an optional rendering pipeline shader to obtain triangular surface data;
[0035] The GPU performs rendering based on the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid device model.
[0036] According to another aspect of the present invention, a discrete rendering device for a power grid device model is provided, the device being executed by a CPU and comprising:
[0037] A target primitive primitive acquisition module is used to acquire a power grid equipment model and perform primitive decomposition according to the components of the power grid equipment model to obtain at least one target primitive primitive;
[0038] a target parameter data determination module, configured to extract parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model;
[0039] The target parameter data sending module is used to send the target parameter data to the GPU, so that the GPU performs geometric discretization and primitive rendering according to the target parameter data.
[0040] Optionally, a target primitive acquisition module includes:
[0041] a preliminary classification result determination unit, configured to obtain a power grid device model, and classify the device model according to the node name and drive parameters of the power grid device model to obtain a preliminary classification result of the device model;
[0042] The target basic body primitive determining unit is configured to perform primitive decomposition on the components of each power grid equipment model in the preliminary classification result based on the preliminary classification result, so as to obtain at least one target basic body primitive.
[0043] Optionally, the device further includes:
[0044] an instantiation module, configured to instantiate a power grid device model according to the target parameter data before sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, and obtain model entity parameters corresponding to the instantiated model;
[0045] Target parameter data sending module, including:
[0046] A parameter data sending unit is used to respond to discrete rendering requests of multiple target power grid device models under the same entity, and send the target model entity parameters corresponding to the multiple target power grid device models and the individual parameter data corresponding to each target power grid device model to the GPU; and perform geometric discretization and primitive rendering according to the target model entity parameters and each individual parameter data by the GPU.
[0047] Optionally, the device further includes:
[0048] A memory space occupancy value determination module is used to determine the GPU memory space occupancy value of a single individual parameter data and the GPU memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity;
[0049] A video memory space occupancy determination module, configured to determine the occupancy of each video memory space of the GPU according to the GPU video memory space occupancy value and the GPU video memory space occupancy start value in response to the update of the target power grid device model;
[0050] The memory compaction instruction module is used to instruct the GPU to perform memory compaction when the GPU memory space occupancy meets a preset occupancy condition.
[0051] Optional memory compaction indicator module, including:
[0052] The memory compaction instruction unit is used to instruct the GPU to perform memory compaction when the occupancy rate of the GPU memory space is less than a preset effective usage rate and the occupancy status of the GPU memory space is not updated within a preset time.
[0053] According to another aspect of the present invention, a discrete rendering device for a power grid device model is provided. The device is executed by a GPU and includes:
[0054] A triangle surface data determination module is used to obtain target parameter data sent by the CPU, and to perform geometric discretization based on the target parameter data through an optional rendering pipeline shader to obtain triangle surface data;
[0055] The rendering module is used to render the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid equipment model.
[0056] Optionally, the device further includes:
[0057] A memory compaction indication acquisition module, configured to acquire a memory compaction indication sent by the CPU; wherein the memory compaction indication is obtained by the CPU based on the determined occupancy of each memory space of the GPU;
[0058] A video memory compaction module is configured to perform video memory compaction according to the video memory compaction instruction.
[0059] According to another aspect of the present invention, a discrete rendering system for a power grid device model is provided, the system comprising:
[0060] The CPU obtains a power grid equipment model, and performs primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive;
[0061] The CPU extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model;
[0062] The CPU sends the target parameter data to the GPU;
[0063] The GPU performs geometric discretization according to the target parameter data through an optional rendering pipeline shader to obtain triangular surface data;
[0064] The GPU performs rendering based on the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid device model.
[0065] According to another aspect of the present invention, an electronic device is provided, comprising:
[0066] at least one processor; and
[0067] a memory communicatively connected to the at least one processor; wherein,
[0068] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for discrete rendering of a power grid device model according to any embodiment of the present invention.
[0069] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the discrete rendering method of a power grid device model according to any embodiment of the present invention when executed.
[0070] The technical solution of the embodiment of the present invention obtains a power grid equipment model and splits the primitives according to the components of the power grid equipment model to obtain at least one target basic body primitive; extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid equipment model; wherein the target parameter data is used to represent the power grid equipment model; the target parameter data is sent to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, thereby solving the problem that when the power grid equipment model is modeled and rendered by the CPU and GPU, the interaction volume between the CPU and the GPU is large and the GPU cannot fully utilize its effectiveness. The power grid equipment model is parameterized by the CPU, and then the corresponding target parameter data is sent to the GPU, which performs geometric discretization and primitive rendering, thereby reducing the amount of interactive data between the CPU and the GPU, making full use of the GPU computing power, realizing dual-end load balancing, avoiding the situation where the CPU computing power is limited, and improving rendering efficiency.
[0071] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0073] Figure 1 This is a flowchart of a method for discrete rendering of a power grid device model provided according to the first embodiment of the present invention;
[0074] Figure 2 This is a flowchart of a discrete rendering process of a power grid device model provided according to the first embodiment of the present invention;
[0075] Figure 3 This is a structural block diagram of a CPU driving a GPU to update video memory according to a first embodiment of the present invention;
[0076] Figure 4 This is a flowchart of a method for discrete rendering of a power grid device model provided according to a second embodiment of the present invention;
[0077] Figure 5 This is a flowchart of a CPU and GPU interaction to implement power grid equipment model rendering according to the second embodiment of the present invention;
[0078] Figure 6 This is a flowchart of using a rendering pipeline shader for implementing discrete rendering of a power grid device model provided in accordance with a second embodiment of the present invention;
[0079] Figure 7 This is a flowchart of a method for discrete rendering of a power grid device model provided in accordance with a third embodiment of the present invention;
[0080] Figure 8 2 is a schematic structural diagram of a discrete rendering device for a power grid device model according to a fourth embodiment of the present invention;
[0081] Figure 9 This is a structural diagram of a discrete rendering device for a power grid device model provided according to a fifth embodiment of the present invention;
[0082] Figure 10 It is a structural diagram of an electronic device for implementing the discrete rendering method of a power grid device model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0083] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0084] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0085] Example 1
[0086] Figure 1 This is a flowchart of a method for discrete rendering of a power grid device model according to a first embodiment of the present invention. This embodiment is applicable to modeling and rendering a power grid device model using a CPU and a GPU. The method can be performed by a discrete rendering device for a power grid device model. The discrete rendering device for a power grid device model can be implemented in hardware and / or software and can be configured in an electronic device such as a computer. The method, executed by the CPU, includes:
[0087] Step 110: Acquire a power grid equipment model, and perform primitive decomposition according to the components of the power grid equipment model to obtain at least one target basic body primitive.
[0088] Power grid equipment models can include basic elements and steel components of power generation projects as specified in the "Interaction Specification for 3D Design Models of Power Transmission and Transformation Projects." Power grid equipment models include, but are not limited to, spheres, ellipsoids, cuboids, pyramids (cones), offset rectangular pyramids, cylinders, bent cylinders, frustums, eccentric frustums, circular rings, rectangular rings, elliptical rings, circular gaskets, pyramid-shaped gaskets, square gaskets, extruded bodies, porcelain bushings / insulators (excluding upper and lower flanges), tapered porcelain bushings, insulator strings, V-shaped insulator strings, terminal blocks, rectangular mounting holes, circular mounting holes, and conductors / cables.
[0089] The component components may be one or more basic primitives included in the power grid equipment model. By performing primitive decomposition on the power grid equipment model, one or more target primitives included in the power grid equipment model can be obtained. For example, the power grid equipment model is an insulator string. The insulator string includes components such as cylinders (or frustums) and mesa-shaped gaskets of equal or different sizes. Based on this, the insulator string can be decomposed into target primitives such as cylinders (or frustums) and mesa-shaped gaskets.
[0090] Specifically, when performing primitive splitting, a variety of methods can be used. For example, the components of each power grid equipment model can be manually identified and stored in a record table. When performing primitive splitting, the CPU can identify the power grid equipment model and obtain the record table, perform component mapping, and implement primitive splitting. Alternatively, the geometric features of the power grid equipment model can be identified through image recognition or a deep learning network model to obtain the components contained therein and perform primitive splitting. Alternatively, the CPU can obtain the user manual, assembly information, etc. of the power grid equipment model, determine the components contained in the power grid equipment model, and perform primitive splitting.
[0091] In an optional implementation of an embodiment of the present invention, a power grid equipment model is obtained, and the primitives are split according to the constituent components of the power grid equipment model to obtain at least one target basic body primitive, including: obtaining the power grid equipment model, and classifying the equipment model according to the node name and driving parameters of the power grid equipment model to obtain a preliminary classification result of the equipment model; taking the preliminary classification result as a unit, the primitives are split into the constituent components of each power grid equipment model in the preliminary classification result to obtain at least one target basic body primitive.
[0092] Equipment models with similar node names, identical keywords, and identical drive parameters can be grouped into the same preliminary classification result. For example, porcelain bushings / insulators (excluding upper and lower flanges), tapered porcelain bushings, insulator strings, and V-type insulator strings can all be grouped into the preliminary classification result named "insulator strings." Before performing primitive splitting, the power grid equipment models are merged and then split into primitives based on the preliminary classification results. This can reduce processing steps and improve efficiency.
[0093] Step 120 : extract parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid equipment model.
[0094] Among them, the target parameter data is used to represent the power grid equipment model.
[0095] In this step, we can sort out the parametric expression methods of basic primitives in power grid engineering, summarize and analyze the geometric characteristics of basic primitives, and encapsulate and implement the expression and operation of basic primitives. By extending parametric methods such as Constructive Solid Geometry (CSG) and Boundary Representation (BRep), basic geometry can be parametrically represented, and parametric data extraction of target primitives can be achieved. For example, a sphere can be parametrically represented as a center and radius. The center and radius can serve as the target parameter data for the sphere.
[0096] Step 130: Send the target parameter data to the GPU, so that the GPU performs geometric discretization and primitive rendering according to the target parameter data.
[0097] The CPU categorizes all scene components into geometric primitives, extracts parametric data, creates corresponding video memory resources based on the primitive type, and uploads the parametric data to the GPU. The GPU then performs geometric discretization and primitive rendering based on the target parametric data.
[0098] In an embodiment of the present invention, the basic primitive types in the substation model are mainly merged, and the parametric expression and data of the substation model are encapsulated into their own unique types for storage. This is different from the conventional display algorithm, that is, no discrete operation is performed on the entity in the CPU, and only parameter data is stored for subsequent GPU discretization.
[0099] In an embodiment of the present invention, after decomposing the power grid equipment model into primitives to obtain target primitives, the method further includes determining whether the target primitives are parametrically expressed as explicit geometric shapes or implicit geometric shapes. If the target primitives are parametrically expressed as explicit geometric shapes, i.e., solid shapes, parametric data is extracted from each target primitive to obtain target parameter data corresponding to the power grid equipment model.
[0100] If the target primitive is parametrically represented as an implicit geometric shape, i.e., a mesh, its triangle data is cached at multiple levels of detail (LOD). This cached triangle data is reused when creating subsequent instances of the same type. Furthermore, in this embodiment of the present invention, the GPU determines the LOD level of the instance object based on its importance within the viewing angle (volume, projected area, distance from the viewing angle, etc.), ensuring that the corresponding primitive is displayed with minimal rendering overhead.
[0101] The technical solution of the embodiments of the present invention achieves modeling and rendering of the entire power grid equipment model by dividing the primitives contained in the power generation project model into basic primitives that can be parametrically displayed and expressed, and mesh primitive components, which are then processed separately. Mesh primitives often have multiple identical entities in a project. In the embodiments of the present invention, the modeling engine can perform geometric reuse on non-parametric primitives, reducing the instruction and data exchange between the CPU and GPU while enabling the rendering of multiple groups of primitives in a single call, thereby improving the rendering efficiency of the non-parametric power generation model.
[0102] On the basis of the above implementation, optionally, before sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, it also includes: instantiating the power grid equipment model according to the target parameter data to obtain model entity parameters corresponding to the instantiated model; sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, including: responding to discrete rendering requests of multiple target power grid equipment models under the same entity, sending the target model entity parameters corresponding to the multiple target power grid equipment models and the individual parameter data corresponding to each target power grid equipment model to the GPU; performing geometric discretization and primitive rendering according to the target model entity parameters and each individual parameter data by the GPU.
[0103] Instantiation involves parameterizing and merging identical entities within a power grid equipment model. For multiple identical entities, their model entity parameters are identical, differing only in their values. For example, spheres of different sizes may all have model entity parameters for their center and radius. However, the individual parameter data differs, meaning the specific values corresponding to the center and radius differ. By instantiating the power grid equipment model, the basic primitive types within the substation model can be merged and the parameterized representations and data of the substation model can be encapsulated and stored as unique types.
[0104] Specifically, the CPU can transmit the individual parameter data corresponding to each target power grid device model to the GPU using various methods, such as matrices and arrays. The CPU creates corresponding video memory resources for parameter data upload based on primitive types, further improving the data exchange rate between the CPU and GPU.
[0105] Figure 2 This is a flowchart of a discrete rendering process of a power grid device model provided according to the first embodiment of the present invention. Figure 2As shown in the figure, the CPU can decompose the power grid equipment model into primitives to obtain basic body primitives. For basic body primitives, the CPU can further distinguish between Solid and Mesh types. For Solid types, the CPU can extract parametric data and instantiate it, and then use the GPU for geometric discretization and primitive rendering. For Mesh types, the CPU can perform Cluster, LOD processing, and Compress, and then hand it over to the GPU for geometric discretization and primitive rendering.
[0106] The design process for power generation engineering models requires constant addition, deletion, and modification of power generation elements. The instability of the design scenario severely impacts rendering system performance, and graphics memory resources cannot be flexibly created and used by applications like internal memory resources.
[0107] In order to solve the problem of resource waste and performance loss caused by constantly opening up internal video memory during dynamic display. In an optional implementation of the embodiment of the present invention, the method further includes: determining the GPU video memory space occupancy value of a single individual parameter data, and the GPU video memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity; in response to the update of the target power grid device model, determining the occupancy status of each GPU video memory space according to the GPU video memory space occupancy value and the GPU video memory space occupancy starting value; when the occupancy of the GPU video memory space meets the preset occupancy condition, instructing the GPU to perform video memory compaction.
[0108] Among them, based on the CPU's instantiation of the power grid equipment model, the CPU can send the individual parameter data in a packaged form when sending it to the GPU. The memory space occupied by each individual parameter data is basically the same as the video memory space. On the CPU side, the GPU video memory space occupancy value of a single individual parameter data, the GPU video memory space occupancy starting value of each individual parameter data, and the offset parameter (such as serial number or number) of each individual parameter data can be recorded. When individual parameter data is increased, it can be increased after each individual parameter data; when individual parameter data is deleted, the CPU side memory space can be set to an invalid bit (such as set to 0) according to the corresponding offset parameter; when individual parameter data is changed, the individual parameter data can be changed accordingly according to the corresponding offset parameter.
[0109] Therefore, in response to the update of the target power grid device model, the CPU can determine the occupancy of each GPU memory space based on the GPU memory space occupancy value and the GPU memory space occupancy starting value. When the GPU memory space occupancy meets the preset occupancy condition, the CPU can instruct the GPU to perform memory compaction. The preset occupancy condition can exist in various situations. For example, the preset occupancy condition can be that the GPU memory space occupancy rate is less than a preset effective usage rate; or, the invalid bit of the GPU memory space is greater than a preset threshold, etc.
[0110] Specifically, in an optional implementation of an embodiment of the present invention, when the occupancy of the GPU video memory space meets a preset occupancy condition, the GPU is instructed to perform video memory compaction, including: when the occupancy rate of the GPU video memory space is less than a preset effective usage rate, and the occupancy status of the GPU video memory space has not been updated within a preset time, the GPU is instructed to perform video memory compaction.
[0111] The GPU memory space occupancy rate may be the ratio of the length of the effectively occupied memory space to the total length of the allocated memory space. For example, the preset effective utilization rate may be set to a value within a range of 50% to 80%, preferably 50%. The preset time may be set to 10 seconds. GPU memory compaction and effective bit forward shifting ensure the continuity of GPU stored data, facilitate GPU data reading, and improve memory utilization.
[0112] Figure 3 This is a structural block diagram of a CPU driving a GPU to update video memory according to the first embodiment of the present invention. Figure 3 As shown, the basic types of power grid primitives, such as points, lines, surfaces, solids, and meshes, can all be instantiated with power grid primitive collection types to form different collections (forms). For example, a sphere and an ellipse can constitute Form 1. For the same entity, they can be packaged and uploaded. For example, the parameterized data of different spheres can be stored in the memory corresponding to Form 1 through different Models. Among them, in the memory corresponding to Form 1, 1 represents valid and 0 represents invalid. The invalid bit of the video memory space and the occupancy rate of the GPU video memory space can be represented by Dirty and INFO. Furthermore, the CPU instructs the GPU to perform video memory compaction based on the occupancy rate of the GPU video memory space.
[0113] The technical solution of the embodiment of the present invention uses a memory management-driven video memory update strategy, which is mainly based on memory scenes. While pursuing rendering efficiency, it also needs to take into account the real-time dynamic modification capabilities of the scene. While recording the basic geometric bodies on the application side, it fully associates its substation graphic element attributes. When the corresponding substation graphic elements are dynamically added, deleted, and modified, the type management unit will be triggered in real time, and the corresponding video memory data identification will be managed and the data correctness correction will be processed. Through custom type video memory to reuse and update valid data segments, a small amount of CPU memory layout information is used to manage the GPU real rendering data; and the corresponding display data is updated in real time according to the scene modification information. While improving the video memory utilization rate, it also improves the flexibility of video memory update management and the video memory utilization rate.
[0114] The technical solution of this embodiment obtains a power grid equipment model and decomposes the primitives according to the components of the power grid equipment model to obtain at least one target basic body primitive; extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid equipment model; wherein the target parameter data is used to represent the power grid equipment model; the target parameter data is sent to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, which solves the problem that when the power grid equipment model is modeled and rendered by the CPU and GPU, the interaction volume between the CPU and the GPU is large and the GPU cannot fully exert its effectiveness. The power grid equipment model is parameterized by the CPU, and the corresponding target parameter data is sent to the GPU, which performs geometric discretization and primitive rendering, reducing the amount of interactive data between the CPU and the GPU, making full use of the GPU computing power, realizing dual-end load balancing, avoiding the situation where the CPU computing power is limited, and improving rendering efficiency.
[0115] Example 2
[0116] Figure 4 This is a flowchart of a discrete rendering method for a power grid device model provided according to Example 2 of the present invention. This embodiment is applicable to the situation where a power grid device model is modeled and rendered using a CPU and a GPU. The method can be executed by a discrete rendering device for a power grid device model. The discrete rendering device for a power grid device model can be implemented in the form of hardware and / or software. The discrete rendering device for a power grid device model can be configured in an electronic device such as a computer.
[0117] like Figure 4 As shown, the method is executed by a GPU and includes:
[0118] Step 410: Obtain target parameter data sent by the CPU, and perform geometric discretization based on the target parameter data through an optional rendering pipeline shader to obtain triangle surface data.
[0119] The optional rendering pipeline shader may be a vertex shader (VS), a tessellation shader (TS), or a geometry shader (GS).
[0120] Step 420: Rendering is performed using a conventional rendering pipeline shader based on the triangle surface data to obtain a display result of the power grid equipment model.
[0121] Among them, conventional rendering pipeline shaders may be VS and pixel shader (Pixel Shader, PS).
[0122] Figure 5 This is a flow chart of a CPU and GPU interaction to realize power grid equipment model rendering according to the second embodiment of the present invention. Figure 5 As shown, the CPU can classify and manage grid primitives, dividing them into implicit geometry, explicit geometry, points, lines, and other categories for display caching. The GPU then fully utilizes the programmable rendering pipeline to perform geometric discretization and rendering mode calculations on parametric data directly on the display device. The discretized rendering data is then automatically received and distributed by the display device to the rasterization unit for raster display, fully utilizing the GPU's computing power to achieve dual-end load balancing.
[0123] Figure 6 This is a flowchart of using a rendering pipeline shader to implement discrete rendering of a power grid device model according to the second embodiment of the present invention. Figure 6 As shown in the figure, the CPU prepares parameterized data. The GPU performs geometric discretization to generate triangle data. Geometric discretization involves first using the VS algorithm. Then, depending on the type, different shaders can be used. For example, in type 1, the TS and GS can be used; in type 2, the GS can be used; and in type 3, the VS and TS can be used. Rasterization is then performed, and then the fragment shader (FS) is used.
[0124] The technical solution of the embodiment of the present invention introduces GPU as the main execution unit of calculation. GPU does not rely on memory, but uses its own display memory. After the CPU splits the primitives into parametric expressions such as points, lines and surfaces, the GPU can start to discretize the geometric body, generate rendering data, process texture maps, etc., and the display, hidden, contour line, surface shading and other operations of the graphics are also uniformly processed by the GPU. Through this algorithm mode, there is no need for large-scale data transmission between the CPU and GPU, which reduces unnecessary data transmission delays. While reducing CPU usage, it also reduces system memory usage and data transmission time, thereby achieving very good results in improving engine efficiency. The rendering efficiency of the substation engineering model is more than five times higher than the frame rate of the traditional rendering solution.
[0125] In an optional implementation of the embodiment of the present invention, the method further includes: obtaining a memory compaction instruction sent by the CPU; wherein the memory compaction instruction is obtained by the CPU based on the determined occupancy of each GPU memory space; and performing memory compaction according to the memory compaction instruction. Memory compaction enables continuous storage of GPU memory after scene updates, facilitating data reading.
[0126] Example 3
[0127] Figure 7 This is a flowchart of a discrete rendering method for a power grid device model according to the third embodiment of the present invention. This embodiment is applicable to the case where a power grid device model is modeled and rendered using a CPU and a GPU. Figure 7 As shown, the method includes:
[0128] Step 710: The CPU obtains a power grid equipment model, and performs primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive.
[0129] Step 720: The CPU extracts parameter data from each target primitive to obtain target parameter data corresponding to the power grid equipment model.
[0130] Among them, the target parameter data is used to represent the power grid equipment model.
[0131] Step 730: The CPU sends the target parameter data to the GPU.
[0132] Step 740: The GPU performs geometric discretization according to the target parameter data through the optional rendering pipeline shader to obtain triangle surface data.
[0133] Step 750: The GPU performs rendering based on the triangle surface data through a conventional rendering pipeline shader to obtain a display result of the power grid device model.
[0134] Optionally, the CPU obtains a power grid equipment model and performs graphic element splitting according to the components of the power grid equipment model to obtain at least one target basic body graphic element, including: the CPU obtains a power grid equipment model and classifies the equipment model according to the node name and driving parameters of the power grid equipment model to obtain a preliminary classification result of the equipment model; taking the preliminary classification result as a unit, the component components of each power grid equipment model in the preliminary classification result are split into graphic elements to obtain at least one target basic body graphic element.
[0135] Optionally, before sending the target parameter data to the GPU via the CPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, the method further includes: instantiating the power grid device model according to the target parameter data via the CPU to obtain model entity parameters corresponding to the instantiated model;
[0136] The CPU sends the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, including: the CPU responds to discrete rendering requests of multiple target power grid device models under the same entity, and sends the target model entity parameters corresponding to the multiple target power grid device models and the individual parameter data corresponding to each target power grid device model to the GPU; the GPU performs geometric discretization and primitive rendering according to the target model entity parameters and the individual parameter data.
[0137] Optionally, the method further includes: the CPU determining the GPU memory space occupancy value of a single individual parameter data, and the GPU memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid equipment models under the same entity; in response to the update of the target power grid equipment model, determining the occupancy status of each GPU memory space according to the GPU memory space occupancy value and the GPU memory space occupancy starting value; when the GPU memory space occupancy meets the preset occupancy condition, instructing the GPU to perform memory compaction.
[0138] Optionally, when the occupancy of the GPU video memory space meets a preset occupancy condition, the GPU is instructing to perform video memory compaction, including: when the occupancy rate of the GPU video memory space is less than a preset effective usage rate, and the occupancy of the GPU video memory space is not updated within a preset time, the CPU is instructing the GPU to perform video memory compaction.
[0139] Optionally, the method further includes: the GPU obtaining a video memory compaction indication sent by the CPU; wherein the video memory compaction indication is obtained by the CPU based on the determined occupancy status of each video memory space of the GPU; and video memory compaction is performed according to the video memory compaction indication.
[0140] In the technical solution of the embodiment of the present invention, the CPU obtains a power grid equipment model and splits the primitives according to the components of the power grid equipment model to obtain at least one target basic body primitive; the CPU extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid equipment model; wherein the target parameter data is used to represent the power grid equipment model; the CPU sends the target parameter data to the GPU; so that the GPU performs geometric discretization according to the target parameter data through an optional rendering pipeline shader to obtain triangular surface data; the GPU renders according to the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid equipment model, which solves the problem that when the power grid equipment model is modeled and rendered by the CPU and GPU, the interaction volume between the CPU and the GPU is large and the GPU cannot fully exert its effectiveness. The power grid equipment model is parameterized by the CPU, and then the corresponding target parameter data is sent to the GPU, which performs geometric discretization and primitive rendering, reducing the amount of interactive data between the CPU and the GPU, making full use of the GPU computing power, achieving dual-end load balancing, avoiding the situation where the CPU computing power is limited, and improving rendering efficiency.
[0141] Specifically, based on the GPU rendering idea, the GPU pipeline computing advantages are fully utilized to share the CPU burden, avoiding the situation where the CPU physical device computing power is limited, and giving full play to the GPU parallel computing power advantages; the basic graphics elements, complex curves and surfaces, and Mesh graphics components of the power generation project are optimized and pre-processed to save the data space of the original model, improve the quality, performance and reliability of the model expression, reduce the data communication between the CPU and GPU during device rendering, and reduce the performance impact caused by bandwidth consumption; a scene update solution based on video memory drive is implemented to reduce the performance consumption caused by two-end data interaction, thereby giving full play to the rendering advantages of GPU-driven discrete technology; for large-scale engineering models of power generation projects, a variety of culling, dynamic LOD and other technologies are applied in the CPU and GPU to ensure the rendering correctness and rendering frame rate of the power generation project model, and improve the user experience.
[0142] Example 4
[0143] Figure 8 Schematic diagram of a discrete rendering device for a power grid equipment model according to the fourth embodiment of the present invention. Figure 8 As shown, the device is executed by a CPU and includes: a target primitive acquiring module 810, a target parameter data determining module 820, and a target parameter data sending module 830.
[0144] A target primitive primitive acquisition module 810 is configured to acquire a power grid equipment model and perform primitive decomposition according to components of the power grid equipment model to obtain at least one target primitive primitive.
[0145] The target parameter data determination module 820 is used to extract parameter data from each target primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model;
[0146] The target parameter data sending module 830 is used to send the target parameter data to the GPU, so that the GPU performs geometric discretization and primitive rendering according to the target parameter data.
[0147] Optionally, the target primitive acquiring module 810 includes:
[0148] A preliminary classification result determination unit is used to obtain a power grid device model and classify the device model according to the node name and drive parameters of the power grid device model to obtain a preliminary classification result of the device model;
[0149] The target basic body primitive determination unit is used to split the components of each power grid equipment model in the preliminary classification result into primitives based on the preliminary classification result to obtain at least one target basic body primitive.
[0150] Optionally, the device further includes:
[0151] An instantiation module is used to instantiate the power grid device model according to the target parameter data before sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, and obtain model entity parameters corresponding to the instantiated model;
[0152] The target parameter data sending module 830 includes:
[0153] A parameter data sending unit is used to respond to discrete rendering requests of multiple target power grid device models under the same entity, and send the target model entity parameters corresponding to the multiple target power grid device models and the individual parameter data corresponding to each target power grid device model to the GPU; the GPU performs geometric discretization and primitive rendering based on the target model entity parameters and each individual parameter data.
[0154] Optionally, the device further includes:
[0155] A memory space occupancy value determination module is used to determine the GPU memory space occupancy value of a single individual parameter data and the GPU memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity;
[0156] A video memory space occupancy determination module, configured to determine the occupancy of each GPU video memory space according to the GPU video memory space occupancy value and the GPU video memory space occupancy start value in response to an update of the target power grid device model;
[0157] The memory compaction instruction module is used to instruct the GPU to perform memory compaction when the GPU memory space occupancy meets a preset occupancy condition.
[0158] Optional memory compaction indicator module, including:
[0159] The memory compaction instruction unit is used to instruct the GPU to perform memory compaction when the occupancy rate of the GPU memory space is less than a preset effective usage rate and the occupancy status of the GPU memory space is not updated within a preset time.
[0160] The discrete rendering apparatus for a power grid device model provided by an embodiment of the present invention can execute the discrete rendering method for a power grid device model provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0161] Example 5
[0162] Figure 9 Schematic diagram of a discrete rendering device for a power grid equipment model according to the fifth embodiment of the present invention. Figure 9 As shown, the device is executed by a GPU, and includes: a triangle surface data determination module 910 and a rendering module 920.
[0163] The triangle surface data determination module 910 is used to obtain the target parameter data sent by the CPU, and perform geometric discretization based on the target parameter data through the optional rendering pipeline shader to obtain triangle surface data;
[0164] The rendering module 920 is used to render the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid device model.
[0165] Optionally, the device further includes:
[0166] A memory compaction indication acquisition module is used to acquire a memory compaction indication sent by the CPU; wherein the memory compaction indication is obtained by the CPU based on the determined occupancy of each GPU memory space;
[0167] The memory compaction module is used to perform memory compaction according to the memory compaction instruction.
[0168] The discrete rendering apparatus for a power grid device model provided by an embodiment of the present invention can execute the discrete rendering method for a power grid device model provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0169] Example 6
[0170] Figure 10A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0171] like Figure 10 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0172] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0173] Processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any other suitable processors, controllers, microcontrollers, etc. Processor 11 executes the various methods and processes described above, such as the discrete rendering method for the power grid device model.
[0174] In some embodiments, the method for discrete rendering of a power grid device model can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for discrete rendering of a power grid device model described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the method for discrete rendering of a power grid device model in any other suitable manner (e.g., via firmware).
[0175] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0176] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0177] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0178] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0179] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0180] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0181] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0182] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A discrete rendering method for a power grid equipment model, characterized in that: The method is executed by a CPU, and includes: Acquire a power grid equipment model, and perform primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive; Extracting parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid equipment model; wherein the target parameter data is used to represent the power grid equipment model; Sending the target parameter data to the GPU, so that the GPU performs geometric discretization and primitive rendering according to the target parameter data; Before sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, the method further includes: instantiating a power grid device model according to the target parameter data to obtain model entity parameters corresponding to the instantiated model; the target parameter data of the target power grid device model includes: corresponding target model entity parameters and individual parameter data; The method further includes: determining a GPU memory space occupancy value of a single individual parameter data and a GPU memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity; in response to an update of the target power grid device model, determining the occupancy status of each GPU memory space based on the GPU memory space occupancy value and the GPU memory space occupancy starting value; and instructing the GPU to perform memory compaction when the GPU memory space occupancy meets a preset occupancy condition; When the GPU memory space occupancy meets a preset occupancy condition, instructing the GPU to perform memory compaction, including: when the GPU memory space occupancy rate is less than a preset effective usage rate, and the GPU memory space occupancy is not updated within a preset time, instructing the GPU to perform memory compaction; The method further includes: when individual parameter data is added, adding after each individual parameter data; when individual parameter data is deleted, setting an invalid bit in the CPU side memory space according to the corresponding offset parameter; when individual parameter data is changed, changing the individual parameter data accordingly according to the corresponding offset parameter; The preset effective usage rate is set to a value within a range of 50% to 80%.
2. The method according to claim 1, characterized in that Acquire a power grid equipment model, and perform primitive decomposition according to the components of the power grid equipment model to obtain at least one target basic body primitive, including: Obtaining a power grid device model, and classifying the device model according to the node name and drive parameters of the power grid device model to obtain a preliminary classification result of the device model; Taking the preliminary classification result as a unit, the component parts of each power grid equipment model in the preliminary classification result are split into primitives to obtain at least one target basic body primitive.
3. The method according to claim 2, characterized in that Sending the target parameter data to a GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, including: In response to discrete rendering requests for multiple target power grid device models under the same entity, target model entity parameters corresponding to the multiple target power grid device models and individual parameter data corresponding to each target power grid device model are sent to the GPU; The GPU is used to perform geometric discretization and primitive rendering according to the target model entity parameters and each individual parameter data.
4. A discrete rendering method for a power grid equipment model, characterized in that: The method is executed by a GPU, and includes: Obtain the target parameter data sent by the CPU, and perform geometric discretization based on the target parameter data through the optional rendering pipeline shader to obtain triangle surface data; Rendering is performed using a conventional rendering pipeline shader according to the triangular surface data to obtain a display result of the power grid device model; Obtain a memory compaction indication sent by the CPU; wherein the memory compaction indication is obtained by the CPU according to the determined occupation status of each GPU memory space; when individual parameter data is increased, the CPU increases it after each individual parameter data; when individual parameter data is deleted, an invalid bit is set for the CPU-side memory space according to the corresponding offset parameter; when individual parameter data is changed, the individual parameter data is changed accordingly according to the corresponding offset parameter; the CPU responds to the update of the target power grid device model, and determines the occupation status of each GPU memory space according to the GPU memory space occupation value and the GPU memory space occupation starting value; when the occupation of the GPU memory space meets the preset occupation condition, the GPU is instructed to perform memory compaction; Perform video memory compaction according to the video memory compaction instruction.
5. A discrete rendering method for a power grid equipment model, characterized in that: The method comprises: The CPU obtains a power grid equipment model, and performs primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive; The CPU extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model; The CPU sends the target parameter data to the GPU; The GPU performs geometric discretization according to the target parameter data through an optional rendering pipeline shader to obtain triangular surface data; The GPU renders the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid device model; Before the CPU sends the target parameter data to the GPU, the method further includes: the CPU instantiates the power grid device model according to the target parameter data to obtain model entity parameters corresponding to the instantiated model; the target parameter data of the target power grid device model includes: corresponding target model entity parameters and individual parameter data; The method further includes: a CPU determining a GPU memory space occupancy value of a single individual parameter data and a GPU memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity; in response to an update of the target power grid device model, the CPU determining an occupancy status of each GPU memory space based on the GPU memory space occupancy value and the GPU memory space occupancy starting value; and when the GPU memory space occupancy meets a preset occupancy condition, the CPU instructing the GPU to perform memory compaction; The method further includes: when the individual parameter data is increased, the CPU adds it after each individual parameter data; when the individual parameter data is deleted, setting an invalid bit in the CPU-side memory space according to the corresponding offset parameter; when the individual parameter data is changed, the individual parameter data is changed according to the corresponding offset parameter; When the occupancy of the GPU video memory space meets a preset occupancy condition, the CPU instructs the GPU to perform video memory compaction, including: when the occupancy rate of the GPU video memory space is less than a preset effective usage rate, and the occupancy of the GPU video memory space is not updated within a preset time, the CPU instructs the GPU to perform video memory compaction; wherein the preset effective usage rate is set to a value within a range of 50% to 80%; The GPU obtains a video memory compaction instruction sent by the CPU; wherein the video memory compaction instruction is obtained by the CPU based on the determined occupancy of each video memory space of the GPU; The GPU performs video memory compaction according to the video memory compaction instruction.
6. A discrete rendering device for a power grid equipment model, characterized in that: The device is executed by a CPU, and the device includes: A target primitive primitive acquisition module is used to acquire a power grid equipment model and perform primitive decomposition according to the components of the power grid equipment model to obtain at least one target primitive primitive; a target parameter data determination module, configured to extract parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model; A target parameter data sending module, configured to send the target parameter data to the GPU, so that the GPU performs geometric discretization and primitive rendering according to the target parameter data; The apparatus further includes: an instantiation module configured to instantiate a power grid device model according to the target parameter data before sending the target parameter data to the GPU so that the GPU performs geometric discretization and primitive rendering according to the target parameter data, thereby obtaining model entity parameters corresponding to the instantiated model; the target parameter data of the target power grid device model includes corresponding target model entity parameters and individual parameter data; The device further includes: a video memory space occupancy value determination module, configured to determine a GPU video memory space occupancy value of a single individual parameter data and a GPU video memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity; a video memory space occupancy value determination module, configured to determine the occupancy status of each video memory space of the GPU according to the GPU video memory space occupancy value and the GPU video memory space occupancy starting value in response to an update of the target power grid device model; and a video memory compaction indication module, configured to instruct the GPU to perform video memory compaction when the occupancy of the GPU video memory space meets a preset occupancy condition; The memory compaction instruction module includes: a memory compaction instruction unit, which is used to instruct the GPU to perform memory compaction when the occupancy rate of the GPU memory space is less than a preset effective usage rate and the occupancy status of the GPU memory space is not updated within a preset time; The device is further configured to: when individual parameter data is added, add it after each individual parameter data; when individual parameter data is deleted, set an invalid bit in the CPU side memory space according to the corresponding offset parameter; when individual parameter data is changed, change the individual parameter data accordingly according to the corresponding offset parameter; The preset effective usage rate is set to a value within a range of 50% to 80%.
7. The device according to claim 6, characterized in that The target primitive acquisition module includes: a preliminary classification result determination unit, configured to obtain a power grid device model, and classify the device model according to the node name and drive parameters of the power grid device model to obtain a preliminary classification result of the device model; The target basic body primitive determining unit is configured to perform primitive decomposition on the components of each power grid equipment model in the preliminary classification result based on the preliminary classification result, so as to obtain at least one target basic body primitive.
8. The device according to claim 7, characterized in that Target parameter data sending module, including: A parameter data sending unit is used to respond to discrete rendering requests of multiple target power grid device models under the same entity, and send the target model entity parameters corresponding to the multiple target power grid device models and the individual parameter data corresponding to each target power grid device model to the GPU; and perform geometric discretization and primitive rendering according to the target model entity parameters and each individual parameter data by the GPU.
9. A discrete rendering device for a power grid equipment model, characterized in that: The device is executed by a GPU, and the device includes: A triangle surface data determination module is used to obtain target parameter data sent by the CPU, and to perform geometric discretization based on the target parameter data through an optional rendering pipeline shader to obtain triangle surface data; A rendering module, configured to render the triangular surface data using a conventional rendering pipeline shader to obtain a display result of the power grid device model; A video memory compaction indication acquisition module, for acquiring a video memory compaction indication sent by the CPU; wherein, the video memory compaction indication is obtained by the CPU based on the determined occupation status of each video memory space of the GPU; when individual parameter data is increased, the CPU adds it after each individual parameter data; when individual parameter data is deleted, an invalid bit is set for the CPU-side memory space according to the corresponding offset parameter; when individual parameter data is changed, the individual parameter data is changed accordingly according to the corresponding offset parameter; in response to the update of the target power grid device model, the CPU determines the occupation status of each video memory space of the GPU according to the GPU video memory space occupation value and the GPU video memory space occupation starting value; when the occupation of the GPU video memory space meets the preset occupation condition, the GPU is instructed to perform video memory compaction; A video memory compaction module is configured to perform video memory compaction according to the video memory compaction instruction.
10. A discrete rendering system for a power grid equipment model, characterized in that: The system comprises: The CPU obtains a power grid equipment model, and performs primitive decomposition according to components of the power grid equipment model to obtain at least one target basic body primitive; The CPU extracts parameter data from each target basic body primitive to obtain target parameter data corresponding to the power grid device model; wherein the target parameter data is used to represent the power grid device model; The CPU sends the target parameter data to the GPU; The GPU performs geometric discretization according to the target parameter data through an optional rendering pipeline shader to obtain triangular surface data; The GPU renders the triangular surface data through a conventional rendering pipeline shader to obtain a display result of the power grid device model; Before the CPU sends the target parameter data to the GPU, the method further includes: the CPU instantiates the power grid device model according to the target parameter data to obtain model entity parameters corresponding to the instantiated model; the target parameter data of the target power grid device model includes: corresponding target model entity parameters and individual parameter data; The system further includes: a CPU determining a GPU memory space occupancy value of a single individual parameter data and a GPU memory space occupancy starting value of each individual parameter data corresponding to multiple target power grid device models under the same entity; in response to an update of the target power grid device model, the CPU determines the occupancy status of each GPU memory space based on the GPU memory space occupancy value and the GPU memory space occupancy starting value; when the GPU memory space occupancy meets a preset occupancy condition, the CPU instructs the GPU to perform memory compaction; The system further includes: when individual parameter data is added, the CPU adds data after each individual parameter data; when individual parameter data is deleted, the CPU side memory space is set to an invalid bit according to the corresponding offset parameter; when individual parameter data is changed, the individual parameter data is changed according to the corresponding offset parameter; When the occupancy of the GPU video memory space meets a preset occupancy condition, the CPU instructs the GPU to perform video memory compaction, including: when the occupancy rate of the GPU video memory space is less than a preset effective usage rate, and the occupancy of the GPU video memory space is not updated within a preset time, the CPU instructs the GPU to perform video memory compaction; wherein the preset effective usage rate is set to a value within a range of 50% to 80%; The GPU obtains a video memory compaction instruction sent by the CPU; wherein the video memory compaction instruction is obtained by the CPU based on the determined occupancy of each video memory space of the GPU; The GPU performs video memory compaction according to the video memory compaction instruction.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for discrete rendering of a power grid device model according to any one of claims 1 to 3 or claim 4.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the discrete rendering method of a power grid device model according to any one of claims 1 to 3 or claim 4 when executed.
Citation Information
Patent Citations
Three-dimensional design-based transmission and transformation project basic pixel construction method and system
CN108563857A
Three-dimensional model rendering method and device, equipment and storage medium
CN116704088A