Power supply partition dynamic coloring method, device and equipment and readable storage medium
By constructing a topology network and a dynamic color allocation mechanism, the problem of color allocation conflict in the traditional static coloring method for power supply zones is solved, realizing fast, accurate and stable dynamic coloring of power supply zones, and supporting the traceability of power grid structure changes and historical data.
Patent Information
- Application Number
- CN202511110527.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional static coloring methods for power supply zones are difficult to meet the coloring requirements of rapidly changing power supply zones, resulting in a high color allocation conflict rate and failing to meet the needs of power grid expansion and distributed energy access.
By constructing a topology network, the target substation is identified and traversed in descending order of voltage level. Colors are dynamically assigned, the color pool is expanded to avoid color conflicts, and a greedy algorithm and historical color backtracking mechanism are used for color allocation to ensure that each power supply zone has a unique color identifier.
It enables automatic avoidance of color conflicts in rapidly changing power supply zones, ensuring that each power supply zone has a unique color identifier, meeting the dynamic coloring requirements of power supply zones, and supporting real-time updates of power grid structure changes and the traceability of historical data.
Smart Images

Figure CN120974748A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power system technology, and in particular to a method, apparatus, device and readable storage medium for dynamic coloring of power supply zones. Background Technology
[0002] Dynamic coloring of power supply zones is a core technology for power system visualization management. Its goal is to intuitively reflect the operating status of each zone of the power grid through color coding. Traditional static zoning methods use predefined rules to color-code power supply zones with fixed topologies. However, with the expansion of the power grid and the integration of distributed energy resources, power supply zones change rapidly, and the conflict rate of color allocation between power supply zones is extremely high. Therefore, traditional methods are difficult to meet the coloring requirements of rapidly changing power supply zones. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for dynamic coloring of power supply zones, which can meet the coloring requirements of rapidly changing power supply zones, in order to address the above-mentioned technical problems.
[0004] Firstly, this application provides a method for dynamic coloring of power supply zones, including:
[0005] Construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed;
[0006] In the topology network, identify at least one target substation that matches the preset voltage level. Starting from each target substation, traverse the topology network in descending order of voltage level to identify the power supply zone corresponding to each target substation.
[0007] At least one power supply zone is color-assigned according to multiple colors in a preset color pool;
[0008] When there are multiple power supply zones, and the target power supply zone has the same color as other power supply zones, the preset color pool is expanded. The target color is determined in the expanded color pool, excluding the colors of non-target power supply zones. The target color is then used to reassign the target power supply zone.
[0009] In one embodiment, the power supply partition dynamic coloring method further includes:
[0010] If a change in equipment is detected in the power area to be processed, the topology network is updated, and the process of identifying at least one target substation in the topology network that matches the preset voltage level is repeated. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to each target substation, and the process is repeated to obtain at least one updated power supply zone.
[0011] If at least one updated power supply zone contains a newly added power supply zone, determine all adjacent power supply zones of the newly added power supply zone;
[0012] Determine colors that are not used by adjacent power supply zones from the preset color pool, and assign colors to newly added power supply zones using these unused colors.
[0013] In one embodiment, the power supply partition dynamic coloring method further includes:
[0014] If no new power supply zone is added in at least one updated power supply zone, determine the target substation to which each of the at least one updated power supply zone belongs; and set the color of the updated power supply zone corresponding to each of the at least one target substation to the color of the power supply zone before the update.
[0015] In one embodiment, determining the target color from the expanded color pool, excluding colors from non-target power supply zones, includes:
[0016] Retrieve the historical colors of non-target power supply zones;
[0017] Historical colors are used to backtrack the colors of non-target power supply zones; the backtracked colors of non-target power supply zones are matched with historical colors.
[0018] The target color is the color in the expanded color pool, excluding the backtracked colors of non-target power supply zones.
[0019] In one embodiment, color expansion of a preset color pool includes:
[0020] Adjust the color parameters of the base colors in the preset color pool;
[0021] The adjusted colors are added to the preset color pool to obtain the expanded color pool.
[0022] In one embodiment, starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to at least one target substation, including:
[0023] Starting from each target substation, traverse the topology network in descending order of voltage level;
[0024] For the current voltage level being traversed, search for all grid devices in the current voltage level that are connected to the grid devices of the previous voltage level, until the traversal stops when the preset traversal stop condition is met, and obtain the power supply zone corresponding to each of the target substations; the preset traversal stop condition includes at least one of the following: detecting a switch open, the current grid device does not have a sub-device node, and the current voltage level being traversed is lower than the preset level.
[0025] Secondly, this application also provides a power supply partition dynamic coloring device, comprising:
[0026] The building module is used to construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed;
[0027] The determination module is used to identify at least one target substation in the topology network that matches the preset voltage level. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to each target substation.
[0028] The allocation module is used to allocate colors to at least one power supply zone according to multiple colors in a preset color pool;
[0029] The reassignment module is used to expand the preset color pool when there are multiple power supply zones and the target power supply zone has the same color as other power supply zones. In the expanded color pool, the target color is determined, excluding the colors of non-target power supply zones, and the target color is used to reassign the target power supply zone.
[0030] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0031] Construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed;
[0032] In the topology network, identify at least one target substation that matches the preset voltage level. Starting from each target substation, traverse the topology network in descending order of voltage level to identify the power supply zone corresponding to each target substation.
[0033] At least one power supply zone is color-assigned according to multiple colors in a preset color pool;
[0034] When there are multiple power supply zones, and the target power supply zone has the same color as other power supply zones, the preset color pool is expanded. The target color is determined in the expanded color pool, excluding the colors of non-target power supply zones. The target color is then used to reassign the target power supply zone.
[0035] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0036] Construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed;
[0037] In the topology network, identify at least one target substation that matches the preset voltage level. Starting from each target substation, traverse the topology network in descending order of voltage level to identify the power supply zone corresponding to each target substation.
[0038] At least one power supply zone is color-assigned according to multiple colors in a preset color pool;
[0039] When there are multiple power supply zones, and the target power supply zone has the same color as other power supply zones, the preset color pool is expanded. The target color is determined in the expanded color pool, excluding the colors of non-target power supply zones. The target color is then used to reassign the target power supply zone.
[0040] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0041] Construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed;
[0042] In the topology network, identify at least one target substation that matches the preset voltage level. Starting from each target substation, traverse the topology network in descending order of voltage level to identify the power supply zone corresponding to each target substation.
[0043] At least one power supply zone is color-assigned according to multiple colors in a preset color pool;
[0044] When there are multiple power supply zones, and the target power supply zone has the same color as other power supply zones, the preset color pool is expanded. The target color is determined in the expanded color pool, excluding the colors of non-target power supply zones. The target color is then used to reassign the target power supply zone.
[0045] The aforementioned dynamic coloring method, apparatus, computer equipment, computer-readable storage medium, and computer program product for power supply zones construct a topology network through the connection relationships between multiple power grid devices in the power area to be processed. Within the topology network, at least one target substation matching a preset voltage level is identified. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to each target substation. Each power supply zone indicates the hierarchical structure for power transmission starting from the target substation. A preset color pool contains multiple colors, and color assignment is performed on at least one power supply zone. If there are multiple power supply zones, and the color of a target power supply zone is the same as the color of other power supply zones, it indicates a large number of power supply zones and a color conflict. The preset color pool is then expanded, and a target color (excluding the colors of non-target power supply zones) is determined from the expanded color pool. This target color is then used to reassign colors to the target power supply zones. This mechanism enables automatic avoidance during color assignment of each power supply zone, ensuring that different power supply zones have unique color identifiers and avoiding color conflicts. The color pool expansion mechanism can meet the coloring requirements of power supply zones in scenarios where power supply zones change rapidly. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is an application environment diagram of the power supply partition dynamic coloring method in one embodiment;
[0048] Figure 2 This is a flowchart illustrating a dynamic coloring method for power supply zones in one embodiment;
[0049] Figure 3 This is a flowchart illustrating the power supply partition dynamic coloring method in another embodiment;
[0050] Figure 4 This is a structural block diagram of a power supply partition dynamic coloring device in one embodiment;
[0051] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0053] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0054] The power supply partition dynamic coloring method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. This embodiment uses the method applied to server 104 as an example; it is understood that this method can also be applied to terminal 102, and can also be applied to a system including terminal 102 and server 104, and implemented through the interaction between terminal 102 and server 104. Server 104 constructs a topology network based on the connection relationships between multiple power grid devices in the power area to be processed; it determines at least one target substation matching a preset voltage level in the topology network; starting from each target substation, it traverses the topology network in descending order of voltage level to determine the power supply zone corresponding to each of the at least one target substation; it assigns colors to at least one power supply zone according to multiple colors in a preset color pool; if there are multiple power supply zones, and the color of a target power supply zone is the same as the color of other power supply zones, the preset color pool is expanded; a target color other than the color of non-target power supply zones is determined in the expanded color pool, and the target color is used to reassign colors to the target power supply zones. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0055] In one exemplary embodiment, such as Figure 2 As shown, a dynamic coloring method for power supply partitions is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 208. Wherein:
[0056] Step 202: Construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed.
[0057] The power area to be processed refers to the power area that needs to be dynamically colored for power supply zoning. This power area includes multiple power grid devices, such as power supply equipment (e.g., generators, substation transformers); transmission equipment (e.g., transmission lines, towers); distribution equipment (e.g., distribution transformers, switchgear, capacitors); and protection and control equipment (e.g., relays). These multiple power grid devices are physically or logically connected through electrical connections.
[0058] For multiple power grid devices in the power area to be processed, based on the device attributes of each power grid device, isolated nodes, i.e. power grid devices that have no connection relationship with other power grid devices, are filtered out. Multiple power grid devices with connection relationships are used as nodes of the topology network, and the connection relationships between power grid devices are used as variables of the topology network to construct the topology network.
[0059] In some embodiments, the topology network is represented using a linked list data structure. For each power grid device node, a unique identifier (e.g., device number), voltage level, device type, and other attribute information are recorded, while the hierarchical relationship between the parent and child nodes of that power grid device node is clearly defined. Power grid devices are abstracted into point devices, line devices, area devices, symbolic devices, etc. To accurately describe the connection relationships between devices, the concepts of fnode (from node, starting node) and tnode (to node, ending node) are introduced. In the linked list data structure of the constructed topology network, each record corresponds to a device connection relationship, and each record contains key information such as fnode identifier, tnode identifier, voltage level, and device number. In this way, the complex physical connection relationships of the power grid are transformed into structured topology table data, which not only facilitates storage and management but also provides efficient data support for subsequent operations such as recursive search and dynamic update of power supply area boundaries based on topology relationships. Each record in the topology table is like a "digital gene" of the power network topology, completely preserving the key information of power grid device connections, enabling the system to quickly respond to changes in the power grid structure and accurately perform dynamic coloring of power supply zones. In the process of constructing linked list data, a doubly linked list is used, which allows nodes to not only quickly access child nodes from parent nodes, but also child nodes to trace back to parent nodes, greatly improving the efficiency of data query and traversal.
[0060] Step 204: In the topology network, identify at least one target substation that matches the preset voltage level. Starting from each target substation, traverse the topology network in descending order of voltage level to identify the power supply zone corresponding to each target substation.
[0061] In this network, substations have rated voltages. Substations are classified into voltage levels according to pre-defined voltage level standards and their rated voltages. For example, voltage levels include 500kV, 220kV, and 110kV. A preset voltage level can be 500kV, and at least one target substation matching this preset voltage level refers to a substation in the network with a rated voltage of 500kV.
[0062] The target substation serves as the starting node for each power supply zone division. Traversing in descending voltage level means starting from each target substation and searching the topology network layer by layer in descending order of voltage level, traversing all reachable grid equipment downstream of the target substation, thus simulating the actual transmission path from high voltage to low voltage. For example, the traversal order in descending voltage level could be: 500kV substation → 220kV substation → 110kV substation → 35kV substation → 10kV substation.
[0063] Each power supply zone uniquely corresponds to a target substation, and each power supply zone can cover the power supply range of the corresponding target substation. The power grid equipment within each power supply zone forms a complete power supply path through connection relationships.
[0064] In some embodiments, multiple grid devices may exist at each voltage level. A breadth-first search (BFS) strategy can be used to visit all grid devices at the same voltage level before moving on to the next voltage level. This ensures that all relevant grid devices are fully covered during the search process, accurately determining the scope of each power supply zone. For example, when searching for a 220kV voltage level, all substations, lines, and other equipment nodes connected to the previous voltage level at that level will be visited to determine whether they belong to the current power supply zone.
[0065] Step 206: Assign colors to at least one power supply zone according to multiple colors in the preset color pool.
[0066] The preset color pool refers to a collection containing multiple colors. Each color can be represented using RGB color values, HSV color systems, or common color names, such as red and blue. The server uses multiple colors from the preset color pool to assign colors to at least one power supply partition. In some embodiments, when the number of power supply partitions is no greater than the number of colors in the preset color pool, different colors can be assigned to each of the at least one power supply partition. For example, the multiple colors in the preset color pool have their own numbers, and the at least one power supply partition can be assigned colors according to the order of these numbers. Sorting the colors in the preset color pool according to their numbers helps improve color assignment efficiency.
[0067] For example, the preset color pool also has its own occupancy information for various colors. Based on the occupancy information of each color, the unoccupied colors are determined, and at least one power supply zone is assigned colors according to the order of their respective numbers.
[0068] When there are multiple power supply zones, there may be cases where the number of power supply zones is less than the number of colors in the preset color pool. For power supply zones with a matching number of colors in the preset color pool, colors from the preset color pool are used to allocate colors to these zones one by one. For power supply zones with a number exceeding the preset color pool, a greedy algorithm can be used for color allocation. The greedy algorithm involves, for any power supply zone with a number exceeding the preset color pool, identifying all its neighboring power supply zones, querying the colors already allocated to each neighboring zone, filtering out colors not used by neighboring power supply zones from the preset color pool, selecting colors from these unused colors, and allocating them to the current power supply zone. A possible method for selecting colors is to choose the color with the smallest number from the unused colors. For example, if there are three available colors with numbers 3, 5, and 7, the color with number 3 can be allocated to the current power supply zone.
[0069] Step 208: When there are multiple power supply zones, and the color of the target power supply zone is the same as the color of other power supply zones, the preset color pool is expanded. In the expanded color pool, the target color is determined, excluding the color of the non-target power supply zone. The target color is then used to redistribute the color of the target power supply zone.
[0070] In cases where there are multiple power supply zones, and the number of power supply zones is less than the number of colors in the preset color pool, color allocation using the greedy algorithm in step 206 will result in color conflicts. This means that in multiple power supply zones, the target power supply zone may have the same color as other power supply zones. For example, if the preset color pool contains three colors: red, green, and blue, and power supply zones 1, 2, 3, and 4 are assigned the colors red, green, blue, and red respectively, then power supply zones 1 and 4 will have the same color, and power supply zone 4 will be the target power supply zone.
[0071] Based on this, embodiments of this application propose to expand the preset color pool by increasing the number of colors in the preset color pool to obtain an expanded color pool. For example, by expanding the preset color pool by 16 colors, the expanded color pool includes 19 colors.
[0072] The target power supply partition refers to the power supply partition with color conflicts, and the non-target power supply partition refers to at least one power supply partition other than the target power supply partition. The color of the non-target power supply partition can be obtained by the method in step 206, or it can be reassigned using colors from the expanded color pool. For example, the reassignment method can be to reassign colors to the non-power supply partition according to a greedy algorithm, or to update the colors based on the historical colors of the non-power supply partition.
[0073] For the target power supply zone, determine the target color from the expanded color pool, excluding colors for non-target power supply zones, and then reassign colors to the target power supply zone using the target color. This reassignment can be performed using a greedy algorithm.
[0074] In the aforementioned dynamic coloring method for power supply zones, a topology network is constructed based on the connection relationships between multiple power grid devices in the power area to be processed. At least one target substation matching a preset voltage level is identified within this topology network. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the corresponding power supply zone for each target substation. Each power supply zone indicates the hierarchical structure for power transmission starting from the target substation. A preset color pool contains multiple colors, and color assignment is performed on at least one power supply zone. If there are multiple power supply zones, and the color of a target power supply zone is the same as the color of other power supply zones, it indicates a large number of power supply zones and a color conflict. The preset color pool is then expanded, and a target color (excluding the colors of non-target power supply zones) is determined from the expanded color pool. This target color is then used to reassign colors to the target power supply zones. This method enables automatic avoidance during color assignment of each power supply zone, ensuring that different power supply zones have unique color identifiers and avoiding color conflicts. The color pool expansion mechanism can meet the coloring requirements of power supply zones in scenarios where power supply zones change rapidly.
[0075] In one exemplary embodiment, such as Figure 3 As shown, the dynamic coloring method for power supply zones also includes:
[0076] Step 302: If equipment changes are detected in the power area to be processed, update the topology network and return to the step of determining at least one target substation in the topology network that matches the preset voltage level. Starting from each target substation, traverse the topology network in descending order of voltage level to determine the power supply zone corresponding to each target substation and re-execute the step to obtain at least one updated power supply zone.
[0077] Step 304: If at least one updated power supply zone has a newly added power supply zone, determine all adjacent power supply zones of the newly added power supply zone.
[0078] Step 306: Determine the colors that are not used by adjacent power supply zones from the preset color pool, and assign colors to the newly added power supply zones using the unused colors.
[0079] The power area to be processed may have equipment changes, including changes in switch status, addition of equipment, etc. If equipment changes are detected, the topology network can be reconstructed using the method in step 202, and the power supply zones can be re-divided according to the method in step 204 based on the reconstructed topology network, resulting in at least one updated power supply zone.
[0080] When equipment changes include adding a target substation matching a preset voltage level, at least one updated power supply zone will have a newly added power supply zone. A greedy algorithm can be used for color allocation for this new power supply zone. Specifically, all adjacent power supply zones of the new power supply zone are identified, and the colors used by each adjacent power supply zone are obtained. Colors not used by adjacent power supply zones are determined from a preset color pool, and these unused colors are used to allocate color to the new power supply zone. For example, the color with the lowest number among the unused colors is used as the color for the new power supply zone.
[0081] In this embodiment, when there are equipment changes in the power area to be processed, the topology network is updated in real time and the power supply partitions are re-divided to ensure that the power supply partitions are consistent with the actual structure of the power grid, providing an accurate spatial reference for power dispatching, fault analysis, etc. In the case of new power supply partitions, the colors of adjacent power supply partitions are identified and unused colors are filtered to achieve automatic color avoidance between adjacent power supply partitions and avoid color conflicts between new power supply partitions.
[0082] In an exemplary embodiment, the power supply partition dynamic coloring method further includes: determining the target substation to which each of the at least one updated power supply partition belongs when there is no newly added power supply partition in at least one updated power supply partition; and determining the color of the updated power supply partition corresponding to each of the at least one target substation to be the color of the power supply partition before the corresponding update.
[0083] Among them, the equipment changes do not include the addition of a target substation that matches the preset voltage level. For example, it may include changes in switch status, etc., and at least one updated power supply zone does not have a newly added power supply zone.
[0084] The server determines the target substation to which each of the updated power supply zones belongs, and sets the color of the updated power supply zone corresponding to each of the at least one target substation to the color of the power supply zone before the update, ensuring that the color of the power supply zones of the same target substation remains unchanged before and after the update.
[0085] In this embodiment, for cases where no new power supply zones are added, the color of the updated power supply zone corresponding to at least one target substation is determined to be the color of the power supply zone before the update. This helps to ensure that the color of the power supply zones of the same target substation remains unchanged before and after the update, ensuring the stability and consistency of color identification and facilitating the traceability of historical data.
[0086] In one exemplary embodiment, determining a target color in the expanded color pool, excluding the color of a non-target power supply partition, includes: obtaining historical colors of the non-target power supply partition; performing color backtracking on the colors of the non-target power supply partition using the historical colors; matching the backtracked colors of the non-target power supply partition with the historical colors; and using the colors in the expanded color pool, excluding the backtracked colors of the non-target power supply partition, as the target color.
[0087] For non-target power supply zones, historical colors can be used for color updates. Specifically, the historical colors of the non-target power supply zones are obtained and used as the updated colors for those zones, ensuring that the colors of the same non-target power supply zone remain consistent with the historical colors.
[0088] The colors in the expanded color pool, excluding the backtracked colors of non-target power supply zones, are used as target colors. These target colors are then used to reassign colors to the target power supply zones.
[0089] In this embodiment, a color backtracking mechanism is used to restore the colors of non-target power supply zones to historical settings, avoiding color confusion caused by color expansion or conflict adjustments, and improving data traceability. For example, when the power grid structure is temporarily adjusted, the system can automatically restore the zone colors, ensuring that maintenance personnel's visual perception of fixed areas is not disturbed and maintaining the stability of the visualization interface.
[0090] In an exemplary embodiment, color expansion of a preset color pool includes: adjusting the color parameters of the base colors in the preset color pool; and adding the adjusted colors to the preset color pool to obtain an expanded color pool.
[0091] The base colors refer to colors in the preset color pool, such as red, green, and blue. Color parameter adjustments include, but are not limited to, brightness adjustment, saturation adjustment, and hue adjustment. For example, the adjusted colors include light red, light blue, and light green.
[0092] The color expansion method mainly involves adjusting the color parameters of the base colors in the preset color pool, and then adding the adjusted colors to the preset color pool. The expanded color pool includes both the base colors and the adjusted colors.
[0093] In this embodiment, by adjusting the color parameters of the basic colors in the preset color pool, the variety of colors in the color pool can be expanded. When the power supply partition data exceeds the number of colors in the preset color pool, the expanded color pool can provide sufficient color options and achieve more refined visual partitioning.
[0094] In an exemplary embodiment, starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to at least one target substation. This includes: starting from each target substation, traversing the topology network in descending order of voltage level; for the currently traversed voltage level, searching for all grid devices in the current voltage level that are connected to grid devices in the previous voltage level, until a preset traversal stop condition is met to stop the traversal, thereby obtaining the power supply zone corresponding to at least one target substation; the preset traversal stop condition includes at least one of the following: detecting a switch open, the current grid device not having a sub-device node, and the currently traversed voltage level being lower than a preset level.
[0095] In the process of determining the power supply zone, starting from each target substation, the topology network is traversed according to the voltage level from high to low (e.g., 500kV→220kV→110kV) to simulate the transmission path of electrical energy from high voltage to low voltage.
[0096] For the current voltage level being traversed, search for all grid devices in the current voltage level that are connected to grid devices in the previous voltage level. For example, a 220kV substation needs to search for all grid devices connected to a 500kV substation to ensure the completeness of devices in each voltage level.
[0097] Preset traversal stop conditions include: detecting a switch opening, such as when a circuit breaker or disconnector is detected to be open, traversing towards the next voltage level stops (e.g., if a 220kV line switch is open, its downstream 110kV equipment is not included in the current power supply zone); the current grid equipment does not have sub-device nodes, such as the current grid equipment has no downstream lower voltage level connection equipment (e.g., stopping after reaching a 10kV load point); and stopping at the current voltage level, such as 35kV, terminating the entire traversal process.
[0098] After each voltage level is traversed, the eligible power grid equipment within that level is incorporated into the power supply zone of the corresponding target substation. Finally, the equipment of all voltage levels is integrated to form the complete power supply zone of the target substation.
[0099] In this embodiment, the topology network is traversed in descending order of voltage level to ensure that the power supply zone boundary is consistent with the actual power supply link; the traversal path is automatically cut off when a switch is disconnected, and the changes in the power grid operation mode are reflected in real time (such as when a switch is disconnected during maintenance of a line, its downstream zone is not included in the current substation power supply range), thereby improving the accuracy of zone division; the traversal is terminated in advance when the voltage level is lower than the preset level or there are no sub-device nodes, thereby improving the efficiency of power supply zone division.
[0100] To illustrate the power supply zone dynamic coloring method and its effects in this solution in detail, a specific embodiment is provided below:
[0101] Step 1: Initialize power grid data: Input device attribute table, filter isolated nodes (such as power grid devices without connection relationships). Preprocess voltage level data.
[0102] Step 2: Constructing the Topology Network: In power systems, the connections between devices are intricate and complex. To process and analyze these relationships more efficiently, the device connections are converted into a linked list data structure. Specifically, for each device node, its unique identifier (such as device number), voltage level, device type, and other attribute information are recorded, while the hierarchical relationship between parent and child nodes is clearly defined. Power grid devices are abstracted into point devices, line devices, area devices, symbolic devices, etc. To accurately describe the connections between devices, the concepts of fnode (from node, starting node) and tnode (to node, ending node) are introduced. When constructing the topology table, each record corresponds to a device connection relationship, containing key information such as fnode identifier, tnode identifier, voltage level, and device number. In this way, the complex physical connections of the power grid are transformed into structured topology table data, which not only facilitates storage and management but also provides efficient data support for subsequent operations such as recursive search and dynamic updates of power supply area boundaries based on topology relationships. Each record in the topology table is like a "digital gene" of the power network topology, completely preserving the key information of device connections, enabling the system to quickly respond to changes in the power grid structure and accurately perform dynamic coloring of power supply zones. In the process of constructing linked list data, a doubly linked list is used, which allows nodes to not only quickly access child nodes from parent nodes, but also child nodes to trace back to parent nodes, greatly improving the efficiency of data query and traversal.
[0103] Step 3: Recursive Search for Supply Area Boundaries: Starting from the target substation (e.g., a 500kV substation), traverse layer by layer in descending order of voltage level (500kV→220kV→110kV). During the traversal, a breadth-first search (BFS) strategy is used, prioritizing all adjacent nodes at the same voltage level before moving to the next voltage level. This ensures comprehensive coverage of all relevant equipment nodes during the search, accurately determining the supply area. For example, when searching for the 220kV voltage level, all substations, lines, and other equipment nodes connected to the previous level at that voltage level are visited to determine if they belong to the current supply area. Preset traversal termination conditions: a) Voltage level lower than the preset level (e.g., 10kV distribution network). When traversing to a voltage level lower than the set level, the search stops because the power grid structure at this level is more complex and it is usually used as the end distribution network, having a relatively small impact on the overall power supply area; b) Switch open is detected. In the power network, the state of the switch directly affects the current flow path and the supply area. When a switch is detected to be open, it means that the power supply path has changed, and the device node after the switch no longer belongs to the current power supply area, thus terminating the search; c) Reaching a leaf node. A leaf node is a device node without child nodes. When the search reaches such a node, it indicates that the boundary of the power supply area has been traversed, and the search ends.
[0104] When a switch state changes, the power supply boundary is recalculated. By monitoring the open and closed states of switches in the power network in real time, the power supply boundary recalculation process is immediately initiated once a switch state change is detected. Based on the constructed topology network linked list data, starting from the affected node, the power supply boundary is recursively searched according to the aforementioned search rules and termination conditions, quickly and accurately updating the power supply range to adapt to dynamic changes in the power network topology and meet the needs of real-time scheduling.
[0105] Step 4: Color Allocation and Historical Consistency Management: The preset color pool serves as the core component for storing available color resources. In addition to preset basic colors (such as red, blue, green, and yellow), it employs a hierarchical expansion strategy. Initially, the color pool can contain 8 basic colors, each with a unique RGB code and color identifier. When the basic colors are about to run out, the system automatically activates the expansion mechanism. Based on the HSV color space model, it generates new colors with clear distinction from the basic colors by adjusting hue, saturation, and brightness parameters. For example, based on basic red, a light red can be generated by reducing saturation and increasing brightness, avoiding visual confusion caused by overly similar colors. Simultaneously, the color pool maintains a color usage status table, recording the occupancy of each color in real time, including the supply area number currently using the color, usage duration, and other information, providing data support for subsequent color allocation.
[0106] Historical colors can be stored using a hash table data structure, with the unique power supply zone number as the hash key and the corresponding historically allocated color as the hash value. The hash function can employ the FNV-1a algorithm, which is characterized by its fast computation speed and low probability of hash collisions, enabling rapid location of the historical color record corresponding to a power supply zone. During color allocation, the system first calculates the hash value based on the power supply zone number, and then quickly indexes the hash table using this hash value. If a historical record for that power supply zone exists in the hash table, the corresponding color is directly reused; otherwise, a new color allocation process is executed. To further optimize hash table performance, a chained hashing method is used to handle hash collisions. When multiple power supply zones have the same hash value, the color records for these zones are stored in the same hash bucket as a linked list, ensuring data integrity and query efficiency.
[0107] In the process of color allocation for newly added power supply zones, a greedy algorithm can be used to select colors according to the "local optimum" principle. The specific execution flow is as follows: The system first obtains a list of all adjacent power supply zones of the current power supply zone and queries the set of colors already allocated to adjacent power supply zones; then, it filters out colors not used by adjacent power supply zones from the preset color pool; if multiple available colors exist, the color with the smallest number in the preset color pool is selected for allocation. To improve algorithm efficiency, an ordered queue is maintained in the color pool data structure, sorted in ascending order of color number, so that no additional sorting operation is required each time the smallest available color is selected, and the color is directly obtained from the head of the queue.
[0108] When the preset color pool is exhausted and there are still power supply zones that need color allocation, the system enters the color conflict handling process. First, a color pool expansion operation is triggered, which can add multiple colors (e.g., 16) and update the color pool usage status table. Simultaneously, power supply zones with current color conflicts are marked, and the time of the conflict and related power supply zone information are recorded. For conflicting power supply zones, a backtracking algorithm is used to reallocate colors: the system backtracks to the most recent color allocation operation, releases the allocated but conflict-causing color, and returns it to the color pool; then, based on the updated color pool and the color status of adjacent power supply zones, a greedy algorithm is re-executed for color allocation. During the backtracking process, the system records each step of the operation and generates a conflict handling log for subsequent analysis and optimization of the color allocation strategy. In addition, the system sets a conflict threshold; when multiple color conflicts occur in the same power supply zone within a short period, a manual intervention process is automatically triggered, allowing maintenance personnel to manually adjust the color allocation scheme to ensure the accuracy and stability of the visualization results.
[0109] When changes in the network topology (such as adding equipment or removing lines) lead to adjustments in the power supply zone boundaries, the system recalculates the power supply zone boundaries and synchronously updates the historical color table. For unchanged power supply zones, historical colors are retained; for newly added power supply zones, colors are assigned according to the aforementioned color allocation rules, and the new color allocation record is added to the historical color table. Simultaneously, to ensure color consistency across different analysis periods, the system synchronizes the latest color allocation record to the distributed database after each color allocation operation. This data synchronization mechanism ensures that the historical color tables across multiple system nodes remain consistent, avoiding visualization chaos caused by data inconsistencies.
[0110] Step 5, Output Results: The visual interface displays the color of at least one power supply zone. In response to the trigger operation of any power supply zone, detailed information of that power supply zone (e.g., voltage level, number of devices, historical analysis records, etc.) can be displayed.
[0111] The aforementioned dynamic coloring method for power supply zones constructs a topology network based on the connection relationships between multiple power grid devices in the power area to be processed. Within this network, at least one target substation matching a preset voltage level is identified. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the corresponding power supply zone for each target substation. Each power supply zone indicates the hierarchical structure for power transmission starting from the target substation. A preset color pool contains multiple colors, and these colors are assigned to at least one power supply zone. If there are multiple power supply zones, and the target power supply zone has the same color as other power supply zones, it indicates a large number of power supply zones and a color conflict. The preset color pool is then expanded, and a target color (excluding colors for non-target power supply zones) is determined from the expanded pool. This target color is then used to reassign colors to the target power supply zones. This method enables automatic color avoidance during color assignment, ensuring that different power supply zones have unique color identifiers and avoiding color conflicts. The color pool expansion mechanism can meet the coloring requirements of power supply zones in scenarios where power supply zones change rapidly. In addition, it supports real-time topology network change response, and power supply zones can be updated in real time with an update delay of less than 1 second; it reduces color conflict rate, ensuring that the color of the same power supply zone is consistent with the historical color, and ensuring that the visualization results are traceable.
[0112] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0113] Based on the same inventive concept, this application also provides a power supply partition dynamic coloring apparatus for implementing the power supply partition dynamic coloring method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more power supply partition dynamic coloring apparatus embodiments provided below can be found in the limitations of the power supply partition dynamic coloring method described above, and will not be repeated here.
[0114] In one exemplary embodiment, such as Figure 4 As shown, a power supply partition dynamic coloring device 100 is provided, including: a construction module 120, a determination module 140, an allocation module 160, and a reallocation module 180, wherein:
[0115] Module 120 is used to construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed;
[0116] The determination module 140 is used to determine at least one target substation in the topology network that matches the preset voltage level. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to each target substation.
[0117] The allocation module 160 is used to allocate colors to at least one power supply zone according to multiple colors in a preset color pool;
[0118] The reallocation module 180 is used to expand the preset color pool when there are multiple power supply zones and the color of the target power supply zone is the same as the color of other power supply zones. In the expanded color pool, the target color is determined except for the color of the non-target power supply zone, and the target color is used to reallocate the color of the target power supply zone.
[0119] The aforementioned dynamic coloring device for power supply zones constructs a topology network based on the connection relationships between multiple power grid devices in the power area to be processed. Within this network, at least one target substation matching a preset voltage level is identified. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the corresponding power supply zone for each target substation. Each power supply zone indicates the hierarchical structure for power transmission starting from the target substation. A preset color pool contains multiple colors, and these colors are assigned to at least one power supply zone. If there are multiple power supply zones, and the target power supply zone's color is the same as other power supply zones, it indicates a large number of power supply zones and a color conflict. The preset color pool is then expanded, and a target color (excluding colors for non-target power supply zones) is determined from the expanded pool. This target color is then used to reassign colors to the target power supply zones. This automatic color avoidance mechanism ensures that different power supply zones have unique color identifiers, preventing color conflicts. The color pool expansion mechanism can meet the coloring requirements of power supply zones in scenarios where power supply zones change rapidly.
[0120] In one embodiment, the power supply zone dynamic coloring device 100 further includes a new power supply zone allocation module, which is used to: update the topology network when a change in equipment is detected in the power area to be processed, and return to the step of determining at least one target substation in the topology network that matches the preset voltage level, starting from each target substation, traversing the topology network in descending order of voltage level, and determining the power supply zone corresponding to each of the at least one target substation, to obtain at least one updated power supply zone; if there is a new power supply zone in the at least one updated power supply zone, determine all adjacent power supply zones of the new power supply zone; determine the color that is not used by the adjacent power supply zones from the preset color pool, and use the unused color to allocate color to the new power supply zone.
[0121] In one embodiment, the power supply zone dynamic coloring device 100 further includes an update zone allocation module, which is used to: determine the target substation to which each of the at least one updated power supply zone belongs when there is no newly added power supply zone in at least one updated power supply zone; and determine the color of the updated power supply zone corresponding to each of the at least one target substation as the color of the power supply zone before the update.
[0122] In one embodiment, the target color other than the color of the non-target power supply partition is determined in the expanded color pool. The reallocation module 180 is further configured to: obtain the historical color of the non-target power supply partition; perform color backtracking on the color of the non-target power supply partition using the historical color; match the backtracked color of the non-target power supply partition with the historical color; and use the color in the expanded color pool other than the backtracked color of the non-target power supply partition as the target color.
[0123] In one embodiment, the color expansion of the preset color pool is further performed by the redistribution module 180, which is used to: adjust the color parameters of the base colors in the preset color pool; and add the adjusted colors to the preset color pool to obtain the expanded color pool.
[0124] In one embodiment, starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to each target substation. The determining module 140 is further configured to: starting from each target substation, traverse the topology network in descending order of voltage level; for the current voltage level, search for all grid devices in the current voltage level that are connected to the grid devices of the previous voltage level, until a preset traversal stop condition is met and the traversal is stopped, thereby obtaining the power supply zone corresponding to each target substation; the preset traversal stop condition includes at least one of the following: detecting a switch open, the current grid device not having a sub-device node, and the current voltage level being lower than a preset level.
[0125] Each module in the aforementioned power supply zone dynamic coloring device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0126] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores the topology network, the colors corresponding to each power supply zone, and preset color pools. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a dynamic coloring method for power supply zones.
[0127] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0128] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0129] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0130] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0132] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0133] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0134] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for dynamic zoning of power supply, characterized in that, The method includes: Construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed; In the topology network, at least one target substation matching the preset voltage level is identified. Starting from each target substation, the topology network is traversed in descending order of voltage level to determine the power supply zone corresponding to each of the at least one target substation. At least one power supply zone is color-assigned according to multiple colors in a preset color pool; When there are multiple power supply zones, and the color of the target power supply zone is the same as the color of other power supply zones, the preset color pool is expanded. In the expanded color pool, a target color other than the color of the non-target power supply zone is determined, and the target color is used to redistribute the color of the target power supply zone.
2. The method according to claim 1, characterized in that, The method further includes: If a change in equipment is detected in the power area to be processed, the topology network is updated, and the step of determining at least one target substation in the topology network that matches the preset voltage level is re-executed, starting from each target substation, traversing the topology network in descending order of voltage level, and determining the power supply zone corresponding to each target substation, is re-executed to obtain at least one updated power supply zone. If at least one updated power supply zone contains a newly added power supply zone, determine all adjacent power supply zones of the newly added power supply zone; The color that is not used by the adjacent power supply zone is determined from the preset color pool, and the new power supply zone is assigned a color using the unused color.
3. The method according to claim 2, characterized in that, The method further includes: If no new power supply zone is added in at least one updated power supply zone, determine the target substation to which each of the at least one updated power supply zone belongs; and set the color of the updated power supply zone corresponding to each of the at least one target substation to the color of the power supply zone before the update.
4. The method according to claim 1, characterized in that, Determining the target color in the expanded color pool, excluding colors from non-target power supply zones, includes: Retrieve the historical colors of non-target power supply zones; The historical colors are used to perform color backtracking on the colors of the non-target power supply zones; the backtracked colors of the non-target power supply zones are matched with the historical colors. The target color is the color in the expanded color pool, excluding the backtracked color of the non-target power supply zone.
5. The method according to claim 1, characterized in that, The step of expanding the preset color pool includes: Adjust the color parameters of the base colors in the preset color pool; The adjusted color is added to the preset color pool to obtain the expanded color pool.
6. The method according to claim 1, characterized in that, Starting from each target substation, traversing the topology network in descending order of voltage level to determine the power supply zone corresponding to each target substation includes: Starting from each target substation, traverse the topology network in descending order of voltage level; For the current voltage level being traversed, search for all grid devices in the current voltage level that are connected to the grid devices of the previous voltage level, until the traversal stops when a preset traversal stop condition is met, and obtain the power supply zone corresponding to each of the at least one target substation; the preset traversal stop condition includes at least one of the following: detecting a switch open, the current grid device not having a sub-device node, and the current voltage level being traversed being lower than a preset level.
7. A power supply zone dynamic coloring device, characterized in that, The device includes: The building module is used to construct a topology network based on the connection relationships between multiple power grid devices in the power area to be processed; The determination module is used to determine at least one target substation in the topology network that matches a preset voltage level, starting from each target substation and traversing the topology network in descending order of voltage level to determine the power supply zone corresponding to each of the at least one target substation. The allocation module is used to allocate colors to at least one power supply zone according to multiple colors in a preset color pool; The reassignment module is used to expand the preset color pool when there are multiple power supply zones and the color of the target power supply zone is the same as the color of other power supply zones. In the expanded color pool, a target color other than the color of the non-target power supply zone is determined, and the target color is used to reassign the color of the target power supply zone.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.