Code pre-configuration method fusing computing power constraint and outlier analysis
By performing hardware fingerprinting and computational power signature annotation on the edge computing function set and combining explosive pruning, along with a spatiotemporal joint output distribution model and local outlier factor calculation, the problems of insufficient computational power and stability of function combination in edge computing are solved, and efficient and stable function sequence selection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-03
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies in edge computing lack fine-grained computing power modeling of functional functions under different hardware fingerprints. This can lead to insufficient computing power, sudden increases in latency, and task interruptions in the selected functional combinations. Furthermore, the lack of evaluation of the stability of the combinations makes it difficult to efficiently screen runnable candidate combinations under computing power constraints.
By performing hardware fingerprint computing power signature annotation on the functional function set, combined with the computing power upper limit threshold for combined explosive pruning, using the spatiotemporal joint output distribution model to predict the output vector, and sorting and selecting the best by calculating the local outlier factor, the optimal functional function number sequence is generated.
It enables efficient selection of runnable function sequences under hardware computing power constraints, avoids combinatorial explosion and insufficient computing power, ensures output stability, and improves the automation level of code pre-configuration and system reliability.
Smart Images

Figure CN121614174B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a code pre-configuration method that integrates computing power constraints and outlier analysis. Background Technology
[0002] With the widespread deployment of edge computing and heterogeneous hardware, low-code development platforms for multiple scenarios and functions are gradually becoming the main form of edge applications. Since the computing resources of edge devices are generally limited and the computing power characteristics of different hardware fingerprint devices vary significantly, the platform needs to automatically select a set of functional function combinations that meet the scenario requirements before deployment. However, existing technologies generally have the following shortcomings: First, they lack fine-grained computing power modeling for functional functions under different hardware fingerprints, which may lead to instantaneous insufficient computing power, sudden increases in latency, or even task interruption during actual operation. Second, traditional functional function combination methods rely solely on rule configuration or manual experience, which can lead to combinatorial explosion when faced with large-scale function sets, making it impossible to efficiently screen runnable candidate combinations under computing power constraints. Third, existing code pre-configuration methods generally ignore the stability of functional combinations in terms of temporal output and spatial input dimensions, failing to identify functional function combinations that may cause abnormal outputs in advance, making it easy for the deployed model to produce outlier results in real-world data, affecting system reliability. Fourth, the lack of unified quantitative indicators for effectively ranking multiple candidate combinations makes it difficult to balance operational stability and output consistency within the limits of computing power.
[0003] Against this backdrop, there is an urgent need for a code pre-configuration method that can simultaneously consider hardware computing power constraints, combinatorial space controllability, and output behavior stability, so that the most suitable functional function number sequence for the target scenario can be automatically selected before deployment, thereby reducing deployment risks and improving the overall predictability and reliability of the system. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a code pre-configuration method that integrates computational power constraints and outlier analysis.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] This invention discloses a code pre-configuration method that integrates computing power constraints and outlier analysis, comprising the following steps:
[0007] S1. On the management end, perform computing power signature annotation with hardware fingerprint on the function set to generate a computing power signature function set that records the maximum instantaneous computing power occupancy value;
[0008] S2. Based on the computing power signature function set, perform combined explosive pruning under the target scenario computing power upper limit threshold constraint to obtain the pruned function number sequence set.
[0009] S3. Inject the pruned function number sequence set into the spatiotemporal joint output distribution model constructed based on historical normal outputs to obtain the predicted output vector set predicted by the spatiotemporal joint output distribution model.
[0010] S4. Calculate the local outlier factor for the expected output vector given by the predicted output vector set and the spatiotemporal joint output distribution model, and output the outlier factor set.
[0011] S5. Using the set of outliers as weights, perform weighted sorting on the pruned function number sequence set to obtain the reordered function number sequence set.
[0012] S6. Select the optimal function number sequence from the reordered function number sequence set, which has the smallest outlier in the outlier set and whose total computing power occupancy value of the computing power signature function set is lower than the target scenario computing power upper limit threshold, and complete the code pre-configuration.
[0013] Further: Step S1 includes:
[0014] On the management side, a hardware performance counter is used to perform a computing power signature annotation with hardware fingerprint on the function set. Specifically, for each function in the function set, under the conditions of CPU frequency, memory bandwidth, and cache capacity represented by the target hardware fingerprint uniquely bound to its function identifier, the function is run with the maximum input data scale of a single function as the incentive, and the instantaneous CPU utilization curve, instantaneous memory utilization curve, and instantaneous cache miss rate curve recorded by the hardware performance counter are collected throughout the entire process. After aligning the instantaneous CPU utilization curve, instantaneous memory utilization curve, and instantaneous cache miss rate curve with the same time granularity, the peak value of the normalized weighted sum of the instantaneous CPU utilization, instantaneous memory utilization, and instantaneous cache miss rate at the same moment is taken as the maximum instantaneous computing power utilization value of the function. The maximum instantaneous computing power utilization value, together with the function identifier, target hardware fingerprint, and input data scale threshold of the function, is written into the function description header of the function to generate a computing power signature function set that records the maximum instantaneous computing power utilization value.
[0015] Further: Step S2 includes:
[0016] On the management side, an ordered search tree is constructed with the target scenario's computing power upper limit threshold as the root node and each function in the computing power signature function set as the leaf node. A depth-first traversal is performed on the ordered search tree, and during the traversal, all leaf nodes under the same parent node are sorted in ascending order according to their maximum instantaneous computing power occupancy value, thereby generating a candidate sequence of function functions that monotonically increases in maximum instantaneous computing power occupancy value. During the traversal, the maximum instantaneous computing power occupancy value of the candidate function sequences is calculated by accumulating it. When the accumulated maximum instantaneous computing power occupancy value exceeds the target scenario's computing power upper limit threshold for the first time, the candidate function sequence and all its subsequent extended branches are immediately backtracked and pruned. Only the candidate function sequences whose accumulated maximum instantaneous computing power occupancy value does not exceed the target scenario's computing power upper limit threshold and whose length meets the minimum number of functions required by the target scenario's functional requirements are retained. The function identifiers of the function functions in the retained candidate function sequences are extracted according to their traversal order in the ordered search tree and mapped to function function numbers, generating a pruned function function number sequence set composed of non-repeating function function numbers.
[0017] Furthermore: step S3 includes:
[0018] On the management end, historical normal output vectors arranged in two dimensions (time stamp and input space grid) from the historical normal output library are used as training samples. For each pruned function number sequence set, the following steps are performed sequentially: extract the historical actual output vectors at the same time and input space grid as the historical normal output vectors from the historical operation logs of all functions contained in the function number sequence under the same target hardware fingerprint. Stack the historical actual output vectors into a three-dimensional tensor in time-space order and input it into the spatiotemporal joint output distribution model composed of a temporal convolutional network and a spatial graph convolutional network. The temporal convolutional network captures the short-term fluctuation pattern of the historical actual output vectors in the time dimension, and the spatial graph convolutional network captures the neighborhood correlation pattern of the historical actual output vectors in the input space grid dimension. After being concatenated by the fusion layer, the prediction head outputs parameter vectors that follow a multivariate Gaussian distribution. The parameter vectors are sampled to generate predicted output vectors. The function number sequence is sampled repeatedly until a preset number of predicted output vectors are generated. The results are then summarized to form a set of predicted output vectors that correspond one-to-one with the function number sequence.
[0019] Furthermore: step S4 includes:
[0020] At the management end, the center of the multivariate Gaussian distribution formed by the mean vector and covariance vector obtained by re-estimating the historical normal output vector using the spatiotemporal joint output distribution model is taken as the expected output vector. Each predicted output vector in the predicted output vector set is matched one-to-one with the expected output vector at the same time-space grid point to form a mixed vector set to be tested. The local outlier factor is calculated for the mixed vector set to be tested: first, the reachability distance between each predicted output vector and all historical normal output vectors in its k-th neighborhood is calculated in units of time-space grid points. Then, the local outlier factor of each predicted output vector is obtained by the ratio of the sum of the reciprocals of the reachability distances to the local reachability density of the k-th neighborhood. The local outlier factor is used as the outlier metric of the functional function number sequence that is homologous to the predicted output vector. The outlier factor set is formed by summing them in the order of the functional function number sequence.
[0021] Furthermore: step S5 includes:
[0022] On the management side, for each local outlier in the outlier set, its reciprocal is taken and normalized to form a first weight vector. For the corresponding function number sequence in the pruned function number sequence set, its cumulative maximum instantaneous computing power occupancy is taken and reversed to form a second weight vector. The first weight vector and the second weight vector are multiplied element-wise according to a preset ratio coefficient to obtain a comprehensive weight vector. The pruned function number sequence set is then weighted and sorted according to the comprehensive weight vector: the pruned function number sequence set is rearranged from largest to smallest according to the comprehensive weight vector value, so that the pruned function number sequence with the smallest local outlier and the lowest cumulative maximum instantaneous computing power occupancy is located at the head of the sort. Finally, the reordered function number sequence set after weighted sorting is output.
[0023] Furthermore: step S6 includes:
[0024] On the management side, the set of reordered function number sequences is traversed. For each reordered function number sequence arranged in descending order of the comprehensive weight vector, a dual judgment is performed: First, the maximum instantaneous computing power occupancy value corresponding to all functions contained in the reordered function number sequence is accumulated to obtain the total occupancy value of the sequence. The total occupancy value of the sequence is then compared with the target scene computing power upper limit threshold. Only candidate reordered function number sequences whose total occupancy value is less than the target scene computing power upper limit threshold are retained. Then, among the retained candidate reordered function number sequences, the reordered function number sequence with the smallest and unique corresponding local outlier in the outlier set is selected as the optimal function number sequence. This optimal function number sequence is written into the configuration description file of the target scene to complete the code pre-configuration.
[0025] The technological advancements achieved by this invention compared to existing technologies are as follows:
[0026] This invention achieves a dual evaluation of the executability and output stability of functional function combinations before deployment by introducing hardware fingerprint-based computing power signatures, combinatorial explosion pruning based on computing power upper limit thresholds, spatiotemporal joint output distribution model prediction, and outlier factor-driven ranking and optimization mechanism. This invention not only efficiently filters runnable candidate function sequences under the computing power constraints of heterogeneous edge devices, avoiding combinatorial explosion and insufficient computing power problems, but also identifies functional combinations that may produce abnormal outputs in advance, ensuring that the final selected function sequence not only meets the hardware computing power budget but also exhibits the most stable performance in both temporal and spatial dimensions. This significantly improves the automation level of code pre-configuration, operational reliability, and scenario adaptability. Attached Figure Description
[0027] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0028] In the attached diagram:
[0029] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0030] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0031] like Figure 1 As shown, this invention discloses a code pre-configuration method that integrates computing power constraints and outlier analysis, including:
[0032] S1. On the management end, perform computing power signature annotation with hardware fingerprint on the function set to generate a computing power signature function set that records the maximum instantaneous computing power occupancy value;
[0033] S2. Based on the computing power signature function set, perform combined explosive pruning under the target scenario computing power upper limit threshold constraint to obtain the pruned function number sequence set.
[0034] S3. Inject the pruned function number sequence set into the spatiotemporal joint output distribution model constructed based on historical normal outputs to obtain the predicted output vector set predicted by the spatiotemporal joint output distribution model.
[0035] S4. Calculate the local outlier factor for the expected output vector given by the predicted output vector set and the spatiotemporal joint output distribution model, and output the outlier factor set.
[0036] S5. Using the set of outliers as weights, perform weighted sorting on the pruned function number sequence set to obtain the reordered function number sequence set.
[0037] S6. Select the optimal function number sequence from the reordered function number sequence set, which has the smallest outlier in the outlier set and whose total computing power occupancy value of the computing power signature function set is lower than the target scenario computing power upper limit threshold, and complete the code pre-configuration.
[0038] Specifically, S1 includes:
[0039] S1's goal is to manage each function on the management side. Under its uniquely bound target hardware fingerprint, a dynamic measurement is run with the single function's maximum single-time input data size as the stimulus, collecting three types of time series (CPU instantaneous utilization curve). Memory instantaneous usage curve Cache instantaneous miss rate curve After time alignment and normalized weighted summation, the peak value in the time series is taken as the maximum instantaneous computing power occupancy of the function. and will The function description header of the function is written together with the function identifier, target hardware fingerprint, and input data scale threshold, and finally a set of computing power signature function functions that record the maximum instantaneous computing power occupancy value is produced.
[0040] Overall steps:
[0041] 1. For each function Determine the target hardware fingerprint (CPU clock speed, memory bandwidth, cache capacity and other necessary static parameters).
[0042] 2. Under a test environment consistent with the hardware fingerprint, use the maximum single-function input data size threshold of the function as the stimulus to run a single complete execution.
[0043] 3. Collect and record the three instantaneous curves generated by the hardware performance counter. , , (Uniform sampling granularity) ).
[0044] 4. Align and normalize the three curves according to a uniform time grid, and calculate the time. Instantaneous computing power indicators (Normalized weighted sum).
[0045] 5. Take Peak value during the entire operation period as .
[0046] 6. The function identifier, target hardware fingerprint, and input data scale threshold are written into the function description header to form a computing power signature entry; the set of all entries is the computing power signature function set.
[0047] Next, the target hardware fingerprint is defined. The target hardware fingerprint must contain at least the following fields (used to uniquely bind the functional identifier and the runtime hardware environment):
[0048] CPU clock speed (e.g.: (in MHz or GHz)
[0049] CPU microarchitecture / model (used to identify counter semantics);
[0050] Memory bandwidth limit ( (e.g., GB / s)
[0051] Cache hierarchy information (such as L1 / L2 / L3 capacity): ( , , ).
[0052] Hardware fingerprinting ensures semantic consistency between measurements and the target deployment environment, enabling reproducible comparison of computing power signatures in subsequent pruning / deployment decisions. For each functional... Based on its single function's maximum single input data size threshold As input, a single-run is performed, the threshold of which is defined by business requirements / function interfaces. This is executed on a controlled node consistent with the target hardware fingerprint, ensuring no other significant interfering processes are currently in operation (or within a controlled load baseline), and the sampling interval is selected accordingly. (e.g., millisecond-level or configurable) to ensure the capture of short-term transient peaks; all function measurements must use consistent methods. Using hardware performance counters (HPU / PMU) or system runtime metric acquisition tools, three types of time series are output:
[0053] CPU instantaneous utilization rate (as a percentage or [0,1] ratio);
[0054] Instantaneous memory utilization (as a percentage or [0,1] ratio, based on memory bandwidth utilization or memory usage ratio);
[0055] : Cache instantaneous miss rate (cache missrate, in ratio [0,1]).
[0056] The three collected curves were resampled to a common time grid. Interval is Nearest neighbor or linear interpolation is used to guarantee the corresponding All three values are available for the function. Let the aligned sequence be:
[0057]
[0058] If the original sample is already a percentage or ratio, then it is considered... If not, it should be converted to standard ratio form first.
[0059] To synthesize three different semantic metrics into a single instantaneous computing power metric. Using a normalized weighted sum, weights are set. , , satisfy:
[0060]
[0061] If the CPU clock speed is low or the number of cores is limited in the target hardware fingerprint, then increase the weight corresponding to the instantaneous CPU utilization rate. ;
[0062] If memory bandwidth or available capacity is limited, increase the weight corresponding to the instantaneous memory occupancy rate. ;
[0063] If the cache capacity is small or the cache level is shallow, increase the weight corresponding to the instantaneous cache miss rate. ;
[0064] Then at each time point definition
[0065]
[0066] in, , , This is the normalized index value.
[0067] The normalization process includes the following steps:
[0068] 1. If the original indicator is already a ratio Then take (same principle) , ).
[0069] 2. If a uniform scale is needed for comparisons between different functions / hardware, hardware-based normalization can be used: divide the original instantaneous value by the theoretical or nominal upper limit under that hardware fingerprint (e.g., memory bandwidth limit). (e.g., maximum miss-rate limit related to cache capacity, 1, etc.)
[0070]
[0071] in, Represents function At any moment Instantaneous memory usage; Indicates the upper limit of memory bandwidth under the target hardware fingerprint; This represents the instantaneous memory usage rate after hardware capability normalization.
[0072] However, to maintain consistency and comparability, this method description uses the standard ratio input (percentage → ratio) as the normalization basis by default. It is important to note the weights. , , The management strategy (e.g., based on the target scenario's preference for CPU, memory, and cache sensitivity) is set and kept consistent in subsequent pruning and sorting to ensure metric comparability.
[0073] After completion After calculation, the maximum instantaneous computing power occupancy is defined as the peak value of the sequence:
[0074]
[0075] scalar (If all inputs are normalized to [0,1]) or within a numerical range defined by the management side. This value represents the threshold value between the given target hardware fingerprint and the input data size. Under the condition, function The instantaneous peak computing power occupancy metric during a single maximum input execution.
[0076] For each function Write the following structured entry in its function description header:
[0077] Function ID: A unique identifier for a function (bound to the function interface);
[0078] Target hardware fingerprint: includes fields such as CPU clock speed, memory bandwidth, cache capacity, and CPU model;
[0079] Input Scale Threshold: , used to describe the scale of the excitation during measurement;
[0080] Maximum Instant Compute Usage: scalar value;
[0081] Sampling Metadata: Sampling Interval Measurement start / end timestamps, and a reference for normalization;
[0082] Weight Vector: Used for calculation of( , , );
[0083] Notes / Version: Measurement version number, measurement environment identifier (for traceability);
[0084] The function description header and function code / configuration are stored together to form a computing power signature entry. The set of all entries is the computing power signature function set.
[0085] Each function's computational power signature is uniquely bound to its target hardware fingerprint to prevent improper reuse across hardware. To ensure the representativeness of the measurement, the measurement is run once with the maximum input data size of a single function and the instantaneous peak value is recorded. If necessary, multiple repeated measurements can be selected, and the maximum value or statistic can be recorded. However, this embodiment uses the single peak value as the standard, and the sampling interval is... It should be sufficient to capture short-term transient peaks; in the patent description, the granularity is specified as milliseconds or set by the management terminal. Within the same management domain, ( , , Consistency should be maintained across all function annotation stages to ensure comparability. If direct addition is required during subsequent computational power accumulation / comparison, [the following should be done]: Standardizing to the same scale (e.g., ([0,1])) facilitates accumulation and threshold comparison in step S2.
[0086] The final output is a set of structured entries (each entry is the computational signature of a function), expressed in set form as follows:
[0087]
[0088] in, This is a set of computing power signature functions, a standardized set of signatures used to describe the computing power occupancy behavior of function functions under a specific hardware fingerprint. This is the size of the function set. This set is the set of computing power signature functions that records the maximum instantaneous computing power occupancy value, and is used in the subsequent step S2 (combined explosive pruning).
[0089] In summary, on the management side, for each function, based on its target hardware fingerprint and the maximum single input data size, hardware performance counters are used to collect three types of instantaneous curves: CPU, memory, and cache. These three curves are then aligned and normalized at a uniform time granularity and synthesized into a time-series computing power index according to preset weights. The peak value is taken as the maximum instantaneous computing power occupancy of the function. ;Will Information such as function identifier, target hardware fingerprint, and input data scale threshold is written into the function description header. The set of all entries forms the computing power signature function set, which provides a comparable and accumulative computing power benchmark for subsequent pruning and deployment decisions.
[0090] Specifically, S2 includes:
[0091] In step S1, each function has obtained a uniquely bound maximum instantaneous computing power occupancy value. And form a complete set of computing power signature function sets. The goal of step S2 is:
[0092] 1. Maximum computing power threshold in the target scenario Under constraints;
[0093] 2. Systematically organize and search all possible combinations of functionalities;
[0094] 3. Avoid combinatorial explosion by using computational power accumulation constraints for pruning within the search tree;
[0095] 4. Finally, output a set of pruned function number sequences that satisfy both the computing power constraints and the functional quantity requirements.
[0096] Input and key variables, computing power signature function set, in the form of
[0097]
[0098] Each of them This serves as a function identifier, which is mapped to a function number via the management interface.
[0099] Target scenario computing power limit threshold: ;
[0100] Minimum number of functions required for the target scenario: .
[0101] Construct an ordered search tree with the target computing power threshold as the root node. The management side constructs an ordered search tree with the following structure:
[0102] (1) Root node
[0103] The root node contains no functionalities, only carrying the following information: the current maximum cumulative instantaneous computing power occupancy. This node represents a state where no function has been selected yet.
[0104] (2) Child Nodes
[0105] Each leaf node corresponds to a function in the set of computing power signature functions. Each leaf node contains: a function identifier. Maximum instantaneous computing power occupancy .
[0106] (3) Father-son relationship
[0107] The child nodes of any node are new nodes formed by adding a new function to the current candidate sequence.
[0108] All leaf nodes under the same parent node must be sorted in ascending order of maximum instantaneous computing power occupancy:
[0109] If the set of child nodes of the parent node is: Then they need to be sorted to satisfy the following conditions. .
[0110] utility:
[0111] This allows depth-first search (DFS) to prioritize exploring combinations with lower computational costs.
[0112] To trigger the pruning condition (cumulative computing power exceeding the limit) as early as possible;
[0113] This allows the search tree to eliminate a large number of combinations that do not meet the constraints early on, thus significantly reducing the size of the combinatorial explosion.
[0114] The management system performs Depth-First Search (DFS) on an ordered search tree. Let the set of selected functions along a certain path be: Then its cumulative maximum instantaneous computing power occupancy value is:
[0115]
[0116] When traversing to a certain node, once the following occurs: Then execute immediately:
[0117] Backtracking;
[0118] And prune that node and all its subsequent subtrees.
[0119] A candidate path (i.e., a sequence of candidate functions) is only retained if the following conditions are met:
[0120] and Otherwise, it will not be included in the pruned sequence set.
[0121] Next, extract the function identifiers and map them to function numbers. For each retained candidate sequence of function functions:
[0122] 1. Extract the function identifiers according to the traversal order formed in DFS;
[0123] 2. Convert function identifiers into function numbers using the function mapping table on the management end;
[0124] 3. Form a sequence consisting of non-repeating function numbers.
[0125] Suppose a valid candidate path contains a function identifier:
[0126]
[0127] The sequence of function numbers obtained by mapping is as follows
[0128]
[0129] The final output of step S2 is a set:
[0130]
[0131] Each of these sequences satisfies the following:
[0132] 1. The cumulative maximum instantaneous computing power occupancy does not exceed the target scene's computing power upper limit threshold:
[0133]
[0134] 2. Minimum threshold for the number of functional functions to meet functional requirements:
[0135]
[0136] 3. The function numbers in the sequence are unique, and the order is determined by DFS.
[0137] Specifically, S3 includes:
[0138] The pruned function sequence is injected into the spatiotemporal joint output distribution model constructed based on historical normal outputs to obtain the predicted output vector set.
[0139] In step S2, the set of pruned function ID sequences that satisfy the computing power constraints has been obtained:
[0140]
[0141] The task of step S3 is:
[0142] 1. For each numbered sequence, based on its historical operation log (under the same target hardware fingerprint conditions), extract the historical actual output vector that matches the historical normal output vector;
[0143] 2. Arrange the historical actual output vectors into a unified time-space three-dimensional tensor;
[0144] 3. Input this tensor into the spatiotemporal joint output distribution model (composed of a temporal convolutional network and a spatial graph convolutional network connected in parallel).
[0145] 4. The model output is a parameter vector (mean, covariance, or its parameterized representation) that follows a multivariate Gaussian distribution.
[0146] 5. Based on the sampling of the distribution parameters, multiple independent predicted output vectors are obtained;
[0147] 6. Finally, a set of predicted output vectors is formed that corresponds one-to-one with the sequence of function numbers for each function.
[0148] The management system maintains a historical normal output library, in which all historical normal output vectors are arranged according to the following two dimensions:
[0149] Timestamp sequence ;
[0150] Input spatial grid sequence .
[0151] In this library, for each time grid point With each spatial grid point There exists a historical normal output vector:
[0152]
[0153] This set constitutes the standard reference structure for the space tensor during training.
[0154] Then, for each pruned function number sequence, extract the historical actual output vector. Let a pruned function number sequence be:
[0155]
[0156] The function corresponding to this sequence is:
[0157]
[0158] (1) Prerequisite for extraction: The fingerprint of the target hardware is consistent.
[0159] The function must originate from the same target hardware fingerprint environment as step S1 in the historical execution log.
[0160] (2) Matching time and space dimensions
[0161] For each time-space grid point Extract from the historical execution log of the corresponding function:
[0162]
[0163] (3) The principle of fusion of intra-sequence functional functions
[0164] Numbering sequence of functions with the same function All functionalities within the same scope are selected. The historical actual output vectors are then stacked, concatenated, or merged according to a method defined by the management end (the default is sequential stacking) to obtain the final historical actual output vector:
[0165]
[0166] The vector maintains the same dimensions as the model input structure.
[0167] For all The historical actual output vectors are arranged in time-space order to form a three-dimensional tensor:
[0168]
[0169] in, For the number of timestamps, To input the number of spatial grid points, The feature dimension for each vector.
[0170] Tensor construction methods:
[0171]
[0172] The model consists of two parallel branches:
[0173] (1) Temporal Convolution Network (TCN)
[0174] Input: 3D tensor ;
[0175] Objective: To capture short-term fluctuation patterns on the timeline.
[0176] The output features are denoted as: .
[0177] (2) Spatial Graph Convolution Network (GCN)
[0178] Input: A dynamic graph structure constructed from spatial grid points;
[0179] Objective: To capture neighborhood correlation patterns between grid points in the input space.
[0180] The output features are denoted as: .
[0181] (3) Fusion Layer
[0182] Concatenate or weighted merge the outputs of two branches:
[0183]
[0184] (4) Distribution Head
[0185] Predict the parameter vector that follows a multivariate Gaussian distribution: Or, the covariance is parameterized in diagonal form: .
[0186] Then, a prediction output vector is generated by sampling based on a multivariate Gaussian distribution, and a single prediction output vector is generated from the distribution parameters output by the prediction head:
[0187]
[0188] Repeat sampling The predicted output vector set is obtained by sampling (the preset number of samples from the management end).
[0189]
[0190] Each predicted output vector corresponds uniquely to the sequence of function numbers.
[0191] The final output is the set of predicted output vectors, for the pruned sequence set. Each sequence :
[0192] The corresponding predicted output vector set is obtained: .
[0193] The predicted outputs for all sequences are summarized as follows:
[0194]
[0195] This set is the output of step S3, which is used for calculating the local outlier factor in step S4.
[0196] Specifically, S4 includes:
[0197] In step S3, the sequence of function numbers after each pruning is determined. Each generated a corresponding set of predicted output vectors:
[0198]
[0199] Simultaneously, the spatiotemporal joint output distribution model re-estimated the multivariate Gaussian distribution center from the historical normal output vector, namely:
[0200] Mean vector Covariance vector (or diagonal covariance parameterization) These together constitute the desired output vector: .
[0201] Step S4 Task:
[0202] 1. Align the predicted output vector and the expected output vector at the same time-space grid point to form a mixed vector set to be detected;
[0203] 2. Calculate the Local Outlier Factor (LOF) for each predicted output vector, using a time-space grid as the unit;
[0204] 3. Obtain the outlier factor for each functional function number sequence;
[0205] 4. Summarize them in sequence to form a set of outlier factors.
[0206] The multivariate Gaussian distribution parameters have been output in step S3. The mean vector is used as the expected output vector.
[0207]
[0208] This vector at each time-space grid point It has the same dimension as the prediction vector.
[0209] Then, the predicted output vectors are aligned with the expected output vectors to form a set of mixed vectors to be detected. For each predicted output vector... (From a sequence of function numbers) At all time-space grid points The above corresponds one-to-one with the expected output vector:
[0210]
[0211] The corresponding alignment results of all grid points constitute the mixed vector set to be detected:
[0212]
[0213] Then, the Local Outlier Factor (LOF) is calculated at each time-space grid point. Execute independently, located in position The predicted output vector is The set of historical normal output vectors is: .
[0214] Then calculate the first... The reachability distance of the neighborhood, and the historical normal output vectors sorted according to Euclidean distance. For a certain neighboring point Define reachable distance:
[0215]
[0216] in, For point To its own The distance between neighbors.
[0217] Then, the locally reachable density is calculated:
[0218]
[0219] in, for of The nearest neighbors (from historical normal output).
[0220] Then, the Local Outlier Factor (LOF) is calculated:
[0221]
[0222] like:
[0223] LOF>1 → Predicted output deviates from the normal pattern;
[0224] LOF≈1 → Consistent with normal behavior;
[0225] LOF < 1 → denser than the neighborhood, generally does not occur (indicating the prediction is abnormally "too normal").
[0226] Calculate the outlier factor for each functional sequence numbered by the pruned sequence. Its predicted output vector set is:
[0227]
[0228] For each predicted output vector The LOF value is calculated for all grid points and aggregated according to the aggregation strategy defined by the administrator (usually the mean or the maximum value) to obtain the outlier of the prediction. Then, all predicted samples are aggregated to obtain the overall outlier factor corresponding to the sequence of function numbers. This value is the sequence. Outlier metric.
[0229] Finally, a set of outlier factors is formed, which is a sequence of numbered functional functions after all pruning. Summarized in order:
[0230]
[0231] This set is the outlier set, used for filtering in step S5 or for generating further code pre-configuration strategies.
[0232] Specifically, S5 includes:
[0233] The pruned function number sequence set is weighted and sorted using the outlier factor set as the weight, resulting in a reordered function number sequence set.
[0234] Step S5 uses the outlier set obtained in step S4. and the set of function number sequences after pruning obtained in step S2. Simultaneously, the cumulative maximum instantaneous computing power occupancy value of each pruned sequence (calculated in step S2 when constructing the candidate sequence of the function) is used, denoted as... The final output is That is, the sequence set of the reordering function that prioritizes the sequence with the lowest outlier factor and the least computational cost.
[0235] Then, the first weight vector is constructed (based on the outlier factor set). Step S4 has yielded the sequence of function numbers for each function. outlier To increase the weight of sequences with smaller outlier factors, the management takes their reciprocal and normalizes them.
[0236] Perform the reciprocal transformation:
[0237]
[0238] Normalization yields the first weight vector:
[0239]
[0240] This vector reflects:
[0241] The closer the sequence output behavior is to the expected output distribution (the smaller the LOF), the greater the weight;
[0242] The higher the probability of an anomaly (the larger the LOF), the smaller the weight.
[0243] Then, the second weight vector is constructed (based on the accumulated maximum instantaneous computing power occupancy). The accumulated maximum instantaneous computing power occupancy for each sequence is denoted as... To ensure that sequences with smaller occupancy values have higher weights, the management side performs reverse normalization.
[0244] Let the occupied range of all sequences be:
[0245]
[0246]
[0247] Map each value to:
[0248]
[0249] Normalization yields the second weight vector:
[0250]
[0251] At this point: the lower the computing power usage, the greater the weight; the higher the computing power usage, the smaller the weight. This weight reflects the computing power friendliness and is an extension of the computing power constraint logic in step S2 into the weight system.
[0252] The management terminal uses a preset ratio coefficient. and Element-wise fusion of the two weights:
[0253]
[0254] Overall weight vector:
[0255]
[0256] Its physical significance:
[0257] The less outlier the sequence (larger w1) and the lower the computational power consumption (larger w2), the greater the overall weight and the higher the ranking. Both play a role in the overall weight, and the other indicator will not be completely ignored because one indicator is too strong.
[0258] With the comprehensive weight vector The management system sorts the sequence of function numbers after pruning.
[0259]
[0260] Sorting principle: The greater the weight, the higher the ranking.
[0261] The smaller the outlier factor, the more stable the result.
[0262] The lower the computing power consumption (the better the computing power constraint is met);
[0263] The higher the priority of the sequence sorting.
[0264] The final result is:
[0265]
[0266] in, This is the sequence of function numbers that has the largest and most optimal overall weight.
[0267] Specifically, S6 includes:
[0268] The optimal function number sequence with the smallest outlier and whose computing power consumption meets the threshold constraint is selected from the reordered function number sequence set to complete the code pre-configuration. In step S5, the management end has already obtained the reordered function number sequence set. Outlier set Maximum instantaneous computing power consumption of each function All have maximum instantaneous computing power occupancy value Maximum instantaneous computing power consumption for sequence accumulation The goal of step S6 is to ultimately determine the optimal sequence among all sequences, which simultaneously satisfies:
[0269] 1. The total computing power occupancy of this sequence is lower than the target scene's computing power upper limit threshold;
[0270] 2. Among the candidate sequences that satisfy the computing power constraints, its corresponding outlier factor is the smallest;
[0271] 3. The sequence should have a unique correspondence in the set of reordered sequences.
[0272] Then, this optimal function number sequence is written into the configuration description file of the target scenario to complete the code pre-configuration.
[0273] The first layer of the dual-judgment process involves determining computing power constraints. The management end traverses the reordered set in descending order of the comprehensive weight vector: Calculate the total computing power required for each sequence:
[0274]
[0275] and the target scenario computing power upper limit threshold Compare:
[0276]
[0277] Only sequences that meet this condition are retained as the candidate sequence set:
[0278]
[0279] This determination guarantees that:
[0280] The sequence is executable under the constraint of the target hardware fingerprint on the edge side and will not trigger insufficient computing power.
[0281] The computational pruning principle of step S2 is strictly inherited, but it is re-verified in the final stage using a sequence-level judgment method.
[0282] Then, the second layer of dual-judgment is performed: the minimum outlier factor determination. In the candidate sequence set that passes the computational power determination, each sequence has a local outlier factor from step S4. The management selects the sequence with the smallest outlier factor from the candidate sequence set.
[0283]
[0284] The sequence That is:
[0285] It exhibits the most stable performance (lowest outlier) under the historical normal output distribution.
[0286] It best meets the operational constraints within the target scenario's computing power budget;
[0287] To avoid uncertainty caused by multiple sequences having the same outlier factor and computational cost, the management requires:
[0288] Only one sequence in the candidate set reaches the minimum outlier factor;
[0289] If multiple sequences have the same LOF value, the sequence is selected based on the order of the reordering vectors (higher weights have higher priority). It always possesses uniqueness.
[0290] The management end will As the final code pre-configuration result, it is written into the configuration description file of the target scenario, including:
[0291] The corresponding function number sequence;
[0292] The computational signature of each function;
[0293] Accumulate the maximum instantaneous computing power usage;
[0294] The outlier factor of this sequence;
[0295] Target hardware fingerprint number;
[0296] Input data size threshold.
[0297] The final step involves generating pre-configured code information that can be directly loaded by low-code edge platforms, marking the completion of the entire method's closed loop.
[0298] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A code pre-configuration method fusing the constraints of computing power and outlier analysis, characterized in that, Comprise the following steps: S1, in the management end to the function function set with hardware fingerprint algorithm power signature mark, generate record maximum instantaneous power occupation value of power signature function function set; S2, according to the power signature function function set is combined under the constraint of target scene power upper limit threshold explosion pruning, obtains the function function number sequence set after pruning; S3, the function function number sequence set after pruning is injected into the space-time joint output distribution model based on historical normal output, obtains the prediction output vector set predicted by the space-time joint output distribution model; S4, the prediction output vector set and the expected output vector given by the space-time joint output distribution model are executed local outlier factor calculation, and the outlier factor set is output; S5, the outlier factor set is used as weight to execute weighted reordering on the function function number sequence set after pruning, and the reordered function function number sequence set is obtained; S6, the optimal function function number sequence is selected from the reordered function function number sequence set, which is the minimum outlier factor in the outlier factor set and the total power occupation value of the power signature function function set is lower than the target scene power upper limit threshold, and the code preconfiguration is completed.
2. The method of claim 1, wherein the code pre-configuration method of fusing the computing power constraint and the outlier analysis is characterized by, The step S1 comprises: In the management end, the function function set is executed with hardware fingerprint algorithm power signature mark through hardware performance counter, specifically: for each function function in the function function set, under the condition of CPU main frequency, memory bandwidth, cache capacity represented by the target hardware fingerprint uniquely bound with its function identification, the single function single maximum input data size is used as the excitation, the function function is run and the CPU instantaneous occupation rate curve, memory instantaneous occupation rate curve and cache instantaneous missing rate curve recorded by the hardware performance counter during the whole running process are collected, after the CPU instantaneous occupation rate curve, memory instantaneous occupation rate curve and cache instantaneous missing rate curve are aligned according to the same time granularity, the peak value of the normalized weighted sum of CPU instantaneous occupation rate, memory instantaneous occupation rate and cache instantaneous missing rate at the same time is taken as the maximum instantaneous power occupation value of the function function, and the maximum instantaneous power occupation value, the function identification of the function function, the target hardware fingerprint and the input data size threshold are written into the function description header of the function function, and the power signature function function set recording the maximum instantaneous power occupation value is generated.
3. The method of claim 1, wherein the code pre-configuration method fuses the computing power constraint and the outlier analysis. The step S2 comprises: The management end constructs an ordered search tree with the target scene computing power upper limit threshold as the root node and each function in the function signature function set as the leaf node, performs depth-first traversal on the ordered search tree, and arranges all leaf nodes under the same parent node in ascending order of their maximum instantaneous computing power occupation values in the traversal process, thereby generating a function candidate sequence that is monotonically increasing in terms of the maximum instantaneous computing power occupation value; the function candidate sequence is calculated in the traversal process, and when the cumulative maximum instantaneous computing power occupation value first exceeds the target scene computing power upper limit threshold, the function candidate sequence and all subsequent extended branches are immediately backtracked and pruned, only the function candidate sequence whose cumulative maximum instantaneous computing power occupation value does not exceed the target scene computing power upper limit threshold and whose length meets the minimum function quantity requirement of the target scene function is retained, the functions in the retained function candidate sequence are extracted according to their traversal order in the ordered search tree, and the corresponding function identifiers are mapped to function numbers, and a pruned function number sequence set composed of non-repeating function numbers is generated.
4. The method of claim 1, wherein the code pre-configuration method fuses the computing power constraint and the outlier analysis. The step S3 comprises: The management end takes the historical normal output vectors arranged in the time stamp and input space grid double dimensions in the historical normal output library as training samples, and sequentially executes the following for each function number sequence in the pruned function number sequence set: extracts the historical actual output vectors of the same time and the same input space grid from the historical running logs of all functions in the function number sequence under the same target hardware fingerprint, stacks the historical actual output vectors into a three-dimensional tensor in time-space order, and inputs the three-dimensional tensor into a space-time joint output distribution model composed of a time convolution network and a space graph convolution network in parallel, captures the short-term fluctuation pattern of the historical actual output vectors in the time dimension through the time convolution network and captures the neighborhood correlation pattern of the historical actual output vectors in the input space grid dimension through the space graph convolution network, and outputs a parameter vector subject to a multivariate Gaussian distribution through a prediction head after splicing by a fusion layer, generates a predicted output vector by sampling the parameter vector, repeats the sampling for the function number sequence until a preset number of predicted output vectors are generated, and forms a predicted output vector set corresponding to the function number sequence.
5. The method of claim 1, wherein the code pre-configuration method fuses the constraints and the outlier analysis. The step S4 comprises: The center of the multivariate Gaussian distribution composed of the mean vector and the covariance vector re-estimated from the historical normal output vectors by the spatio-temporal joint output distribution model at the management end is taken as the expected output vector, each predicted output vector in the predicted output vector set is corresponded to the expected output vector at the same space-time grid point to form a set of to-be-inspected mixed vectors, and the local outlier factor calculation is performed on the set of to-be-inspected mixed vectors: the reachable distance between each predicted output vector and all historical normal output vectors in the k-th neighborhood of the predicted output vector is calculated in the time-space grid unit, and then the local outlier factor of each predicted output vector is obtained by taking the ratio of the sum of the reciprocals of the reachable distances to the local reachable density of the k-th neighborhood, and the local outlier factor is taken as the outlier measure of the functional function number sequence homologous to the predicted output vector, and the outlier factor set is formed by sequentially aggregating the functional function number sequence.
6. The method of claim 1, wherein the code pre-configuration method of fusing the computing power constraint and the outlier analysis is characterized by, The step S5 comprises: The reciprocal of each local outlier factor in the outlier factor set is taken to form a first weight vector at the management end, and the inverse normalization of the accumulated maximum instantaneous computing power occupation value of the corresponding functional function number sequence in the pruned functional function number sequence set is taken to form a second weight vector, the first weight vector and the second weight vector are multiplied by the preset proportion coefficient to obtain a comprehensive weight vector, and the pruned functional function number sequence set is weighted and reordered by the comprehensive weight vector: the pruned functional function number sequence set is rearranged from large to small according to the value of the comprehensive weight vector, so that the pruned functional function number sequence with the smallest local outlier factor and the lowest accumulated maximum instantaneous computing power occupation value is located at the head of the sequence, and the reordered functional function number sequence set after weighted reordering is finally output.
7. The method of claim 1, wherein the code pre-configuration method fuses the computing power constraint and the outlier analysis. The step S6 comprises: The reordered functional function number sequence set is traversed at the management end, and double determination is performed on each reordered functional function number sequence in the reordered functional function number sequence set arranged in descending order according to the comprehensive weight vector: first, the sequence total occupation value is obtained by accumulating the maximum instantaneous computing power occupation values corresponding to all functional functions contained in the reordered functional function number sequence, and the sequence total occupation value is compared with the target scene computing power upper threshold value, and only the candidate reordered functional function number sequence with the sequence total occupation value less than the target scene computing power upper threshold value is reserved; subsequently, the reordered functional function number sequence corresponding to the minimum local outlier factor and unique in the outlier factor set is selected as the optimal functional function number sequence from the reserved candidate reordered functional function number sequence, and the optimal functional function number sequence is written into the configuration description file of the target scene, and the code pre-configuration is completed.
Citation Information
Patent Citations
Demand-oriented code pre-configuration method, system and equipment and storage medium
CN120653229A
Elastic computing power scheduling method and device based on space-time prediction and medium
CN120723452A