A hierarchical caching method for AI training samples for multiple power business scenarios
By constructing a candidate sample set and a sample attribute set, evaluating and classifying the return density, and implementing granular reconstruction and dual-domain allocation, the problem of caching strategies in power systems being unable to balance data access popularity and capacity consumption is solved, thereby improving resource utilization and training efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING YISHUNHONG INFORMATION TECH CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-05-26
AI Technical Summary
In power systems, existing cache eviction policies struggle to balance high data access frequency with high capacity usage, leading to memory jitter and resource waste, especially in the low efficiency of processing heterogeneous data in multi-service parallel training environments.
By constructing a candidate sample set and a sample attribute set, converting them into cache objects and evaluating the benefit density, and then performing granular reconstruction on the objects to be reconstructed after classification, dividing the cache domain into isolated cache domains and shared cache domains, and generating iterative caching strategies to optimize resource utilization.
It improves the utilization rate of parallel training resources in multiple power service scenarios, reduces memory jitter and resource waste, and improves the overall efficiency of hardware resources.
Smart Images

Figure CN122086799A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and underlying data processing technology, and in particular to a hierarchical caching method for AI training samples for multiple power business scenarios. Background Technology
[0002] In artificial intelligence applications involving power systems, scenarios such as substation equipment inspection and transmission line channel monitoring generate massive and highly heterogeneous datasets. In deep learning model training, data caching mechanisms can reduce the read latency of input / output devices, prevent processors from being idle due to data loading waits, improve the overall throughput of multi-task parallel training, and increase hardware resource utilization.
[0003] For optimizing data storage during model training, cache eviction strategies are commonly employed, such as algorithms based on historical access frequency, like Least Recently Used (LRU) and Least Frequently Used (LRF). These algorithms perform relatively stably when processing general, publicly available datasets with simple structures. However, in industrial-grade, multi-service parallel training environments, the data sizes vary significantly across different tasks, and the data sampling logic and preprocessing procedures for each task are independent. Existing eviction strategies struggle to balance data access frequency with the cost of high capacity usage, leading to frequent swapping of large amounts of data and causing memory thrashing. Summary of the Invention
[0004] Purpose of the invention: To provide a hierarchical caching method for AI training samples for multiple power business scenarios, so as to solve the above-mentioned problems in the existing technology.
[0005] Technical solution: A hierarchical caching method for AI training samples in multiple power service scenarios, comprising:
[0006] Obtain raw training samples and training operation information under multiple power service scenarios, and construct candidate sample sets and sample attribute sets;
[0007] The candidate sample set is converted into cache objects, the benefit density of each cache object is evaluated and classified, and the object classification results including objects to be reconstructed and non-objects to be reconstructed are obtained.
[0008] The computational granularity of the refactoring of the object to be refactored is determined, and granular refactoring is performed on the object to be refactored accordingly to generate a set of refactoring objects;
[0009] Reuse boundary identification is performed on the set of objects to be reconstructed and the objects not to be reconstructed to obtain reuse boundary identification results. Based on the reuse boundary identification results, dual-domain allocation of isolated cache domain and shared cache domain is performed to generate cache deployment results.
[0010] Obtain real-time training execution feedback, update object benefit evaluation parameters and cache deployment parameters based on cache deployment results and training execution feedback, and generate an iterative caching strategy.
[0011] Beneficial effects: This invention can adapt to heterogeneous data and improve the overall resource utilization of parallel training. Attached Figure Description
[0012] Figure 1 This is a flowchart of the hierarchical caching method for AI training samples for multiple power service scenarios proposed in this application.
[0013] Figure 2 This is a flowchart for evaluating and classifying the benefit density of each cache object in this application.
[0014] Figure 3 This is a flowchart illustrating the process of obtaining the effective call coefficients for this application.
[0015] Figure 4 This is a flowchart illustrating the granularity of the refactoring tendency for the object to be refactored in this application.
[0016] Figure 5 This is a flowchart for extracting the degree of regional call concentration in this application. Detailed Implementation
[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein are implemented in a sequence other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to the process, method, product, or apparatus.
[0019] To address the aforementioned issues, the applicant conducted in-depth research and analysis, discovering that existing cache scheduling mechanisms face challenges such as high costs for heterogeneous data residency and intense competition for parallel resources under complex multi-scenario cross-training conditions. Furthermore, when each parallel training process independently initiates requests to the storage system, a large amount of structurally similar intermediate data is repeatedly loaded into physical memory, resulting in wasted storage space.
[0020] To address this issue, this application proposes a hierarchical caching method and object-oriented construction of AI training samples for multi-service scenarios in the power industry, such as... Figure 1 As shown, the scattered raw training data is transformed into schedulable cache objects, establishing a process from object hierarchical classification and granular reconstruction to dual-domain deployment and parameter iteration, including:
[0021] Step 101 involves constructing a candidate sample set and a sample attribute set, and converting the candidate sample set into a cache object, specifically including:
[0022] The process involves acquiring raw training samples and training operation information from various power service scenarios to construct candidate sample sets and sample attribute sets. Specifically, it involves extracting service scenario affiliation information, historical call records, and sample capacity information from the raw training samples to form the sample attribute set.
[0023] In this embodiment, the various power service scenarios include substation equipment appearance defect detection, transmission line corridor environmental inspection, safety helmet wearing standard identification in distribution rooms, and drone aerial photography for insulator damage diagnosis. Due to the different service scenarios, the corresponding data formats and task characteristics also exhibit heterogeneity.
[0024] Accordingly, data is aggregated from the distributed storage nodes of various business systems via a data bus or file transfer protocol to obtain the original training samples and corresponding training operation information. The original training samples include image files of various formats and resolutions, video frame sequences, and corresponding annotation files. The training operation information includes training task configuration files for each scenario within a historical period, model hyperparameter settings, data loader sampling strategy records, and historical training logs.
[0025] When constructing the candidate sample set and sample attribute set, data cleaning and standardization parsing are performed. Specifically, the original training samples are categorized according to business scenarios, identifying the corresponding scenario type, training task affiliation, and version status. Invalid samples, duplicate samples, and incomplete samples with corrupted files are removed, and the validated valid samples are combined into the candidate sample set.
[0026] Multi-dimensional metadata information is extracted from the original training samples and training operation information to form a sample attribute set. The sample attribute set records the business scenario affiliation information, sample size information, sample resolution information, file encoding format, number of annotations, annotation level, total number of historical calls, most recent call time, priority identifier of the training task to which it belongs, and the scarcity of samples of its category in the global dataset for each candidate sample. In this embodiment, based on the candidate sample set, baseline data for each business scenario is also statistically analyzed, such as the scenario sample size distribution, training frequency distribution, and overall capacity distribution.
[0027] Step 102: Convert the candidate sample set into cache objects, evaluate the benefit density of each cache object and classify them, obtaining object classification results including objects to be reconstructed and non-objects to be reconstructed. In other words, convert each original sample in the candidate sample set into an independent schedulable cache object, and record the corresponding source sample identifier, scene relationship, and training task relationship for each cache object based on the sample attribute set, so that the cache object retains the source mapping with the original training samples.
[0028] In the artificial intelligence framework, the training data loading pipeline contains a complex preprocessing chain. Directly using the original file as a cache unit may not meet the requirements of high-frequency access to local areas or the reuse of preprocessing operators.
[0029] During the conversion process, based on the sample attribute set, the source sample identifier, the scene relationship, and the training task relationship of each cached object are recorded, so that the cached object retains the source mapping relationship with the original training samples.
[0030] After objectification, a benefit density evaluation is performed on each cached object based on the sample attribute set. Benefit density quantifies the unit training utility that an object can bring by residing in a limited cache capacity. The benefit density value of each object is calculated based on the object's call frequency, loading and parsing time, capacity cost, and its extent in a preset power business scenario.
[0031] Based on yield density, all cached objects are sorted and hierarchically divided using preset grading thresholds. For example, objects with yield density higher than the first grading threshold are classified as first-level candidate objects; objects with yield density between the first and second grading thresholds are classified as second-level candidate objects; and objects with yield density lower than the second grading threshold are classified as third-level candidate objects. Furthermore, among the first-level candidate objects, objects with high yield density but exceeding a preset capacity threshold are identified and marked as objects to be refactored. All other objects at each level, excluding those to be refactored, are collectively referred to as non-refactorable objects, and the resulting object grading is compiled.
[0032] Step 103: Calculate the granularity of the reconstruction tendency for the object to be reconstructed, and perform granular reconstruction on the object to be reconstructed based on the granularity of the reconstruction tendency to generate a set of reconstructed objects.
[0033] Among them, if cache entities marked as objects to be reconstructed are directly stored in the form of the original whole graph, it will consume a lot of memory or high-speed solid-state storage resources, which can easily lead to cache thrashing.
[0034] Accordingly, the historical call trajectory, preprocessing operator execution records, and cross-task cross-references of the object are extracted to calculate the granularity refactoring tendency. The granularity refactoring tendency is used to characterize the degree to which the object is decoupled and refactored from its whole object form to a finer granular form and the expected net benefit.
[0035] Based on the calculated granularity reconstruction tendency, reconstruction actions are performed on the object to be reconstructed. For example, for a panoramic image of a drone inspection containing dozens of tiny insulator defects, if its granularity reconstruction tendency is high and the access exhibits spatial clustering, it can be segmented into several local image patches containing the defects and their context. For objects that repeatedly perform the same time-consuming augmentation operations in multiple rounds of training, such as color space conversion and nonlinear scaling, their processed standardized tensors are extracted as independent objects. Through granular reconstruction, a set of reconstructed objects containing various heterogeneous data forms is generated.
[0036] Step 104: Perform reuse boundary identification on the set of objects to be reconstructed and the objects not to be reconstructed to obtain reuse boundary identification results. Based on the reuse boundary identification results, perform dual-domain allocation of isolated cache domain and shared cache domain to generate cache deployment results.
[0037] In parallel training scenarios for multiple power services, different model tasks may share some underlying data. Therefore, it is necessary to perform cross-reference analysis on the set of objects to be reconstructed and the objects not to be reconstructed to determine the isolation and sharing attributes of each object, i.e., the reuse boundary identification results.
[0038] Specifically, the system identifies two types of objects: one type is objects loaded only in a single business scenario training pipeline, and the other type is objects that are explicitly or implicitly repeatedly invoked in multiple different business scenarios, such as in scenarios like conductor strand breakage detection and hardware corrosion detection. Based on the reuse boundary identification results, the physical or logical storage space of the caching system is divided into isolated cache domains and shared cache domains.
[0039] Objects belonging to a single scenario are written into an isolated cache domain dedicated to that scenario. This ensures the stability of data residence for high-priority tasks and prevents the isolated cache domain from being occupied by other low-priority data. For example, real-time security model training for core hub substations occupies an isolated cache domain. For objects with cross-scenario reuse value, after evaluating their sharing benefits and adaptability, they are written into a shared cache domain. This allows multiple parallel training tasks to jointly read the same data copy through memory mapping or pointer references, thereby reducing memory redundancy.
[0040] Step 105: Obtain real-time training execution feedback, update object benefit evaluation parameters and cache deployment parameters based on cache deployment results and training execution feedback, and generate an iterative caching strategy.
[0041] During the training of AI models, the actual hit rate and expected value of cached objects will dynamically drift due to the randomness of data samplers, hard example mining strategies, and changes in the model's learning saturation for different samples.
[0042] Real-time training execution feedback is acquired through probes in the built-in data loading pipeline. This feedback includes the actual number of object hits in each cache domain, the number of source loads caused by misses, the average waiting and blocking time caused by data loading, the actual concurrent reuse of objects in the shared domain, and eviction and replacement records triggered by capacity limitations. This runtime feedback data is then time-series aligned and correlated with the current cache deployment results to smoothly update the underlying decision parameters, including the expected call frequency of objects and shared adaptability evaluation metrics.
[0043] Based on the updated parameter set, an iterative caching strategy is generated for the next training execution window, such as setting the window after the next training epoch or a specified batch step.
[0044] As an optional implementation, it can also be: obtaining real-time training execution feedback, updating the object benefit evaluation parameters used for benefit density evaluation and the cache deployment parameters used for dual-domain allocation based on the cache deployment results and training execution feedback, generating an iterative caching strategy, and using the iterative caching strategy to guide the re-execution of benefit density evaluation, granular reconstruction and dual-domain allocation in the next training window.
[0045] like Figure 2 As shown in the embodiments of this application, a revenue density evaluation method based on training phase perception and scene correction is also proposed. Specifically, based on the diminishing marginal returns of the artificial intelligence model training and the multi-business scene correction coefficient, the residency value of each cached object is quantified, including:
[0046] Step 201: Obtain the effective call coefficients of the cached object, extract the corresponding estimated call count, average decoding time, average preprocessing time, and average loading time, and calculate the training gain value. That is, for any cached object, obtain the effective call coefficients, extract the corresponding estimated call count, average decoding time, average preprocessing time, and average loading time, and calculate the training gain value.
[0047] In this embodiment, the expected number of calls reflects the frequency with which the object will be requested by the data loader within a future preset training window. The average decoding time, average preprocessing time, and average loading time together constitute the time cost of a single call to the object. The corresponding time cost attributes are extracted by reading historical records from the sample attribute set. The training gain value is used to characterize the cumulative savings in input / output and total computation time when the cached object resides in high-speed storage. The formula for calculating the training gain value is:
[0048] G _i =N _i ×(t _decode,i +t _pre,i +t _io,i )×λ _i ;
[0049] Among them, G _i N represents the training gain value of the i-th cached object. _i t represents the estimated number of calls to the i-th cached object. _decode,i t represents the average decoding time of the i-th cached object. _pre,i t represents the average preprocessing time for the i-th cached object. _io,i λ represents the average loading time of the i-th cached object. _i This represents the effective call coefficient of the i-th cached object.
[0050] In some alternative implementations, if the cached object corresponds to multiple preprocessing chains, the average preprocessing time can be taken as the expected value of the time spent in each preprocessing branch.
[0051] Step 202: Obtain the number of consecutive residency rounds of the cached object during the most recent consecutive residency period, as recorded in real time; multiply the number of consecutive residency rounds by the deceleration rate coefficient, add 1, and take the reciprocal to obtain the training marginal decay factor; obtain the training task scheduling factor and the sampling probability factor; multiply the training marginal decay factor, the training task scheduling factor, and the sampling probability factor together to obtain the effective call coefficient, such as... Figure 3 As shown.
[0052] During model training, when the same cached object is repeatedly used in multiple consecutive training rounds, the model's learning of the object's features tends to saturate, and its contribution to incremental gradients decreases. The number of consecutive resident rounds is obtained by continuously monitoring the lifetime of cached objects in memory. The formula for calculating the training marginal diminishing returns factor is:
[0053] f _dim,i =1 / (1+η×n _cached,i );
[0054] Among them, f _dim,i Let n represent the training marginal decay factor of the i-th cached object, η represent the pre-configured decay rate coefficient, and n _cached,i This represents the number of consecutive residency rounds for the i-th cached object. The pre-configured deceleration rate coefficient can be set between 0 and 1.
[0055] In one optional implementation, the deceleration rate coefficient η can be determined by observing the trend of the model's gradient contribution to preset samples on the validation set, based on the sample repetition characteristics of the actual training task; the deceleration rate coefficient η can be 0.5.
[0056] Furthermore, the training task scheduling factor is used to distinguish the difference in rewards between active and inactive tasks within the current training window. When the training task to which the object belongs is not scheduled, the training task scheduling factor is 0, automatically reducing the reward value of inactive objects to 0 and avoiding unnecessary cache space usage. The sampling probability factor reflects the difference in the probability of the object being sampled during actual training under class-balanced sampling or hard sample weighted sampling strategies. The formula for calculating the effective call coefficient is:
[0057] λ _i =f _sch,i ×f _samp,i ×f _dim,i ;
[0058] Where, λ _i f represents the effective call coefficient of the i-th cached object. _sch,i f represents the training task scheduling factor for the i-th cached object. _samp,i f represents the sampling probability factor for the i-th cached object. _dim,i This represents the training marginal decrease factor for the i-th cached object.
[0059] Step 203: Extract the object capacity of the cached object as the capacity cost; calculate the ratio of the training benefit value to the capacity cost value to obtain the original benefit density.
[0060] For example, the storage volume of a substation panoramic view might be hundreds of times that of a partial hardware cutout image. Comparing absolute benefit values would result in large objects dominating the cache for extended periods. The total number of bytes occupied by cached objects in the storage medium is used as the capacity cost. The original benefit density is calculated using the following formula:
[0061] C _i =m _i ;
[0062] R _i =G _i / C _i ;
[0063] Among them, C _i m represents the capacity cost of the i-th cached object. _i R represents the actual physical capacity occupied by the i-th cached object. _i G represents the original benefit density of the i-th cached object. _i This represents the training gain value of the i-th cached object. In this embodiment, the training gain value is converted into a gain density per unit capacity.
[0064] Step 204: Based on the sample attribute set, extract the normalized values of business priority, category scarcity, and annotation complexity corresponding to the cached object; construct a correction coefficient using the normalized values of business priority, category scarcity, and annotation complexity, and multiply it by the original revenue density to obtain the scenario-corrected revenue density.
[0065] Specifically, the business priority normalization value is used to retain core scheduling task data; the category scarcity normalization value is used to increase the caching weight of long-tail defect samples; and the annotation complexity normalization value is used to protect samples with high manual costs, such as polygon segmentation or dense key points. The formula for calculating the scene correction benefit density is:
[0066] R _star_i =R _i ×(1+α×p _i +β×q _i +γ×c _i );
[0067] Among them, R _star_i R represents the scenario correction benefit density of the i-th cached object. _i p represents the original benefit density of the i-th cached object. _i q represents the normalized value of the business priority corresponding to the i-th cached object. _i c represents the normalized value of the category scarcity corresponding to the i-th cached object. _iThis represents the normalized value of the annotation complexity corresponding to the i-th cached object. α, β, and γ represent the pre-configured positive correction weight parameters corresponding to business priority, category scarcity, and annotation complexity, respectively. In this embodiment, α, β, and γ can be set to 0.3, 0.4, and 0.2, respectively. After completing the basic input-output cost conversion, this embodiment introduces constraint indicators from a pre-defined power business scenario for correction.
[0068] Step 205: Sort and classify according to the scene-corrected benefit density of each cached object, that is, sort and classify according to the scene-corrected benefit density to obtain the object classification result.
[0069] After obtaining the scene correction benefit density of all cached objects globally, a descending sorting operation is performed to construct a unified object hierarchy comparison benchmark. Specifically, a first-level threshold and a second-level threshold are pre-configured, where the first-level threshold is greater than the second-level threshold. Cache objects with a scene correction benefit density greater than or equal to the first-level threshold are assigned to the first-level candidate object pool; cache objects with a scene correction benefit density less than the first-level threshold but greater than or equal to the second-level threshold are assigned to the second-level candidate object pool; and the remaining cache objects are assigned to the third-level candidate object pool.
[0070] In some optional implementations, a capacity check is performed on high-value objects included in the first-level candidate object pool. A preset capacity threshold is obtained, and it is determined whether the object capacity of each cached object in the first-level candidate object pool exceeds the capacity threshold. Objects determined to exceed the capacity threshold are marked as objects to be reconstructed. Based on this, the entire set of data that has been sorted, hierarchically defined, and marked together constitutes the object classification result.
[0071] As an achievable approach, this embodiment proposes a granular reconstruction tendency evaluation method based on annotation distribution and execution cost. Specifically, it utilizes the inherent causal relationships within the annotation space of training samples to infer region concentration and introduces a capacity penalty mechanism for execution cost into the reconstruction decision process. This includes:
[0072] Step 301, as follows Figure 4 As shown, based on the annotation information of the object to be reconstructed and the training and running information, the degree of concentration of regional calls, the frequency of preprocessing reuse, and the potential for cross-scene sharing are extracted;
[0073] Obtain the object capacity of the object to be reconstructed, perform normalization processing, and obtain the capacity normalization value;
[0074] The granularity reconstruction tendency is obtained by multiplying the regional call concentration, preprocessing reuse frequency, cross-scenario sharing potential, and capacity normalization value by their respective weight coefficients and summing them, where the weight coefficient corresponding to the capacity normalization value is negative.
[0075] In this embodiment, the concentration of region calls characterizes the clustering state of the object in a spatial dimension, indicating frequent local access. The preprocessing reuse frequency is the ratio of the number of times the same preprocessing operator chain is executed for the object in the most recent N training batches to the total number of calls; that is, it characterizes the probability that the same object is repeatedly executed with the same operator chain in different training batches. The preprocessing reuse frequency can be determined by statistically analyzing the number of times the preprocessing operator chain executed by the data loader for the object is consistent with the historical baseline chain when the object is called within several training windows, and the ratio to the total number of calls; this ratio is determined using conventional frequency statistics methods based on the actual data loading pipeline's logging mechanism.
[0076] Cross-scenario sharing potential is the ratio of the number of different business scenarios referencing the object to the total number of active business scenarios, representing the likelihood that the object is associated with multiple concurrent business tasks. Cross-scenario sharing potential can be determined by calculating the ratio of the number of business scenarios to which the training tasks requesting the object belong to to the total number of current concurrent business scenarios within a preset statistical window; this ratio is determined using conventional proportional statistics methods based on the actual task assignment records of the training scheduler.
[0077] After obtaining the object capacity of the object to be reconstructed, the min-max normalization algorithm is used for processing. Specifically, the physical capacity of the current object is subtracted from the minimum capacity among all objects to be reconstructed in the current batch, and then divided by the difference between the maximum capacity and the minimum capacity to obtain a value mapped to the interval between 0 and 1, which is the capacity normalization value.
[0078] Accordingly, a linear weighted model is used to calculate the granularity reconstruction tendency, and the corresponding calculation formula is:
[0079] U _i =θ _1 ×d _i +θ _2 ×r _i +θ _3 ×s _i -θ _4 ×m * _i ;
[0080] Among them, U _i d represents the granularity of the refactoring tendency value of the i-th object to be refactored. _i r represents the degree of concentration of region calls for the i-th object to be reconstructed. _i s represents the preprocessing reuse frequency of the i-th object to be reconstructed. _i m represents the cross-scenario sharing potential of the i-th object to be reconstructed. * _i This represents the normalized capacity value of the i-th object to be reconstructed, as opposed to m. _i The actual physical capacity, θ_1 θ _2 θ _3 θ represents the pre-configured positive adjustment coefficients corresponding to the degree of regional call concentration, the frequency of preprocessing reuse, and the potential for cross-scenario sharing, respectively. _4 This represents the pre-configured penalty coefficient that characterizes the cost of refactoring.
[0081] As an example, assuming that after data extraction and normalization, the regional call concentration of a certain object to be reconstructed is 0.9, the preprocessing reuse frequency is 0.2, and the cross-scenario sharing potential is 0.1. The object's original capacity usage is high, and the corresponding normalized capacity value is calculated to be 0.95. A pre-configured positive adjustment coefficient θ is used. _1 θ is 1.0 _2 =0.5, θ _3 The pre-configured penalty coefficient θ is 0.5. _4 It is 0.6.
[0082] Using this parameter, the calculation is 1.0×0.9+0.5×0.2+0.5×0.1-0.6×0.95=0.48. In this calculation, the object's capacity attribute produces a negative execution cost penalty of 0.57, but due to the object's high spatial access clustering characteristics, its positive tendency value of 0.9 dominates, resulting in a calculated tendency value of 0.48.
[0083] In some alternative implementations, if it is determined that the current training environment is a closed, single-task fine-tuning phase with no cross-business interaction, the cross-scenario sharing potential can be set to 0, and the corresponding positive adjustment coefficient θ can be set accordingly. _3 Setting it to 0 is used to assess the tendency to concentrate computational resources on spatial and operator dimensions.
[0084] Step 302, as follows Figure 5 As shown, extract the center coordinates of all labeled regions contained in the object to be reconstructed; obtain the data augmentation clipping window size in the training task configuration, and generate corresponding clipping candidate windows with each center coordinate as the anchor point; take the union of all clipping candidate windows in the space of the object to be reconstructed, and calculate the effective access coverage area; calculate the ratio of the effective access coverage area to the total area of the object to be reconstructed, and take the difference between 1 and the ratio as the degree of region call concentration.
[0085] In this embodiment, the calculation process for the concentration of region calls is based on the spatial causal relationship of the artificial intelligence data loading mechanism. In deep learning vision tasks, data augmentation and pruning operations during the model training phase are typically performed around the target defect box or physical device region. Specifically, the labeled metadata of the object to be reconstructed is parsed, the geometric center positions of each labeled bounding box are extracted, and the corresponding two-dimensional spatial coordinates are obtained. The rectangular pruning size determined in the training task configuration is obtained, and a corresponding rectangular spatial domain, i.e., a pruning candidate window, is generated on the two-dimensional plane of the object to be reconstructed, with each spatial coordinate point as the geometric center.
[0086] Next, a union operation on the two-dimensional spatial area of all cropping candidate windows generated on the same object is performed. If the coordinates of multiple labeled regions are close to each other, their corresponding cropping candidate windows will overlap. After the union operation, the duplicate spatial area calculation can be eliminated, and the actual two-dimensional coverage area accessed by the data loader during the training process, i.e., the effective access coverage area, can be determined. The corresponding calculation formula is:
[0087] d _i =1-A _cover,i / (W _i ×H _i );
[0088] Where, d _i A represents the degree of concentration of region calls for the i-th object to be reconstructed. _cover,i W represents the calculated effective access coverage area. _i H represents the horizontal pixel width of the object to be reconstructed. _i W represents the vertical pixel height of the object to be reconstructed. _i With H _i The product of these is the total area of the object to be reconstructed.
[0089] In this embodiment, the access pattern is directly calculated using the inherent semantic structure of the data annotations, enabling the system to obtain definite spatial distribution parameters when faced with newly imported training samples. When the calculated ratio is close to 1, it indicates that the annotation distribution is scattered throughout the entire object domain. Subtracting this ratio from 1 results in a region call concentration close to 0, indicating that the object does not perform local block reconstruction. If the annotations are clustered, the ratio is close to 0, and the calculated concentration is close to 1.
[0090] In another alternative implementation, for unsupervised learning tasks lacking spatial bounding boxes or whole-image classification tasks, an evaluation strategy can be switched to obtain logs of the actual clipping coordinates of the object by the data loader throughout the historical training cycles. By performing polygon area integration calculations on the coverage trajectory formed by multiple rounds of clipping coordinates, instead of using the effective access coverage area generated based on labeled anchor points, a numerical measurement of the concentration of region accesses can be achieved.
[0091] As an optional implementation, this embodiment proposes a multi-mode heterogeneous object adaptive reconstruction method. After determining the granularity reconstruction tendency, it uses priority anti-conflict logic to allocate reconstruction modes, and performs local block clustering, preprocessing result extraction, and shared index generation actions, specifically including:
[0092] Step 401: Perform granular refactoring on the object to be refactored, including assigning a refactoring mode to the object, specifically:
[0093] If the granularity-level refactoring tendency exceeds the refactoring threshold, the corresponding modes are determined and assigned according to priority: if the cross-scenario sharing potential meets the shared index mode condition, the shared index mode is assigned; if the preprocessing reuse frequency meets the preprocessing result mode condition, the preprocessing result mode is assigned; if the regional call concentration meets the local block mode condition, the local block mode is assigned. Alternatively, it can be determined whether the granularity-level refactoring tendency exceeds the pre-configured refactoring threshold; if it does, the refactoring modes are determined and assigned according to the following priority rules: whether the cross-scenario sharing potential of the object to be refactored meets the shared index mode condition; if so, the shared index mode is assigned; whether the preprocessing reuse frequency of the object to be refactored meets the preprocessing result mode condition; if so, the preprocessing result mode is assigned; and whether the regional call concentration of the object to be refactored meets the local block mode condition; if so, the local block mode is assigned.
[0094] If the value is not higher than the reconstruction threshold, or if the conditions for shared index mode, preprocessing result mode, and local block mode are not met, then the whole object mode is allocated.
[0095] Accordingly, this embodiment obtains the granular reconstruction tendency and compares it with a pre-configured reconstruction threshold, namely, three types of thresholds: shared index mode condition, preprocessing result mode condition, and local block mode condition. When the granular reconstruction tendency is greater than the reconstruction threshold, it is determined that the corresponding object needs to be transformed from a whole object form to a fine-grained form. Among them, a single-source object may simultaneously exhibit characteristics such as local concentration, operator reuse, and cross-scene calls. To prevent mode allocation conflicts in the reconstruction state machine, priority determination logic is executed. Specifically, since the shared index mode only retains reference mapping in the caching system, its actual physical capacity overhead is the smallest, and its cross-scene reuse gain is the highest, so it is given the highest determination priority. The preprocessing result mode eliminates repeated processor operation overhead by solidifying the computation graph output, so its priority is the second highest. The local block mode retains high-frequency pixel features through physical pruning, has capacity occupation, and has the lowest priority.
[0096] Specifically, to determine whether the conditions for a shared index mode are met, the extracted cross-scenario sharing potential is assessed to see if it exceeds a preset sharing potential threshold. The direct training loading percentage refers to the proportion of times the object is accessed via direct reads within the statistical window, where direct reads mean accessing the original data directly without referencing a shared index. A low percentage indicates that the object has been accessed extensively through shared reference paths, with low dependence on direct loading paths, and can be converted to a pure shared index form.
[0097] Next, the direct training loading percentage is obtained, and it is determined whether it is lower than the preset loading percentage threshold. Then, the preprocessing result mode condition is checked, i.e., whether the preprocessing reuse frequency is higher than the preset reuse threshold. Finally, the local block mode condition is checked, i.e., whether the concentration of region calls is higher than the preset concentration threshold. Conditions are validated sequentially according to the set priority. When a condition is validated and passes, subsequent validations are interrupted, and the corresponding mode is assigned. For objects that fail all conditions, or whose initial granularity reconstruction tendency is less than or equal to the pre-configured reconstruction threshold, the whole object mode is assigned and used as a reserved path in the reconstruction process.
[0098] In some optional implementations, multi-mode derivation is allowed for the same source object when different spatial regions or different processing operator branches of the original cache object are subject to independent reconstruction logic. That is, the source object identifier and derivation mode type are recorded in the metadata of the reconstructed object to prevent duplicate capacity billing for different derivation structures from the same physical source during dual-domain deployment scheduling and capacity statistics.
[0099] Step 402: For objects to be reconstructed that are assigned to the local block mode, they are divided into multiple local block objects according to the high-frequency access areas; for objects to be reconstructed that are assigned to the preprocessing result mode, standardized preprocessing result extraction is performed to generate preprocessing result objects; for objects to be reconstructed that are assigned to the shared index mode, reference relationships that can be reused across scenarios are extracted to generate shared index objects; for objects to be reconstructed that are assigned to the whole object mode, they are kept as whole objects; the generated local block objects, preprocessing result objects, shared index objects, and whole objects are summarized to generate a reconstructed object set, and a source mapping identifier is recorded for each reconstructed object.
[0100] In this embodiment, the generation logic for heterogeneous cache entities is executed based on the object pattern determined by the allocation action. For objects allocated as preprocessing result patterns, their output tensors, after scaling, normalization, and color space conversion, are obtained and converted into preprocessing result objects in a unified format. For objects allocated as shared index patterns, reference relationships containing memory address pointers, target offsets, or file paths are constructed to generate shared index objects. For objects allocated as integer object patterns, their data structure is not changed, and their complete matrix form is maintained.
[0101] Based on this, all generated objects are uniformly merged into a memory buffer pool to obtain a set of reconstructed objects. Further, a source mapping identifier is injected into each reconstructed object in the set. This source mapping identifier includes the object's unique source sample code, the source object version number, the corresponding preprocessing chain configuration information, and the business scenario code to which it belongs.
[0102] Step 403: Extract the center coordinates of all labeled regions on the object to be reconstructed; perform hierarchical clustering on the center coordinates to obtain the bounding rectangle regions corresponding to each cluster; use the bounding rectangle regions as the dividing boundaries to divide the object to be reconstructed into corresponding local block objects.
[0103] In this embodiment, for objects assigned to a local block pattern, a clustering algorithm based on labeled semantic distribution is used to obtain the segmentation boundaries of frequently accessed regions. Specifically, the labeled file of the object to be reconstructed is parsed to obtain the geometric attributes of each target bounding box, the two-dimensional center coordinates of all target bounding boxes are calculated and extracted, and an agglomerative hierarchical clustering algorithm is used to perform unsupervised classification of the set of center coordinates.
[0104] The agglomerative hierarchical clustering algorithm employs the full linkage criterion, using the diagonal length of the pre-defined training task data augmentation clipping window as a distance threshold. Merging stops when the Euclidean distance between the farthest coordinates of two clusters to be merged exceeds this threshold, and the current clusters are output. This embodiment adaptively adjusts the distance threshold based on the actual labeled distribution density and the degree of overlap between the segmentation boundary and frequently accessed regions observed on the validation set. By calculating the Euclidean distance between coordinate points, spatially adjacent center coordinates are merged into independent clusters.
[0105] After obtaining each cluster, the center coordinates and original target bounding boxes within each cluster are traversed. The minimum boundary coordinates that can enclose all target bounding boxes within the cluster are calculated to generate the bounding rectangle region corresponding to each cluster. The parameters of the generated bounding rectangle region are then imported into the data cropping module. Using the four boundaries of the bounding rectangle region as the cutting boundaries, a physical cutting operation is performed on the pixel matrix of the original object to be reconstructed, extracting the corresponding image data blocks to generate local block objects.
[0106] This embodiment also provides an alternative implementation: if the current task type is an unlabeled classification task, the actual sampling window center coordinates during pruning in previous training rounds can be extracted from historical training records. A hierarchical clustering algorithm is applied to the sampling window center coordinates to generate the bounding rectangle region of the high-frequency pruning area and perform cutting. This can obtain local block objects with high hit rate characteristics in unlabeled scenarios.
[0107] In some embodiments, a dual-domain allocation method integrating preprocessed chain hash fingerprints is proposed, which is based on the cross-scenario reuse boundary of the object identified by physical calls and operator-level fingerprint matching, and performs scheduling of isolated cache domains and shared cache domains and replacement mechanism under capacity constraints according to the shared adaptation value.
[0108] Step 501 involves identifying reuse boundaries for non-reconstructable objects in the reconstructed object set and object classification results. This includes: extracting call coverage and reference relationships for each reconstructed object and each non-reconstructable object in training tasks across different power business scenarios based on training runtime information; marking objects that are only called during training in a single business scenario as scenario-specific objects based on call coverage and reference relationships; and marking objects that have repeated calls or references during training in multiple business scenarios as cross-scenario reuse objects, thereby obtaining reuse boundary identification results that include scenario-specific objects and cross-scenario reuse objects.
[0109] In this embodiment, the call coverage relationship represents the direct read range of the object in the training data loading pipeline of each business scenario. The reference relationship represents the cross-task memory address pointers or file mapping links generated by the reconstruction of the shared index pattern. The cache entities of all scheduling stages are traversed, and the set of business scenario identifiers associated with them within a preset statistical window is counted.
[0110] The physical affiliation boundary of an object is determined through set comparison. Specifically, when the set of associated business scenario identifiers for an object contains only a unique identifier, the object is deemed to lack cross-business reuse conditions and is marked as a scenario-specific object. When the set of associated business scenario identifiers for an object contains at least two different identifiers, it indicates that the object is jointly requested in concurrent multi-scenario cross-training, and it is marked as a cross-scenario reuse object. Based on the identifier allocation action, the reuse boundary identification result is output.
[0111] In some alternative implementations, objects with unique data source constraints, such as private data in a secure encrypted zone, can skip overlay detection and be directly marked as scene-specific objects.
[0112] Step 502, the method of identifying cross-scenario reuse objects also includes: extracting the preprocessing operation sequence, operation parameters and output dimensions corresponding to the preprocessing result objects in the reconstructed object set; concatenating the preprocessing operation sequence, operation parameters and output dimensions and performing hash calculation to generate a preprocessing chain fingerprint; matching each preprocessing result object that does not belong to the same source object but has the same preprocessing chain fingerprint and marking it as a cross-scenario reuse object.
[0113] Beyond explicit sharing based on object physical identifier overlap, implicit processing chain-level sharing potential also exists in multi-service AI training scenarios. For example, image A from a power transmission line inspection scenario and image B from a substation inspection scenario may have different sources, but their corresponding preprocessing tasks may employ the same scaling, channel normalization, and color dithering sequences. Based on the extracted preprocessing result object, the preprocessing operation sequence, operation parameters, and output dimensions are obtained.
[0114] By concatenating strings, the three types of parameters are combined in a fixed order. A deterministic hash function is then called to perform calculations on the concatenated string, resulting in a fixed-length hexadecimal string, which is the preprocessed chain fingerprint. The corresponding expression is:
[0115] FP _i =Hash(op 1,i ||param 1,i ||...||dimout i );
[0116] Among them, FP _i Op represents the preprocessing chain fingerprint of the i-th preprocessed result object. 1,i Indicates the type of the first operator in the preprocessing operation sequence corresponding to the i-th preprocessed result object, param 1,i This represents the first operation parameter, dimout. i The symbol indicates the final output dimension, the double vertical bar symbol indicates a string concatenation operation, and Hash indicates a hash calculation function.
[0117] Accordingly, the hash value is retrieved in the global cache directory. If multiple preprocessed result objects from different business scenarios and sources are found to have the same preprocessing chain fingerprint, these objects are grouped into matching pairs and uniformly marked as cross-scenario reusable objects.
[0118] Step 503: Write the scenario-specific object into the isolated cache domain of the corresponding business scenario; for cross-scenario reused objects, extract the cross-scenario call ratio normalization value, the shared benefit density normalization value, and the shared reference stability normalization value; multiply the cross-scenario call ratio normalization value, the shared benefit density normalization value, and the shared reference stability normalization value by the corresponding shared adaptation adjustment coefficient and sum them to calculate the shared adaptation value; determine whether the shared adaptation value is higher than the pre-configured shared threshold; if it is higher than the shared threshold, write the corresponding cross-scenario reused object into the shared cache domain; if it is not higher than the shared threshold, write the corresponding cross-scenario reused object back into the isolated cache domain of its corresponding call scenario.
[0119] Obtain the physical partition configuration of the global cache medium, and deploy the cache entities marked as scene-specific objects to the isolated cache domain exclusively allocated to the business scene to which the object belongs through direct memory writing or storage block mapping, so as to avoid mutual crowding of different priority scenes in the cache pool.
[0120] For cached entities marked as cross-scenario reuse objects, a quantitative adaptation evaluation is introduced. The extracted cross-scenario call ratio, shared benefit density, and shared reference stability are subjected to min-max normalization, mapping each indicator to the 0-1 range. A linear weighted calculation model is used to derive the shared adaptation value, the formula of which is:
[0121] V _i =mu _1 ×x _i +mu _2 ×y _i +mu _3 ×z _i ;
[0122] Among them, V _i Let x represent the shared adaptation value of the i-th cross-scene reuse object. _i y represents the normalized value of the cross-scene call ratio of the i-th cross-scene reused object. _i z represents the normalized value of the shared benefit density of the i-th cross-scenario reused object. _i mu represents the normalized value of the shared reference stability of the i-th cross-scenario reused object. _1 、mu _2 、mu _3 These represent the corresponding shared adaptation adjustment coefficients.
[0123] The shared adaptation value is compared with a pre-configured shared threshold. Shared adaptation values higher than the threshold indicate higher cross-scenario public utilization value, allowing them to be physically loaded into the shared cache domain, and access handles distributed to training processes requesting the object. Shared adaptation values not higher than the threshold have their shared domain deployment process interrupted, a rollback operation performed, and are stored in the isolated cache domain corresponding to the scenario with the highest call frequency.
[0124] Furthermore, during write scheduling, a dynamic resource coordination mechanism oriented towards the physical capacity limit needs to be configured. The remaining capacity parameters of the shared cache domain and each isolated cache domain are obtained. When the shared cache domain capacity is insufficient to write new objects, all objects within the shared cache domain are traversed, and objects with low shared benefit density and reference stability below a preset retention line are calculated and extracted, and eviction is performed. When the isolated cache domain capacity for a certain business scenario is insufficient, a regular replacement algorithm is triggered within that scenario to remove low-benefit objects. Furthermore, if the current business scenario is marked as a high-security business level, and under this scenario, the continuous generation of high-benefit scenario-specific objects causes the isolated domain to overload, the idle quota status of the shared cache domain is verified. If the shared domain idle quota is higher than a preset ratio, the dedicated objects of this high-security scenario are allowed to be temporarily written to the shared cache domain, and data migration is performed after the isolated domain capacity is released.
[0125] In some embodiments, a closed-loop update and evolution method for cache scheduling parameters oriented to the entire lifecycle is also proposed, namely, using an exponentially weighted moving average algorithm to perform time-series smooth updates on the underlying evaluation metrics of the cache system, and setting a reset threshold triggering mechanism based on global parameter offset.
[0126] Step 601 involves updating the object benefit evaluation parameters and cache deployment parameters based on the cache deployment results and training execution feedback. This includes updating the expected number of calls in the object benefit evaluation parameters, specifically:
[0127] Obtain the pre-configured smoothing coefficient; use the exponentially weighted moving average method to calculate the weighted fusion of the actual number of calls and the expected number of calls for the current training window, and update the expected number of calls for the next training window.
[0128] In this embodiment, the training execution feedback is the underlying recorded data of the system during the forward and backward propagation cycles of model execution. In concurrent training of AI in multi-service scenarios, random sampling mechanisms and data augmentation operations cause the actual call frequency of preset cached objects to exhibit discrete and fluctuating characteristics within a single training window. If the latest actual call records are used to replace historical predicted parameters, it may cause the caching system to frequently trigger invalid loading and eviction operations.
[0129] Accordingly, the actual number of calls recorded in the training execution feedback is extracted. A pre-configured smoothing coefficient is obtained, the value of which is a real number between 0.5 and 0.9. In other words, the value of the smoothing coefficient φ can be adjusted according to the random fluctuation amplitude of the training sampler, for example, by observing the historical fluctuation variance of the expected number of calls; in an optional implementation, the smoothing coefficient φ can be 0.8.
[0130] The estimated number of calls is updated using an exponentially weighted moving average method, and the corresponding calculation formula is as follows:
[0131] N _i,t+1 =φ×N _i,t +(1-φ)×N _actual,i,t ;
[0132] Where, N _i,t+1 N represents the estimated number of calls for the next training window obtained from the update, φ represents the obtained pre-configured smoothing coefficient, and N _i,t N represents the expected number of times the i-th cached object will be invoked in the current training window. _actual,i,t This represents the actual number of times the extracted i-th cached object is invoked in the current training window.
[0133] In this embodiment, a smoothing coefficient is used as a factor for preserving historical inertia. When the smoothing coefficient is large, the updated expected number of calls can retain more historical statistical weights, filtering out occasional access fluctuations in a single training window; when the smoothing coefficient is small, the updated index can quickly respond to changes in the current actual sampling frequency.
[0134] Step 602, based on training execution feedback, after updating the expected number of calls in the cache deployment results using an exponentially weighted moving average method, also includes: synchronously updating the granular reconstruction tendency of the object to be reconstructed and the shared adaptation value of the reusable object across scenarios using an exponentially weighted moving average method; cumulatively calculating the parameter offset of the updated parameters; when the parameter offset exceeds a preset reset threshold, triggering a complete execution process of reclassification, granular reconstruction, and dual-domain allocation for all current objects. When the parameter offset does not exceed the reset threshold, incremental cache object replacement is performed according to the updated parameters.
[0135] In addition to the single call intensity parameter, this embodiment also employs an exponentially weighted moving average method to perform fusion updates on the remaining core evaluation indicators that determine the cache form. Specifically, the actual local access concentration and preprocessing reuse records of each object to be reconstructed within the current training window are extracted, and the granularity reconstruction tendency is recalculated and updated using the same weighted fusion formula. Correspondingly, the actual cross-business cross-reference frequency of each cross-scenario reused object is extracted, and the corresponding shared adaptation value is updated.
[0136] Building upon this, to prevent global state passivation caused by prolonged local fine-tuning of parameters, a macroscopic reset triggering mechanism is introduced. For all globally cached objects, the absolute difference between their updated parameters and the initial parameters is calculated. All absolute differences are summed to obtain the parameter offset. A preset reset threshold is obtained, and a numerical value determination is performed. When the parameter offset exceeds the reset threshold, it indicates that the training task of the current power multi-service model has undergone a phase change, such as transitioning from the basic feature learning phase to the hard example mining phase, or a change in the concurrent task pool of the business system.
[0137] When the triggering condition is met, reclassification, granular restructuring, and dual-domain allocation are performed on all current objects. Specifically, the current cache isolation domain and shared domain deployment structure is cleared, and the scenario correction benefit density is recalculated using the parameters after the full update. Then, layering, pattern allocation, splitting restructuring, and dual-domain write operations are performed.
[0138] In one alternative implementation, when the parameter offset is less than or equal to the reset threshold, a local incremental cache object replacement operation is performed based on the updated parameters.
[0139] This application also provides a computer-readable storage medium storing computer instructions for implementing the methods executed in the above-described method embodiments. For example, when the computer program is executed by a computer, the computer can implement the methods executed in the above-described method embodiments.
[0140] This application also provides a computer program product comprising instructions which, when executed by a computer, implement the methods performed in the above-described method embodiments.
[0141] The explanations and beneficial effects of the relevant contents in any of the devices provided above can be found in the corresponding method embodiments provided above, and will not be repeated here.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0143] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. For example, the computer can be a personal computer, a server, or a network device, etc. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs). For example, the aforementioned available media include, but are not limited to, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and other media capable of storing program code.
[0144] Unlike the above embodiments, this invention proposes another implementation method for hierarchical caching of AI training samples for multi-service scenarios in the power industry, specifically including:
[0145] The original sample files, annotation files, training task configuration files, and historical training logs from multiple power business scenarios are aggregated and normalized according to unified parsing rules to obtain the original sample summary set.
[0146] The samples in the original sample aggregation set are classified according to business scenarios. The scenario type, training task affiliation and version status of each sample are identified. Invalid samples, duplicate samples and incomplete samples are removed to form a candidate sample set that can participate in caching decisions.
[0147] Extract the business scenario attribution information, sample size information, sample resolution information, sample format information, number of annotations information, annotation level information, historical call count, most recent call time, priority of the training task to which it belongs, and the scarcity of samples in the category to which it belongs from each candidate sample to form a sample attribute set.
[0148] Based on the candidate sample set and sample attribute set, the sample size distribution, training frequency distribution, capacity distribution and hot / cold differences of each business scenario are statistically analyzed to obtain the scenario statistical set.
[0149] Instead of treating the original samples as the sole cache unit, this method combines sample invocation, preprocessing, and training usage to transform candidate samples into cache objects that can be independently cached, evicted, and scheduled. Each cache object retains its mapping relationship with the original sample, its scene relationship, and its training task relationship. This step takes a candidate sample set and a sample attribute set as input and outputs a set of cache objects.
[0150] Extract the object capacity, average decoding time, average preprocessing time, average loading time, historical call intensity, expected call intensity, task priority, category scarcity, and annotation complexity of each cached object to construct a set of object benefit attributes.
[0151] Based on the expected call intensity of the object, the average decoding time of the object, the average preprocessing time of the object, and the average loading time of the object, the training benefit value of each object within the preset training window is calculated; the object capacity is used as the capacity cost to form the unit capacity benefit density; the business priority, category scarcity and annotation complexity are introduced to make scenario corrections, and the object benefit density set for multiple power business scenarios is obtained.
[0152] Based on the scenario, the benefit density is adjusted, and cached objects are divided into high-benefit objects, medium-benefit objects, and low-benefit objects. High-benefit but high-capacity objects are identified and marked as objects to be reconstructed. That is, an object classification result containing first-level candidate objects, second-level candidate objects, third-level candidate objects, and objects to be reconstructed is constructed.
[0153] Extract all objects to be reconstructed from the object classification results, read the original call trajectory, local area call distribution, preprocessing reuse records and cross-scenario reference relationships corresponding to the object, and construct a reconstruction analysis set.
[0154] For each object to be refactored, a tendency value for fine-grained refactoring is calculated based on the degree of regional call concentration, preprocessing reuse frequency, cross-scenario sharing potential, and object capacity. When the tendency value is higher than a set threshold, the object is determined to undergo fine-grained refactoring.
[0155] For objects with a high degree of concentration of regional calls, generate a local block pattern; for objects with repeated calls to preprocessed results, generate a preprocessed result pattern; for objects with cross-scenario index reuse and few direct loadings, generate a shared index pattern; for objects with a high proportion of complete calls and insufficient refactoring benefits, retain the whole object pattern.
[0156] The objects corresponding to the local block mode are decomposed into multiple local block objects, the objects corresponding to the preprocessing result mode are converted into standardized preprocessing result objects, the objects corresponding to the shared index mode are converted into shared index objects, and the objects corresponding to the whole object mode are retained as whole objects; for each reconstructed object, its source object identifier, source sample identifier, scene identifier, and object attributes required for subsequent scheduling are recorded.
[0157] Perform object reuse analysis on the reconstructed object set, extract the call coverage relationship and reference relationship of each reconstructed object in different business scenario training tasks, and form a reuse analysis set.
[0158] Reconstructed objects that are called only during training in a single business scenario are marked as scenario-specific objects. Reconstructed objects that are repeatedly called or referenced in training in multiple business scenarios are marked as cross-scenario reusable objects. Cross-scenario reusable objects are evaluated for shared compatibility based on shared benefit density and reference stability.
[0159] By writing scenario-specific objects into the isolated cache domain of the corresponding business scenario, writing cross-scenario reused objects with shared adaptation values higher than the threshold into the shared cache domain, and writing objects with insufficient shared adaptation values back to the isolated cache domain of the corresponding scenario, a domain allocation result oriented towards the reuse boundaries of different objects can be formed.
[0160] When the shared cache domain capacity is insufficient, shared objects with low sharing benefits and low reference stability are abandoned; when the isolated cache domain capacity is insufficient, object replacement is performed within the corresponding scenario; when a high-guarantee business scenario continues to see a growth in high-return objects, under certain conditions, they are allowed to temporarily borrow the free quota of the shared cache domain.
[0161] During training execution, data such as object hit rate, object return rate, average wait time, object eviction count, and sharing / reuse status are collected to construct a runtime feedback set.
[0162] By correlating the runtime feedback set with the cache deployment results, we can correct the expected call intensity, training benefit value, shared adaptation value, and refactoring tendency value of objects, thus obtaining a parameter correction set. In other words, based on the cache deployment results and training execution feedback, we update the object benefit evaluation and cache deployment parameters to generate an iterative caching strategy.
[0163] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.
Claims
1. A hierarchical caching method for AI training samples in multi-service scenarios of the power industry, characterized in that, include: Obtain raw training samples and training operation information under multiple power service scenarios, and construct candidate sample sets and sample attribute sets; The candidate sample set is converted into cache objects, the benefit density of each cache object is evaluated and classified, and the object classification results including objects to be reconstructed and non-objects to be reconstructed are obtained. The granularity of the refactoring tendency of the object to be refactored is calculated, and granular refactoring is performed on the object to be refactored accordingly to generate a set of refactored objects; Reuse boundary identification is performed on the set of objects to be reconstructed and the objects not to be reconstructed to obtain reuse boundary identification results. Based on the reuse boundary identification results, dual-domain allocation of isolated cache domain and shared cache domain is performed to generate cache deployment results. Obtain real-time training execution feedback, update object benefit evaluation parameters and cache deployment parameters based on cache deployment results and training execution feedback, and generate an iterative caching strategy.
2. The method according to claim 1, characterized in that, Evaluate and rank the benefit density of each cached object, including: Obtain the effective call coefficient of the cached object, extract the corresponding expected number of calls, average decoding time, average preprocessing time and average loading time, and calculate the training benefit value; Extract the capacity of the cached object as the capacity cost; Calculate the ratio of training gain to capacity cost to obtain the original gain density; Based on the sample attribute set, extract the normalized values of business priority, category scarcity, and annotation complexity of the cached object; Based on this, a correction coefficient is constructed, which is then multiplied by the original revenue density to obtain the scenario-corrected revenue density; The objects are sorted and graded according to the benefit density adjusted for different scenarios to obtain the object grading results.
3. The method according to claim 2, characterized in that, The process of obtaining the effective call coefficients includes: Get the number of consecutive resident rounds of a cached object recorded in real time during the most recent consecutive resident cache period; Multiply the number of consecutive dwell times by the deceleration rate coefficient, add 1 and take the reciprocal to obtain the training marginal decrease factor; Obtain the pre-training task scheduling factor and sampling probability factor; The effective call coefficient is obtained by multiplying the training marginal decrease factor, the training task scheduling factor, and the sampling probability factor.
4. The method according to claim 1, characterized in that, The tendency to refactor at the computational granularity of the object being refactored includes: Based on the annotation information of the object to be reconstructed and the training and operation information, we extract the degree of concentration of regional calls, the frequency of preprocessing reuse, and the potential for cross-scenario sharing. Obtain the object capacity of the object to be reconstructed, perform normalization processing, and obtain the capacity normalization value; The granularity reconstruction tendency is obtained by multiplying the regional call concentration, preprocessing reuse frequency, cross-scenario sharing potential, and capacity normalization value by their respective weight coefficients and summing them, where the weight coefficient corresponding to the capacity normalization value is negative.
5. The method according to claim 4, characterized in that, The process of extracting the concentration level of region calls includes: Extract the center coordinates of all labeled regions contained in the object to be reconstructed; Obtain the data augmentation cropping window size from the training task configuration, and generate corresponding cropping candidate windows using each center coordinate as anchor point; Take the union of all candidate clipping windows in the space of the object to be reconstructed, and calculate the effective access coverage area. Calculate the ratio of the effective access coverage area to the total area of the object to be reconstructed, and subtract the difference from 1 as the degree of region call concentration.
6. The method according to claim 4, characterized in that, Performing granular refactoring on the object to be refactored includes assigning a refactoring mode to the object, specifically: If the tendency for granular reconstruction is higher than the reconstruction threshold, judge and assign the corresponding mode according to priority: if the cross-scenario sharing potential meets the conditions of the shared index mode, assign the shared index mode. If the preprocessing reuse frequency meets the preprocessing result mode conditions, allocate the preprocessing result mode; if the regional call concentration meets the local block mode conditions, allocate the local block mode. If the granularity reconstruction tendency is not higher than the reconstruction threshold, or does not meet any of the three threshold conditions, then the whole object pattern is assigned.
7. The method according to claim 1, characterized in that, Reuse boundary identification is performed on non-reconstructable objects in the reconstructed object set and object hierarchy results, including: Based on training operation information, the call coverage relationship and reference relationship of each reconstructed object and each non-reconstructed object in the training tasks of different power business scenarios are extracted; Based on call coverage and reference relationships, objects that are called only during training in a single business scenario are marked as scenario-specific objects; Objects that are repeatedly called or referenced during training in multiple business scenarios are marked as cross-scenario reuse objects, resulting in reuse boundary identification results that include scenario-specific objects and cross-scenario reuse objects.
8. The method according to claim 7, characterized in that, Other ways to identify reusable objects across different scenarios include: Extract the preprocessing operation sequence, operation parameters, and output dimensions corresponding to the preprocessed result objects in the reconstructed object set; The preprocessing operation sequence, operation parameters, and output dimension are concatenated and hash calculations are performed to generate a preprocessed chain fingerprint. Match preprocessed result objects that do not belong to the same source object but have the same preprocessing chain fingerprint, and mark them as cross-scenario reuse objects.
9. The method according to claim 1, characterized in that, The process of updating object benefit evaluation parameters and cache deployment parameters based on cache deployment results and training execution feedback, including updating the expected number of calls in the object benefit evaluation parameters, specifically includes: Extract the actual number of calls contained in the training execution feedback; Obtain the pre-configured smoothing coefficient; An exponentially weighted moving average method is used, which employs a smoothing coefficient to weight and merge the actual number of calls with the expected number of calls for the current training window, and then updates the expected number of calls for the next training window.
10. The method according to claim 1, characterized in that, Constructing the candidate sample set and sample attribute set, and converting the candidate sample set into a cache object, specifically includes: Extract business scenario attribution information, historical call records, and sample size information from the original training samples to form a sample attribute set; Each original sample in the candidate sample set is converted into an independent schedulable cache object. Based on the sample attribute set, the corresponding source sample identifier, the scene relationship, and the training task relationship are recorded for each cache object, so that the cache object retains the source mapping with the original training sample.