A Design Method for Grouped Rendering Controls Based on Risk Indicators

By dividing the control into three parts—controller, renderer, and container—on-demand rendering and instance caching are achieved, solving the memory overflow and performance bottleneck problems caused by synchronous rendering in power systems, and improving rendering efficiency and system stability.

CN118626292BActive Publication Date: 2025-12-02STATE GRID FUJIAN ELECTRIC POWER RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410808512.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-12-02
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The current synchronous rendering method for risk indicators in power systems leads to excessive memory consumption, memory overflow, and performance bottlenecks, affecting rendering efficiency and system stability.

Method used

The control is divided into three parts: controller, renderer and container. Context data is passed through the container to realize on-demand rendering logic, forced rendering control and instance caching. Asynchronous rendering is adopted and the rendering process is optimized by combining caching mechanism.

Benefits of technology

It improves the rendering efficiency and stability of power systems, reduces memory consumption, and enhances the overall system performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626292B_ABST
    Figure CN118626292B_ABST
Patent Text Reader

Abstract

This invention provides a grouped rendering control design method based on risk indicators, comprising the following steps: Step 1: Divide the control into three parts: controller, renderer, and container; Step 2: Add a unique rendering identifier to the context, and implement matching verification and rendering logic in the renderer; Step 3: Implement global forced rendering configuration pass-through in the container to achieve forced rendering; Step 4: Implement sub-module rendering interception logic in the container; Step 5: According to the previous control division method, the container and its internal controls use the nearest parent context data acquisition method to obtain values, achieving a single data source for the module and realizing nested combination functionality. Applying this technical solution can provide more accurate, efficient, and reliable risk management in the power system construction process, improve the overall system efficiency and performance, and provide a better user experience and decision support.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system risk index technology, and in particular to a design method for a grouped rendering control based on risk indicators. Background Technology

[0002] In the process of building and improving the power system, the accurate assessment and monitoring of risk indicators are crucial to ensuring the reliable operation of the power system.

[0003] For the stable operation of the power system, the rendering of risk indicators needs to be real-time and efficient, so as to promptly identify, analyze and resolve potential problems in the system and ensure its normal operation.

[0004] Currently, risk metrics rendering typically employs synchronous rendering. Synchronous rendering is a procedural rendering method, and during synchronous execution, issues such as runtime blocking and inefficient memory resource allocation can arise, easily leading to excessive memory overhead in the rendering engine. When multiple complex metrics are rendered simultaneously, the rendering process is also more prone to performance bottlenecks such as memory overflow and rendering stutters, resulting in rendering efficiency and system stability problems.

[0005] Currently, risk metrics are typically rendered synchronously. This method suffers from issues such as blocking and insufficient memory allocation during execution, easily leading to excessive memory overhead in the rendering engine. When rendering multiple complex metrics simultaneously, memory overflow and performance bottlenecks may occur, impacting rendering efficiency and system stability.

[0006] To address the issues present in the current synchronous rendering approach, asynchronous rendering can be considered. Asynchronous rendering can effectively resolve problems such as blocking and insufficient resource allocation in synchronous rendering, thereby reducing the memory overhead of the rendering engine. By asynchronously processing rendering tasks with multiple complex metrics, memory overflow and performance bottlenecks can be avoided, improving the overall performance and stability of the system. Furthermore, methods such as introducing caching mechanisms can be explored to further enhance rendering efficiency and system reliability. Summary of the Invention

[0007] In view of this, the purpose of this invention is to provide a group rendering control design method based on risk indicators, which can provide more accurate, efficient and reliable risk management for the power system construction process, improve the efficiency and performance of the overall system, and provide a better user experience and decision support.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: a method for designing a grouped rendering control based on risk indicators, comprising the following steps:

[0009] Step 1: Divide the control into three parts: controller, renderer, and container, and share the context data to the controller and renderer through container pass-through;

[0010] Step 2: Add a unique rendering identifier to the context, implement matching verification and rendering logic in the renderer, and realize on-demand rendering logic;

[0011] Step 3: Implement global forced rendering configuration pass-through in the container, implement local forced rendering configuration control in the controller, and implement style-based visible / hidden state rendering control logic in the renderer to achieve forced rendering;

[0012] Step 4: Implement the submodule rendering interception logic in the container, capture and store the rendering instance in the context, and render the instance object according to the method of pre-cached object verification to achieve instance cache rendering;

[0013] Step 5: Based on the division method of the preceding controls, the container and its internal controls use the method of obtaining the data from the nearest parent context to achieve a single data source for the module and realize the nested combination function.

[0014] In a preferred embodiment, step 1 specifically includes:

[0015] The control contains a container, which wraps the control module, rendering module, and context instance, and injects global property values ​​and global property update methods.

[0016] The container implements a context wrapping function, which includes the internal child controls in the context provider, and provides data-driven methods for the internal control module and rendering module to obtain the nearest parent context object;

[0017] The control contains a controller, which is the main control module for group switching. The controller has the following characteristics, including rendering group control module and control of up and down rendering indicators;

[0018] The control contains a renderer, which is the bound module for module rendering. The renderer renders the specified module based on the rendering flag of the context.

[0019] In a preferred embodiment, step 2 specifically includes:

[0020] The unique identifier of the context serves as the primary basis for the generation of the renderer's rendering module. This value needs to be generated based on the configuration data and the forced rendering identifier, and it applies to both the control module and the rendering module.

[0021] The matching and verification logic for rendering is based on a unique identifier and is divided into initial rendering and secondary rendering.

[0022] In a preferred embodiment, step 3 specifically includes:

[0023] The container enables global rendering configuration pass-through, which can be based on the container component's custom properties. After being passed through the component, the value is stored in the context inside the component.

[0024] In a preferred embodiment, step 4 specifically includes:

[0025] To implement cached rendering by caching instances, cached object instances need to be initialized in the context object. The cached object instances can use the rendering module identifier as the attribute key and the rendering module instance as the attribute value.

[0026] After the rendering module calls the rendering method for the first time, the rendering instance returned by the rendering method is saved in the context cache object in the data format of an object;

[0027] During the secondary rendering process, the system checks whether the identifier of the rendering module exists in the cached object instance. If it exists, the object in the instance is directly copied to the renderer. If it does not exist, it is defined as the first rendering, and the instance is saved according to the cached object saving method described above.

[0028] Compared with existing technologies, this invention has the following advantages: It divides the control into three parts: a controller, a renderer, and a container, and uses the container to share context data with the controller and renderer. Features include adding a unique rendering identifier to the context and implementing matching validation and rendering logic in the renderer to achieve on-demand rendering. Furthermore, the container implements global forced rendering configuration pass-through, the controller implements local forced rendering configuration control, and the renderer implements style-based show / hide state rendering control logic, thus achieving forced rendering. Additionally, the container implements sub-module rendering interception logic, capturing and storing rendering instances in the context, and rendering instance objects through pre-cached object validation, achieving instance cache rendering. Moreover, based on the pre-control division method, the container and its internal controls obtain values ​​using the nearest parent context data, achieving single data source and nested combination functionality for modules. Attached Figure Description

[0029] Figure 1 This application provides a schematic diagram of a group rendering main design process.

[0030] Figure 2 A schematic diagram of the grouping control relationship provided in an embodiment of this application;

[0031] Figure 3 This is a schematic diagram of market risk module grouping rendering provided in an embodiment of this application. Detailed Implementation

[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0033] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, 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.

[0034] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0035] A design method for grouped rendering controls based on risk indicators, referenced Figure 1-3 This invention provides more accurate, efficient, and reliable risk management for power system construction, improves the overall system efficiency and performance, and offers a better user experience and decision support. The controls in this application are characterized by: dividing the control into three parts: a controller, a renderer, and a container; sharing context data with the controller and renderer through container pass-through; adding a unique rendering identifier to the context; implementing matching verification and rendering logic in the renderer to achieve on-demand rendering logic; implementing global forced rendering configuration pass-through in the container; implementing local forced rendering configuration control in the controller; and implementing style-based show / hide state rendering control logic in the renderer to achieve forced rendering; implementing sub-module rendering interception logic in the container; capturing and storing rendering instances in the context; and rendering instance objects according to the pre-cached object verification method to achieve instance cache rendering; and, according to the pre-control division method, the container and its internal controls use the nearest parent context data acquisition method to obtain values, achieving a single data source for the module and enabling nested combination functionality.

[0036] According to one aspect of the feature requirements, in step 101, the control is divided into three parts: a controller, a renderer, and a container. Context data is shared to the controller and renderer through container pass-through. By dividing the control, the control achieves a specialized function and assemblable characteristics.

[0037] According to step 201, the control contains a container, which wraps the control module, rendering module, and context instance, and injects global property values ​​and global property update methods.

[0038] Step 202: The container implements a context wrapping function, including internal child controls as context providers, and provides data-driven methods for the internal control and rendering modules to obtain the most recent parent context object. Through this logic, it ensures that internal rendering data and control use a unified context data source. The context needs to include a unique rendering identifier, cached instance objects, a pre-rendering identifier, and a forced rendering switch, etc.

[0039] Step 203: The control contains a controller, which is the main control module for group switching. The controller has the following characteristics, including a rendering group control module and a control for up and down rendering identifiers.

[0040] The controller must be applied inside the container, assembled and applied in a wrapped manner.

[0041] The controller internally searches for the nearest parent context object and associates its internal getter and controller methods with the memory address of the context object. When a value is updated, the value of the context object's property is also updated.

[0042] The controller's configuration data needs to be bound to a unique identifier. For controllers without a bound identifier, identifier data is dynamically generated based on an index. The control module is then dynamically rendered based on the configuration data and the identifier data.

[0043] Within the control module, the binding operation triggers a static callback function for the event. The callback function is associated with the identifier data and dynamically updates the unique identifier of the context based on the event execution, thereby achieving rendering control.

[0044] Step 204: The control contains a renderer. The renderer is the module bound to the module rendering. The renderer renders the specified module according to the rendering identifier of the context.

[0045] The renderer must be applied inside the container, assembled and applied in a wrapped manner.

[0046] The renderer's rendering module configuration data and the controller configuration data mentioned above come from the same source, and correspond one-to-one with the controller modules generated by the controller. One controller module controls one renderer module.

[0047] The renderer's value retrieval and update methods are derived from the controller to ensure that control and rendering are related.

[0048] The renderer's rendering module needs to have a lifecycle, and a static rendering method needs to be bound to the lifecycle method. The static method needs to include: capturing the rendering module instance and listening to and updating the context cache instance object data. The rendering module instance is captured by binding it using an index, with a unique identifier as the key and the instance reference address as the property value, and dynamically updated to the context object for subsequent rendering control.

[0049] According to another aspect of the feature requirements, in step 102, a unique rendering identifier is added to the context, and the matching verification and rendering logic are implemented in the renderer to realize the on-demand rendering logic.

[0050] Essentially, the unique identifier of the context serves as the primary basis for the rendering module's generation. This value needs to be generated based on the configuration data and the forced rendering identifier, and it applies to both the control module and the rendering module.

[0051] It is necessary. The matching and verification logic for rendering is based on a unique identifier and is divided into initial rendering and secondary rendering, as detailed below:

[0052] The first render needs to determine the value of the unique identifier. If no default value is passed, the unique identifier is the identifier value of the first rendering module, and this value is saved to the context data source.

[0053] Secondary rendering is based on the identifier value in the context and listens for changes in that value, thus ensuring that local variables are the same as context variables.

[0054] Based on the unique context identifier obtained above, it is matched against the identifier in the rendering module. If the identifier values ​​match, the match is successful. The rendering module that successfully matches is retrieved, and only the rendering method of that module is called, thereby implementing the module's on-demand rendering logic.

[0055] According to another aspect of the feature requirements, in step 103, a global forced rendering configuration pass-through is implemented in the container, a local forced rendering configuration control is implemented in the controller, and a style-based visible / hidden state rendering control logic is implemented in the renderer to achieve forced rendering.

[0056] The container enables global rendering configuration pass-through. Custom properties of container components can be passed in through the component, and the values ​​are stored in the context within the component. The container, by default, wraps the controller and renderer, allowing them to listen to the context's configuration data and implement corresponding rendering control logic based on whether forced rendering is enabled. Specifically, this includes:

[0057] When forced rendering is enabled, during the initialization phase, the rendering methods of all rendering modules are called, and default styles are passed through the rendering modules. Rendering modules whose styles do not match the context's unique identifier are injected with hidden rendering style properties. In this rendering mode, the rendering modules execute the corresponding component rendering logic, but these properties are not displayed on the page. When the unique identifier in the context object is switched via the controller, the hidden style properties of each rendering module are re-matched and changed. Based on this rendering logic, the effect of switching rendering modes is achieved by only changing style properties without re-executing the rendering logic, resulting in fast rendering.

[0058] When forced rendering is off, during the initialization phase, the on-demand rendering logic in the preceding steps is followed, and only the rendering module identifier that matches the context unique identifier is called. This rendering method can improve the efficiency of the first rendering.

[0059] According to another aspect of the feature requirements, in step 104, the submodule rendering interception logic is implemented in the container, the rendering instance is captured and stored in the context, and the instance object is rendered in accordance with the method of pre-cached object verification, thereby realizing instance cache rendering.

[0060] To implement cached rendering by caching instances, cached object instances need to be initialized in the context object. The cached object instances can use the rendering module identifier as the attribute key and the rendering module instance as the attribute value.

[0061] After the rendering module calls the rendering method for the first time, the rendering instance returned by the rendering method is saved to the context cache object in the data format of an object.

[0062] During the secondary rendering process, the system checks whether the identifier of the rendering module exists in the cached object instance. If it exists, the object in the instance is directly copied to the renderer. If it does not exist, it is defined as the first rendering, and the instance is saved according to the cached object saving method described above.

[0063] By using the above-mentioned cached object data format and caching logic, instance caching rendering can be achieved, thereby enabling a secondary rendering process with high-efficiency rendering.

[0064] According to another aspect of the feature requirements, in step 105, based on the division method of the preceding controls, the container and its internal controls use the method of obtaining the data of the nearest parent context to obtain values, thereby realizing a single data source for the module and realizing the nested combination function.

[0065] For controllers and renderers at the same level, they are uniformly wrapped in the same container and use the same context object to get and set context data. The context can be implemented using object creation methods from component-based development models, such as React.context. During component rendering, events are subscribed to and consumed by the nearest node according to the component hierarchy. This ensures that each node component gets and sets a reference to the context from the nearest parent context instance. Contexts implemented in this way can be nested. Nested controllers and renderers will only access the context object set in the nearest parent element's container, thus achieving data isolation and preventing data corruption even after nesting.

[0066] This embodiment provides a method for designing a grouped rendering control based on risk indicators. The embodiment includes the following steps:

[0067] Step 301: Define risk theme configuration information according to business characteristics, including risk indicator items and the hierarchical relationship of risk rendering modules.

[0068] Step 302: Based on the configured hierarchical relationship of the risk rendering modules, assemble the risk rendering modules and use the indicator calculation identifier as the rendering matching identifier for each module. Then, assemble the identifiers, names, and rendering modules of each module into a tree-like data structure, and pass the grouping configuration data through to the grouping control to realize the rendering control of the indicator rendering module.

[0069] Depending on the configuration of the group control, two types of rendering modes can be supported, including on-demand rendering and forced rendering processes.

[0070] The on-demand rendering process includes the following steps:

[0071] Step 303: The group control uses on-demand rendering logic for module rendering by default. The rendering method can be changed by passing parameters through the group control.

[0072] Step 304: The group control is rendered on demand for the first time. Internally, the group control determines the value of a unique identifier based on the passed-through identifier data and rendering configuration data. If no default value is passed, the unique identifier is the identifier value of the first rendering module, and this value is saved to the context data source. Based on the determined unique identifier, the identifier value in the rendering configuration data is matched to determine the rendering module, and the rendering method of the rendering module is called, thereby realizing the functional rendering and display of a single risk module.

[0073] Step 305: The group component internally calls the controller to generate control modules based on the passed-through configuration data. Each control module is bound to a callback function with a unique identifier in the control context. After the callback function is triggered, the associated module identifier value replaces the unique identifier data in the context. The renderer listens and re-matches the identifier value of the rendering module with the unique identifier value in the context, renders the matching rendering module, and destroys the original rendering module, thereby achieving secondary on-demand rendering.

[0074] The forced rendering process includes the following steps:

[0075] Step 306: The group control can change the rendering mode to forced rendering mode by passing parameters. In the rendering process of the rendering module, the forced rendering mode will execute the rendering method of all modules during initialization and bind the hidden style attribute.

[0076] Step 307: The group control undergoes its initial forced rendering. Similar to the on-demand rendering logic, the group control internally generates and saves a unique identifier value to the context using the same logic. Rendering configuration data is processed by sequentially calling the rendering methods of all rendering modules in a loop, binding different style data based on whether the rendering identifier matches the unique identifier. If the match is successful, an explicit rendering style is bound; otherwise, an implicit rendering style is bound. In this way, the component's internal lifecycle is executed directly during initialization, and rendering instance information is directly stored in memory.

[0077] Step 308: The controller follows the same logic as the on-demand rendering module. It generates a control module through configuration data and binds an identifier value and callback function to control the unique identifier in the rendering context. The characteristic of forcing a change in the unique identifier of the rendering context is that the rendering module will not re-execute the rendering method; it will directly reuse the rendering instance generated during initialization. Simultaneously, the renderer recalculates the rendering style of the rendering module based on the updated unique identifier, thereby achieving control over the module's visibility. Switching in this way allows for highly efficient secondary display of the module.

[0078] The risk indicator-based grouped rendering control design method provided by this invention enables flexible rendering and display of modules according to the analysis results of risk indicators. Through on-demand rendering and rendering control mechanisms, system rendering efficiency can be improved, memory consumption reduced, and page loading speed accelerated. Furthermore, the design of a single data source and data isolation ensures data accuracy and reliability. This design method also possesses flexible component combination capabilities. Through the passing and nesting combination function of the nearest parent context data, modules can be dynamically combined according to actual needs to meet different requirements and changes in risk indicators.

[0079] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for designing a grouped rendering control based on risk indicators, characterized in that, Includes the following steps: Step 1: Divide the control into three parts: controller, renderer, and container, and share the context data to the controller and renderer through container pass-through; Step 2: Add a unique rendering identifier to the context, implement matching verification and rendering logic in the renderer, and realize on-demand rendering logic; Step 3: Implement global forced rendering configuration pass-through in the container, implement local forced rendering configuration control in the controller, and implement style-based visible / hidden state rendering control logic in the renderer to achieve forced rendering; Step 4: Implement the submodule rendering interception logic in the container, capture and store the rendering instance in the context, and render the instance object according to the method of pre-cached object verification to achieve instance cache rendering; Step 5: Based on the division method of the preceding controls, the container and its internal controls use the method of obtaining the data from the nearest parent context to achieve a single data source for the module and realize the nested combination function; Step 1 specifically includes: The control contains a container, which wraps the control module, rendering module, and context instance, and injects global property values ​​and global property update methods. The container implements a context wrapping function, which includes the internal child controls in the context provider, and provides data-driven methods for the internal control module and rendering module to obtain the nearest parent context object; The control contains a controller, which is the main control module for group switching. The controller has the following characteristics, including rendering group control module and control of up and down rendering indicators; The control contains a renderer, which is the bound module for module rendering. The renderer renders the specified module according to the rendering flag of the context. Step 2 specifically includes: The unique identifier of the context serves as the primary basis for the generation of the renderer's rendering module. This value needs to be generated based on the configuration data and the forced rendering identifier, and it applies to both the control module and the rendering module. The matching and verification logic for rendering is based on a unique identifier and is divided into initial rendering and secondary rendering.

2. The method for designing a grouped rendering control based on risk indicators according to claim 1, characterized in that, Step 3 specifically includes: The container implements global rendering configuration pass-through. Based on the container component's custom properties, the configuration is passed through the component and then stored in the context within the component.

3. The method for designing a grouped rendering control based on risk indicators according to claim 1, characterized in that, Step 4 specifically includes: To implement cached rendering by caching instances, cached object instances need to be initialized in the context object. The cached object instances use the rendering module identifier as the attribute key and the rendering module instance as the attribute value data format. After the rendering module calls the rendering method for the first time, the rendering instance returned by the rendering method is saved in the context cache object in the data format of an object; During the secondary rendering process, the system checks whether the identifier of the rendering module exists in the cached object instance. If it exists, the object in the instance is directly copied to the renderer. If it does not exist, it is defined as the first rendering, and the instance is saved according to the cached object saving method described above.

Citation Information

Patent Citations

  • Generating method, device, equipment and storage medium for image frame in application

    CN108363569A

  • Component linkage rendering method and device, electronic equipment, storage medium and product

    CN114661287A