Intelligent scheduling method based on embedded terminal AI technology for electricity meter data
By using an intelligent scheduling method for electricity meter data based on embedded terminal AI technology, a hierarchical scheduling queue is generated, which solves the problem of low efficiency in the electricity meter acquisition system under limited channel resources in the distribution area, and realizes stable and efficient deployment of models and communication optimization on edge devices.
Patent Information
- Application Number
- CN202611630620.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing meter data acquisition systems in distribution areas are inefficient due to limited channel resources, and machine learning models have poor stability when deployed on edge devices, making it difficult to meet the requirements for efficient communication.
An intelligent scheduling method for electricity meter data based on embedded terminal AI technology is adopted. By acquiring basic electricity meter data and real-time system features, a feature matrix to be inferred is generated. Batch inference is performed using a standardized deployment model. A hierarchical scheduling queue is generated by combining edge communication environment constraints to optimize electricity meter data acquisition.
It improved the efficiency of meter data collection in the distribution area, enhanced the stability of model inference deployment on edge-constrained hardware, and optimized the utilization of channel resources.
Smart Images

Figure CN123123282A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge computing and data acquisition technology for the Internet of Things in the power sector, and in particular to an intelligent scheduling method for electricity meter data based on embedded terminal AI technology. Background Technology
[0002] With the large-scale development of the distribution network Internet of Things (IoT), the number of smart meters connected to distribution transformer areas has increased dramatically. High-frequency, high-concurrency acquisition of meter data is fundamental to achieving real-time perception of power grid status, line loss analysis, and load forecasting. Edge computing terminals, acting as data aggregation nodes in distribution transformer areas, schedule communication tasks for meters within the constraints of communication channel capacity and service time windows, helping to maintain the timeliness and integrity of underlying power grid data.
[0003] Current meter data acquisition systems for distribution areas mostly employ a fixed-order polling mechanism, where the edge control program sends read requests sequentially according to the meter address list. Furthermore, existing solutions that attempt to introduce machine learning for communication status prediction typically require directly loading the prediction model into the edge device.
[0004] Existing edge acquisition scheduling cannot fully utilize limited channel resources, thus limiting the acquisition efficiency of meters in the distribution area; at the same time, the inference deployment stability of prediction models on edge-constrained hardware is poor, making it difficult to meet the acquisition efficiency requirements. Summary of the Invention
[0005] The technical problem to be solved by the present invention is as described above, and based on this, a method for intelligent scheduling of electricity meter data based on embedded terminal AI technology is provided.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: On the one hand, a method for intelligent scheduling of electricity meter data based on embedded terminal AI technology includes: Acquire basic meter data and real-time time characteristics of the system within the jurisdiction of the edge terminal; Feature engineering is performed based on the basic data of the electricity meter and the real-time time characteristics of the system to generate a feature matrix to be inferred. The standardized deployment model is invoked, and the feature matrix to be inferred is inferred in batches in the inference engine of the edge terminal to obtain the communication prediction results and predicted communication time of each meter. The standardized deployment model is a gradient boosting tree model modified by input size solidification and operator version locking. Based on the communication prediction results and predicted communication time, and combined with the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated. Output a hierarchical scheduling queue to control the edge terminal to perform meter data collection according to the hierarchical scheduling queue.
[0007] On the other hand, feature engineering is performed based on the basic data of the electricity meter and the real-time time characteristics of the system to generate a feature matrix to be inferred, including: Extract historical communication records from the basic data of the electricity meter; Calculate the time-decaying weights for historical communication records, and generate weighted statistical features based on these time-decaying weights. Extract the recent time sequence of historical communication records and fit it to generate communication quality trend features; The weighted statistical features, communication quality trend features, and system real-time features are concatenated, encoded, and normalized to generate a feature matrix to be inferred.
[0008] On the other hand, a standardized deployment model is invoked to perform batch inference of the feature matrix to be inferred in the inference engine of the edge terminal, including: Obtain the currently available system memory for the edge terminal; The target batch size is dynamically calculated based on the system's currently available memory. The feature matrix to be inferred is divided into multiple feature slices according to the target batch size; Multiple feature slices are sequentially input into the inference engine for inference to obtain the communication prediction results and predicted communication time for each meter.
[0009] On the other hand, based on the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated, including: Obtain the concurrent capacity of the current communication channel and the acquisition time window for this acquisition, as constraints for the edge communication environment; Based on the communication prediction results and predicted communication time of each meter, the expected collection revenue per unit time is calculated. The meters are sorted according to the expected revenue collected per unit time, and a multi-channel greedy allocation is performed by combining the concurrent capacity and the collection time window to generate a hierarchical scheduling queue.
[0010] On the other hand, calculating the expected revenue collected per unit time includes: The ratio of the communication success probability in the communication prediction result to the sum of the predicted communication time and the preset smoothing constant is used as the expected collection revenue per unit time for the corresponding electricity meter. On the other hand, multi-channel greedy allocation is performed, including: The meters are traversed in descending order of expected revenue per unit time. For the electricity meters being traversed, find the earliest available target channel among multiple communication channels; If the sum of the current completion time of the target channel and the predicted communication time of the meter does not exceed the collection time window, then the meter is assigned to the target channel and its current completion time is updated, and it is added to the effective scheduling set. Otherwise, add the meter to the delay set; the hierarchical scheduling queue consists of the effective scheduling set and the delay set.
[0011] On the other hand, based on the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated, including: The acquisition time window for this data collection is used as a constraint condition for the edge communication environment. Based on the communication success probability in the communication prediction results, each meter is divided into a priority acquisition layer, a conditional acquisition layer, and a delayed acquisition layer by using preset high confidence thresholds and low confidence thresholds. Different communication retry strategies are configured for meters at different acquisition levels. The delayed acquisition layer is truncated according to the acquisition time window, and a hierarchical scheduling queue is generated.
[0012] On the other hand, the standardized deployment model is obtained through the following offline transformation steps: Obtain the initial gradient boosting tree model after training; When converting the initial gradient boosting tree model, the input tensor size is forcibly limited to remove the dynamic batch dimension, and the exported operator version is globally locked within the compatible version range supported by the inference engine of the edge terminal to generate a standardized deployment model.
[0013] On the other hand, the inference engine of the edge terminal is the ONNX Runtime inference engine, which is pre-deployed on the central processing unit of the edge terminal.
[0014] On the other hand, the predicted communication time for each meter is obtained, including: Obtain the logarithmic transmission latency output by the standardized deployment model; The logarithmic transmission delay is restored by exponential operation to obtain the predicted communication time for each meter.
[0015] The beneficial effects of this invention are: it improves the efficiency of meter data collection in areas with limited channel resources and is beneficial for the inference deployment of models on edge-constrained hardware. Attached Figure Description
[0016] Figure 1 A flowchart of an intelligent scheduling method for electricity meter data based on embedded terminal AI technology is shown.
[0017] Figure 2 A flowchart for generating a feature matrix to be inferred is shown.
[0018] Figure 3 The flowchart illustrates a process for batch inference of a feature matrix to be inferred in an inference engine on an edge terminal.
[0019] Figure 4A flowchart for generating a hierarchical scheduling queue is shown.
[0020] Figure 5 A flowchart for performing a multi-channel greedy allocation is shown.
[0021] Figure 6 A flowchart for another method of generating hierarchical scheduling queues is shown. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] In view of the aforementioned problems, the applicant conducted a search and analysis and found that: In actual operation, due to environmental interference or equipment aging, some electricity meters often experience communication timeouts or no response. Under the polling mechanism, the communication process must wait for the protocol to time out before releasing channel resources when encountering such nodes, resulting in invalid waiting time within the data collection period.
[0025] Existing solutions that attempt to introduce machine learning for communication status prediction typically require loading the prediction model directly onto the edge device. However, due to limitations in the memory and computing power of edge hardware, memory overflow is easily triggered when processing high-concurrency feature matrices. At the same time, different underlying hardware inference frameworks have varying compatibility with the native model computation graph, which can easily lead to model conversion failures or crashes.
[0026] To address the aforementioned technical issues, the following section combines... Figures 1 to 6 The present application will be further illustrated with reference to specific embodiments.
[0027] To standardize the wording throughout the text and eliminate ambiguity in terminology, this embodiment adopts the following unified conventions for some technical terms: Based on embodiments of this application, a method for intelligent scheduling of electricity meter data based on embedded terminal AI technology is provided, the method comprising the following steps: Step 101: Obtain basic meter data and real-time time characteristics of the system within the jurisdiction of the edge terminal; For example, the edge terminal can be implemented as a distribution IoT transformer area edge computing terminal, such as an embedded device equipped with a general-purpose main control chip, which has smart meters connected within its jurisdiction via a high-speed power line carrier communication channel or a 4G wireless communication channel.
[0028] For example, the basic data of the electricity meter mainly includes the fixed address identifier of each electricity meter and historical communication records.
[0029] For example, a successful communication can be defined as follows: after the edge terminal sends a data read request frame to the target meter, it receives a complete and valid response frame within the protocol timeout window, and the response frame is verified by cyclic redundancy check. At this time, the communication result is marked as 1. If there is no response after a timeout or the response frame verification fails, the communication is considered to have failed and is marked as 0.
[0030] For example, the timeout for a single communication can be defined as the time interval from when the edge terminal sends the first byte of the request frame to when it receives the last byte of the valid response frame.
[0031] For meters that fail to communicate, the time taken is directly recorded as the corresponding protocol timeout window threshold.
[0032] For example, the real-time time characteristics of the system can be obtained by reading the system clock of the edge terminal to reflect the periodic pattern of the meter communication environment over time.
[0033] Step 102: Perform feature engineering processing based on the basic data of the electricity meter and the real-time time characteristics of the system to generate the feature matrix to be inferred; For example, it is converted into a numerical matrix that can be recognized by a machine learning model.
[0034] In practice, a tag encoding algorithm can be used to map the discrete address tags and real-time time features in the basic data of the electricity meter into a numerical sequence. Statistical quantities can be extracted by combining historical communication records, and a normalization scaling algorithm can be used to normalize all continuous features, thereby integrating multidimensional heterogeneous data into a unified dimension feature matrix to be inferred.
[0035] Step 103: Using a pre-deployed standardized deployment model, perform batch inference on the feature matrix to be inferred in the inference engine of the edge terminal to obtain the communication prediction results and predicted communication time of each meter. The standardized deployment model is a gradient boosting tree model modified by input size fixing and operator version locking; In environments with limited edge hardware resources, direct deployment of gradient boosting tree models can easily lead to inference engine crashes due to incompatibility in dynamic tensor dimensions or operator versions. To address this, the underlying computation graph of the selected gradient boosting tree model can be modified in advance in an offline environment, forcibly constraining the shape and size of its input tensors and globally locking the exported operator versions, thereby obtaining a standardized deployment model.
[0036] During inference, since sending all the meter features at once may cause a memory overflow, the feature slices are sent in batches.
[0037] For example, the inference engine calls the classification calculation graph and regression calculation graph inside the model respectively, and outputs the probability indicator of successful communication of each meter in the current collection period, i.e. the communication prediction result, and the theoretical time required to complete a single communication, i.e. the predicted communication time.
[0038] Step 104: Based on the communication prediction results and predicted communication time, and combined with the pre-acquired edge communication environment constraints, generate a hierarchical scheduling queue; In this step, edge communication environment constraints are introduced, upgrading sequence sorting into a scheduling optimization process under multi-dimensional constraints.
[0039] For example, the edge communication environment constraints include the current channel concurrency capacity available in the current transformer area and the time window for allocating a single acquisition task.
[0040] Based on the communication prediction results and predicted communication time of each meter, its communication efficiency is evaluated. Meters with high success rates and low latency are then allocated to idle channels, while meters with high prediction failure probabilities or excessively long latency are delayed. A hierarchical scheduling queue composed of different priority levels is output. This step achieves a skewed allocation of channel resources to high-quality communication nodes.
[0041] Step 105: Output the hierarchical scheduling queue and control the edge terminal to perform meter data acquisition according to the hierarchical scheduling queue.
[0042] For example, the main control program of the edge terminal reads the hierarchical scheduling queue file and, according to the channel allocation strategy and time sequence specified in the queue, sends collection instructions to each target meter in sequence.
[0043] This solution centrally schedules meters that are likely to experience communication timeouts to the end of the data collection cycle. In extreme cases where the total time window is limited, the system can selectively abandon data collection attempts for some meters, thereby shortening the effective data collection time and improving the overall communication resource utilization rate of the distribution IoT area while ensuring equivalent data collection coverage.
[0044] As an example, the protocol timeout window for the high-speed power line carrier channel and the protocol timeout window for the 4G channel can be set and adjusted by on-site personnel according to the actual working conditions; the values of other parameters are also set in the same way, and will not be described in detail in subsequent embodiments. Another example is that "partial meter" can refer to meters with poor system quality.
[0045] Based on embodiments of this application, this process can be completed on a server or local computer with high computing power before being deployed to an edge terminal.
[0046] The standardized deployment model is obtained through the following offline transformation steps, which can be completed on a server or local computer with high computing power before deployment to edge terminals. The specific steps are as follows: Step 201: Obtain the initial gradient boosting tree model after training; specifically, it can be: Step 201.1: Obtain the computing power level of the target edge terminal; During the offline build phase, the hardware configuration parameters of the target edge device are read in advance to assess and quantify its computing power level.
[0047] Step 201.2: Based on the computing power level, select the target tree algorithm from the candidate gradient boosting tree algorithms with different complexities; Accordingly, a model selection strategy that adapts to computing power is adopted. An example: When the target edge terminal is a high-computing device, such as a terminal equipped with a multi-core high-performance processor and a large amount of memory, the extreme gradient boosting XGBoost algorithm can be selected as the target tree algorithm; for example, the RK3588 device can use the XGBoost algorithm as the target tree algorithm.
[0048] When the model is configured as a deep tree with a large number of trees and multiple iterations, the greedy splitting strategy adopted by XGBoost has better prediction accuracy.
[0049] When the target edge terminal is a low-computing-power device, the Lightweight Gradient Boosting Machine (LightGBM) algorithm can be selected as the target tree algorithm. Its leaf node-based growth strategy can reduce memory usage and accelerate training and inference speed.
[0050] When the target edge terminal is a resource-constrained micro-terminal, the CatBoost algorithm is selected as the target tree algorithm. The CatBoost algorithm uses a symmetric tree structure, which has high addressing and computational efficiency during the inference phase and generates a more compact model file, thus reducing the storage and inference overhead of micro-edge devices.
[0051] In other embodiments, the micro-terminal is specifically an embedded terminal with a computing power level lower than that of the RK3588 series embedded neural network processor (NPU) hardware and which does not have the ability to stably run XGBoost and LightGBM inference loads.
[0052] Step 203.1: Using a pre-built historical communication sample set, a classification model for predicting the probability of successful communication and a regression model for predicting communication time are trained in parallel based on the target tree algorithm, and combined to obtain the initial gradient boosting tree model.
[0053] Optionally, a data leakage prevention mechanism can be adopted by dividing the dataset into chronological sets. For example, the data from the first few days can be divided into a training set, and the data from the later days can be divided into a validation set.
[0054] Optionally, hyperparameters such as the maximum tree depth, number of iterations, and learning rate of the model are set, and two sets of training tasks are executed in parallel. One set can be trained using a binary classification logistic regression objective function to train a communication result classification model, which is used to output the probability value of successful meter communication; the other set can be trained using a mean square error objective function to train a communication time regression model, which is used to output continuous transmission delay prediction values.
[0055] In other words, another set uses the logarithmic value of communication time as the training label and employs the mean squared error objective function to train the communication time regression model, which is used to output the logarithmic transmission delay prediction value. Subsequently, in the inference stage, it is restored to the actual time through exponential operation.
[0056] In this scheme, after training is completed, the initial gradient boosting tree model file containing the model weights is exported.
[0057] Step 202: When performing format conversion on the initial gradient boosting tree model, the input tensor size is forcibly limited to remove the dynamic batch dimension, and the exported operator version is globally locked within the compatible version range supported by the inference engine of the edge terminal to generate a standardized deployment model.
[0058] When the initial gradient boosting tree model is exported to the Open Neural Network Exchange (ONNX) format under the native framework, it will generate an input tensor size with dynamic batch dimensions by default, which is usually represented as a dynamic dimension of indeterminate length, and the higher version of the operator set OPSET is used by default.
[0059] When porting this format to embedded edge devices, especially those equipped with neural network processors (NPUs) and their accompanying model conversion toolchains, it is prone to causing dimension verification anomalies and operator version out-of-bounds errors.
[0060] In this embodiment, when calling a format conversion tool, such as onnxmltools, to convert the initial gradient boosting tree model, the following modification mechanism can be performed: On the one hand, the input tensor size of the model computation graph is forcibly replaced from a dynamic dimension to a fixed static dimension corresponding to the number of columns in the feature matrix.
[0061] In one possible scenario, if the input features are 8-dimensional, the input tensor size is fixed into a predetermined static shape, such as 1 row and 8 columns or a specified batch size multiplied by 8 columns.
[0062] On the other hand, in the conversion configuration parameters, the exported operator version OPSET can be set globally to 11; This version number falls within the range of compatible versions supported by current mainstream general-purpose inference engines and various embedded dedicated model conversion tools.
[0063] In the above scheme, forcing the model input tensor size to be fixed and globally locking the compatible operator version is beneficial to suppressing dynamic parameter barriers and realizing the stable deployment of multiple gradient boosting tree models to the domestic edge inference environment.
[0064] Based on the embodiments of this application, feature engineering processing is performed on the basic data of the electricity meter and the real-time time characteristics of the system to generate a feature matrix to be inferred; This can be used to improve the model's ability to detect recent changes in the communication status of electricity meters, overcoming the problem that equal-weighted statistical methods cannot capture sudden changes in communication quality; specifically, it can include the following steps: Step 301: Extract historical communication records from the meter's basic data; Read all communication interaction logs of the target meter within a preset historical time window from the database or log file stored locally on the edge terminal.
[0065] For example, each log record includes a corresponding communication timestamp, the actual communication time, and a communication result identifier; for example, a successful communication is marked as 1, and a failed communication is marked as 0.
[0066] In some possible examples, the preset historical time window can be set to 30 days; Step 302: Calculate the weights that decay over time for historical communication records, and generate weighted statistical features based on these weights (weights that decay over time). For example, based on the time difference between the current moment corresponding to the real-time time characteristics of the system and the timestamps of each record in the historical communication records, an exponentially decaying time decay weight is calculated, so that the record closer to the current moment receives a greater weight. This weight value has a non-linear negative correlation with the time difference. The weight of long-term communication records decays exponentially over time, and the calculation relationship is as follows: ; in: Indicates the first Time decay weight of each historical communication record; exp represents an exponential function with the natural constant as its base; This represents the preset decay rate parameter, used to control the decay speed of the weights; The timestamp represents the current moment in the system. Indicates the first The timestamp when the historical communication record was generated.
[0067] For example, based on the time decay weight, the weighted average time consumption, weighted time consumption volatility, and weighted success rate of historical communication time consumption and historical communication results in historical communication records are calculated as weighted statistical features.
[0068] Accordingly, the formulas for calculating the weighted average time consumption, weighted volatility, and weighted success rate are as follows: ; ; ; In the formula: The weighted average time consumption corresponding to meter m; n corresponds to the total number of communication records of meter m within the historical time window; The time decay weight corresponding to the i-th historical communication record; The actual communication time corresponding to the i-th historical communication record; The weighted time-consuming volatility corresponding to meter m; Corresponding electricity meter The weighted success rate; Corresponding to the The communication result identifier for each historical communication record, with a value of 0 or 1.
[0069] Step 303: Extract the recent time sequence of historical communication records and fit it to generate communication quality trend features; For example, the average daily consumption time sequence within a preset recent time period can be extracted from historical communication records, and the slope of the communication quality trend can be generated by fitting the data using the linear least squares method, which serves as the communication quality trend feature.
[0070] For example, for the daily average time consumption sequence, the standard univariate linear least squares algorithm is used to fit the sequence points to obtain the communication quality trend slope; The sign of the slope reflects the changing trend of the meter's communication status, namely: If the slope of the trend is greater than 0, it indicates that the communication quality of the meter is deteriorating. If the slope of the trend is less than 0, it indicates that the communication quality is showing an improving trend.
[0071] This allows the model to identify electricity meters that are deteriorating but whose historical averages have not yet been reflected.
[0072] Step 304: The weighted statistical features, communication quality trend features and system real-time features are concatenated, encoded and normalized to generate the feature matrix to be inferred.
[0073] The system's real-time time characteristics include the current system hour, weekday, month, and time period identifier.
[0074] Among them, the time period identifier can be discretized according to the peak-valley-flat electricity price period of the power system; The communication address identifier of the electricity meter is mapped to an integer sequence using existing label encoding algorithms, such as LabelEncoder; Discrete features are concatenated with continuous features (weighted mean time consumption, weighted volatility of time consumption, weighted success rate, and communication quality trend slope) to form a feature vector; in this embodiment, the feature vector can be 9-dimensional. For example, existing Z-score normalization algorithms, such as StandardScaler, are used to normalize and scale the feature vectors, eliminating the differences in magnitude between features of different dimensions, and generating the feature matrix to be inferred.
[0075] As an example, in scenarios where computing power or storage resources are limited, it is not necessary to introduce exponential time decay weights and communication quality trend slopes. The system directly calculates the equal-weighted arithmetic mean, equal-weighted sample standard deviation, and equal-weighted median within a preset time window based on historical communication records. These values are then concatenated with the address code and real-time system time features to form a feature vector, thereby generating a downgraded version of the feature matrix to be inferred. In this embodiment, the feature vector can be 8-dimensional. In this embodiment, the discretization segment can be configured to encode the valley period from 23:00 to 7:00 the next day as 0; The regular hours are 7:00-10:00 and 15:00-18:00, coded as 1; The peak hours are 10:00-15:00 and 18:00-23:00, coded as 2.
[0076] The above scheme introduces exponentially decaying time weights and recent communication trend slopes, enabling the model to capture sudden changes and deterioration trends in the communication status of electricity meters, which can be used to improve the reliability of prediction results.
[0077] In this embodiment, the inference engine of the edge terminal can optionally be set to the ONNX Runtime inference engine pre-deployed on the central processing unit of the edge terminal for performing lightweight CPU inference.
[0078] In other words, ONNX is an open neural network exchange format; ONNX Runtime is a general inference engine adapted to the ONNX model format.
[0079] Under this path, the solidification of the model input dimensions not only ensures compatibility with neural network processing units, but also eliminates the runtime overhead of dynamic memory allocation and reduces inference latency jitter in the central processing unit inference path.
[0080] According to one aspect of this application, using a pre-deployed standardized deployment model, batch inference of the feature matrix to be inferred is performed in the inference engine of an edge terminal, specifically including: Step 401: Obtain the current available system memory of the edge terminal; Before executing model inference, the program reads the memory status file of the edge terminal operating system, such as the proc / meminfo file in Linux, and extracts the available memory field to obtain the system's current available memory, which serves as the basis for dynamically allocating the inference batch size.
[0081] Step 402: Dynamically calculate the target batch size based on the system's currently available memory; Furthermore, multiple feature slices can be sequentially input into the inference engine for inference; For example, the safe batch limit is calculated based on the system's currently available memory, the preset system reserved memory, and the peak memory usage for single-sample inference.
[0082] The calculation logic for this safe batch size limit is as follows: The difference between the system's currently available memory and the system's reserved memory is calculated. This difference is then compared to the peak memory usage for a single sample inference, and this ratio is rounded down to obtain the safe batch limit. This reflects the maximum number of concurrent inference samples the system can accommodate without memory overflow. The specific calculation process is as follows: ; In the above formula: Corresponding safe batch size limit; The corresponding floor function; The corresponding system's currently available memory; The corresponding preset system reserved memory is used to ensure the normal operation of the operating system and other background daemons; The peak memory usage for a single-sample inference can be determined through small-batch trial testing before the first inference.
[0083] For example, a preset upper and lower bound constraint on the safe batch size is applied to obtain the target batch size.
[0084] By setting a lower bound for the batch size and an empirical upper bound for the batch size, we can prevent excessive computation time caused by too many samples in a single inference run, which could block the main thread. The constraints are as follows: ; Accordingly: Corresponding target batch size; max corresponds to the function that retrieves the maximum value; min corresponds to the function that takes the minimum value; The corresponding preset empirical batch size limit.
[0085] Step 403: Divide the feature matrix to be inferred into multiple feature slices according to the target batch size; Based on the calculated target batch size, the feature matrix to be inferred, which contains the features of all electricity meters in the entire area, is sliced to ensure that the number of samples in each feature slice does not exceed the target batch size.
[0086] Correspondingly, when invoking the inference engine, the size of the input tensor is dynamically adjusted to match the dimension of the current feature slice.
[0087] Step 404: Input multiple feature slices into the inference engine in sequence for inference, and obtain the communication prediction results and predicted communication time of each meter; Multiple feature slices are sequentially fed into the classification and regression models in the ONNX Runtime inference engine for calculation.
[0088] For example, when a data anomaly occurs during inference for any feature slice, a default prediction failure flag and a preset timeout are assigned to the electricity meters in that feature slice, and the inference for the next feature slice continues.
[0089] Data anomalies include the presence of illegal values such as non-numbers or infinity in the input feature slices.
[0090] According to one aspect of this application, the process for predicting communication time acquisition specifically includes: One example is obtaining the logarithmic transmission latency output by a standardized deployment model; The logarithmic transmission delay is restored by exponential operation to obtain the predicted communication time for each meter.
[0091] Since the regression model aims to fit logarithmic time delay during the training phase, the original values output by the model need to be reverse-converted by calling the standard exponential reduction operator to obtain the predicted communication time.
[0092] As an alternative, if the edge terminal has limited memory resources or the inference engine does not support dynamic batch input, a sample-by-sample iterative inference method with a fixed batch size of 1 can be used.
[0093] That is, skipping the steps of dynamically calculating the target batch size and matrix slicing, the feature matrix to be inferred is directly input into the inference engine row by row for serial processing.
[0094] This solution introduces a memory-aware adaptive batching mechanism, which dynamically calculates the upper limit of the safe batch size and constrains the scale of a single inference, thereby mitigating memory overflow and process blocking caused by concurrent inference of massive meter features.
[0095] In this embodiment, the scheduling problem is transformed into a multi-channel constrained optimization problem, which serves as an optional scheduling scheme for generating hierarchical scheduling queues.
[0096] Among these, a hierarchical scheduling queue is generated by combining the pre-acquired edge communication environment constraints, including: Step 501: Obtain the concurrent capacity of the current communication channel and the acquisition time window for this acquisition, as constraints for the edge communication environment; In some embodiments, the number of concurrent communication channels of the current transformer area communication module is read to obtain the concurrent capacity of the current communication channel; in this embodiment, the concurrent capacity of the high-speed power line carrier channel can be configured to 3 channels.
[0097] In some embodiments, a preset time limit for a single data collection task is read to obtain the data collection time window for this data collection.
[0098] The above constitutes the boundary constraints of the scheduling algorithm.
[0099] Step 502: Based on the communication prediction results and predicted communication time of each meter, calculate the expected collection revenue per unit time; The calculation of the expected collection revenue per unit time includes: For example, the ratio of the communication success probability in the communication prediction result to the sum of the predicted communication time and the preset smoothing constant is used as the expected collection revenue per unit time of the corresponding electricity meter.
[0100] This calculation logic obtains an index representing the "expected probability of successful acquisition per second" by dividing the dimensionless probability value by the time-dimension-dimension-diminished value. The calculation process is as follows: ; In the formula, This represents the expected data collection revenue per unit time for the i-th meter. The first one represents the output of the classification model. The probability of successful communication between the block meters; The first, representing the output of the regression model after reduction. Predictive communication time for block meters; This represents a preset smoothing constant, used to prevent division by zero anomalies when the predicted communication time approaches zero.
[0101] In some embodiments, the value of the preset smoothing constant is determined so as not to affect the ranking of earnings, and on-site personnel can make adaptive adjustments based on the order of magnitude of the actual communication time.
[0102] Step 503: Sort the meters according to the expected revenue collected per unit time, and perform multi-channel greedy allocation based on concurrent capacity and collection time window to generate a hierarchical scheduling queue. The allocation of multi-channel resources using a greedy algorithm includes: Optionally, each meter is traversed in descending order of expected collection revenue per unit time to generate an initial candidate scheduling sequence.
[0103] Optionally, for the currently traversed electricity meter, among the multiple communication channels corresponding to the concurrent capacity, find the target channel that is currently idle and obtain the current completion time of the target channel.
[0104] During execution, an array is maintained to record the current completion time of each channel, and the channel with the smallest value in the array is selected as the target channel.
[0105] Optionally, if the sum of the current completion time of the target channel and the predicted communication time of the meter does not exceed the collection time window, the meter is assigned to the target channel and its current completion time is updated, and it is added to the effective scheduling set.
[0106] The update operation adds the original completion time to the predicted communication time of the meter, and uses this as the new completion time for the channel.
[0107] Otherwise, if the meter is determined to be unable to complete data collection within the current data collection period's time window, the meter will be added to the delay set.
[0108] After traversing all the meters, the hierarchical scheduling queue consists of an effective scheduling set and a delay set.
[0109] Among them, the meters in the effective scheduling set are arranged according to the actual allocated channels and the expected start time to form the execution queue for the current period.
[0110] According to one aspect of this application, for electricity meters that fail to complete data collection within the current collection cycle due to constraints of the edge communication environment, they are transferred to the head of the hierarchical scheduling queue for the next collection cycle. For meters assigned to the delay set, no communication request is initiated to them in the current cycle. Instead, their identifier is retained, and when the scheduling queue is generated in the next collection cycle, they are placed at the beginning of the effective scheduling set to ensure the overall integrity of the meter data in the distribution area.
[0111] Furthermore, if it is determined that the same meter has failed to complete data collection for multiple consecutive data collection cycles, an operation and maintenance alarm for that meter will be triggered. Further maintain the continuous non-collection counter for each electricity meter. When the counter exceeds the preset threshold, such as for several consecutive cycles, generate an alarm log containing the address identifier of the electricity meter and report it to the main station system.
[0112] According to another aspect of this application, based on the execution results of meter data collection, meters that failed to complete collection within the current collection cycle due to constraints of the edge communication environment can be identified, the identifier of the meters that failed to complete collection can be recorded, and they can be transferred to the head of the hierarchical scheduling queue of the next collection cycle. If, based on the number of consecutive data collection failures of each meter under maintenance, it is determined that the same meter has failed to complete data collection for multiple consecutive collection cycles, then an operation and maintenance alarm for that meter will be triggered.
[0113] In the following scheme, a hierarchical approach is adopted based on probability confidence, and reasonable retry resources are allocated to meters in different states. This approach can be used to solve the problem of retry occupancy of channel resources caused by coarse scheduling.
[0114] Accordingly, based on the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated, including: Step 601: Obtain the acquisition time window for this acquisition as a constraint condition for the edge communication environment; Before scheduling execution, the preset time limit for a single data collection task is read, and the data collection time window for this data collection is obtained, which is used as the time boundary condition for scheduling control.
[0115] Step 602: Based on the communication success probability in the communication prediction results, each meter is divided into a priority acquisition layer, a conditional acquisition layer, and a delayed acquisition layer by using preset high confidence thresholds and low confidence thresholds. For example, the communication success probability of each meter is obtained from the output of the classification model.
[0116] For example, two decision points are set within the probability interval: a high-confidence threshold and a low-confidence threshold. Based on these thresholds, a stratification process is performed, allowing meters with a communication success probability greater than the high-confidence threshold to be classified into a priority acquisition layer. This layer represents meters with a high confidence level capable of successful communication. Electricity meters with a communication success probability between the low confidence threshold and the high confidence threshold are classified into the conditional acquisition layer. This layer represents electricity meters with uncertain communication results. Electricity meters with a communication success probability lower than the low confidence threshold are classified into the delayed acquisition layer, which represents electricity meters with high confidence communication failures.
[0117] In this scheme, the electricity meters within each layer are arranged in ascending order from smallest to largest according to the predicted communication time.
[0118] Step 603: Configure differentiated communication retry strategies for meters at different acquisition levels, and truncate the delayed acquisition layer according to the acquisition time window and the predicted communication time consumption to generate a hierarchical scheduling queue.
[0119] For example, the priority acquisition layer includes meters with a communication success probability greater than a high confidence threshold, and is configured with a single acquisition strategy, that is, only one communication attempt is performed and no retries are made; For example, the conditional acquisition layer includes electricity meters with a communication success probability between a low confidence threshold and a high confidence threshold, and is configured with a time-limited short retry policy; That is, after the first collection fails, wait for a preset fixed time to retry. If it still fails, the collection of the current cycle is abandoned. For example, the delayed acquisition layer includes meters with a communication success probability of less than a low confidence threshold, and is configured with a strategy to delay acquisition to the next cycle.
[0120] In other embodiments, this step may also be configured with a low-priority single-attempt strategy.
[0121] Furthermore, based on the predicted communication time, communication success probability, and waiting time corresponding to the time-limited short retry strategy for each meter, the expected total data collection time for this scheduling is calculated.
[0122] Optionally, the predicted communication time in the priority acquisition layer and the delayed acquisition layer are summed respectively; For the conditional acquisition layer, the sum of the initial communication time and the additional expected retry time is calculated, where the expected retry time is obtained by multiplying the predicted failure probability and the retry time cost (the sum of waiting time and retry time). This calculated value is summed over the conditional acquisition layer. Adding the sums of the three levels, we obtain the expected total data collection time, i.e.: ; In the formula: This represents the expected total data acquisition time for this scheduling. , , These represent the sets of electricity meters within the priority acquisition layer, conditional acquisition layer, and delayed acquisition layer, respectively. i, j, and k represent the meter indices in the three sets mentioned above, respectively. , , These represent the predicted communication time for the corresponding electricity meter; The first in the representative conditional acquisition layer The probability of successful communication between the block meters; The probability of prediction failure for the j-th meter in the conditional acquisition layer; This represents the waiting time corresponding to the time-limited short retry strategy.
[0123] In this step, if the calculated expected total acquisition time is greater than the acquisition time window, it is determined that the current time window cannot accommodate the scheduling plan of all meters. At this time, the truncation mechanism is triggered, and all meters in the delayed acquisition layer are removed from the current effective scheduling set. Only the hierarchical scheduling queue composed of the priority acquisition layer and the condition acquisition layer is output.
[0124] In other embodiments, for meters that fail to complete data collection within the current collection cycle due to constraints of the edge communication environment, including meters removed from the delayed collection layer due to the truncation mechanism and meters that still fail after retries in the conditional collection layer, they are transferred to the head of the hierarchical scheduling queue of the next collection cycle to ensure the integrity of global data.
[0125] Meanwhile, the program sets up a counting logic to record the number of consecutive failures for each meter. If it is determined that the same meter has failed to complete data collection for multiple consecutive collection cycles, such as several consecutive cycles, an operation and maintenance alarm will be triggered for that meter, and an operation and maintenance work order will be generated.
[0126] In other embodiments, the delayed acquisition layer includes meters with a communication success probability of less than a low confidence threshold. A low-priority limited attempt strategy is configured, that is, after all acquisition tasks of the priority acquisition layer and the condition acquisition layer have been completed, a single acquisition attempt is made on the meters in this layer only if the remaining time allows.
[0127] At the service scheduling level, this invention improves upon the traditional passive polling waiting mechanism. By calculating the expected acquisition benefit per unit time and combining it with a multi-channel greedy allocation, or by implementing refined three-level stratification and differentiated retries based on predicted confidence levels, communication tasks with a high probability of timeout are postponed and over-limit truncation is implemented. This allows channel resources to be concentrated on serving higher-quality nodes at the front end, thereby shortening the total effective acquisition time for the entire station area.
[0128] According to one aspect of this application, a specific implementation method for end-to-end performance monitoring and quantitative evaluation is described, which specifically includes the following steps: Step 701: Implant timestamp acquisition logic into multiple execution nodes of the scheduling method.
[0129] For example, timing nodes are set at the execution boundaries of each important functional module. Before the model file is loaded into memory, before feature engineering preprocessing begins, after feature engineering preprocessing is completed, after the full feature matrix inference is completed, and after the final scheduling sequence file is output, the underlying time function of the edge terminal operating system is called to obtain the current system timestamp.
[0130] In other embodiments, the feature engineering preprocessing is completed, i.e., before the edge terminal inference engine starts inference; After the full feature matrix inference is completed, before the generation of the hierarchical scheduling queue begins.
[0131] Step 702: Based on the acquired timestamps, calculate the segmented time consumption of each core process and the overall total time consumption.
[0132] Optionally, the time difference before and after model loading can be calculated to obtain the model loading time; Calculate the time difference before and after feature preprocessing to obtain the feature preprocessing time; Calculate the time difference before and after inference to obtain the inference time of the full meter reading; Calculate the time difference between queue generation and file output to obtain the sorting and file output time.
[0133] In this step, the time difference between the first and last timing nodes can also be calculated to obtain the total time consumed by this scheduling task.
[0134] Step 703: Output quantitative evaluation logs, which can be used as a basis for optimization.
[0135] Accordingly, the segmented time consumption is formatted and concatenated with the overall total time consumption to generate a quantitative evaluation log, which is then output to the operation and maintenance monitoring interface or log file on the edge terminal. This allows for a clear distinction and recording of the performance overhead percentage of each stage.
[0136] For example, if the evaluation log shows that the inference time of all electricity meters accounts for more than the preset performance warning threshold in the total time, it will indicate that the standardized deployment model needs to be further trimmed or the safety batch limit should be reduced. If the time consumed by feature preprocessing accounts for a large proportion, it indicates that the concurrent processing logic of feature engineering needs to be optimized or the memory resources of the edge terminal need to be expanded.
[0137] The above can provide a quantitative basis for the deployment and optimization of the system on edge terminals with different computing power.
[0138] In some embodiments, an exemplary scheme of an optional scheduling method based on binarized grouping is described; This solution achieves scheduling optimization with low edge computing overhead, making it suitable for scenarios with limited computing power or simple communication environments, such as distribution centers. Specifically, it can be: In this solution, the communication prediction results and predicted communication time of each meter are obtained from the output of the edge terminal inference engine.
[0139] The communication prediction results are presented as binary labels, namely, predicting communication success or predicting communication failure.
[0140] Based on the communication prediction results, meters predicted to successfully communicate are classified into the first layer, and meters predicted to fail to communicate are classified into the second layer.
[0141] For the meters in the first layer, extract their corresponding predicted communication time and use a sorting algorithm to sort them in ascending order according to the predicted communication time from small to large, generating a priority scheduling subsequence; For the meters in the second layer, append them as a whole to the end of the priority scheduling subsequence to generate a subsequent scheduling subsequence. Concatenate the priority scheduling subsequence and the subsequent scheduling subsequence to generate a hierarchical scheduling queue.
[0142] For example, the generated hierarchical scheduling queue is written to a specified path in the edge terminal operating system to generate a readable scheduling sequence file.
[0143] The edge terminal's communication scheduling process reads the file and sends data read request frames to each meter in sequence according to the meter arrangement in the file.
[0144] In some embodiments, the values of the high confidence threshold and the low confidence threshold can be adaptively adjusted by technicians based on the historical communication success rate distribution of the electricity meters in the distribution area and the actual data collection coverage requirements; The inference engine is not limited to the ONNX Runtime mentioned above; other lightweight inference engines compatible with open neural network exchange formats can also be selected to achieve equivalent functionality.
[0145] Alternatively, the hardware selection, parameter values, and process steps given are merely exemplary implementation methods and are not intended to limit the scope of protection of this invention. Based on the core technical logic of this invention, equivalent substitutions and adjustments can be made to the devices, parameters, and implementation methods according to the actual application scenario.
[0146] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for intelligent scheduling of electricity meter data based on embedded terminal AI technology, characterized in that, include: Acquire basic meter data and real-time time characteristics of the system within the jurisdiction of the edge terminal; Feature engineering is performed based on the basic data of the electricity meter and the real-time time characteristics of the system to generate a feature matrix to be inferred. The standardized deployment model is invoked, and the feature matrix to be inferred is inferred in batches in the inference engine of the edge terminal to obtain the communication prediction results and predicted communication time of each meter. The standardized deployment model is a gradient boosting tree model modified by input size solidification and operator version locking. Based on the communication prediction results and predicted communication time, and combined with the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated. Output a hierarchical scheduling queue to control the edge terminal to perform meter data collection according to the hierarchical scheduling queue.
2. The method according to claim 1, characterized in that, Feature engineering is performed based on basic meter data and real-time time characteristics of the system to generate a feature matrix for inference, including: Extract historical communication records from the basic data of the electricity meter; The weights of historical communication records are calculated to decay over time, and weighted statistical features are generated accordingly. Extract the recent time sequence of historical communication records and fit it to generate communication quality trend features; The weighted statistical features, communication quality trend features, and system real-time features are concatenated, encoded, and normalized to generate a feature matrix to be inferred.
3. The method according to claim 1, characterized in that, The standardized deployment model is invoked, and the feature matrix to be inferred is performed in batches within the inference engine of the edge terminal, including: Obtain the currently available system memory for the edge terminal; The target batch size is dynamically calculated based on the system's currently available memory. The feature matrix to be inferred is divided into multiple feature slices according to the target batch size; Multiple feature slices are sequentially input into the inference engine for inference to obtain the communication prediction results and predicted communication time for each meter.
4. The method according to claim 1, characterized in that, Based on the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated, including: Obtain the concurrent capacity of the current communication channel and the acquisition time window for this acquisition, as constraints for the edge communication environment; Based on the communication prediction results and predicted communication time of each meter, the expected collection revenue per unit time is calculated. The meters are sorted according to the expected revenue collected per unit time, and a multi-channel greedy allocation is performed by combining concurrent capacity and collection time window to generate a hierarchical scheduling queue.
5. The method according to claim 4, characterized in that, Calculate the expected collection revenue per unit time, including: The ratio of the communication success probability in the communication prediction result to the sum of the predicted communication time and the preset smoothing constant is used as the expected collection revenue per unit time for the corresponding electricity meter.
6. The method according to claim 4, characterized in that, Perform a multi-channel greedy allocation, including: The meters are traversed in descending order of expected revenue per unit time. For the electricity meters being traversed, find the earliest available target channel among multiple communication channels; If the sum of the current completion time of the target channel and the predicted communication time of the meter does not exceed the collection time window, then the meter is assigned to the target channel and its current completion time is updated, and it is added to the effective scheduling set. Otherwise, add the meter to the delay set; the hierarchical scheduling queue consists of the effective scheduling set and the delay set.
7. The method according to claim 1, characterized in that, Based on the pre-acquired edge communication environment constraints, a hierarchical scheduling queue is generated, including: The acquisition time window for this data collection is used as a constraint condition for the edge communication environment. Based on the communication success probability in the communication prediction results, each meter is divided into a priority acquisition layer, a conditional acquisition layer, and a delayed acquisition layer by using preset high confidence thresholds and low confidence thresholds. Different communication retry strategies are configured for meters at different acquisition levels. The delayed acquisition layer is truncated according to the acquisition time window, and a hierarchical scheduling queue is generated.
8. The method according to claim 1, characterized in that, The standardized deployment model was obtained through the following offline transformation steps: Obtain the initial gradient boosting tree model after training is complete; When converting the initial gradient boosting tree model, the input tensor size is forcibly limited to remove the dynamic batch dimension, and the exported operator version is globally locked within the compatible version range supported by the inference engine of the edge terminal to generate a standardized deployment model.
9. The method according to claim 1, characterized in that, The inference engine for the edge terminal is the ONNX Runtime inference engine, which is pre-deployed on the central processing unit of the edge terminal.
10. The method according to claim 1, characterized in that, Obtain the predicted communication time for each electricity meter, including: Obtain the logarithmic transmission latency output by the standardized deployment model; The logarithmic transmission delay is restored by exponential operation to obtain the predicted communication time for each meter.
