Peak shifting execution method and device for edge AI task, equipment and medium

By acquiring a global task list and converting it into a standard frequency and task-occupied blocks, sorting and calculating penalty values, generating a dictionary of scheduled task results, and grouping them by edge server, the problem of cloud load surges was solved, enabling off-peak execution of edge AI tasks and improving system stability and business real-time performance.

CN121349700APending Publication Date: 2026-01-16SHENZHEN BEIDOU APPLIED TECH RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511664256.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

In existing technologies, the task scheduling mechanism of edge computing devices causes cloud servers to receive high-concurrency requests at fixed time points, resulting in load surges and response delays, affecting business real-time performance and system stability. Furthermore, it lacks global coordination capabilities and makes it difficult to dynamically coordinate task execution times.

Method used

By obtaining the global task list, converting it into standard frequency and task-occupied blocks, sorting and calculating penalty values, generating a dictionary of scheduled task results, and grouping them by edge servers, staggered execution can be achieved to avoid cloud overload.

Benefits of technology

Effectively distribute cloud load, improve the continuity of task execution and the real-time performance of business, optimize system load distribution, and enhance system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349700A_ABST
    Figure CN121349700A_ABST
Patent Text Reader

Abstract

The invention relates to an off-peak execution method and device for edge AI tasks, equipment and a medium. The method comprises the steps that a global task list of all the edge AI tasks is obtained; respectively converting the frequency and the cost of each edge AI task into a standard frequency and a task occupation block, and generating a standardized task list; sorting the standardized task list according to the standard frequency of the edge AI tasks and the task occupation blocks to obtain a sorted task list; penalty values of all candidate time slots of each edge AI task are calculated in sequence according to the task sequence, task allocation is performed on the edge AI tasks based on the penalty values, and a timed task result dictionary is generated; and grouping all task allocation results according to the edge servers to obtain a target exclusive scheduling plan, and issuing the target exclusive scheduling plan to the corresponding edge servers. The task execution continuity and the service real-time performance are improved, and the system stability and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device and medium for off-peak execution of edge AI tasks. Background Technology

[0002] In the edge-cloud collaborative artificial intelligence architecture widely used in industrial inspection and security monitoring, edge computing devices deploy lightweight models to perform real-time initial identification tasks, while the cloud provides high-precision large-scale model secondary verification services.

[0003] Current technical solutions generally rely on timed tasks with fixed cycles to trigger edge operations, such as setting an initial identification process every ten minutes. When an edge device detects a suspected anomaly, it must simultaneously call a cloud API for verification and wait for the response before proceeding with subsequent alarm actions. This scheduling mechanism has several technical bottlenecks: First, if a large number of edge devices use the same trigger time configuration, tasks will be launched at the top of the hour or at fixed minutes. In the event of a widespread anomaly, this will trigger a massive number of devices simultaneously making high-concurrency requests to the cloud, causing a sudden surge in server load and resulting in a severe instantaneous load spike. Second, cloud services experience response delays due to their inability to handle sudden traffic spikes, leading to frequent timeouts for edge synchronization requests and forced interruptions of inspection tasks, directly impacting the real-time requirements of the business. Furthermore, the existing scheduling mode based on simple Cron expressions lacks global coordination capabilities, making it difficult to dynamically coordinate the task execution times of large-scale edge devices. It cannot flexibly adapt to changes in business requirements, nor can it optimize load distribution at the system level. The aforementioned defects cause cloud resources to be continuously subjected to periodic overload, posing challenges to system stability and reliability. There is an urgent need to establish a global scheduling mechanism to resolve the time conflict problem in the execution of edge tasks. Summary of the Invention

[0004] The purpose of this application is to propose a method, apparatus, device, and medium for off-peak execution of edge AI tasks, so as to improve the continuity of task execution and the real-time performance of business, and enhance system stability and reliability.

[0005] To address the aforementioned technical problems, embodiments of this application provide a method for off-peak execution of edge AI tasks, including: Get a global task list of all edge AI tasks; The frequency and cost of each edge AI task in the global task list are converted into standard frequency and task occupancy blocks, respectively, to generate a standardized task list; The standardized task list is sorted according to the standard frequency and the task-occupied block of the edge AI task to obtain a sorted task list. According to the task order in the sorted task list, the penalty value of all candidate time slots for each edge AI task is calculated sequentially, and the edge AI task is assigned based on the penalty value to generate a timed task result dictionary; All task allocation results in the scheduled task result dictionary are grouped by edge server to obtain a target-specific scheduling plan, and the target-specific scheduling plan is then sent to the corresponding edge server.

[0006] To address the aforementioned technical problems, embodiments of this application provide a device for off-peak execution of edge AI tasks, comprising: The task acquisition module is used to obtain a global task list of all edge AI tasks; The task standardization module is used to convert the frequency and cost of each edge AI task in the global task list into a standard frequency and task occupancy block, respectively, to generate a standardized task list. The task sorting module is used to sort the standardized task list according to the standard frequency of the edge AI task and the task occupancy block to obtain a sorted task list. The task allocation module is used to calculate the penalty value of all candidate time slots of each edge AI task in turn according to the task order in the sorted task list, and to allocate the edge AI task based on the penalty value, and generate a timed task result dictionary; The plan distribution module is used to group all task allocation results in the scheduled task result dictionary by edge server to obtain a target-specific scheduling plan, and then distribute the target-specific scheduling plan to the corresponding edge server.

[0007] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is to provide a computer device, including one or more processors; and a memory for storing one or more programs, so that the one or more processors implement the off-peak execution method for edge AI tasks as described in any one of the above-mentioned methods.

[0008] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is: a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the staggered execution method for edge AI tasks described in any one of the above-mentioned methods.

[0009] This invention provides a method, apparatus, device, and medium for off-peak execution of edge AI tasks. The method includes: obtaining a global task list of all edge AI tasks; converting the frequency and cost of each edge AI task in the global task list into a standard frequency and task occupancy block, respectively, to generate a standardized task list; sorting the standardized task list according to the standard frequency and task occupancy block of the edge AI tasks to obtain a sorted task list; calculating the penalty value of all candidate time slots for each edge AI task according to the task order in the sorted task list, and allocating tasks to the edge AI tasks based on the penalty values ​​to generate a scheduled task result dictionary; grouping all task allocation results in the scheduled task result dictionary by edge server to obtain a target-specific scheduling plan, and distributing the target-specific scheduling plan to the corresponding edge servers. This invention achieves off-peak execution of edge AI tasks by acquiring a global task list, standardizing and sorting tasks, allocating tasks based on penalty values, and generating a dedicated scheduling plan. This avoids the instantaneous overload of the cloud caused by concentrated task triggering by edge devices, reduces cloud response latency, improves the continuity of task execution and the real-time performance of business, realizes global dynamic coordination of edge task execution time, optimizes system load distribution, and improves system stability and reliability. Attached Figure Description

[0010] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a flowchart illustrating the implementation of the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 2 This is a flowchart illustrating the implementation of the first sub-process in the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 3 This is a flowchart illustrating the implementation of the second sub-process in the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 4 This is a flowchart illustrating the implementation of the third sub-process in the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 5 This is a flowchart illustrating the implementation of the fourth sub-process in the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 6 This is a flowchart illustrating the implementation of the fifth sub-process in the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 7 This is a flowchart illustrating the implementation of the sixth sub-process in the off-peak execution method for edge AI tasks provided in this application embodiment; Figure 8 This is a schematic diagram of a staggered execution device for edge AI tasks provided in an embodiment of this application; Figure 9 This is a schematic diagram of the computer device provided in the embodiments of this application. Detailed Implementation

[0012] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0013] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0014] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0015] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0016] It should be noted that the off-peak execution method for edge AI tasks provided in this application embodiment is generally executed by the server, and correspondingly, the off-peak execution device for edge AI tasks is generally configured in the server.

[0017] Please see Figure 1 , Figure 1 This paper illustrates one specific implementation of a method for staggered execution of edge AI tasks.

[0018] It should be noted that if substantially the same result is obtained, the method of this invention is not based on... Figure 1 Limited to the order of the processes shown, this method includes the following steps: S1: Get a global task list of all edge AI tasks.

[0019] Specifically, the global task definition, the "cloud-based central scheduling and processing module," aggregates all edge AI tasks to form a global task list. Each edge AI task includes at least a globally unique task identifier (alg_name, e.g., BoxA-Camera1-Task), a task trigger frequency (alg_frequency, e.g., 144, meaning 144 times per day), and a single task cost (alg_execnum). The single task cost (alg_execnum) is the cloud call cost, a quantitative indicator representing the estimated "standard workload" (e.g., 50 units) that a single "secondary verification" request for the task will consume from the cloud API. The global task list can be understood as a collection containing information related to all edge AI tasks, its main function being to provide a foundation for centralized management. For example, task information from each edge device can be collected manually, or task data can be extracted from a distributed system using automated tools, with the aim of achieving global task visibility.

[0020] S2: Convert the frequency and cost of each edge AI task in the global task list into standard frequency and task occupancy blocks, respectively, to generate a standardized task list.

[0021] In this context, standard frequency can be understood as a unified and quantified frequency metric used to describe the triggering cycle of edge AI tasks. For example, a predefined frequency grading table can be used to map the triggering cycles of different tasks to discrete frequency levels, thereby achieving unified quantification of heterogeneous task attributes. Task-occupied blocks can be understood as a quantified metric representing task resource consumption. For example, the number of blocks occupied by a task can be determined by statistically analyzing its resource consumption per unit of time.

[0022] Please see Figure 2 , Figure 2 A specific implementation of step S2 is shown below: S21: Match the task trigger frequency of each edge AI task in the global task list with a predefined standard frequency list, and select the value in the standard frequency list that is closest to the task trigger frequency as the standard frequency. S22: Calculate the task-occupied block based on the single-task cost of each edge AI task, and record the task-occupied block. S23: When the transformation of each edge AI task in the global task list is completed, generate the standardized task list.

[0023] An edge AI task should include at least a globally unique task identifier, a task trigger frequency, and a single task cost. A globally unique task identifier is a unique code or tag assigned to each edge AI task, which can be implemented using UUIDs, auto-incrementing IDs, or other unique identifiers, aiming to ensure the task's distinguishability and traceability within the system. The task trigger frequency refers to the time interval or period at which the edge AI task is executed, which can be implemented through fixed time intervals, dynamic time windows, or event-driven methods, aiming to provide a time benchmark for task scheduling. The single task cost refers to the resource consumption required to execute each edge AI task, which can be measured using metrics such as CPU utilization, memory usage, or execution time, aiming to quantify the task's impact on system load.

[0024] Specifically, by establishing standardized rules for task parameters, the heterogeneity of task data hinders off-peak execution. First, edge AI tasks are required to include a globally unique task identifier, task trigger frequency, and single-task cost. This ensures the integrity and traceability of basic task information, providing a unified data framework for subsequent transformations. Next, the task trigger frequency is matched against a predefined list of standard frequencies, and the closest value is selected as the standard frequency. This operation maps continuous or discrete original frequency values ​​to preset discrete standard values, eliminating arbitrary differences in task trigger cycles through frequency normalization, allowing different tasks to be prioritized on the same scale. Then, the task-occupied blocks are calculated and recorded based on the single-task cost. This transforms the abstract concept of cost into quantifiable time-series resource units, making the impact of task execution on system load concrete and measurable through the cost-to-block conversion. Finally, when all tasks have been transformed, a standardized task list is generated, marking the completion of the transformation process and outputting a structured task dataset. This ensures that subsequent sorting and allocation modules can operate based on a consistent data format, effectively supporting the overall process of off-peak execution.

[0025] In one specific embodiment, the actual running frequency and available frequency in each algorithm are matched. For example, the task trigger frequency alg_frequency (such as 130 proposed by the business) is mapped to the nearest value (e.g., 144) in the target_valid_frequencies list (a divisor or multiple of 24) to obtain the standard frequency.

[0026] In this embodiment, the diversity of task triggering frequency and the complexity of single task cost are effectively regulated, enabling subsequent task sorting and allocation to be based on a unified standard, thereby avoiding scheduling chaos caused by heterogeneity of task parameters and significantly reducing the risk of instantaneous load surges in the cloud.

[0027] Please see Figure 3 , Figure 3 A specific implementation of step S22 is shown below: S221: For each edge AI task, calculate the single processing time of the cloud API. S222: Calculate the total task duration based on the single processing time and the single task cost. S223: Calculate the task-occupied block based on the preset scheduling granularity and the total task duration, and record the task-occupied block.

[0028] The single-processing time refers to the actual execution time required for a cloud API to process a single edge AI task. This time can be determined through statistical analysis of historical task execution data or based on cloud service performance benchmarks. The single-task cost can be understood as the quantified value of the resource overhead required to complete a single task, including a comprehensive evaluation of multiple dimensions such as network transmission and computing resource usage. The total task duration is a time-quantified indicator obtained by combining the single-processing time and single-task cost. Its purpose is to ensure that the estimation of task execution time is closer to actual business scenarios by integrating time and cost parameters.

[0029] Specifically, by introducing the calculation step of the single-processing time of the cloud API, the problem of inaccurate task resource quantification that may result from relying solely on the cost of a single task is addressed. Building upon this, the operation of calculating the total task duration using the cost of a single task effectively integrates the time dimension and cost parameters, thereby transforming abstract costs into measurable execution durations. Furthermore, by discretizing the total task duration through a preset scheduling granularity to generate task-occupied blocks, this operation not only achieves accurate quantification of task time resources but also provides reliable data support for subsequent load balancing calculations. In addition, combining the above method with the standardization process of the global task list makes the calculation logic of task-occupied blocks more refined, significantly improving the accuracy and stability of off-peak scheduling and effectively alleviating the problems of high-concurrency requests and resource overload in the cloud.

[0030] Furthermore, the conversion process for task-occupied blocks is as follows: Single processing time = 1 / alg_qps (cloud API capacity); Total task duration (seconds) = Single task cost alg_execnum * Single processing time; Task-occupied blocks = ceil(Total task duration / Scheduling granularity BLOCK_SIZE_SECONDS), where the task-occupied blocks represent how many consecutive time blocks the synchronous call of this task will "occupy" from the cloud API. A typical value for BLOCK_SIZE_SECONDS is 10.

[0031] S3: Sort the standardized task list according to the standard frequency and the task-occupied block of the edge AI task to obtain a sorted task list.

[0032] In this embodiment, the global task list is not sorted by box ID, but rather by standard frequency and task-occupied blocks. Standard frequency is given the first priority, and task-occupied blocks are given the second priority. The sorting strategy prioritizes low-frequency, high-cost tasks.

[0033] Please see Figure 4 , Figure 4 A specific implementation of step S3 is shown below: S31: Sort the standardized global task list in ascending order of standard frequency to obtain an initial sorted task list. S32: If the standard frequencies are the same, sort the initial sorted task list in descending order of task-occupied blocks to obtain the final sorted task list.

[0034] Specifically, a two-layer rule design achieves structured optimization of the task allocation process. First, the standardized task list is sorted from low to high standard frequency, ensuring that tasks with lower execution frequencies are processed first. Since low-frequency tasks have more flexible time window requirements, prioritizing their allocation spreads tasks across a wider time range, preventing high-frequency tasks from triggering at the same time, thus reducing the possibility of time slot conflicts and reserving flexible scheduling space for subsequent high-frequency tasks. Next, when multiple tasks have the same standard frequency, the initially sorted task list is further sorted from high to low task block usage, ensuring that resource-intensive tasks are allocated first. Because large tasks require continuous idle time blocks, allocating smaller tasks first could lead to time slot fragmentation, making it difficult for large tasks to find sufficiently long continuous time periods. Prioritizing large tasks utilizes complete time slot resources, reducing penalties due to insufficient time slots and improving the success rate of task allocation and overall system stability.

[0035] This application's embodiments effectively alleviate the problem of peak cloud load, while improving the success rate of task allocation and the overall stability of the system. This sorting method not only optimizes the task allocation process but also provides a solid foundation for subsequent task allocation modules, ensuring the overall effectiveness of off-peak execution of edge AI tasks.

[0036] S4: Calculate the penalty value of all candidate time slots for each edge AI task according to the task order in the sorted task list, and allocate tasks to the edge AI task based on the penalty value to generate a timed task result dictionary.

[0037] Please see Figure 5 , Figure 5 A specific implementation of step S4 is shown below: S41: Initialize the load table representing the virtual load of the cloud API. S42: Determine the current edge AI task according to the task order in the sorted task list. S43: Generate all candidate time slots based on the standard frequency of the current edge AI task and calculate the penalty value of each candidate time slot. S44: Assign the current edge AI task to the candidate time slot with the smallest penalty value and generate the corresponding Cron expression for the current edge AI task. S45: Record the Cron expression in a pre-built empty dictionary to generate an initial scheduled task result dictionary and increment the task occupancy block in the load table by 1. S46: Redetermine a new current edge AI task and assign tasks to it until all tasks in the sorted task list are assigned, then generate the scheduled task result dictionary.

[0038] The load table is a data structure used to simulate the load status of cloud APIs at different times. It can be implemented using data structures such as arrays, linked lists, or hash tables. Its purpose is to track and predict the load distribution of cloud APIs in real time, thereby providing a dynamic basis for task allocation. Candidate time slots refer to multiple possible execution time points divided based on standard frequencies. They can be divided using predefined time windows or scheduling granularity, aiming to provide flexible options for task allocation. The penalty value is a quantitative indicator reflecting the load pressure of a candidate time slot. It can be calculated by accumulating load values ​​over consecutive time blocks or using other weighted algorithms, aiming to assess the impact of task allocation on the overall load. A Cron expression is a string format used to describe the rules for task execution time. It can be generated using standard Cron syntax or extended syntax, aiming to precisely specify the task execution time.

[0039] Specifically, a series of orderly steps were used to achieve global task off-peak scheduling. First, a load table was initialized to create a virtual load model. This model can simulate the pressure state of cloud APIs in real time, avoiding response latency issues caused by directly relying on the actual service status. Based on this, the current edge AI tasks were processed one by one according to the task order of the sorted task list, prioritizing tasks with lower standard frequencies. This ensures that low-frequency tasks can occupy flexible time slots first, reserving off-peak space for high-frequency tasks. Subsequently, all candidate time slots were generated based on the standard frequency of the current edge AI task, and the total load of consecutive time blocks was calculated by combining the task-occupied blocks to obtain the penalty value. This dynamic evaluation mechanism allows the penalty value to accurately reflect the incremental impact of task execution on the load, effectively avoiding the time slot overlap problem caused by fixed time allocation. Next, the current edge AI task was assigned to the candidate time slot with the smallest penalty value and a Cron expression was generated. This strategy directly selects the time slot with the lowest load pressure to execute the task, significantly dispersing request surges and suppressing the risk of avalanche caused by synchronous calls. Furthermore, by recording Cron expressions in an empty dictionary and updating the task occupancy blocks in the load table in real time, subsequent task allocation decisions are made based on the latest load status, thereby achieving continuous optimization of global load distribution. Finally, through a closed-loop mechanism of sequential processing and real-time feedback, the entire task list allocation process becomes adaptively adjusted, and the final generated dictionary of scheduled task results can systematically avoid load hotspots.

[0040] This application not only solves the problem of load concentration caused by the lack of a dynamic load simulation mechanism during task allocation, but also achieves global optimization of task execution time through a refined penalty value calculation strategy. Especially when multiple tasks share similar execution windows, real-time tracking of virtual load status significantly improves the peak-shaving effect, fundamentally enhancing the stability and reliability of edge-cloud collaboration.

[0041] Please see Figure 6 , Figure 6 A specific implementation of step S43 is shown below: S431: Generate all candidate time slots based on the standard frequency of the current edge AI task. S432: For each candidate time slot, determine a set of consecutive time blocks corresponding to the task occupancy block of the current edge AI task in the load table. S433: Calculate the sum of all load values ​​on the consecutive time blocks to generate the penalty value.

[0042] In this context, a continuous time block refers to a set of adjacent time units mapped by the task's occupied block in the load table. Its purpose is to accurately quantify the continuous load pressure on the cloud API during task execution. A penalty value of 0 indicates that the time slot is completely idle and is the optimal choice. A penalty value > 0 indicates that the time slot conflicts with one or more already scheduled (higher priority) tasks. The current edge AI task is ultimately assigned to the "candidate time slot" with the "lowest penalty value."

[0043] Specifically, by combining standard frequencies to generate candidate time slots, it ensures that the generation of candidate time slots strictly matches the actual triggering cycle of the task, providing a time window basis consistent with business needs for subsequent load assessment. Based on this, for each candidate time slot, by determining the continuous time blocks corresponding to the task's occupied block in the load table, the continuous load impact on the cloud API during task execution can be accurately reflected, rather than focusing only on the instantaneous load of a single time slot. Furthermore, by accumulating all load values ​​on the continuous time blocks, the generated penalty value directly reflects the overall load accumulation that the task may cause when executed in the candidate time slot. This mechanism allows task allocation decisions to prioritize time slots with lower loads, thereby effectively distributing the execution time of edge AI tasks and mitigating the cloud hotspot storm problem. In addition, this solution, combined with the aforementioned task standardization, sorting, and allocation processes, forms a complete technical system for optimizing task scheduling from a global perspective, significantly improving the system's stability and reliability.

[0044] S5: Group all task allocation results in the scheduled task result dictionary by edge server to obtain a target-specific scheduling plan, and send the target-specific scheduling plan to the corresponding edge server.

[0045] Please see Figure 7 , Figure 7 A specific implementation of step S5 is shown below: S51: Iterate through each globally unique task identifier and Cron expression in the scheduled task result dictionary to extract the edge server identifier. S52: Group edge AI tasks and Cron expressions containing the same edge server identifier into a group to generate the target-specific scheduling plan. S53: Distribute the target-specific scheduling plan to the corresponding edge server.

[0046] The scheduled task result dictionary is a data structure that stores scheduling information for all edge AI tasks. It can be implemented using key-value pairs, where the key is a globally unique task identifier and the value is the corresponding Cron expression. The edge server identifier is a unique identifier used to distinguish different edge devices, which can be obtained by parsing specific fields or additional attributes in the task identifier. The target-specific scheduling plan can be understood as a set of task sequences customized for a single edge server. Its purpose is to ensure that each edge device only receives and executes tasks relevant to it, avoiding cross-device task interference. In practical applications, the above grouping operations can be implemented using hash tables, dictionaries, or other data structures that support fast lookup and classification, thereby improving task grouping efficiency.

[0047] Specifically, a series of ordered steps achieves precise task allocation and efficient execution. First, each globally unique task identifier and Cron expression in the scheduled task result dictionary is traversed to extract the implicit edge server identifier. This process, based on predefined attribution attributes in the task identifier, ensures that tasks can be accurately categorized to their corresponding edge devices. Next, tasks with the same edge server identifier and their Cron expressions are grouped together to form a target-specific scheduling plan. This step eliminates the possibility of task conflicts by merging similar tasks and significantly reduces the pressure on cloud-based synchronous calls. Finally, the generated target-specific scheduling plan is transmitted to the corresponding edge server, enabling edge devices to independently parse and execute their own task sequences without relying on a global coordination mechanism. This design not only improves the real-time performance of task execution but also fundamentally prevents sudden load spikes caused by task mismatches. Furthermore, this scheme, closely integrated with the aforementioned standardization, sorting, and task allocation steps, constructs a complete closed-loop system from global scheduling to local execution, effectively addressing resource waste and system stability issues present in existing technologies. The embodiments of this application realize the precise scheduling and efficient execution of edge AI tasks, significantly improve the stability and reliability of the system, and provide strong support for the centralized management of large-scale edge devices.

[0048] This application provides a specific implementation: Assume a scenario with two edge servers (BoxA, BoxB) and a cloud API. Prerequisites: Cloud API capacity: alg_qps = 1.0 (for ease of calculation, assumed to process 1 cost unit per second); Scheduling granularity: BLOCK_SIZE_SECONDS = 10 (one block every 10 seconds); Cloud load table: schedule_overlap_count = [0, 0, ..., 0] (length 8640). Tasks to be scheduled: Task A: BoxA-Task_Video (high-cost task), freq=24 (once per hour), execnum=300 (cost 300 units); Task B: BoxB-Task_Image (low-cost task), freq=144 (6 times per hour), execnum=50 (cost 50 units).

[0049] Step 1 Cost Quantification: API processing speed = 1 / 1.0 = 1 second / cost unit. Task A duration: 300 units * 1 second = 300 seconds. Task block usage: otask_duration_blocks = ceil(300 seconds / 10 seconds) = 30 blocks (occupying 5 minutes).

[0050] Task B duration: 50 units * 1s = 50s. Task usage blocks: otask_duration_blocks = ceil(50s / 10s) = 5 blocks (occupying 50 seconds).

[0051] Step 2: Global Greedy Sort: Task A (f=24, d=30), Task B (f=144, d=5). According to the principle of "low frequency, high cost priority", Task A has a lower frequency. Sort result: [Task A, Task B].

[0052] Step 3: Scheduling Simulation (Simulating Cloud Brain Computation): Scheduling Task A (f=24, d=30): The algorithm enters Case 2 (freq == 24) and begins testing the optimal number of "minutes" (0 to 59) per hour for Task A. Testing minute=0: `ocalculate_penalty` checks the 30 blocks corresponding to minute=0 (i.e., [block 0...block 29]). It queries `schedule_overlap_count[0...29]` and finds all values ​​are 0. Penalty value = 0. This is the optimal choice. Decision: Assign 0 * * * * (minute 0 of the hour) to Task A. Update the load table: The value of `oschedule_overlap_count[0...29]` is incremented by 1. The value of `oschedule_overlap_count[360...389]` (1 o'clock) is incremented by 1. And so on, the first 5 minutes (30 blocks) of each hour are reserved by Task A. Similarly, scheduling simulation is performed for Task B.

[0053] Step 4: Plan Distribution: The "Cloud Central Scheduling and Processing Module" has completed its calculations and generated a global plan. Box A (Edge Server) receives: {"Task_Video":"0 * * * *"}. Box B (Edge Server) receives: {"Task_Image":"5,15,25,35,45,55 * * * *"}.

[0054] Final Result: At 10:00:00: BoxA triggers Task_Video, immediately calls the cloud API and waits. The cloud API begins processing this request, which took 5 minutes. At 10:05:00: BoxA's call ends. BoxB triggers Task_Image, immediately calls the cloud API. The cloud API begins processing this request, which took 50 seconds. At 10:05:50: BoxB's call ends. At 10:10:00: BoxA triggers Task_Video.

[0055] In this embodiment, a global task list of all edge AI tasks is obtained; the frequency and cost of each edge AI task in the global task list are converted into a standard frequency and task occupancy block, respectively, to generate a standardized task list; the standardized task list is sorted according to the standard frequency and task occupancy block of the edge AI tasks to obtain a sorted task list; the penalty value of all candidate time slots of each edge AI task is calculated sequentially according to the task order in the sorted task list, and the edge AI tasks are allocated based on the penalty value to generate a timed task result dictionary; all task allocation results in the timed task result dictionary are grouped by edge server to obtain a target-specific scheduling plan, and the target-specific scheduling plan is sent to the corresponding edge server. This embodiment of the invention achieves off-peak execution of edge AI tasks by obtaining a global task list, standardizing and sorting tasks, allocating tasks based on penalty values, and generating a dedicated scheduling plan. This avoids cloud overload caused by concentrated task triggering by edge devices, reduces cloud response latency, improves the continuity of task execution and business real-time performance, realizes global dynamic coordination of edge task execution time, optimizes system load distribution, and improves system stability and reliability.

[0056] This application's embodiments address cloud overload, task execution failures, and insufficient scheduling flexibility through a centralized global task management and dynamic scheduling mechanism. Specifically, by converting task frequency and cost into standard frequency and task-occupied blocks, unified quantification of heterogeneous task attributes is achieved, providing a comparable basis for off-peak scheduling. Simultaneously, by calculating the penalty value of candidate time slots and allocating tasks based on the minimum penalty value, cloud request pressure is effectively distributed, avoiding resource overload caused by high-concurrency queries. Finally, by grouping task allocation results by edge servers and issuing dedicated scheduling plans, customized execution timing for each device is ensured, suppressing the possibility of synchronous triggering.

[0057] Please refer to Figure 8 As a response to the above Figure 1 The implementation of the method shown in this application provides an embodiment of a staggered execution device for edge AI tasks, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0058] like Figure 8 As shown, the off-peak execution device for edge AI tasks in this embodiment includes: a task acquisition module 61, a task standardization module 62, a task sorting module 63, a task allocation module 64, and a plan issuance module 65, wherein: Task acquisition module 61 is used to acquire a global task list of all edge AI tasks; The task standardization module 62 is used to convert the frequency and cost of each edge AI task in the global task list into a standard frequency and task occupancy block, respectively, to generate a standardized task list. The task sorting module 63 is used to sort the standardized task list according to the standard frequency and the task occupancy block of the edge AI task to obtain the sorted task list. The task allocation module 64 is used to calculate the penalty value of all candidate time slots of each edge AI task in turn according to the task order in the sorted task list, and to allocate the edge AI task based on the penalty value to generate a timed task result dictionary; The plan distribution module 65 is used to group all task allocation results in the scheduled task result dictionary by edge server to obtain a target-specific scheduling plan, and distribute the target-specific scheduling plan to the corresponding edge server.

[0059] Furthermore, the task standardization module 62 includes: The matching unit is used to match the task trigger frequency of each edge AI task in the global task list with a predefined standard frequency list, so as to select the value in the standard frequency list that is closest to the task trigger frequency as the standard frequency. The task occupancy block calculation unit is used to calculate the task occupancy block based on the single task cost of each edge AI task, and record the task occupancy block. The standardized task list generation unit is used to generate the standardized task list when the transformation of each edge AI task in the global task list is completed.

[0060] Furthermore, the task-occupied block calculation unit includes: The single-processing time calculation subunit is used to calculate the single-processing time of the cloud API for each of the edge AI tasks. The task total duration calculation subunit is used to calculate the task total duration based on the single processing time and the single task cost; The task-occupied block recording subunit is used to calculate the task-occupied block according to the preset scheduling granularity and the total task duration, and to record the task-occupied block.

[0061] Furthermore, the task sorting module 63 includes: The initial sorted task list generation unit is used to sort the standardized global task list in ascending order of the standard frequency to obtain the initial sorted task list. The sorted task list generation unit is used to sort the initial sorted task list in descending order of the task occupancy blocks if the standard frequencies are the same, so as to obtain the sorted task list.

[0062] Furthermore, the task allocation module 64 includes: The load table initialization unit is used to initialize the load table representing the virtual load of cloud APIs. The current edge AI task determination unit is used to determine the current edge AI task according to the task order in the sorted task list; The penalty value calculation unit is used to generate all candidate time slots based on the standard frequency of the current edge AI task, and calculate the penalty value of the candidate time slots; The current edge AI task allocation unit is used to allocate the current edge AI task to the candidate time slot with the smallest penalty value and generate the Cron expression corresponding to the current edge AI task. The load table update unit is used to record the Cron expression into a pre-built empty dictionary, generate an initial scheduled task result dictionary, and increment the task occupancy block in the load table by 1; The scheduled task result dictionary generation unit is used to redetermine the new current edge AI task and assign tasks to the new current edge AI task until all tasks in the sorted task list have been assigned, and then generate the scheduled task result dictionary.

[0063] Furthermore, the penalty value calculation unit includes: A candidate time slot generation subunit is used to generate all the candidate time slots based on the standard frequency of the current edge AI task. The continuous time block determination subunit is used to determine, for each of the candidate time slots, a set of continuous time blocks corresponding to the task occupancy block of the current edge AI task in the load table; The penalty value generation unit is used to calculate the sum of all load values ​​on the continuous time block and generate the penalty value.

[0064] Furthermore, the planned distribution of module 65 includes: The edge server identifier extraction unit is used to traverse each globally unique task identifier and Cron expression in the timed task result dictionary to extract the edge server identifier; A target-specific scheduling plan generation unit is used to group edge AI tasks and Cron expressions containing the same edge server identifier into a group and generate the target-specific scheduling plan. The target-specific scheduling plan distribution unit is used to distribute the target-specific scheduling plan to the corresponding edge server.

[0065] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 9 , Figure 9 This is a basic structural block diagram of the computer device in this embodiment.

[0066] Computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected via a system bus. It should be noted that... Figure 9 Only a computer device 7 with three components—memory 71, processor 72, and network interface 73—is shown. It should be understood that implementing all shown components is not required; more or fewer components may be implemented alternatively. Those skilled in the art will understand that this computer device is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), and embedded devices.

[0067] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.

[0068] The memory 71 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 71 may be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 7. Of course, the memory 71 may include both internal storage units and external storage devices of the computer device 7. In this embodiment, the memory 71 is typically used to store the operating system and various application software installed on the computer device 7, such as the program code of the off-peak execution method for edge AI tasks. In addition, the memory 71 may also be used to temporarily store various types of data that have been output or will be output.

[0069] In some embodiments, processor 72 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. Processor 72 is typically used to control the overall operation of computer device 7. In this embodiment, processor 72 is used to run program code stored in memory 71 or process data, for example, to run the program code of the aforementioned off-peak execution method for edge AI tasks, to implement various embodiments of the off-peak execution method for edge AI tasks.

[0070] The network interface 73 may include a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the computer device 7 and other electronic devices.

[0071] This application also provides another embodiment, namely, providing a computer-readable storage medium storing a computer program that can be executed by at least one processor to cause the at least one processor to perform the steps of the off-peak execution method for an edge AI task as described above.

[0072] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of this application.

[0073] Obviously, the embodiments described above are merely some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the scope of this application. This application can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application 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 specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of protection of this application.

Claims

1. A method for staggered execution of edge AI tasks, characterized in that, The method comprises the following steps: obtaining a global task list of all edge AI tasks; converting the frequency and cost of each edge AI task in the global task list into a standard frequency and a task occupation block respectively to generate a normalized task list; sorting the normalized task list according to the standard frequency and the task occupation block of the edge AI task to obtain a sorted task list; calculating the penalty value of all candidate time slots of each edge AI task in sequence according to the task order in the sorted task list, and performing task allocation on the edge AI task based on the penalty value to generate a timing task result dictionary; grouping all task allocation results in the timing task result dictionary according to edge servers to obtain a target exclusive scheduling plan, and issuing the target exclusive scheduling plan to the corresponding edge server.

2. The method of claim 1, wherein, The edge AI task at least includes a global unique task identifier, a task trigger frequency and a single task cost, and the conversion of the frequency and cost of each edge AI task in the global task list into a standard frequency and a task occupation block to generate a normalized task list comprises: matching the task trigger frequency of each edge AI task in the global task list with a predefined standard frequency list to select the value closest to the task trigger frequency in the standard frequency list as the standard frequency; calculating the task occupation block based on the single task cost of each edge AI task and recording the task occupation block; generating the normalized task list when the conversion of each edge AI task in the global task list is completed.

3. The method of claim 2, wherein, The calculation of the task occupation block based on the single task cost of each edge AI task and the recording of the task occupation block comprises: calculating the single processing time of the cloud API for each edge AI task; calculating the total task duration according to the single processing time and the single task cost; calculating the task occupation block according to the preset scheduling granularity and the total task duration and recording the task occupation block.

4. The method of claim 1, wherein, The sorting of the normalized task list according to the standard frequency and the task occupation block of the edge AI task to obtain a sorted task list comprises: sorting the normalized global task list in the order from low to high according to the standard frequency to obtain an initial sorted task list; if the standard frequencies are the same, sorting the initial sorted task list in the order from high to low according to the task occupation block to obtain the sorted task list.

5. The method of claim 1, wherein, The calculation of the penalty value of all candidate time slots of each edge AI task in sequence according to the task order in the sorted task list and the task allocation on the edge AI task based on the penalty value to generate a timing task result dictionary comprises: initializing a load table representing the virtual load of the cloud API; determining the current edge AI task according to the task order in the sorted task list; generating all candidate time slots based on the standard frequency of the current edge AI task and calculating the penalty value of the candidate time slots; assign the current edge AI task to the candidate time slot with the minimum penalty value, and generate a Cron expression corresponding to the current edge AI task; record the Cron expression in a pre-constructed empty dictionary, generate an initial timing task result dictionary, and add 1 to the task occupation block in the load table; redetermine a new current edge AI task, and perform task assignment on the new current edge AI task until all tasks in the sorted task list are assigned, and generate the timing task result dictionary.

6. The method of claim 5, wherein, The generating all candidate time slots based on the standard frequency of the current edge AI task and calculating the penalty value of the candidate time slot comprises: generating all the candidate time slots based on the standard frequency of the current edge AI task; for each candidate time slot, determining a group of continuous time blocks corresponding to the task occupation block of the current edge AI task in the load table; calculating the sum of all load values on the continuous time blocks to generate the penalty value.

7. The method of claim 1 to 6, wherein, The grouping all task assignment results in the timing task result dictionary according to edge servers to obtain a target exclusive scheduling plan, and delivering the target exclusive scheduling plan to the corresponding edge server comprises: traversing each globally unique task identifier and Cron expression in the timing task result dictionary to extract an edge server identifier; grouping edge AI tasks and Cron expressions containing the same edge server identifier into a group to generate the target exclusive scheduling plan; delivering the target exclusive scheduling plan to the corresponding edge server.

8. An off-peak execution device of an edge AI task, comprising: It comprises: a task acquisition module configured to acquire a global task list of all edge AI tasks; a task standardization module configured to convert the frequency and cost of each edge AI task in the global task list into a standard frequency and a task occupation block respectively to generate a standardized task list; a task sorting module configured to sort the standardized task list according to the standard frequency and the task occupation block of the edge AI task to obtain a sorted task list; a task assignment module configured to calculate the penalty value of all candidate time slots of each edge AI task according to the order of tasks in the sorted task list, and perform task assignment on the edge AI task based on the penalty value to generate a timing task result dictionary; a plan delivery module configured to group all task assignment results in the timing task result dictionary according to edge servers to obtain a target exclusive scheduling plan, and deliver the target exclusive scheduling plan to the corresponding edge server.

9. A computer device, comprising: It comprises a memory and a processor, the memory stores a computer program, and the processor implements the peak-shaving execution method of the edge AI task in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the peak-shaving execution method of the edge AI task in any one of claims 1 to 7.