Power message processing method and device based on adaptive partitioning, equipment, storage medium and program product

By using an adaptive partitioning processing method and an internal and external dual-loop control mechanism, the resource allocation of the power message processing system is dynamically adjusted, solving the problems of uneven load and fixed resource allocation in traditional power message processing, and achieving efficient and flexible power message processing.

CN121900983BActive Publication Date: 2026-06-09GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
Filing Date
2026-03-25
Publication Date
2026-06-09

Smart Images

  • Figure CN121900983B_ABST
    Figure CN121900983B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, readable storage medium, and program product for power message processing based on adaptive partitioning, belonging to the field of power data processing technology. This application can improve the flexibility and adaptability of power message processing. The method includes: configuring thread pools and lock-free queues for each partition according to the partition identifier of the service area-measurement point partition; dynamically adjusting the thread resource allocation of each service area-measurement point partition through an inner and outer double-loop control mechanism based on the thread pools and lock-free queues; routing measurement points to the corresponding service area-measurement point partitions for processing according to the partition mapping table based on the service area-measurement point partition structure and partition identifier to obtain message processing results; prioritizing the adjustment of the number of threads in each service area-measurement point partition through a partition load and thread resource control strategy to cope with short-term load fluctuations; if the inner-loop control cannot solve the problem, triggering structural adjustments to the service area-measurement point partition structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power data processing technology, and in particular to a power message processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product based on adaptive partitioning. Background Technology

[0002] With the rapid development of smart grids, various power terminal devices are constantly generating massive amounts of power messages. As the basic unit for transmitting information in the power system, the processing performance of power messages directly affects the real-time performance and reliability of key operations such as power dispatching, energy management, and fault diagnosis.

[0003] In traditional technologies, power message processing systems typically employ fixed thread pools and queue configurations, which cannot dynamically adjust resource allocation based on actual business load. This leads to resource waste or insufficient processing capacity during load fluctuations, and is particularly prominent in high-concurrency power system message processing scenarios. Traditional methods suffer from low flexibility and adaptability in power message processing, making it difficult to meet the real-time processing needs of modern power systems for massive amounts of power messages. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for power message processing based on adaptive partitioning to address the aforementioned technical problems.

[0005] Firstly, this application provides a power message processing method based on adaptive partitioning, including:

[0006] The original power message to be processed is obtained, and the original power message is partitioned into two levels: service area and measurement point. The service area-measurement point partitions are adjusted by a partition self-splitting and merging mechanism based on the binary search method to obtain the service area-measurement point partition structure. A partition identifier is assigned to each service area-measurement point partition in the service area-measurement point partition structure and a partition mapping table is maintained.

[0007] Based on the partition identifier, an independent thread pool and lock-free queue are configured for each of the business area-measurement point partitions. The thread resource allocation of each of the business area-measurement point partitions is dynamically adjusted through an inner and outer double-loop control mechanism based on the thread pool and the lock-free queue.

[0008] Based on the business area-measurement point partitioning structure and the partition identifier, the measurement points of the original power message are extracted by the front-end distributor, and the measurement points are routed to the corresponding business area-measurement point partitions for processing according to the partition mapping table to obtain the message processing result;

[0009] The message processing results are first stored in a buffer and then forwarded to the downstream system in batches. The number of threads in each business area-measurement point partition is adjusted first through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with the short-term load fluctuations, the structural adjustment of the business area-measurement point partition structure is triggered.

[0010] In one embodiment, the adjustment of the business area-measurement point partitioning through a binary-based partitioning self-splitting and merging mechanism includes:

[0011] In the service area-measurement point partition, the backlog coefficient, processing deviation coefficient, and message density coefficient are monitored and acquired in real time. Based on the backlog coefficient, the processing deviation coefficient, and the message density coefficient, a scoring function for each service area-measurement point partition is constructed by weighted summation. The scoring function is used to reflect the load status of each service area-measurement point partition. The service area-measurement point partition is adjusted according to the scoring function.

[0012] In one embodiment, adjusting the business area-measurement point partitioning according to the scoring function includes:

[0013] When the scoring function of any of the business area-measurement point partitions exceeds the splitting threshold for M1 consecutive monitoring periods, a splitting operation is triggered, generating two new business area-measurement point sub-partitions. The midpoint of the hash value range of the original business area-measurement point partition is used as the splitting point to divide the hash value range into two sub-ranges. The thread pool and the lock-free queue are configured for the business area-measurement point sub-partitions, and a new first partition mapping table is generated. When the scoring function of two adjacent business area-measurement point partitions is lower than the merging threshold for M2 consecutive monitoring periods, a merging operation is triggered, generating a new business area-measurement point merged partition. The thread pool and the lock-free queue are configured for the business area-measurement point merged partition, and a new second partition mapping table is generated. The hash range of the business area-measurement point merged partition covers the sum of the original two adjacent business area-measurement point partitions.

[0014] In one embodiment, the dynamic adjustment of thread resource allocation for each of the business area-measurement point partitions based on the thread pool and the lock-free queue through an inner and outer dual-loop control mechanism includes:

[0015] Based on the backlog coefficient, the processing deviation coefficient, and the message density coefficient, a partition state vector for the business area-measurement point partition is generated; the inner ring is used as a fast response layer, which adjusts the thread pool capacity within a single business area-measurement point partition according to the partition state vector; the outer ring is used as a structure adjustment layer, which adjusts the lock-free queue boundaries between adjacent business area-measurement point partitions.

[0016] In one embodiment, the step of adjusting the thread pool capacity within a single business area-measurement point partition by the fast response layer according to the partition state vector includes: periodically adjusting the thread pool capacity by the fast response layer according to the partition state vector; calculating the thread expansion ratio according to the expansion ratio when the backlog coefficient or the processing deviation coefficient exceeds the expansion threshold, and performing thread expansion according to the thread expansion ratio; and triggering thread recycling when both the backlog coefficient and the processing deviation coefficient are lower than the recycling threshold and the duration exceeds a preset time window.

[0017] The adjustment of the lockless queue boundary between each of the service area-measurement point partitions by the structure adjustment layer includes: periodically evaluating the load difference coefficient between each adjacent service area-measurement point partition; obtaining the overall system imbalance by calculating the maximum value of the load difference coefficient between all service area-measurement point partition pairs based on the load difference coefficient; and when the system imbalance exceeds a preset threshold, performing progressive lockless queue boundary adjustment on the target service area-measurement point partition pair with the largest difference.

[0018] In one embodiment, the strategy of adjusting the number of threads in each of the business area-measurement point partitions to cope with short-term load fluctuations through partitioned load and thread resource control includes:

[0019] When a change in the partition state vector is detected, the capacity of the thread pool is adjusted first through the inner and outer dual-loop control mechanism to adapt. Only when the number of threads in the thread pool reaches a preset upper limit and the scoring function exceeds the splitting threshold for N consecutive monitoring periods is a partition splitting operation triggered for the business area-measurement point partition. When the number of threads in the thread pools of two adjacent business area-measurement point partitions drops to a preset upper limit and the scoring function is lower than the merging threshold for N consecutive monitoring periods, a partition merging operation for the business area-measurement point partition is triggered.

[0020] Secondly, this application also provides a power message processing apparatus based on adaptive partitioning, comprising:

[0021] The message acquisition module is used to acquire the original power message to be processed, perform two-level partitioning of the original power message into a service area and a measurement point, and adjust the service area and measurement point partitions through a partition self-splitting and merging mechanism based on the binary search method to obtain the service area and measurement point partition structure. It assigns a partition identifier to each service area and measurement point partition in the service area and measurement point partition structure and maintains a partition mapping table.

[0022] The dynamic adjustment module is used to configure an independent thread pool and a lock-free queue for each of the business area-measurement point partitions according to the partition identifier, and dynamically adjust the thread resource allocation of each of the business area-measurement point partitions through an inner and outer double-loop control mechanism based on the thread pool and the lock-free queue.

[0023] The message processing module is used to extract the measurement points of the original power message through the front-end distributor based on the service area-measurement point partition structure and the partition identifier, and to route the measurement points to the corresponding service area-measurement point partition for processing according to the partition mapping table to obtain the message processing result.

[0024] The resource regulation module is used to first store the message processing results in a buffer and then forward them to the downstream system in batches. It also uses a partition load and thread resource regulation strategy to prioritize adjusting the number of threads in each of the business area-measurement point partitions to cope with short-term load fluctuations. If the inner loop regulation cannot cope with the short-term load fluctuations, it triggers a structural adjustment for the business area-measurement point partition structure.

[0025] 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:

[0026] The process involves acquiring the raw power message to be processed, performing a two-level partitioning process (service area-measurement point), and adjusting the service area-measurement point partitions using a partition self-splitting and merging mechanism based on binary search to obtain a service area-measurement point partition structure. Each service area-measurement point partition in this structure is assigned a partition identifier, and a partition mapping table is maintained. Based on the partition identifier, an independent thread pool and lock-free queue are configured for each service area-measurement point partition. The thread pool and lock-free queue are then dynamically adjusted using an inner and outer dual-loop control mechanism. Resource allocation; based on the business area-measurement point partitioning structure and the partition identifier, the measurement points of the original power message are extracted by the front-end distributor, and the measurement points are routed to the corresponding business area-measurement point partitions for processing according to the partition mapping table to obtain the message processing results; the message processing results are first stored in the buffer and then forwarded to the downstream system in batches, and the number of threads in each business area-measurement point partition is preferentially adjusted through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with the short-term load fluctuations, the structural adjustment of the business area-measurement point partitioning structure is triggered.

[0027] 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:

[0028] The process involves acquiring the raw power message to be processed, performing a two-level partitioning process (service area-measurement point), and adjusting the service area-measurement point partitions using a partition self-splitting and merging mechanism based on binary search to obtain a service area-measurement point partition structure. Each service area-measurement point partition in this structure is assigned a partition identifier, and a partition mapping table is maintained. Based on the partition identifier, an independent thread pool and lock-free queue are configured for each service area-measurement point partition. The thread pool and lock-free queue are then dynamically adjusted using an inner and outer dual-loop control mechanism. Resource allocation; based on the business area-measurement point partitioning structure and the partition identifier, the measurement points of the original power message are extracted by the front-end distributor, and the measurement points are routed to the corresponding business area-measurement point partitions for processing according to the partition mapping table to obtain the message processing results; the message processing results are first stored in the buffer and then forwarded to the downstream system in batches, and the number of threads in each business area-measurement point partition is preferentially adjusted through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with the short-term load fluctuations, the structural adjustment of the business area-measurement point partitioning structure is triggered.

[0029] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0030] The process involves acquiring the raw power message to be processed, performing a two-level partitioning process (service area-measurement point), and adjusting the service area-measurement point partitions using a partition self-splitting and merging mechanism based on binary search to obtain a service area-measurement point partition structure. Each service area-measurement point partition in this structure is assigned a partition identifier, and a partition mapping table is maintained. Based on the partition identifier, an independent thread pool and lock-free queue are configured for each service area-measurement point partition. The thread pool and lock-free queue are then dynamically adjusted using an inner and outer dual-loop control mechanism. Resource allocation; based on the business area-measurement point partitioning structure and the partition identifier, the measurement points of the original power message are extracted by the front-end distributor, and the measurement points are routed to the corresponding business area-measurement point partitions for processing according to the partition mapping table to obtain the message processing results; the message processing results are first stored in the buffer and then forwarded to the downstream system in batches, and the number of threads in each business area-measurement point partition is preferentially adjusted through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with the short-term load fluctuations, the structural adjustment of the business area-measurement point partitioning structure is triggered.

[0031] The aforementioned adaptive partitioning-based power message processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product first utilize a two-level partitioning method of service area-measuring point to finely divide the original power messages according to service area (Region) and measuring point (Key). By maintaining a partition mapping table, fast routing of messages to partitions is achieved, improving the concurrency and accuracy of message processing. Then, based on the binary search approach, the splitting and merging operations of service area-measuring point partitions are determined, which can quickly identify the most unbalanced load areas and reduce the load difference between partitions with the fewest splits, exhibiting strong flexibility and adaptability, and reducing partition maintenance overhead to some extent. Next, the adaptive adjustment of service area-measuring point partitions is divided into two levels: inner-loop control and partition reconstruction. When load fluctuations are small, the lower-cost thread number adjustment is preferred, while the higher-cost but more beneficial partition reconstruction is triggered only when the load is severely unbalanced. This allows for dynamic adaptation to load while minimizing frequent changes in the partition structure, balancing flexibility and stability. This application solves the technical problems of uneven load and fixed resource allocation in traditional power message processing, realizes the optimal allocation of system resources and efficient processing of power messages, significantly improves the flexibility, adaptability and system throughput of power message processing, reduces message processing latency, and can meet the high-concurrency data processing needs of power systems. Attached Figure Description

[0032] 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.

[0033] Figure 1 This is an application environment diagram of an adaptive partitioning-based power message processing method in one embodiment;

[0034] Figure 2 This is a flowchart illustrating an adaptive partitioning-based power message processing method in one embodiment.

[0035] Figure 3 This is a flowchart illustrating the partition self-splitting and merging mechanism in one embodiment;

[0036] Figure 4 This is a flowchart illustrating the dual-loop control mechanism in one embodiment;

[0037] Figure 5 This is a flowchart illustrating a power message processing method based on adaptive partitioning in a specific embodiment.

[0038] Figure 6 This is a structural block diagram of a power message processing device based on adaptive partitioning in one embodiment;

[0039] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0040] 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.

[0041] The adaptive partitioning-based power message processing method provided in this application can be applied to, for example... Figure 1 The application environment shown illustrates this. In this environment, the terminal can communicate with the server via a network. The data storage system can store the data that the server needs to process. The data storage system can be integrated onto the server or located on the cloud or other network servers. In situations such as... Figure 1 In the application environment shown, the terminal can be, but is not limited to, various personal computers, laptops, smartphones, and tablets. The server can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0042] In one embodiment, such as Figure 2 As shown, an adaptive partitioning-based power message processing method is provided, which can be applied to... Figure 1 In the terminal, the method may include the following steps:

[0043] Step S201: Obtain the original power message to be processed, perform two-level partitioning of the original power message into service area and measurement point, and adjust the service area-measurement point partitions through a partition self-splitting and merging mechanism based on the binary search method to obtain the service area-measurement point partition structure. Assign a partition identifier to each service area-measurement point partition in the service area-measurement point partition structure and maintain a partition mapping table.

[0044] In the business area-measurement point partitioning structure, the Region partitions are divided according to the physical or logical areas of the power business, and the Key partitions are hashed by extracting measurement points from the messages. The partition mapping table is used to store the mapping relationship between measurement points and partition identifiers, which reflects the business area-measurement point partitioning structure.

[0045] Specifically, in response to the received power message processing instruction, the terminal obtains the original power message to be processed. First, it divides the power service into Region partitions according to the physical or logical area of ​​the service. For example, this can be done based on geographical location (e.g., province, city, and county), voltage level (e.g., 500kV, 220kV, 110kV, and 35kV), and service type (e.g., distribution automation, electricity consumption information collection, and power dispatching), forming several relatively independent service domains. Within each Region partition, the measurement point ID (e.g., the unique identifier of the power terminal equipment) is extracted from the message, hashed, and the message is then assigned to different Key partitions based on the hash value range. Initially, only one Key partition is created within each Region partition; a unique partition identifier ID is assigned to each business area-measurement point partition instance, and a partition mapping table is maintained in the system to record the mapping relationship from measurement point ID to partition identifier ID and partition structure information; for example, the partition identifier ID adopts the format of "Region number_Key number", such as "R01_K03" representing the 3rd Key partition under the 1st Region partition; the partition mapping table can be stored using an efficient in-memory data structure, such as a hash table or a balanced tree, supporting O(1) or O(logn) query complexity, and ensuring query performance under high concurrency through a read-write separation mechanism.

[0046] Step S202: Based on the partition identifier, configure an independent thread pool and lock-free queue for each business area-measurement point partition, and dynamically adjust the thread resource allocation of each business area-measurement point partition through an inner and outer double-loop control mechanism based on the thread pool and lock-free queue.

[0047] In the dual-loop control mechanism, the inner loop acts as a fast response layer to adjust the thread pool capacity within a single partition, while the outer loop acts as a structural adjustment layer to adjust the boundaries between partitions to balance the overall load.

[0048] Specifically, based on the partition identifier, the terminal configures an independent thread pool and lock-free queue for each business area-measurement point partition instance. The thread pool contains parsing threads and forwarding threads, while the lock-free queue is used to store pending packets and processing results. As an example, the thread pool adopts a strategy combining core threads and dynamic threads. The core threads reside in memory and are not reclaimed, ensuring that the system always maintains basic processing capabilities, while the dynamic threads scale elastically according to the load. The lock-free queue adopts a high-performance implementation based on memory barriers and atomic operations, such as the Disruptor ring buffer mode, to maintain low operation latency under high concurrency. Then, based on the thread pool and lock-free queue, the thread resource allocation of each business area-measurement point partition is dynamically adjusted through an inner and outer double-ring control mechanism.

[0049] Step S203: Based on the service area-measurement point partitioning structure and partition identifier, the measurement points of the original power message are extracted by the front-end distributor. The measurement points are routed to the corresponding service area-measurement point partitions for processing according to the partition mapping table to obtain the message processing result.

[0050] Specifically, after the front-end distributor obtains the original power message, it quickly parses the message header information and extracts the measurement point ID. It then determines the corresponding partition identifier ID by querying the partition mapping table. As an example, the front-end distributor adopts a lightweight parsing strategy, parsing only the necessary message header fields, including message type identifier, version number, and measurement point ID, to avoid performance loss caused by complete parsing. During the parsing process, a unified measurement point ID extraction template is designed for messages of different power protocols, such as DL / T634, DL / T645, and IEC61850, to achieve consistent processing across protocols. The partition mapping table adopts an efficient in-memory data structure, such as a hash table or B+ tree, to ensure a query complexity of O(1) or O(logn) and reduce routing decision latency. Original packets with the same measurement point ID are precisely routed to the lock-free queue of the corresponding business area-measurement point partition instance. As an example, the routing process uses branchless prediction technology to reduce CPU pipeline pauses. For packets with the same measurement point ID, the system ensures that they are processed in a strictly ordered manner to maintain the timing dependency relationship. The lock-free queue is implemented based on CAS (Compare-And-Swap) operation, and the lock-free queue of each partition instance runs independently to avoid global lock contention.

[0051] Step S204: The message processing results are first stored in the buffer and then forwarded to the downstream system in batches. The number of threads in each business area-measurement point partition is adjusted first through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with the short-term load fluctuations, the structural adjustment of the business area-measurement point partition structure is triggered.

[0052] Specifically, the parsing thread in the partition instance's thread pool retrieves packets from the lock-free queue for parsing and processing. After processing, it quickly submits the results to a dedicated distribution buffer and immediately returns to process the next batch of packets. As an example, the parsing thread can use a work-stealing algorithm, temporarily stealing tasks from adjacent partitions with higher loads when its own partition queue is empty, thus improving thread utilization. The parsing process supports various optimization techniques, including packet template caching, field pre-parsing, and parallel decoding, reducing redundant computations. The processing result submission uses zero-copy technology, directly writing the processing result to a specified location in the distribution buffer, avoiding additional memory copying overhead. To prevent individual complex packets from causing long-term blocking of processing threads, the system has a timeout mechanism; packets exceeding the predetermined processing time limit are transferred to a dedicated slow-processing queue for processing. A dedicated forwarding thread periodically retrieves processing results in batches from the distribution buffer and efficiently forwards them to downstream systems using batch processing. Through partition load and thread resource control strategies, when a partition state change is detected, the thread pool capacity is adjusted first via an inner-loop control mechanism. When the thread pool capacity approaches its limit and the load remains high, partition splitting is triggered; when adjacent partitions have consistently low loads, partition merging is triggered to achieve optimal allocation of system resources. The inner-loop control, acting as a fast-response layer, dynamically expands and shrinks the thread pool to handle short-term load changes. When the backlog coefficient or processing deviation coefficient exceeds a threshold, the number of threads is increased; when the load decreases, excess threads are reclaimed. When inner-loop control cannot meet the demand, the partition splitting mechanism is triggered, dividing the high-load partition into two sub-partitions based on hash distribution, allocating independent resources to each. Conversely, when the system load remains consistently low, the partition merging mechanism is triggered to improve resource utilization.

[0053] In this embodiment, the two-level partitioning design of business area-measuring point, using physical or logical regions to divide the region partitions, considers the natural boundaries of power services, ensuring that the system structure is consistent with the business structure, facilitating subsequent management and expansion. Key partitioning based on measuring point IDs enables precise routing, ensuring that packets from the same measuring point are always routed to the same partition for processing, avoiding state dispersion and consistency issues. An adaptive splitting and merging mechanism allows the system to adjust resource configuration according to actual load, optimizing resource utilization while maintaining processing performance. Furthermore, the precise routing based on measuring point IDs in the packet precise routing and processing mechanism ensures that packets from the same data source are always processed in the same partition, guaranteeing not only the consistency of processing order but also effectively utilizing local caching, improving data locality, and significantly reducing cache invalidation and memory access latency. The adaptive partitioning and multi-level resource control mechanism enable the system to intelligently sense load changes and respond quickly, minimizing resource consumption while maintaining processing performance. It demonstrates excellent adaptability, especially when facing power grid data fluctuations (such as peak electricity consumption periods and billing cycles), achieving stable and efficient power packet processing.

[0054] In one embodiment, step S201 above, adjusting the service area-measurement point partitioning through a partition self-splitting and merging mechanism based on the binary search method, may include the following steps:

[0055] Within the business area-measurement point partition, the backlog coefficient, processing deviation coefficient, and message density coefficient are monitored and obtained in real time. Based on the backlog coefficient, processing deviation coefficient, and message density coefficient, a scoring function for each business area-measurement point partition is constructed through weighted summation. The scoring function is used to reflect the load status of each business area-measurement point partition. The business area-measurement point partition is adjusted according to the scoring function.

[0056] Specifically, within the service area-measurement point partition, the terminal monitors in real time the backlog coefficient α, processing deviation coefficient β, and message density coefficient γ of each partition, and calculates the scoring function. As an example, weighting coefficients Adjustments can be made based on system characteristics and business needs. For example, for businesses with high real-time requirements, the settings can be appropriately increased. The value should be adjusted to focus more on processing time; for services with significant peak traffic, it can be appropriately increased. The value is adjusted to focus more on message density; then the business area-measurement point partitioning is adjusted according to the scoring function.

[0057] In one embodiment, as described above, adjusting the business area-measurement point partitioning based on the scoring function may include the following steps:

[0058] When the scoring function of any business area-measurement point partition exceeds the splitting threshold for M1 consecutive monitoring periods, a splitting operation is triggered, generating two new business area-measurement point sub-partitions. The midpoint of the hash value range of the original business area-measurement point partition is used as the splitting point to divide the hash value range into two sub-ranges. Thread pools and lock-free queues are configured for the business area-measurement point sub-partitions, and a new first partition mapping table is generated. When the scoring function of two adjacent business area-measurement point partitions is lower than the merging threshold for M2 consecutive monitoring periods, a merging operation is triggered, generating a new business area-measurement point merged partition. Thread pools and lock-free queues are configured for the business area-measurement point merged partition, and a new second partition mapping table is generated. The hash range of the business area-measurement point merged partition covers the sum of the original two adjacent business area-measurement point partitions.

[0059] The monitoring periods M1 and M2 are typically set to 3-5 periods to avoid frequent adjustments due to instantaneous fluctuations.

[0060] Specifically, such as Figure 3As shown, partition splitting is triggered when the terminal detects that the scoring function of any service area-measurement point partition exceeds the splitting threshold TH for M1 consecutive monitoring cycles; partition merging is triggered when the terminal detects that the scoring functions of two adjacent service area-measurement point partitions are both below the merging threshold TL for M2 consecutive monitoring cycles. During partition splitting, the original partition is divided into two sub-partitions using the midpoint of the original partition hash value range as the splitting point. Resources are configured for the new partitions, and the partition mapping table is updated. During partition merging, two adjacent low-load partitions are merged into a new partition, and the hash range of the new partition covers the sum of the original two partitions. As an example, partition splitting and merging operations have a cooling-off period mechanism. Newly adjusted partitions will not trigger further adjustments during a cooling-off period of 30 seconds to 5 minutes, giving the system sufficient time to adapt to the new partition structure. The system sets upper and lower limits on the number of Key partitions within a single Region, such as a minimum of 1 and a maximum of 16, to prevent excessive splitting or merging from causing excessive system complexity or low resource utilization. A version control mechanism is used to manage the partition mapping table. A new version is generated after each adjustment, and a smooth switch is used to adjust the partition structure to ensure business continuity. As an example, the smooth switch is implemented using a "double buffering" strategy. Specifically, the system maintains the currently effective mapping table A and a new mapping table B that is being prepared. When a switch is required, the new mapping relationship is first written to B, and then the system reference is switched from A to B through an atomic operation. At the same time, A remains valid for a period of time to process packets that have been routed to the old partition. The partition self-splitting and merging mechanism also sets a hysteresis threshold, that is, a certain distance is maintained between the splitting threshold TH and the merging threshold TL. For example, TH is set to 0.75 and TL is set to 0.3 to prevent the system from oscillating frequently under critical load.

[0061] In one embodiment, step S202 above, which dynamically adjusts the thread resource allocation of each business area-measurement point partition based on the thread pool and lock-free queue through an inner and outer dual-loop control mechanism, may include the following steps:

[0062] Based on the backlog coefficient, processing deviation coefficient, and message density coefficient, a partition state vector for the business area-measurement point partition is generated. The inner ring is used as a fast response layer, which adjusts the thread pool capacity within a single business area-measurement point partition according to the partition state vector. The outer ring is used as a structure adjustment layer, which adjusts the lock-free queue boundaries between adjacent business area-measurement point partitions.

[0063] Specifically, the terminal forms a partition state vector for the service area-measurement point partition based on the backlog coefficient, the processing deviation coefficient, and the packet density coefficient; the inner ring is used as a fast response layer, and the partition thread pool capacity is periodically adjusted according to the state vector. When the backlog coefficient or the processing deviation coefficient exceeds the expansion threshold, the thread expansion ratio is calculated according to the expansion ratio. The calculation logic of the thread expansion ratio is based on the extent by which the sum of the backlog coefficient and the processing deviation coefficient exceeds the baseline threshold, and ensures that the ratio value is not negative; when both the backlog coefficient and the processing deviation coefficient are lower than the recycling threshold and the duration exceeds the time window, thread recycling is triggered, and an appropriate amount of standby resources are maintained to cope with sudden load. The outer ring is used as a structural adjustment layer. The load difference coefficient between partitions is periodically evaluated. The difference coefficient is used to quantify the degree of load imbalance between two adjacent partitions. Its value is equal to the sum of the absolute difference between the backlog coefficients of the two partitions and the absolute difference between the processing deviation coefficients of the two partitions. Based on the load difference coefficients of all adjacent partition pairs, the overall system imbalance U is obtained by calculating the maximum value of the difference coefficients between all partition pairs. When the system imbalance U exceeds the critical value, a progressive boundary adjustment is triggered for the partition pair with the largest difference. Part of the hash range of the partition with higher load is moved to the partition with lower load. The movement ratio is proportional to the load difference coefficient between the partitions and is scaled by an adjustment coefficient. By smoothly moving the partition boundaries, only the boundaries between adjacent partitions are modified, and only the necessary hash range is moved.

[0064] In one embodiment, as described above, adjusting the thread pool capacity within a single service area-measurement point partition based on the partition state vector by the fast response layer may include the following steps:

[0065] The fast response layer periodically adjusts the thread pool capacity based on the partition state vector; when the backlog coefficient or processing deviation coefficient exceeds the expansion threshold, the thread expansion ratio is calculated according to the expansion ratio, and the thread expansion is performed according to the thread expansion ratio; when both the backlog coefficient and processing deviation coefficient are lower than the recycling threshold and the duration exceeds the preset time window, thread recycling is triggered.

[0066] Adjusting the lock-free queue boundaries between various business areas and measurement point partitions by the structural adjustment layer may include the following steps:

[0067] The structural adjustment layer periodically evaluates the load difference coefficient between adjacent business area-measurement point partitions. Based on the load difference coefficient, the system overall imbalance is obtained by calculating the maximum value of the load difference coefficient between all business area-measurement point partition pairs. When the system imbalance exceeds a preset threshold, a progressive lockless queue boundary adjustment is performed on the target business area-measurement point partition pair with the largest difference.

[0068] Specifically, such as Figure 4 As shown, the terminal responds quickly to load changes through an inner-loop control mechanism, periodically detecting the partition state vector S(i). When the backlog coefficient α or the processing deviation coefficient β exceeds the expansion threshold T_high, the thread expansion ratio is calculated according to the function f(α, β)=max(α+β-T_base, 0), and the number of threads is immediately increased. As an example, the expansion operation adopts a gradual strategy, with the number of threads expanded at one time not exceeding 30% of the current thread pool capacity to avoid resource mutations that could lead to system instability. During peak system periods, the T_base value can be increased in advance to make the expansion more aggressive and quickly cope with the surge in packet load. When both the backlog coefficient α and the processing deviation coefficient β are lower than the recycling threshold T_low and the duration exceeds the time window W, thread recycling is triggered, but a certain proportion of standby resources are reserved to cope with sudden loads. As an example, thread recycling uses a sliding time window mechanism for smooth operation, with W typically set to 30 seconds to 2 minutes. The thread recycling ratio is dynamically calculated based on the difference between the backlog coefficient and the recycling threshold; the larger the difference, the higher the recycling ratio, but the maximum does not exceed 80% of the idle threads, ensuring that the system always maintains a certain level of processing redundancy. The terminal also achieves load balancing between partitions through an outer-loop control mechanism. It periodically evaluates the load difference coefficient between partitions, D(i,j)=|α_i-α_j|+|β_i-β_j|, and calculates the overall system imbalance U=max{D(i,j)}. As an example, to reduce computational complexity, only the load difference between adjacent partitions is compared, that is, only the D(i,j) values ​​of adjacent partition pairs in the hash space on the ring are calculated. When the system imbalance U exceeds the critical value C, a gradual boundary adjustment is performed on the partition pair (i,j) with the largest load difference. Part of the hash range of the partition with higher load is moved to the partition with lower load according to the proportion P=k×D(i,j) to ensure the overall system load balance. The adjustment operation of the lockless queue boundary adopts a multi-stage strategy. A small proportion of trial adjustment is performed first, usually k is set to 0.2, and the effect is observed before deciding whether to make a larger proportion of adjustment.

[0069] In this embodiment, the inner loop can achieve millisecond-level response to cope with short-term load fluctuations by quickly adjusting the thread pool capacity, while the outer loop achieves a higher level of overall system load balancing by adjusting partition boundaries. The two work together to form a more adaptive resource scheduling system, which not only ensures the system's ability to respond quickly to sudden loads, but also maintains the global resource optimization configuration during long-term operation.

[0070] In one embodiment, step S204 above, which prioritizes adjusting the number of threads in each service area-measurement point partition to cope with short-term load fluctuations through a partition load and thread resource control strategy, may include the following steps:

[0071] When a change in the partition state vector is detected, the thread pool capacity is adjusted first through an inner and outer dual-loop control mechanism to adapt. Only when the number of threads in the thread pool reaches the preset upper limit and the scoring function exceeds the splitting threshold for N consecutive monitoring periods, a partition splitting operation for the business area-measurement point partition is triggered. When the number of threads in the thread pools of two adjacent business area-measurement point partitions drops to the preset upper limit and the scoring function is below the merging threshold for N consecutive monitoring periods, a partition merging operation for the business area-measurement point partition is triggered.

[0072] Specifically, when the terminal detects a change in the partition state vector, it prioritizes adjusting the thread pool capacity through an internal and external dual-loop control mechanism. Only when the number of threads in the thread pool reaches the preset upper limit and the scoring function exceeds the splitting threshold for N consecutive monitoring periods, a partition splitting operation for the business area-measurement point partition is triggered. Conversely, when the number of threads in the thread pools of two adjacent business area-measurement point partitions drops to the preset upper limit and the scoring function is below the merging threshold for N consecutive monitoring periods, a partition merging operation for the business area-measurement point partition is triggered.

[0073] In one embodiment, such as Figure 5 As shown, a power message processing method based on adaptive partitioning is provided in a specific embodiment, which includes the following steps:

[0074] Step S501: Obtain the original power message to be processed, perform two-level partitioning processing of the original power message into a service area and a measurement point, and monitor and obtain the backlog coefficient, processing deviation coefficient and message density coefficient in real time within the service area and measurement point partition; based on the backlog coefficient, processing deviation coefficient and message density coefficient, construct the scoring function of each service area and measurement point partition by weighted summation.

[0075] Step S502: When the scoring function of any business area-measurement point partition exceeds the splitting threshold for M1 consecutive monitoring periods, a splitting operation is triggered to generate two new business area-measurement point sub-partitions. The midpoint of the hash value range of the original business area-measurement point partition is used as the splitting point to divide the hash value range into two sub-ranges. A thread pool and the lock-free queue are configured for the business area-measurement point sub-partitions, and a new first partition mapping table is generated.

[0076] Step S503: When the scoring functions of two adjacent business area-measurement point partitions are both below the merging threshold for M2 consecutive monitoring periods, a merging operation is triggered to generate a new business area-measurement point merged partition. A thread pool and a lock-free queue are configured for the business area-measurement point merged partition, and a new second partition mapping table is generated. The hash range of the business area-measurement point merged partition covers the sum of the original two adjacent business area-measurement point partitions.

[0077] Step S504: Obtain the adjusted business area-measurement point partition structure, assign a partition identifier to each business area-measurement point partition in the business area-measurement point partition structure and maintain a partition mapping table; configure an independent thread pool and lock-free queue for each business area-measurement point partition according to the partition identifier; generate the partition state vector of the business area-measurement point partition based on the backlog coefficient, processing deviation coefficient and message density coefficient.

[0078] Step S505: The inner ring is used as a fast response layer, which adjusts the thread pool capacity within a single business area-measurement point partition according to the partition state vector; the outer ring is used as a structure adjustment layer, which adjusts the lock-free queue boundaries between adjacent business area-measurement point partitions; based on the business area-measurement point partition structure and partition identifier, the measurement points of the original power message are extracted by the front-end dispatcher, and the measurement points are routed to the corresponding business area-measurement point partitions for processing according to the partition mapping table to obtain the message processing result.

[0079] Step S506: The message processing results are first stored in the buffer and then forwarded to the downstream system in batches. The number of threads in each business area-measurement point partition is adjusted first through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with short-term load fluctuations, the structural adjustment of the business area-measurement point partition structure is triggered.

[0080] The beneficial effects of the above embodiments are as follows:

[0081] (1) By using the two-level partitioning method of business area-measuring point, power messages are divided into fine-grained categories according to business area (Region) and measuring point ID (Key). By maintaining the partition mapping table, fast routing of messages to partitions is achieved, which improves the concurrency and accuracy of message processing.

[0082] (2) By using a partition adaptive adjustment mechanism based on the binary search idea, load indicators such as backlog coefficient, processing deviation coefficient and packet density coefficient are introduced to construct a scoring function to quantify the load status of the partition. Split threshold and merge threshold are set. When the scoring function exceeds the threshold, the partition is split or merged. The number and boundaries of partitions can be dynamically adjusted according to the actual load level, which has strong flexibility and adaptability. By using the binary search idea to determine the partition split point and merge operation, the region with the most unbalanced load can be quickly locked and the partition load difference can be reduced with the fewest splits. To a certain extent, the maintenance overhead of the partition is also reduced.

[0083] (3) The adaptive adjustment of partitions is divided into two levels: inner loop control and partition reconstruction. When the load fluctuation is not large, the lower-cost thread number adjustment is preferred, while the higher-cost but more beneficial partition reconstruction is triggered when the load is severely unbalanced. In this way, the partition structure can be reduced as much as possible while dynamically adapting to the load, thus taking into account both flexibility and stability.

[0084] (4) The partition adaptive adjustment with inner and outer loops is designed for resource optimization within and between partitions, respectively. The two work together to form a complete partition adaptive adjustment closed loop. The inner loop is designed for local optimization and provides a fast and flexible resource scheduling response; the outer loop is designed for global coordination and pursues overall load balancing. It takes into account both the timeliness of adjustment and the coordination of global control, avoiding simple and crude global resource reallocation. It improves parallel processing performance while reducing system overhead.

[0085] 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 of other steps.

[0086] Based on the same inventive concept, this application also provides an adaptive partitioning-based power message processing apparatus for implementing the adaptive partitioning-based power message processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the adaptive partitioning-based power message processing apparatus provided below can be found in the limitations of the adaptive partitioning-based power message processing method described above, and will not be repeated here.

[0087] In one exemplary embodiment, such as Figure 6 As shown, an adaptive partitioning-based power message processing apparatus is provided, which may include:

[0088] The message acquisition module 601 is used to acquire the original power message to be processed, perform two-level partitioning of the original power message into a service area and a measurement point, and adjust the service area and measurement point partitions through a partition self-splitting and merging mechanism based on the binary method to obtain the service area and measurement point partition structure. It assigns a partition identifier to each service area and measurement point partition in the service area and measurement point partition structure and maintains a partition mapping table.

[0089] The dynamic adjustment module 602 is used to configure independent thread pools and lock-free queues for each business area-measurement point partition according to the partition identifier, and dynamically adjust the thread resource allocation of each business area-measurement point partition through an inner and outer double-loop control mechanism based on the thread pools and lock-free queues.

[0090] The message processing module 603 is used to extract the measurement points of the original power message through the front-end distributor based on the service area-measurement point partition structure and partition identifier, and to route the measurement points to the corresponding service area-measurement point partition for processing according to the partition mapping table to obtain the message processing result;

[0091] The resource regulation module 604 is used to store the message processing results into a buffer and then forward them to the downstream system in batches. It prioritizes adjusting the number of threads in each business area-measurement point partition to cope with short-term load fluctuations through partition load and thread resource regulation strategies. If the inner loop regulation cannot cope with the short-term load fluctuations, it triggers structural adjustments to the business area-measurement point partition structure.

[0092] In one embodiment, the message acquisition module 601 is further configured to monitor and acquire the backlog coefficient, processing deviation coefficient, and message density coefficient in real time within the service area-measurement point partition; construct a scoring function for each service area-measurement point partition by weighted summation based on the backlog coefficient, processing deviation coefficient, and message density coefficient; the scoring function is used to reflect the load status of each service area-measurement point partition; and adjust the service area-measurement point partition according to the scoring function.

[0093] In one embodiment, the message acquisition module 601 is further configured to: trigger a splitting operation when the scoring function of any business area-measurement point partition exceeds the splitting threshold for M1 consecutive monitoring periods, generate two new business area-measurement point sub-partitions, divide the hash value range into two sub-ranges using the midpoint of the hash value range of the original business area-measurement point partition as the splitting point, configure a thread pool and a lock-free queue for the business area-measurement point sub-partitions, and generate a new first partition mapping table; and trigger a merging operation when the scoring function of two adjacent business area-measurement point partitions is lower than the merging threshold for M2 consecutive monitoring periods, generate a new business area-measurement point merged partition, configure a thread pool and a lock-free queue for the business area-measurement point merged partition, and generate a new second partition mapping table; the hash range of the business area-measurement point merged partition covers the sum of the original two adjacent business area-measurement point partitions.

[0094] In one embodiment, the dynamic adjustment module 602 is further configured to generate a partition state vector of the business area-measurement point partition based on the backlog coefficient, the processing deviation coefficient, and the message density coefficient; use the inner ring as a fast response layer, which adjusts the thread pool capacity within a single business area-measurement point partition according to the partition state vector; and use the outer ring as a structure adjustment layer, which adjusts the lock-free queue boundaries between adjacent business area-measurement point partitions.

[0095] In one embodiment, the dynamic adjustment module 602 is further configured to periodically adjust the thread pool capacity according to the partition state vector by the fast response layer; when the backlog coefficient or processing deviation coefficient exceeds the expansion threshold, calculate the thread expansion ratio according to the expansion ratio, and expand the thread capacity according to the thread expansion ratio; when both the backlog coefficient and the processing deviation coefficient are lower than the recycling threshold and the duration exceeds the preset time window, trigger thread recycling; the dynamic adjustment module 602 is further configured to periodically evaluate the load difference coefficient between each adjacent business area-measurement point partition by the structure adjustment layer, and obtain the overall system imbalance by calculating the maximum value of the load difference coefficient between all business area-measurement point partition pairs based on the load difference coefficient; when the system imbalance exceeds the preset threshold, perform progressive lock-free queue boundary adjustment for the target business area-measurement point partition pair with the largest difference.

[0096] In one embodiment, the resource control module 604 is further configured to, when a change in the partition state vector is detected, prioritize adjusting the thread pool capacity through an inner and outer dual-loop control mechanism to adapt, and only trigger a partition splitting operation for the business area-measurement point partition when the number of threads in the thread pool reaches a preset upper limit and the scoring function exceeds the splitting threshold for N consecutive monitoring periods; and trigger a partition merging operation for the business area-measurement point partition when the number of threads in the thread pools of two adjacent business area-measurement point partitions drops to a preset upper limit and the scoring function is below the merging threshold for N consecutive monitoring periods.

[0097] Each module in the aforementioned adaptive partitioning-based power message processing 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 corresponding operations of each module.

[0098] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output 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 and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements an adaptive partitioning-based power message processing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0099] Those skilled in the art will understand that Figure 7The 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.

[0100] In one embodiment, a computer device is also 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 method embodiments.

[0101] 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.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] 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.

[0106] 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 power message processing method based on adaptive partitioning, characterized in that, The method includes: The process involves acquiring raw power messages to be processed, performing two-level partitioning of the raw power messages into service areas and measurement points, and monitoring and acquiring backlog coefficients, processing deviation coefficients, and message density coefficients in real time within each service area-measurement point partition. Based on the backlog coefficients, processing deviation coefficients, and message density coefficients, a scoring function is constructed for each service area-measurement point partition using a weighted summation method. The scoring function reflects the load status of each service area-measurement point partition. The service area-measurement point partitions are adjusted according to the scoring function to obtain a service area-measurement point partition structure. A partition identifier is assigned to each service area-measurement point partition in the service area-measurement point partition structure, and a partition mapping table is maintained. Based on the partition identifier, an independent thread pool and lock-free queue are configured for each of the business area-measurement point partitions. The thread resource allocation of each business area-measurement point partition is dynamically adjusted through an inner and outer dual-loop control mechanism based on the thread pool and the lock-free queue. This dynamic adjustment of thread resource allocation for each business area-measurement point partition through the inner and outer dual-loop control mechanism includes: generating a partition state vector for each business area-measurement point partition based on the backlog coefficient, the processing deviation coefficient, and the packet density coefficient; using the inner loop as a fast response layer, which adjusts the thread pool capacity within a single business area-measurement point partition according to the partition state vector; and using the outer loop as a structural adjustment layer, which adjusts the lock-free queue boundaries between adjacent business area-measurement point partitions. Based on the business area-measurement point partitioning structure and the partition identifier, the measurement points of the original power message are extracted by the front-end distributor, and the measurement points are routed to the corresponding business area-measurement point partitions for processing according to the partition mapping table to obtain the message processing result; The message processing results are first stored in a buffer and then forwarded to the downstream system in batches. The number of threads in each business area-measurement point partition is adjusted first through the partition load and thread resource control strategy to cope with short-term load fluctuations. If the inner loop control cannot cope with the short-term load fluctuations, the structural adjustment of the business area-measurement point partition structure is triggered.

2. The method according to claim 1, characterized in that, The adjustment of the business area-measurement point partitioning according to the scoring function includes: When the scoring function of any of the business area-measurement point partitions exceeds the splitting threshold for M1 consecutive monitoring periods, a splitting operation is triggered to generate two new business area-measurement point sub-partitions. The midpoint of the hash value range of the original business area-measurement point partition is used as the splitting point to divide the hash value range into two sub-ranges. The thread pool and the lock-free queue are configured for the business area-measurement point sub-partitions, and a new first partition mapping table is generated. When the scoring function of two adjacent business area-measurement point partitions is lower than the merging threshold for M2 consecutive monitoring periods, a merging operation is triggered to generate a new business area-measurement point merged partition. The thread pool and the lock-free queue are configured for the business area-measurement point merged partition, and a new second partition mapping table is generated. The hash range of the business area-measurement point merged partition covers the sum of the original two adjacent business area-measurement point partitions.

3. The method according to claim 2, characterized in that, The step of adjusting the thread pool capacity within a single service area-measurement point partition by the fast response layer based on the partition state vector includes: The fast response layer periodically adjusts the thread pool capacity based on the partition state vector; when the backlog coefficient or the processing deviation coefficient exceeds the expansion threshold, the thread expansion ratio is calculated according to the expansion ratio, and the thread expansion is performed according to the thread expansion ratio; when both the backlog coefficient and the processing deviation coefficient are lower than the recycling threshold and the duration exceeds a preset time window, thread recycling is triggered. The adjustment of the lockless queue boundaries between adjacent service area-measurement point partitions by the structure adjustment layer includes: The structure adjustment layer periodically evaluates the load difference coefficient between each adjacent service area-measurement point partition, and calculates the maximum value of the load difference coefficient between all service area-measurement point partition pairs based on the load difference coefficient to obtain the overall system imbalance. When the system imbalance exceeds a preset threshold, a progressive lockless queue boundary adjustment is performed on the target service area-measurement point partition pair with the largest difference.

4. The method according to claim 3, characterized in that, The strategy of adjusting the load and thread resources by partitioning prioritizes adjusting the number of threads in each of the aforementioned business area-measurement point partitions to cope with short-term load fluctuations, including: When a change in the partition state vector is detected, the capacity of the thread pool is adjusted first through the inner and outer dual-loop control mechanism to adapt. Only when the number of threads in the thread pool reaches the preset upper limit and the scoring function exceeds the splitting threshold for N consecutive monitoring periods, a partition splitting operation is triggered for the business area-measurement point partition. When the number of threads in the thread pool of two adjacent business area-measurement point partitions drops to a preset upper limit and the scoring function is lower than the merging threshold for N consecutive monitoring periods, the partition merging operation of the business area-measurement point partition is triggered.

5. A power message processing device based on adaptive partitioning, characterized in that, The device includes: The message acquisition module is used to acquire the raw power messages to be processed, perform two-level partitioning of the raw power messages into service areas and measurement points, and monitor and acquire the backlog coefficient, processing deviation coefficient, and message density coefficient in real time within the service area-measurement point partitions. Based on the backlog coefficient, the processing deviation coefficient, and the message density coefficient, a scoring function is constructed for each service area-measurement point partition by weighted summation. The scoring function is used to reflect the load status of each service area-measurement point partition. The service area-measurement point partitions are adjusted according to the scoring function to obtain the service area-measurement point partition structure. A partition identifier is assigned to each service area-measurement point partition in the service area-measurement point partition structure, and a partition mapping table is maintained. A dynamic adjustment module is used to configure independent thread pools and lock-free queues for each of the business area-measurement point partitions according to the partition identifier, and to dynamically adjust the thread resource allocation of each of the business area-measurement point partitions through an inner and outer double-loop control mechanism based on the thread pools and the lock-free queues. The dynamic adjustment of thread resource allocation of each of the business area-measurement point partitions through the inner and outer double-loop control mechanism includes: generating a partition state vector of the business area-measurement point partition based on the backlog coefficient, the processing deviation coefficient, and the packet density coefficient; using the inner loop as a fast response layer, which adjusts the thread pool capacity within a single business area-measurement point partition according to the partition state vector; and using the outer loop as a structural adjustment layer, which adjusts the lock-free queue boundaries between adjacent business area-measurement point partitions. The message processing module is used to extract the measurement points of the original power message through the front-end distributor based on the service area-measurement point partition structure and the partition identifier, and to route the measurement points to the corresponding service area-measurement point partition for processing according to the partition mapping table to obtain the message processing result. The resource regulation module is used to first store the message processing results in a buffer and then forward them to the downstream system in batches. It also uses a partition load and thread resource regulation strategy to prioritize adjusting the number of threads in each of the business area-measurement point partitions to cope with short-term load fluctuations. If the inner loop regulation cannot cope with the short-term load fluctuations, it triggers a structural adjustment for the business area-measurement point partition structure.

6. 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 4.

7. 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 4.

8. 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 4.