A multitask scheduling collection method and collection system of a power collection terminal

CN122414765BActive Publication Date: 2026-10-27HANGZHOU HUALONG ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610895931.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-22
Publication Date
2026-10-27
Estimated Expiration
2046-06-22

AI Technical Summary

Technical Problem

[0004]为了提升电力采集终端在多任务环境下的整体执行成功率和资源利用效率,解决现有电力采集终端的多任务调度采集方法不能动态适配任务特征的缺陷,本发明提供了一种电力采集终端的多任务调度采集方法及采集系统,其技术方案如下:

Benefits of technology

本发明通过引入工况特征和任务队列特征两个维度建立最优分析窗口动态筛选机制,克服了传统方法中窗口长度的设定高度依赖人工经验,导致窗口长度静态僵化的弊端;使得在进行特征提取分析时,能够精准适配动态工况环境与任务队列特性,从而精准捕捉不同任务类型在特定工况环境下的时序规律;同时,基于各任务类型在其最优分析窗口长度下的专属历史样本集,对各任务类型专属的预测模型进行训练,在未增加模型复杂度的前提下,显著提高了任务超时预测的准确性;最终,基于高精度的超时概率预测,实现前瞻性的多任务动态调度,从而在保障任务调度执行高实时性的同时,优化了终端资源的整体利用效率,从而全面提升电力采集终端在多任务、高并发场景下的执行成功率和稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122414765B_ABST
    Figure CN122414765B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-task scheduling acquisition methods and acquisition system of electric power acquisition terminal, it is related to smart grid technical field, method includes: obtaining the historical data and execution result label of each task type of electric power acquisition terminal, constructs the historical sample set of each task type;Divide multiple analysis window length, construct the exclusive historical sample set of each analysis window length under each type task;Feature extraction and cluster analysis are carried out to each exclusive historical sample set, and the optimal analysis window length of each task type is screened out;Respectively construct and train the prediction model of each task type;In response to scheduling instruction, extract the task queue to be processed of current time and carry out permutation and combination, based on the trained prediction model, optimal scheduling strategy is selected and executed.The application can dynamically adapt task characteristics, improve the overall execution success rate and resource utilization of electric power acquisition terminal in multitask environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart grid technology, and in particular to a multi-task scheduling acquisition method and acquisition system for power acquisition terminals. Background Technology

[0002] Power data acquisition terminals are core edge devices for data acquisition and transmission in smart grids. They are primarily used to collect real-time load data and equipment operating status data from the power system, and to perform core tasks such as fault alarm reporting, batch uploading of historical data, and terminal operation log statistics. They serve as a crucial hub connecting the power grid master station and terminal equipment. With the development of smart grids, the tasks that power data acquisition terminals need to handle are becoming increasingly diverse and concurrency-driven. These different types of tasks have significantly different requirements for real-time performance, data reliability, and terminal resource consumption, posing a significant challenge to the multi-task scheduling of power data acquisition terminals.

[0003] Existing multi-task scheduling acquisition methods for power acquisition terminals have significant drawbacks. For example, in traditional methods, the time window length used to extract task failure prediction features often relies on statically set manual experience. This rigid window length can lead to inaccurate or discriminative features extracted under different operating conditions, failing to effectively characterize the task execution environment. Furthermore, it fails to fully consider the varying impacts of dynamic changes in operating conditions such as CPU utilization and memory usage on the success rate of different types of tasks, resulting in timeout failures due to insufficient resource preemption. Moreover, traditional methods do not adaptively adapt to the waiting time characteristics of different task types or the feature distribution patterns under different operating conditions, which can easily lead to task failures, distorted feature extraction in the prediction model, and limited prediction accuracy. Summary of the Invention

[0004] To improve the overall success rate and resource utilization efficiency of power acquisition terminals in multi-task environments, and to address the shortcomings of existing multi-task scheduling acquisition methods for power acquisition terminals that cannot dynamically adapt to task characteristics, this invention provides a multi-task scheduling acquisition method and acquisition system for power acquisition terminals, the technical solution of which is as follows: In a first aspect, the present invention provides a multi-task scheduling and acquisition method for a power acquisition terminal, the steps of which include: acquiring historical data and execution result tags of each task type of the power acquisition terminal, and constructing a historical sample set for each task type; Based on the maximum allowed waiting time preset for each task type, multiple analysis window lengths are divided to construct a dedicated historical sample set for each analysis window length under each task type. Extract data features from each dedicated historical sample to generate a working condition feature vector and a queue feature vector for each dedicated historical sample. Cluster each dedicated historical sample set based on the working condition feature vector to obtain multiple working condition clusters for each dedicated historical sample set. Perform statistical analysis on each working condition cluster based on the queue feature vector to obtain the nearest neighbor discrimination and distribution discrimination of each working condition cluster. Based on the nearest neighbor discrimination and distribution discrimination, calculate the global adaptability of each analysis window length under each type of task to select the optimal analysis window length for each task type. Prediction models for each task type are constructed separately and trained based on the dedicated historical sample sets for each task type under its optimal analysis window length. In response to scheduling instructions, the queue of tasks to be processed at the current moment is extracted and arranged in a permutation and combination. Based on the optimal analysis window length corresponding to each task to be processed, the input samples of each task to be processed under each permutation and combination at the current moment are obtained and input into the trained prediction model to obtain the timeout probability of each task to be processed under each permutation and combination, thereby selecting and executing the optimal scheduling strategy.

[0005] Preferably, all task types of the power acquisition terminal are encoded, and the maximum allowable waiting time for each task type is configured. Multidimensional operating condition data and the queue of tasks to be processed of the power acquisition terminal are collected in real time at a fixed sampling frequency, and time-series data of two dimensions, namely position parameter and queue length parameter, are extracted from the queue of tasks to be processed. The label of timed-out tasks is set to 1, and the label of tasks that have not timed out is set to 0. Any task type is selected as the target task type, and multiple data sequences under the target task type are extracted from the historical data of the power acquisition terminal. The data sequences of all dimensions under the target task type are normalized to obtain multiple historical samples of the target task type. The set of all historical samples and their labels under the target task type is taken as the historical sample set of the target task type. Similarly, the historical sample set of each task type is obtained.

[0006] Preferably, the maximum allowable waiting time for the target task type is divided into multiple equal-length window benchmarks. Different multiples of these window benchmarks are used as the lengths of the analysis windows to generate a set of candidate window lengths for the target task type. Any analysis window length within this set is then selected as the target window length. Historical sample sets for the target task type are extracted. Based on the target window length, data for each dimension is truncated from the end of each historical sample. Each truncated window is treated as a unique historical sample. The set of unique historical samples and their corresponding labels under the target window length is used as the unique historical sample set for the target window length under the target task type. The candidate window length set for the target task type is traversed to obtain the unique historical sample set for each analysis window length under the target task type. Similarly, the unique historical sample set for each analysis window length under each task type is obtained.

[0007] Preferably, the working condition data of any specific historical sample is extracted and the mean of the working condition data in each dimension is calculated respectively to serve as the working condition feature of the specific historical sample. The working condition features in each dimension are merged to generate the working condition feature vector of the specific historical sample. The rank parameter sequence and queue length parameter sequence in the specific historical sample are extracted and the mean of the two sequences is calculated respectively to serve as the rank feature and queue length feature corresponding to the specific historical sample. The linear fitting slope of the two sequences is calculated respectively using the least squares formula to serve as the rank change trend feature and queue length change trend feature corresponding to the specific historical sample. The above four features are merged to generate the queue feature vector of the specific historical sample.

[0008] Preferably, the combination of the working condition feature vector, queue feature vector, and corresponding label of the same exclusive historical sample is used as a training sample, thereby obtaining the training sample set corresponding to each exclusive historical sample set; any training sample set is selected as the target training sample set, and based on the working condition feature vector in the target training sample set, multiple candidate K values ​​are preset, and the K-Means clustering algorithm is executed for clustering, and the silhouette coefficient method is used to determine the optimal K value, thereby obtaining the working condition cluster with the optimal number of K values, and several training samples corresponding to each working condition cluster are used as a cluster sample subset; any cluster sample subset under the target training sample set is selected as the target subset, and any training sample within the target subset is selected as the target sample.

[0009] Preferably, based on the queue feature vectors of each training sample in the target subset, the Euclidean distance between the target sample and the remaining training samples in the target subset is calculated and sorted in ascending order; based on a preset selection limit for nearest neighbor samples, a nearest neighbor sample set for the target sample is obtained, and the proportion of training samples under the two labels in the nearest neighbor sample set is counted, and the absolute difference between the two is calculated; based on a preset judgment threshold for mixed samples, if the absolute difference is less than the threshold, the target sample is judged as a mixed sample; similarly, each training sample in the target subset is judged in turn, the proportion of mixed samples is counted, and a natural exponential function is used for inverse mapping, and the mapped value is used as the nearest neighbor discrimination of the target subset; the maximum and minimum values ​​of each dimension feature value in all queue feature vectors in the target subset are extracted, and the value range of each dimension feature value is divided into multiple equal-length and continuous intervals; the proportion of training samples under the two labels in each interval is counted, and the absolute difference between the two is calculated, and the mean of the absolute difference of each interval is used as the distribution discrimination of the target subset.

[0010] Preferably, the discrimination scores of the target subset are obtained by combining the nearest neighbor discrimination score and the distribution discrimination score of the target subset and then using the Sigmoid function mapping. The discrimination scores of all cluster sample subsets of the target task type under the target analysis window length are accumulated to obtain the global adaptability of the target task type under the target analysis window length. Similarly, the global adaptability of the target task type under each analysis window length is obtained. The analysis window length with the largest global adaptability and the shortest length is selected as the optimal analysis window length of the target task type. Similarly, the optimal analysis window length of each task type is obtained.

[0011] Preferably, a prediction model for each task type is constructed using a long short-term memory network model. For any task type, a dedicated historical sample set for that task type under its optimal analysis window length is extracted. The dedicated historical samples in the dedicated historical sample set are used as inputs, and the values ​​of the corresponding labels are used as outputs to obtain the prediction model trained for that task type. Similarly, the prediction models trained for each task type are obtained.

[0012] Preferably, when the power acquisition terminal receives a scheduling instruction, it triggers a multi-task scheduling update; it obtains the current task queue of the power acquisition terminal, arranges and combines all tasks in the task queue according to their positions, and extracts the position parameters of each task under each arrangement; based on the optimal analysis window length corresponding to each task, it extracts the operating data, position parameters, and queue length parameters of the current time and before the current time, and fills missing values ​​with 0; it replaces the actual position parameters of each task under the current time with the position parameters of each task under each arrangement in turn, and constructs the input samples of each task under each arrangement at the current time; after inputting each input sample into the prediction model trained for the corresponding task type, it outputs the timeout probability of each task under each arrangement, and accumulates them to obtain the comprehensive timeout probability of each arrangement; it selects the arrangement with the smallest comprehensive timeout probability as the optimal scheduling strategy for multi-task scheduling.

[0013] Secondly, the present invention provides a multi-task scheduling and acquisition system for a power acquisition terminal, used to implement the aforementioned multi-task scheduling and acquisition method for a power acquisition terminal, comprising: a processor, a memory, a communication interface, and a data acquisition module. The processor stores computer program instructions for implementing the aforementioned multi-task scheduling and acquisition method for a power acquisition terminal. The data acquisition module is electrically connected to the power acquisition terminal device, and the communication interface is electrically connected to both the data acquisition module and the power acquisition terminal device.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention establishes an optimal analysis window dynamic filtering mechanism by introducing two dimensions: operating condition characteristics and task queue characteristics. This overcomes the drawback of traditional methods where window length setting heavily relies on manual experience, resulting in a static and rigid window length. This allows for precise adaptation to dynamic operating conditions and task queue characteristics during feature extraction and analysis, thereby accurately capturing the temporal patterns of different task types under specific operating conditions. Simultaneously, based on the unique historical sample set of each task type under its optimal analysis window length, a prediction model specific to each task type is trained, significantly improving the accuracy of task timeout prediction without increasing model complexity. Finally, based on high-precision timeout probability prediction, forward-looking multi-task dynamic scheduling is achieved. This ensures high real-time performance of task scheduling execution while optimizing the overall utilization efficiency of terminal resources, thus comprehensively improving the success rate and stability of power acquisition terminals in multi-task, high-concurrency scenarios. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the implementation of a multi-task scheduling and acquisition method for a power acquisition terminal according to an embodiment of the present invention. Figure 2 The flowchart for selecting the optimal analysis window length in step S3 is shown below. Figure 3 This is a structural block diagram of a multi-task scheduling and acquisition system for a power acquisition terminal according to an embodiment of the present invention. Detailed Implementation

[0016] The technical features of the present invention will be further described in detail below with reference to the accompanying drawings so that those skilled in the art can understand them.

[0017] A multi-task scheduling and acquisition method for a power acquisition terminal, the implementation process of which is as follows: Figure 1 As shown, the specific implementation steps are as follows: Step S1: Obtain historical data and execution result tags for each task type from the power acquisition terminal, and construct a historical sample set for each task type.

[0018] Specifically, all task types of the power acquisition terminal are coded, and the maximum allowed waiting time for each task type is configured. The specific task types of the power acquisition terminal include: fault alarm tasks, load acquisition tasks, data upload tasks, log statistics tasks, etc.; a unique code is assigned to each task type, for example: the code for fault alarm tasks is set to 1, the code for load acquisition tasks is set to 2, the code for data upload tasks is set to 3, and the code for log statistics tasks is set to 4.

[0019] Multidimensional operating condition data and task queue to be processed are collected in real time from the power acquisition terminal at a fixed sampling frequency, and time-series data of two dimensions, namely position parameter and queue length parameter, are extracted from the task queue to be processed. The sampling frequency can be set to 10Hz. The operating data includes three dimensions: CPU utilization, terminal temperature, and memory usage. In addition, two dimensions are extracted from the queue of tasks to be processed: the position parameter and the queue length parameter. It is necessary to collect time-series data of five dimensions simultaneously to obtain a five-dimensional data sequence.

[0020] The "task queue to be processed" refers to an ordered queue maintained by the task scheduling module within the power acquisition terminal. It is used to temporarily store tasks received by the power acquisition terminal but not yet executed. The queue follows the "first-in-first-out or priority scheduling" rule. The real-time total length of the queue and the real-time position of the tasks to be processed in the queue change dynamically as tasks are enqueued and dequeued.

[0021] In addition, the time taken for each task to be processed from entering the task queue to being scheduled out of the queue is recorded. Tasks that time out and whose time exceeds the maximum allowed waiting time range are marked as failed and have their labels set to 1. Tasks that do not time out and whose time is within the maximum allowed waiting time range are marked as successful and have their labels set to 0.

[0022] Select any task type as the target task type, and extract multiple data sequences under the target task type from the historical data of the power acquisition terminal; First, the maximum allowed waiting time is converted into the number of sampling points to determine the length of the truncated data. When truncating data, the sampling time corresponding to the entry into the task queue is taken as the starting point, and the normal dequeue time or timeout determination time is taken as the ending point. For timeout tasks, the length of the truncated data sequence is its maximum allowed waiting time. For tasks that do not time out, the length of the truncated data sequence is the entire process from the corresponding task being enqueued to being dequeued.

[0023] Normalize the data sequences of all dimensions under the target task type to obtain multiple historical samples of the target task type; The number of historical samples is the same for each task type, and the number of historical samples for the two labels under the same task type is the same. For example, 200 historical samples can be extracted for each task type, namely 100 historical samples of timed-out tasks and 100 historical samples of non-timed-out tasks.

[0024] The normalization process adopts the Min-Max normalization method. The operating condition data can be normalized based on the rated upper and lower limits of the power acquisition terminal equipment. The position parameter and queue length parameter can be normalized based on the upper limit of the queue capacity length of the task scheduling module in the power acquisition terminal. For example: When normalizing terminal temperature data, if the upper limit of the rated operating temperature of the power acquisition terminal equipment is... The lower limit is The terminal temperature at the k-th sampling time is Then the normalized terminal temperature data at the k-th sampling time is: In practical applications, the rated operating temperature range of power data acquisition terminal equipment is typically -25℃ to +55℃. If the terminal temperature at a certain sampling moment is 30℃, then the normalized terminal temperature data is... ; For example: when normalizing the position parameter and queue length parameter, if the upper limit of the queue length of the task scheduling module in the power acquisition terminal equipment is... The position parameter at the k-th sampling time is The queue length parameter is Then the normalized position parameter at the k-th sampling time is The normalized queue length parameter is .

[0025] The set of all historical samples and their labels under the target task type is taken as the historical sample set of the target task type. Similarly, the historical sample set of each task type is obtained.

[0026] Step S2: Based on the maximum allowed waiting time preset for each task type, divide the analysis window into multiple lengths to construct a dedicated historical sample set for each analysis window length under each task type.

[0027] Specifically, the maximum allowable waiting time for the target task type is divided into multiple equal-length window bases. The window bases of different multiples are used as the length of the analysis window in turn to generate a set of candidate window lengths for the target task type. Then, any analysis window length in the set is selected as the target window length. The window baseline can be set to 0.01 times the maximum allowable waiting time. For example, the maximum allowable waiting time for the target task type is... Then the set of candidate window lengths for the target task type is When the length of the analysis window is a decimal, it is rounded down to the nearest integer.

[0028] Extract historical sample sets for the target task type. Based on the target window length, set the sliding step size to 1 sampling point. Slide forward from the end of each historical sample to extract five-dimensional time series data of the target window length. Treat each extracted window as a unique historical sample. The set of unique historical samples and corresponding labels under the target window length is taken as the unique historical sample set of the target task type under the target window length. Traverse the candidate window length set of the target task type to obtain the unique historical sample set of each analysis window length under the target task type. Similarly, obtain the unique historical sample set of each analysis window length under each task type.

[0029] For each analysis window length, each historical sample corresponds to multiple dedicated historical samples. The dedicated historical samples are slidably extracted and the sliding step size is set to 1 sampling point. The purpose is to accurately capture the relevant working condition characteristics and queue characteristics of timeout risk.

[0030] Step S3: Perform feature extraction and cluster analysis on each dedicated historical sample set to select the optimal analysis window length for each task type.

[0031] Traditional multi-task scheduling methods typically employ fixed window lengths set manually based on experience for feature analysis, or use a static configuration method where a single task type corresponds to a unique window for analysis. These methods fail to consider both the overall queue characteristics of the tasks to be processed and the dynamic operating conditions of the terminal, resulting in poor adaptability to operating conditions and unreasonable task scheduling. The purpose of this step is to achieve optimal window adaptation for each task type through a collaborative design of operating condition clustering and dual-discrimination screening, thereby improving the accuracy of feature extraction and the ability to distinguish samples.

[0032] Step S301: Extract the data features of each dedicated historical sample and generate the working condition feature vector and queue feature vector for each dedicated historical sample.

[0033] Specifically, the working condition data of any specific historical sample is extracted and the mean of the working condition data in each dimension is calculated to serve as the working condition feature of that specific historical sample. The working condition features in each dimension are then merged to generate the working condition feature vector of that specific historical sample.

[0034] In addition, the position parameter sequence and queue length parameter sequence are extracted from the dedicated historical sample, and the mean of the two sequences is calculated respectively to serve as the position feature and queue length feature corresponding to the dedicated historical sample. The linear fitting slope of the two sequences is calculated respectively using the least squares formula to serve as the position change trend feature and queue length change trend feature corresponding to the dedicated historical sample. The above four features are combined to generate the queue feature vector of the dedicated historical sample.

[0035] Among them, the position parameter and the queue length parameter can represent the "task's own queuing progress" and the "overall queue congestion status", respectively. The position feature is used to reflect the average queuing position of a task within a window period, while the position change trend feature is used to reflect the changing trend of the task queuing position. If the slope of the linear fit of the position is positive, it indicates that the queue position has moved backward and the queuing progress has slowed down. If the slope of the linear fit of the position is negative, it indicates that the queue position has moved forward and the queuing progress has fastened. The queue length feature reflects the average congestion level of the queue within the window period, while the queue length change trend feature reflects the change trend of queue congestion level. A positive slope of the linear fit of the queue length indicates that the queue length continues to lengthen and congestion intensifies; a negative slope of the linear fit of the queue length indicates that the queue length continues to shorten and congestion eases.

[0036] Step S302: Cluster each specific historical sample set based on the working condition feature vector to obtain multiple working condition clusters for each specific historical sample set.

[0037] Specifically, the combination of the working condition feature vector, queue feature vector and corresponding label of the same exclusive historical sample is used as a training sample, so as to obtain the training sample set corresponding to each exclusive historical sample set. Select any training sample set as the target training sample set. Based on the working condition feature vector in the target training sample set, preset multiple candidate K values, perform K-Means clustering algorithm to cluster, and then use the silhouette coefficient method to determine the optimal K value, thus obtaining the working condition cluster with the optimal number of K values. Among them, the silhouette coefficient method is an existing technology. The silhouette coefficient is an internal evaluation index used to evaluate the effect of clustering algorithms. It provides an intuitive numerical evaluation of the rationality of clustering results by quantifying the tightness (i.e., cohesion) of a sample within its own cluster and the degree of separation (i.e., separation) from other clusters. The cohesion of a sample is calculated based on the Euclidean distance between the sample and other samples in its own cluster, and the separation of a sample is the minimum value of the average Euclidean distance from the sample to other clusters other than its own cluster.

[0038] In this embodiment, the cohesion and separation of each training sample can be obtained according to the working condition feature vector to calculate the silhouette coefficient of each training sample. Taking any candidate K value as an example, the average of the silhouette coefficients of all training samples in the clustering result corresponding to the candidate K value is taken as the overall silhouette coefficient corresponding to the candidate K value, and the candidate K value with the largest overall silhouette coefficient is taken as the optimal K value of the target training sample set. Similarly, the optimal K value of each training sample set is obtained.

[0039] During the clustering process, the Euclidean distance between the feature vectors of the working conditions corresponding to any two training samples is used as the similarity criterion. The smaller the Euclidean distance, the greater the similarity between the two training samples, the more similar the working conditions are, and the more they should be classified into the same working condition cluster.

[0040] For calculating the Euclidean distance between the feature vectors of the operating conditions corresponding to any two training samples, let the dimension of the feature vectors of the operating conditions of the two training samples be n, and let the value of the i-th dimension of the feature vector of the operating condition of one of the training samples be n. The i-th dimension value of the working condition feature vector of another training sample is The calculation formula is as follows: In the formula, D represents the Euclidean distance between two operating condition feature vectors; in the embodiment provided by this solution, the number of dimensions n of the operating condition feature vectors is 3, including three dimensions: CPU utilization, terminal temperature, and memory usage.

[0041] In addition, several training samples corresponding to each working condition cluster are taken as a cluster sample subset, and any cluster sample subset under the target training sample set is selected as the target subset, and any training sample within the target subset is selected as the target sample.

[0042] Step S303: Perform statistical analysis on each working condition cluster based on the queue feature vector to obtain the nearest neighbor discrimination and distribution discrimination of each working condition cluster.

[0043] Specifically, based on the queue feature vectors of each training sample in the target subset, the Euclidean distance between the target sample and the other training samples in the target subset is calculated and sorted in ascending order; based on the preset selection limit of the nearest neighbor samples, the nearest neighbor sample set of the target sample is obtained, and the proportion of training samples under the two labels in the nearest neighbor sample set is counted and the absolute difference between the two is calculated. Among them, the selection limit of the nearest neighbor samples can be set to the top 20% of the training samples after sorting from smallest to largest; the proportion of training samples under two labels is calculated, that is, the proportion of normal samples with label 0 and the proportion of abnormal samples with label 1 in the nearest neighbor sample set.

[0044] Based on a preset threshold for judging mixed samples, for example, the threshold can be set to 0.3. If the absolute difference is less than the threshold, the target sample is judged as a mixed sample. Similarly, each training sample in the target subset is judged in turn, the proportion of mixed samples is counted and the natural exponential function is used for inverse mapping, and the mapped value is used as the nearest neighbor discrimination of the target subset. The proportion of mixed samples reflects the distribution characteristics of normal or abnormal samples around a single training sample in the target subset, and is used to accurately capture the local clustering characteristics of the working condition feature vector. The larger the proportion of mixed samples in the target subset, the more blurred the boundary between normal and abnormal samples, and the smaller the nearest neighbor discrimination of the target subset.

[0045] The nearest neighbor discriminant is used to reflect the difficulty of distinguishing normal samples from abnormal samples using the corresponding queue feature vectors within the target analysis window length. The nearest neighbor discriminant ranges from 0 to 1. The larger the nearest neighbor discriminant value, the smaller the proportion of mixed samples in the target subset, and the higher the degree of distinction between normal samples and abnormal samples, and the easier it is to distinguish them.

[0046] Extract the maximum and minimum values ​​of each dimension of the feature vectors of all queues within the target subset, and divide the range of each dimension of feature values ​​into multiple equal and continuous intervals; calculate the proportion of training samples under the two labels in each interval and the absolute difference between them; take the mean of the absolute difference of each interval under a certain dimension of feature as the discrimination degree of that dimension of feature, and take the mean of the discrimination degree of each dimension of feature as the distribution discrimination degree of the target subset, that is, calculate the mean of the absolute difference of each interval as the distribution discrimination degree of the target subset; The value range of each dimension feature can be divided into 10 intervals; the larger the value of the distribution discrimination, the stronger the ability of the queue features extracted under the target analysis window length to distinguish normal or abnormal samples in the global statistical distribution; the value range of the distribution discrimination is 0 to 1.

[0047] Step S304: Based on the nearest neighbor discrimination and distribution discrimination, calculate the global adaptability of each analysis window length under each type of task, so as to select the optimal analysis window length for each task type.

[0048] Specifically, the discrimination score of the target subset is obtained by combining the nearest neighbor discrimination score and the distribution discrimination score of the target subset and then using the Sigmoid function mapping. The formula for calculating the differentiation effect score is as follows: In the formula, S represents the discrimination score of the target subset. Let D1 represent the nearest neighbor discrimination of the target subset, and D2 represent the distribution discrimination of the target subset. Nearest neighbor discrimination and distribution discrimination evaluate the overall ability of the target analysis window length to distinguish between normal and abnormal samples under the working conditions corresponding to the target subset from two dimensions: local nearest neighbor features and global statistical distribution. The larger the discrimination score, the better the fit between the target analysis window length and the working conditions corresponding to the target subset.

[0049] The global adaptability of the target task type under the target analysis window length is obtained by summing the discrimination scores of all cluster sample subsets under the target analysis window length. Similarly, the global adaptability of the target task type under each analysis window length is obtained. Global adaptability is a comprehensive evaluation of the target analysis window length under all operating conditions for the target task type. By calculating global adaptability, we can avoid the problem that the target analysis window length is optimal for a single operating condition cluster but has poor overall operating condition adaptability, and ensure that the selected optimal analysis window length can adapt to all actual operating conditions of the target task type.

[0050] The analysis window length with the highest global adaptability and the shortest length is selected as the optimal analysis window length for the target task type. Similarly, the optimal analysis window length for each task type is obtained. Among them, the analysis window length with the highest global adaptability is selected as the optimal analysis window length. If the global adaptability of multiple analysis window lengths is the same under the same task type, the analysis window length with the smallest length is selected as the optimal analysis window length.

[0051] Step S4: Construct prediction models for each task type and train them based on the dedicated historical sample sets for each task type under its optimal analysis window length.

[0052] Specifically, a prediction model for each task type is constructed using a long short-term memory network model. For any task type, a dedicated historical sample set for that task type under its optimal analysis window length is extracted. The dedicated historical samples in this dedicated historical sample set are used as input, and the values ​​of the corresponding labels are used as output to obtain the prediction model trained for that task type. Similarly, the prediction models trained for each task type are obtained.

[0053] The training process for a prediction model of any task type is as follows: Based on a ratio, such as 7:3, the specific historical sample set for this task type under its optimal analysis window length is divided into a training set and a validation set. Using the training set, the input layer of the Long Short-Term Memory (LSTM) network model receives the five-dimensional data matrix corresponding to the specific historical samples, and the output layer receives the labels corresponding to the specific historical samples. Through hidden layers, Dropout layers, and fully connected layers, the model learns the mapping relationship between the temporal features of the specific historical samples in the training set and their labels. Forward propagation is used to calculate the predicted probability distribution, and the cross-entropy loss function is used to calculate the error between the predicted and measured values. Then, the weight parameters of each layer are updated through backpropagation. Finally, the output layer outputs the probability distribution of the binary labels for the corresponding specific historical samples. The probability of a binary label being 1 is the timeout failure probability. After each training round, based on the specific historical samples in the validation set, the prediction error of the validation set is calculated, and the model parameters are continuously iterated and optimized until the prediction error on the validation set converges to a preset threshold or reaches a preset number of training rounds, at which point model training stops.

[0054] By training a prediction model specific to each task type based on its own historical sample set within its optimal analysis window length, the prediction model can pay more attention to the data changes of the corresponding task type during training, accurately capture the temporal patterns of different task types under specific working conditions, thereby effectively improving the training effect and enhancing the prediction accuracy of the prediction model for the corresponding task type.

[0055] Step S5: In response to the scheduling instruction, extract the queue of tasks to be processed at the current moment and arrange them in a permutation and combination. Based on the optimal analysis window length corresponding to each task to be processed, obtain the input samples of each task to be processed under each permutation and combination at the current moment, and input them into the trained prediction model to obtain the timeout probability of each task to be processed under each permutation and combination, thereby selecting and executing the optimal scheduling strategy.

[0056] Specifically, when the power acquisition terminal receives a scheduling instruction, it triggers a multi-task scheduling update; it obtains the current queue of tasks to be processed in the power acquisition terminal, arranges and combines all tasks to be processed in the queue in terms of their positions, and extracts the position parameters of each task to be processed under each arrangement and combination. The purpose of permuting and combining the tasks to be processed is to generate all possible order combinations of the tasks to be processed.

[0057] Based on the optimal analysis window length for each task to be processed obtained in step S3, extract the working condition data, position parameters and queue length parameters at the current time and before the current time, fill in missing values ​​with 0, until the optimal analysis window length for each task to be processed is completed. Replace the actual position parameters of each task under each permutation and combination with the position parameters of each task at the current time. Based on the normalization processing method of the collected data in step S1, normalize the intercepted data and construct the input samples of each task under each permutation and combination at the current time. The format of the input samples is consistent with the format of the dedicated historical samples. After each input sample is fed into the prediction model trained for the corresponding task type, the timeout probability of each task to be processed under each permutation and combination is output. The combined timeout probability of each permutation and combination is accumulated. The permutation and combination with the smallest combined timeout probability is selected as the optimal scheduling strategy for multi-task scheduling. After obtaining the optimal scheduling strategy, the position of each task to be processed in the task queue is adjusted so that the power acquisition terminal can schedule and execute according to the optimal scheduling strategy.

[0058] The flowchart provided in this embodiment is not intended to indicate that the operations of the method will be performed in any particular order, or that all operations of the method are included in every case. Furthermore, the method may include additional operations. Within the scope of the technical concept provided by the method in this embodiment, additional variations can be made to the above method.

[0059] It should be understood that in some embodiments, the components may be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.

[0060] This invention also discloses a multi-task scheduling and acquisition system for a power acquisition terminal, used to implement the aforementioned multi-task scheduling and acquisition method for a power acquisition terminal. The system structure is as follows: Figure 2 As shown, it includes: a processor, a memory, a communication interface, and a data acquisition module. The processor stores computer program instructions for implementing the multi-task scheduling acquisition method of the power acquisition terminal described above. The data acquisition module is electrically connected to the power acquisition terminal device, and the communication interface is electrically connected to both the data acquisition module and the power acquisition terminal device.

[0061] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages ​​and procedural programming languages.

[0062] Computer program instructions can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.

[0063] In the latter case, the remote computer can connect to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can connect to an external computer (e.g., via the Internet using an Internet service provider).

[0064] In some embodiments, in order to perform aspects of the present invention, electronic circuits including, for example, programmable logic circuits, field-programmable gate arrays (FPGAs) or programmable logic arrays (PLAs) can execute computer-readable program instructions to personalize the electronic circuits by utilizing state information of computer-readable program instructions.

[0065] The embodiments included in this invention are descriptions of preferred embodiments of the invention and are not limited to the precise structures already described above and shown in the accompanying drawings. Various modifications and changes can be made without departing from the scope of protection. All variations and improvements made by those skilled in the art to the technical solutions of this invention without departing from the design concept of this invention should fall within the scope of protection of this invention.

Claims

1. A multi-task scheduling and acquisition method for a power acquisition terminal, characterized in that, include: Acquire historical data and execution result tags for each task type from the power acquisition terminal, and construct a historical sample set for each task type; Based on the maximum allowed waiting time preset for each task type, multiple analysis window lengths are divided to construct a dedicated historical sample set for each analysis window length under each task type. Data features are extracted from each specific historical sample to generate a working condition feature vector and a queue feature vector for each specific historical sample. Based on the working condition feature vectors, each specific historical sample set is clustered to obtain multiple working condition clusters for each specific historical sample set. Statistical analysis is performed on each working condition cluster based on the queue feature vectors to obtain the nearest neighbor discrimination and distribution discrimination of each working condition cluster. Based on the nearest neighbor discrimination and distribution discrimination, the global adaptability of each analysis window length under each task type is calculated to select the optimal analysis window length for each task type. This includes: combining the nearest neighbor discrimination and distribution discrimination of the target subset, and then using the Sigmoid function to map and obtain the discrimination effect score of the target subset; accumulating the discrimination effect scores of all cluster sample subsets of the target task type under the target analysis window length to obtain the global adaptability of the target task type under the target analysis window length, and similarly obtaining the global adaptability of the target task type under each analysis window length; selecting the analysis window length with the largest global adaptability and the smallest length as the optimal analysis window length for the target task type, and similarly obtaining the optimal analysis window length for each task type. Prediction models for each task type are constructed separately and trained based on the dedicated historical sample sets for each task type under its optimal analysis window length. In response to scheduling instructions, the queue of tasks to be processed at the current moment is extracted and arranged in a permutation and combination. Based on the optimal analysis window length corresponding to each task to be processed, the input samples of each task to be processed under each permutation and combination at the current moment are obtained and input into the trained prediction model to obtain the timeout probability of each task to be processed under each permutation and combination, thereby selecting and executing the optimal scheduling strategy.

2. The multi-task scheduling and acquisition method for a power acquisition terminal according to claim 1, characterized in that, The construction of historical sample sets for each task type includes: All task types of the power acquisition terminal are coded, and the maximum allowed waiting time for each task type is configured separately; Multidimensional operating condition data and task queue to be processed are collected in real time from the power acquisition terminal at a fixed sampling frequency, and time-series data of two dimensions, namely position parameter and queue length parameter, are extracted from the task queue to be processed. Set the label for timed-out tasks to 1 and the label for tasks that have not timed out to 0; Select any task type as the target task type, extract multiple data sequences under the target task type from the historical data of the power acquisition terminal, normalize the data sequences of all dimensions under the target task type to obtain multiple historical samples of the target task type, and take the set of all historical samples and their labels under the target task type as the historical sample set of the target task type. Similarly, the historical sample set of each task type is obtained.

3. The multi-task scheduling and acquisition method for a power acquisition terminal according to claim 2, characterized in that, The construction of a dedicated historical sample set for each analysis window length under each type of task includes: The maximum allowable waiting time for the target task type is divided into multiple equal-length window bases. The window bases of different multiples are used as the length of the analysis window in turn to generate a set of candidate window lengths for the target task type. Then, any analysis window length in the set is selected as the target window length. Extract the historical sample set of the target task type. Based on the target window length, slide forward from the end of each historical sample to extract data of each dimension. Treat each extracted window as an exclusive historical sample. The set of exclusive historical samples and corresponding labels under the target window length is used as the exclusive historical sample set of the target window length under the target task type. Traverse the candidate window length set of the target task type to obtain the exclusive historical sample set of each analysis window length under the target task type. Similarly, we obtain a dedicated historical sample set for each analysis window length under each task type.

4. The multi-task scheduling and acquisition method for a power acquisition terminal according to claim 2, characterized in that, The generation of the working condition feature vector and queue feature vector for each unique historical sample includes: Extract the operating condition data of any specific historical sample and calculate the mean of the operating condition data in each dimension to serve as the operating condition feature of that specific historical sample. Merge the operating condition features in each dimension to generate the operating condition feature vector of that specific historical sample. Extract the rank parameter sequence and queue length parameter sequence from the specific historical sample, calculate the mean of the two sequences respectively, and use them as the rank feature and queue length feature corresponding to the specific historical sample. Calculate the linear fitting slope of the two sequences respectively using the least squares formula, and use it as the rank change trend feature and queue length change trend feature corresponding to the specific historical sample. Combine the above four features to generate the queue feature vector of the specific historical sample.

5. The multi-task scheduling and acquisition method for a power acquisition terminal according to claim 1, characterized in that, The clustering of each specific historical sample set based on the working condition feature vector includes: The combination of the working condition feature vector, queue feature vector and corresponding label of the same exclusive historical sample is used as a training sample, so as to obtain the training sample set corresponding to each exclusive historical sample set. Select any training sample set as the target training sample set. Based on the working condition feature vector in the target training sample set, preset multiple candidate K values, perform K-Means clustering algorithm to cluster, and then use the silhouette coefficient method to determine the optimal K value, thus obtaining the working condition cluster with the optimal number of K values. Each cluster of working conditions is used as a subset of training samples. Any subset of cluster samples in the target training sample set is selected as the target subset, and any training sample in the target subset is selected as the target sample.

6. The multi-task scheduling and acquisition method for a power acquisition terminal according to claim 5, characterized in that, The statistical analysis of each working condition cluster based on queue feature vectors includes: Based on the queue feature vectors of each training sample in the target subset, calculate the Euclidean distance between the target sample and the remaining training samples in the target subset and sort them in ascending order; Based on the preset selection limit of the nearest neighbor samples, the nearest neighbor sample set of the target sample is obtained. The proportion of training samples under the two labels in the nearest neighbor sample set is counted respectively, and the absolute difference between the two is calculated. Based on a preset threshold for judging mixed samples, if the absolute difference is less than the threshold, the target sample is judged to be a mixed sample. Similarly, each training sample in the target subset is judged in turn, the proportion of mixed samples is counted and the natural exponential function is used for inverse mapping, and the mapping value is used as the nearest neighbor discriminant of the target subset. Extract the maximum and minimum values ​​of each dimension of the feature vectors of all queues in the target subset, and divide the range of each dimension of feature values ​​into multiple equal and continuous intervals; The proportion of training samples under each label in each interval is counted and the absolute difference between the two is calculated. The mean of the absolute difference in each interval is used as the distribution discrimination of the target subset.

7. The multi-task scheduling and acquisition method for a power acquisition terminal according to claim 1, characterized in that, The construction of prediction models for each task type, and training them separately based on a dedicated historical sample set for each task type within its optimal analysis window length, includes: Prediction models for each task type were constructed using a long short-term memory network model. For any task type, extract the dedicated historical sample set for that task type under its optimal analysis window length, use the dedicated historical samples in the dedicated historical sample set as input and the values ​​of the corresponding labels as output to obtain the prediction model trained for that task type. Similarly, the training yields prediction models for each task type.

8. A multi-task scheduling and acquisition method for a power acquisition terminal according to any one of claims 2 to 7, characterized in that, The selection and execution of the optimal scheduling strategy includes: When the power acquisition terminal receives a scheduling instruction, it triggers a multi-task scheduling update. Obtain the current task queue of the power acquisition terminal, arrange and combine all the tasks in the task queue according to their positions, and extract the position parameters of each task under each arrangement. Based on the optimal analysis window length for each task to be processed, extract the working condition data, position parameters and queue length parameters at the current time and before the current time, and fill missing values ​​with 0; Replace the actual position parameters of each task under each permutation and combination with the position parameters of each task under each permutation and combination at the current time to construct the input samples of each task under each permutation and combination at the current time. After inputting each input sample into the prediction model trained for the corresponding task type, the timeout probability of each task to be processed under each permutation and combination is output, and the combined timeout probability of each permutation and combination is obtained by summing them up. The optimal scheduling strategy for multi-task scheduling is to select the permutation and combination with the lowest overall timeout probability.

9. A multi-task scheduling and acquisition system for power acquisition terminals, characterized in that, include: The device includes a processor, a memory, a communication interface, and a data acquisition module. The processor stores computer program instructions for implementing a multi-task scheduling and acquisition method for a power acquisition terminal according to any one of claims 1 to 8. The data acquisition module is electrically connected to the power acquisition terminal device, and the communication interface is electrically connected to both the data acquisition module and the power acquisition terminal device.

Citation Information

Patent Citations

  • Clustering method, device, equipment, medium and program product

    CN121959080A

  • Sparse positive sample risk discrimination method and system based on clustering analysis

    CN122091258A