A smart chip hardware resource allocation method
By generating a task-core time period matching table, filtering available core resources, and adjusting the task execution order, the problem of resource conflict and waste in the allocation of intelligent chip hardware resources is solved, and efficient task execution and resource utilization are achieved.
Patent Information
- Application Number
- CN202610487291.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-10
AI Technical Summary
Existing intelligent chip hardware resource allocation methods are prone to resource conflicts or wasted idle time periods during multi-task concurrency, and cannot monitor task execution status in real time, resulting in the core resources not being used optimally, increasing task execution time or causing execution delays.
By obtaining the time requirements of tasks and the core execution status, a task-core time period matching table is generated, available core resources are filtered, tasks are sorted and allocated according to core rotation sequence number and idle time period, and time window compression is monitored during task execution. The task execution order and resource allocation are adjusted to generate an optimized scheduling plan.
It achieves precise scheduling of task execution, avoids resource waste, improves task allocation efficiency, optimizes the utilization rate of core resources, enhances the flexibility and adaptability of the scheduling system, and ensures that tasks are completed on time.
Smart Images

Figure CN122363903A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart chip technology, and in particular to a method for allocating hardware resources for smart chips. Background Technology
[0002] The field of intelligent chip technology encompasses processor architecture design, on-chip system structure organization, computing unit scheduling mechanisms, memory hierarchy management, on-chip interconnect structure, and hardware resource control strategies. Its core lies in achieving resource scheduling and execution control in a multi-tasking environment through the coordinated configuration of computing cores, cache units, memory control units, and bus structures. Its overall technical system covers instruction execution path planning, data access path management, task queue organization, hardware unit working state switching, and resource occupancy constraint settings, thereby forming a chip-level resource organization and scheduling framework for different application loads.
[0003] Among them, the intelligent chip hardware resource allocation method refers to the rule setting method for specific allocation and scheduling of the number of computing cores, cache capacity, storage bandwidth and task execution order inside the chip. The technical matters involved include dividing computing priority according to task type, dividing cache occupancy interval according to data access frequency, setting computing core allocation order according to task execution time slice, determining data transmission path in combination with on-chip bus occupancy, and limiting the storage address range corresponding to each task through a preset resource mapping table. Its specific implementation methods usually include sequential marking of task queues, allocation numbering rules for computing cores, segmentation of cache space, address binding of storage access, and channel specification of data transmission path.
[0004] Existing technologies mainly rely on static task scheduling and resource allocation methods. Although resources can be allocated by setting rules for computation priority, cache usage, etc., resource conflicts or wasted idle time periods are likely to occur when multiple tasks are running concurrently. Since the task execution status cannot be monitored in real time, core resources may not be used optimally, and resource allocation cannot be adjusted in a timely manner according to the actual execution progress of the task, thereby increasing the execution time of the task or causing execution delays. Summary of the Invention
[0005] To address the technical problems existing in the prior art, embodiments of the present invention provide a method for allocating hardware resources in a smart chip. The technical solution is as follows: A method for allocating hardware resources for a smart chip includes the following steps: S1: Obtain the time requirements of the task, including start and end times, estimated duration, memory access and data write-back periods; obtain the execution status of each core, such as the end time of the current execution segment, the start time of the next available time period and the core rotation sequence number, and generate a task-core time period matching table; S2: Based on the matching table, compare the end time of the current execution segment of the core with the start time of the task to exclude unexecutable cores; then compare the expected execution time of the task with the idle time of the core to filter available cores and obtain a list of available core resources. S3: Sort available core resources by core rotation sequence number and idle time period, allocate tasks to appropriate cores, adjust start time to ensure tasks start as planned, and form a core scheduling allocation table; S4: Monitor whether there is time window compression during the execution of the task. If the task is nearing completion and the core cannot be completed, determine whether to execute it in advance and adjust the execution order to obtain the adjusted scheduling plan. S5: Based on the adjusted scheduling plan, update the core allocation table to ensure that tasks are executed smoothly according to the new arrangement. If the time window changes, reassess the core availability and generate an optimized scheduling and task allocation scheme.
[0006] As a further aspect of the present invention, the task-core time period matching table specifically includes the task's start execution time, end execution time, estimated execution duration, memory access period, data write-back period, the end time of the current execution segment of the core, the start time of the next available time period, and the core rotation sequence number. The available core resource list includes the end time of the current execution segment of the core, the start execution time of the task, the remaining idle time period of the core, and the core's capacity to accommodate tasks. The core scheduling allocation table includes the core rotation sequence number, idle time period, task start time, the core to which the task is allocated, and the arrangement for the task to start at a suitable time period. The adjusted task scheduling plan specifically includes adjusting the task execution order, arranging for tasks to be executed earlier, and monitoring the time window compression. The optimized core scheduling and task allocation scheme includes the updated core scheduling allocation table, the core availability assessment after the task time window changes, and the final task execution arrangement.
[0007] As a further aspect of the present invention, the step of obtaining the task-core time period matching table is as follows: S101: Obtain the start time, end time, and estimated execution duration of the task. Based on the task's time requirements, extract the memory access period and data write-back period. Calculate the time difference between the start and end times according to the specific time requirements of the task to obtain the overall execution time span. Further obtain the specific intervals of the task's memory access period and data write-back period, and divide them accordingly. S102: Obtain the current execution status of each core, monitor the end time of the current execution segment, the start time of the next available time period, and the core rotation sequence number, and obtain the execution segment time information of each core. Based on this information, list the end time of the current execution segment and the start time of the next available time period for each core, and record the rotation sequence number of each core; S103: Based on the task time requirement results and core current execution status results obtained in the previous two sub-steps, match the task time requirements with the idle time periods of each core. By comparing the degree of overlap between the task execution time period and the core idle time period, determine whether each task can be executed on the specified core, and generate a task-core time period matching table; task-core time period matching results.
[0008] As a further aspect of the present invention, the step of obtaining the list of available core resources is as follows: S201: Based on the task and core time period matching results, compare the end time of the current execution segment of each core with the start time of the task to determine whether the end time of the current execution segment is later than the start time of the task. If the end time of the current execution segment is later than the start time of the task, exclude the core and continue to perform the same operation on other cores to exclude all cores that cannot execute tasks.
[0009] S202: Based on the task and core time period matching results and the list of cores that cannot execute tasks, compare the remaining idle time periods of the cores with the expected execution time of the tasks to determine whether the remaining idle time periods of the cores are sufficient to accommodate the expected execution time of the tasks. If they are sufficient, select the cores that can accommodate the task execution and continue to perform the same operation on other cores.
[0010] S203: Based on the core resource list that can accommodate tasks, summarize all cores that can execute tasks to generate the final available core resource list, which includes the cores that can execute tasks and their idle time periods.
[0011] As a further aspect of the present invention, the step of obtaining the core scheduling allocation table is as follows: S301: Obtain the idle time slots of all available cores and sort the idle time slots of each core in chronological order to form an idle time schedule; select the most suitable core for allocation based on the idle time slots of the cores and the needs of the tasks, and adjust the start time of the tasks to the start time of the idle time slot of that core, thereby ensuring that the tasks can start at the appropriate time and generating a preliminary task allocation table. S302: Based on the idle timetable and task allocation table, calculate the start and end times of each core task, determine whether there are overlapping conflicts between tasks, and if there are conflicts, further adjust the start time of the task to prevent it from conflicting with other tasks, and obtain the adjusted core task timetable. S303: By comparing the task schedules of all cores, ensure that the task scheduling of each core does not exceed its idle time range, and finally generate the core scheduling allocation table.
[0012] As a further aspect of the present invention, the step of obtaining the adjusted scheduling plan is as follows: Step 401: Obtain task information from the core scheduling allocation table, and extract the planned start time, end time, and current execution status of each task. By determining whether a task is nearing its end time, monitor whether the task's execution progress has reached the predetermined plan. Based on the remaining execution time of the current core, identify tasks that are nearing their end but have not yet been completed. Step 402: Call the monitoring system to further analyze the identified incomplete tasks. Based on the remaining execution capacity of the current core, compare the remaining time of the task with the current execution progress to determine whether there is a situation where the core cannot complete the task within the remaining time, and obtain the judgment result of whether the task needs to be adjusted. Step 403: Based on the result of the task adjustment necessity judgment, adjust the execution order of the unfinished tasks, determine the tasks that can be executed in advance according to the urgency and priority of the current tasks, and optimize the execution order of the core tasks to finally obtain the adjusted task scheduling plan.
[0013] As a further aspect of the present invention, the step of obtaining the optimized scheduling and task allocation scheme is as follows: Step 501: Based on the adjusted task scheduling plan, obtain the task time window and priority information, monitor and analyze changes in task scheduling, and collect and update data such as resource requirements and execution time of all relevant tasks; based on this data, check whether the tasks are in line with the current resource allocation and determine whether there is an impact from changes in time windows. If there are changes, calculate the resource requirements of each task after the adjustment, and generate the resource requirement data of the adjusted tasks through this process. Step 502: Based on the adjusted task resource requirement data, assess the availability and resource allocation of the cores, obtain the current load of each core, calculate the maximum task load that each core can accept based on its processing capacity, compare the core availability for each task's requirements, determine whether the task can be successfully allocated, and generate a task and core availability matching result through this process. Step 503: Based on the availability matching results of tasks and cores, readjust the core scheduling scheme to ensure that each task can be assigned to a suitable core, further refine the core scheduling arrangement, update the task order and allocation information in the scheduling table, and generate an optimized core scheduling and task allocation scheme.
[0014] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: This invention generates a task-core time slot matching table by comparing the time requirements of tasks with core idle time slots, enabling precise task scheduling, avoiding resource waste, improving task allocation efficiency, and optimizing core resource utilization. Through detailed analysis and sorting of each core idle time slot, it ensures tasks are allocated to appropriate cores in a reasonable order. Furthermore, it adjusts the task order based on time window compression during task execution, preventing task delays or conflicts due to excessive core load. This enhances the flexibility and adaptability of the scheduling system. Ultimately, by dynamically adjusting the core scheduling and task allocation scheme, tasks can be completed on time, while simultaneously improving the overall system's resource utilization efficiency, optimizing scheduling strategies, and reducing resource waste. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart illustrating the process of obtaining the task-core time period matching table for this invention. Figure 3 This is a flowchart illustrating the process of obtaining the list of available core resources for this invention. Figure 4 This is a flowchart illustrating the process of obtaining the core scheduling allocation table of this invention. Figure 5 This is a flowchart illustrating the process of obtaining the adjusted task scheduling plan according to the present invention. Figure 6 This is a flowchart illustrating the process of obtaining the optimized core scheduling and task allocation scheme of this invention. Detailed Implementation
[0016] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0017] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0018] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the difference between them, their intended meanings are consistent. Similarly, the terms "of," "correlation (ponding)," and "correlation (ponding)" may sometimes be used interchangeably. It should be noted that, without emphasizing the difference between them, their intended meanings are consistent.
[0019] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0020] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0021] Please see Figure 1 This invention provides a technical solution: a method for allocating hardware resources for a smart chip, comprising the following steps: S1: Obtain the time requirements of the scheduled task, including the start time, end time, and estimated execution duration, as well as the time period requirements for memory access and data write-back. Obtain the current execution status of each core, including the end time of the current execution segment, the start time of the next available time period, and the core rotation sequence number. Compare the time requirements of the task with the idle time period of each core to obtain the task-core time period matching table. S2: Based on the task and core time period matching table, compare the end time of the current execution segment of each core with the start time of the task to exclude cores that cannot execute tasks. Then, compare the expected execution time of the task with the remaining idle time period of the core to filter out the cores that can accommodate task execution and obtain a list of available core resources. S3: Based on the list of available core resources, sort the cores by core rotation sequence number and idle time period, assign tasks to appropriate cores, and ensure that tasks can start as planned at the appropriate time period by adjusting the start time of tasks, thus forming a core scheduling and allocation table. S4: Based on the core scheduling allocation table, monitor whether time window compression occurs during task execution. If a task is about to end and the current core cannot complete the task, determine whether the task can be executed in advance, adjust the task execution order, and obtain the adjusted task scheduling plan. S5: Based on the adjusted task scheduling plan, update the core scheduling allocation table to ensure that tasks are executed smoothly according to the new arrangement. If the task time window changes, reassess the availability of the core and finally generate an optimized core scheduling and task allocation scheme.
[0022] The task-core time period matching table specifically includes the task's start execution time, end execution time, estimated execution duration, memory access period, data write-back period, the end time of the current execution segment of the core, the start time of the next available time period, and the core rotation sequence number. The available core resource list includes the end time of the current execution segment of the core, the start execution time of the task, the remaining idle time period of the core, and the core's task capacity. The core scheduling allocation table includes the core rotation sequence number, idle time period, task start time, the core to which the task is assigned, and the arrangement for the task to start at a suitable time period. The adjusted task scheduling plan specifically includes adjustments to the task execution order, arrangements for advancing the task execution time period, and monitoring of time window compression. The optimized core scheduling and task allocation scheme includes the updated core scheduling allocation table, core availability assessment after changes in task time windows, and the final task execution arrangement.
[0023] Please see Figure 2 The steps to obtain the task-core time period matching table are as follows: S101: Obtain the start time, end time, and estimated execution duration of the task. Based on the task's time requirements, extract the memory access period and data write-back period. Calculate the time difference between the start and end times according to the specific time requirements of the task to obtain the overall execution time span. Further obtain the specific intervals of the task's memory access period and data write-back period, and divide them accordingly. Obtain the start time, end time, and estimated execution duration of each task. Designate the tasks to be processed as Task 1, Task 2, and Task 3. Extract the time parameters for each task using the task input module of the task scheduling system. Specifically, set the start time of Task 1 to 09:00:00 and the end time to 09:30:00; the start time of Task 2 to 09:15:00 and the end time to 09:45:00; and the start time of Task 3 to 09:30:00 and the end time to 09:45:00. The time is set to 10:00:00. The time calculation module is called to perform a difference calculation on the start and end times of each task. The calculation method is to subtract the start time from the end time. The estimated execution time of Task 1 is 30 minutes, the estimated execution time of Task 2 is 30 minutes, and the estimated execution time of Task 3 is 30 minutes. The total execution time span of each task is further calculated. The time span of Task 1 is from 09:00:00 to 09:30:00, and the time span of Task 2 is from 09:15:00 to 09:30:00. 45:00, Task 3's time span is from 09:30:00 to 10:00:00; based on the task's memory access characteristics and data write-back mechanism, the memory access period is set to account for 40% of the estimated execution time, the data write-back period to account for 20% of the estimated execution time, and the remaining 40% is the core computation period. Through time interval splitting, the specific intervals for the memory access period and data write-back period of each task are determined. For Task 1, the memory access period is from 09:00:00 to 09:12:00, and the data write-back period is from 09:24... From 09:00 to 09:30:00, the memory access period for Task 2 is from 09:15:00 to 09:27:00, and the data write-back period is from 09:39:00 to 09:45:00. The memory access period for Task 3 is from 09:30:00 to 09:42:00, and the data write-back period is from 09:54:00 to 10:00:00. Each period is divided into 1-minute units to form a time granularity that can be accurately matched, obtain the specific intervals of the task's memory access period and data write-back period, and divide them.
[0024] S102: Obtain the current execution status of each core, monitor the end time of the current execution segment of the core, the start time of the next available time period and the core rotation sequence number, obtain the execution segment time information of each core, and based on this information, list the end time of the current execution segment and the start time of the next available time period for each core, and record the rotation sequence number of each core. The current execution status of each core is obtained. The system is set to contain 3 cores, namely core 1, core 2 and core 3. The running parameters of each core are collected in real time through the core status monitoring module. Table 1 lists the relevant data of the current execution status of each core. Table 1. Core Current Execution Status Parameters; As shown in Table 1, the current execution segment of Core 1 ends at 09:10:00. After completing its current task, it immediately enters an idle state. The start time of the next available time period is the same as the end time of the current execution segment. Its core rotation number is 1, indicating that it has the highest priority in the core scheduling queue. The current execution segment of Core 2 ends at 09:20:00, and the start time of the next available time period is 09:20:00. Its core rotation number is 2. The current execution segment of Core 3 ends at 09:05:00, and the start time of the next available time period is 09:05:00. Its core rotation number is 3, and it has the lowest priority. By recording the above parameters for each core, the execution segment time information of each core is obtained. The end time of the current execution segment and the start time of the next available time period for each core are listed, and the rotation number of each core is recorded.
[0025] S103: Based on the task time requirement results and core current execution status results obtained in the previous two sub-steps, match the task time requirements with the idle time periods of each core. By comparing the degree of overlap between the task execution time period and the core idle time period, determine whether each task can be executed on the specified core, and generate a task-core time period matching table; task-core time period matching results.
[0026] Based on the task time requirements and core current execution status obtained from the first two sub-steps, the matching calculation module is invoked to compare the time requirements of each task with the idle time slot of each core one by one. An overlap threshold of 80% is set, meaning that if the overlap between the task execution time slot and the core idle time slot is at least 80% of the task's estimated execution time, the core is deemed capable of executing the task. The overlap is calculated as (overlap duration ÷ estimated task execution time) × 100%. For task 1, its execution time slot is from 09:00:00 to 09:30:00, and core 1's idle time slot is from 09:10:00 to the subsequent period without any other tasks, resulting in an overlap of 20%. The overlap is calculated as (20÷30)×100%≈66.7%, which is lower than the judgment threshold, therefore core 1 cannot execute task 1; the idle time period of core 2 is from 09:20:00 to the subsequent period without any tasks, with an overlap duration of 10 minutes and an overlap of (10÷30)×100%≈33.3%, which is lower than the judgment threshold, therefore core 2 cannot execute task 1; the idle time period of core 3 is from 09:05:00 to the subsequent period without any tasks, with an overlap duration of 25 minutes and an overlap of (25÷30)×100%≈83.3%, which is higher than the judgment threshold, therefore core 3 can execute task 1; for task 2, its execution time is from 09:15: From 09:10:00 to 09:45:00, the idle period for core 1 is from 09:10:00 to the subsequent period without any tasks, with an overlap of 30 minutes and an overlap rate of 100%, which is higher than the judgment threshold. Therefore, core 1 is determined to be able to execute task 2. The idle period for core 2 is from 09:20:00 to the subsequent period without any tasks, with an overlap of 25 minutes and an overlap rate of approximately 83.3%, which is higher than the judgment threshold. Therefore, core 2 is determined to be able to execute task 2. The idle period for core 3 is from 09:05:00 to the subsequent period without any tasks, with an overlap of 30 minutes and an overlap rate of 100%. Therefore, core 3 is determined to be able to execute task 2. For task 3, its execution period is from 09:30:00 to... At 10:00:00, the idle time period of Core 1 is from 09:10:00 to the subsequent period without any tasks, with an overlap of 30 minutes and an overlap rate of 100%. Therefore, Core 1 is determined to be able to execute Task 3. The idle time period of Core 2 is from 09:20:00 to the subsequent period without any tasks, with an overlap of 30 minutes and an overlap rate of 100%. Therefore, Core 2 is determined to be able to execute Task 3. The idle time period of Core 3 is from 09:05:00 to the subsequent period without any tasks, with an overlap of 30 minutes and an overlap rate of 100%. Therefore, Core 3 is determined to be able to execute Task 3. The above determination results are compiled and summarized to generate a matching table of tasks and core time periods, and the matching results of tasks and core time periods are shown.
[0027] Please see Figure 3 The steps to obtain the list of available core resources are as follows: S201: Based on the task and core time period matching results, compare the end time of the current execution segment of each core with the start time of the task to determine whether the end time of the current execution segment is later than the start time of the task. If the end time of the current execution segment is later than the start time of the task, exclude the core and continue to perform the same operation on other cores to exclude all cores that cannot execute tasks. Based on the task and core time period matching results, the comparison calculation module is invoked to compare the end time of the current execution segment of each core with the start time of the task. The comparison rule is to compare the numerical values of the end time of the current execution segment of the core with the start time of the task. If the numerical value of the end time of the current execution segment of the core is greater than the numerical value of the start time of the task, it is determined that the core cannot execute the task and is excluded. For task 1, its start time is 09:00:00, and the end time of the current execution segment of core 1 is 09:10:00. Since 09:10:00 is greater than 09:00:00, core 1 is excluded. Core 2... The current execution segment ends at 09:20:00, which is greater than 09:00:00, so core 2 is excluded. The current execution segment ends at 09:05:00, which is greater than 09:00:00. Further analysis is performed to determine the time difference between the current execution segment end time of core 3 and the task start time. The time difference is calculated as 09:05:00 minus 09:00:00, which equals 5 minutes. The allowed time difference threshold is set to 10 minutes. If 5 minutes is less than 10 minutes, core 3 is deemed unnecessary to exclude. The same operation is performed on other cores to exclude all cores that cannot execute the task.
[0028] S202: Based on the task and core time period matching results and the list of cores that cannot execute tasks, compare the remaining idle time periods of the cores with the expected execution time of the tasks to determine whether the remaining idle time periods of the cores are sufficient to accommodate the expected execution time of the tasks. If they are sufficient, select the cores that can accommodate the task execution and continue to perform the same operation on other cores.
[0029] Based on the task and core time period matching results and the list of unexecutable core tasks, the comparison module is invoked to compare the remaining idle time periods of core tasks with the expected execution duration of each task. The criterion for determining the remaining idle time period of a core is that the total idle time period of the core is not less than the sum of the expected execution duration of the task and the redundancy period. The redundancy period is set to 5 minutes, taking into account the minor delays that may occur during task execution. Experiments have verified that setting the redundancy period to 5 minutes can avoid more than 95% of task failures caused by delays. The experimental data consisted of 100 consecutive task executions, with only 5 instances showing delays exceeding 5 minutes. Therefore, the redundancy period of 5 minutes was determined. The remaining idle time period is calculated as the total duration from the start of the next available time period of the core to the subsequent unoccupied time period. The estimated execution time of Task 1 is 30 minutes, so the remaining idle time period of the core must be no less than 35 minutes. The only remaining core is Core 3. The start of the next available time period of Core 3 is 09:05:00, and the subsequent unoccupied time period is until 10:30:00. The remaining idle time of Core 3 is calculated as 10:30:00 minus 09:05:00, which gives 85 minutes. Since 85 minutes is greater than 35 minutes, it is determined that the remaining idle time period of Core 3 is sufficient to accommodate the estimated execution time of Task 1. Cores that can accommodate task execution are selected, and the same operation is performed on other cores.
[0030] S203: Based on the core resource list that can accommodate tasks, summarize all cores that can execute tasks to generate the final available core resource list, which includes the cores that can execute tasks and their idle time periods.
[0031] Based on the core resource list that can accommodate tasks, the aggregation module is called to centrally organize all cores capable of executing tasks, clarifying key parameters such as core number, end time of the current execution segment, start time of the next available time period, core rotation sequence number, and remaining idle time. The specific parameters for core 3 are core number 3, end time of the current execution segment 09:05:00, start time of the next available time period 09:05:00, core rotation sequence number 3, and remaining idle time of 85 minutes. These parameters are organized according to the standard format to generate the final list of available core resources, which includes the cores capable of executing tasks and their idle time periods.
[0032] Please see Figure 4 The steps to obtain the core scheduling allocation table are as follows: S301: Obtain the idle time slots of all available cores and sort the idle time slots of each core in chronological order to form an idle time schedule; select the most suitable core for allocation based on the idle time slots of the cores and the needs of the tasks, and adjust the start time of the tasks to the start time of the idle time slot of that core, thereby ensuring that the tasks can start at the appropriate time and generating a preliminary task allocation table. Obtain the idle time periods of all available cores. Only core 3 is available, with its idle time period from 09:05:00 to 10:30:00. Sort this idle time period chronologically in 1-minute increments to form an idle time table. The time nodes in the idle time table start at 09:05:00 and increment by 1 minute until 10:30:00. Based on the idle time period of core 3 and the requirements of task 1, the estimated execution time of task 1 is 30 minutes, with memory access from 09:00:00 to 09:12:00, and data write-back... The time period is from 09:24:00 to 09:30:00. The start time of the idle time period of core 3 is 09:05:00. The start time of task 1 is adjusted to 09:05:00. Correspondingly, the memory access time period of task 1 is adjusted to 09:05:00 to 09:17:00, and the data write-back time period is 09:29:00 to 09:35:00. This ensures that task 1 can start execution during the idle time of core 3. The correspondence between task 1 and core 3 and the adjusted task time parameters are entered into the table to generate a preliminary task allocation table.
[0033] S302: Based on the idle timetable and task allocation table, calculate the start and end times of each core task, determine whether there are overlapping conflicts between tasks, and if there are conflicts, further adjust the start time of the task to prevent it from conflicting with other tasks, and obtain the adjusted core task timetable. Based on the idle timetable and the preliminary task allocation table, the time calculation module is called to calculate the start and end times of the tasks in core 3. The start time of task 1 is 09:05:00 and the end time is 09:35:00. Further monitoring is conducted to see if there are other tasks allocated to core 3. At this time, core 3 only allocates task 1, and no other tasks occupy it, so it is determined that there is no task overlap or conflict. If we assume that core 3 allocates task 1 and task 4 at the same time, the start time of task 4 is 09:25:00 and the end time is 09:55:00, and the end time of task 1 is 09:35:00. The start time of task 4, 09:25:00, is less than the end time of task 1, 09:35:00, so it is determined that there is an overlap or conflict. At this time, the start time of task 4 is adjusted to 09:35:00, and the end time is adjusted accordingly to 10:05:00, so that task 4 and task 1 do not overlap. In this embodiment, core 3 only allocates task 1, and there is no conflict, resulting in the adjusted core task timetable.
[0034] S303: By comparing the task schedules of all cores, ensure that the task scheduling of each core does not exceed its idle time range, and finally generate the core scheduling allocation table.
[0035] By comparing the task schedule of Core 3 with its idle time period, the idle time period of Core 3 is from 09:05:00 to 10:30:00, and the execution time period of Task 1 is from 09:05:00 to 09:35:00. The start time of Task 1 is equal to the start time of the idle time period of Core 3, and the end time of Task 1, 09:35:00, is less than the end time of the idle time period of Core 3, 10:30:00. It is determined that the arrangement of Task 1 does not exceed the idle time range of Core 3. At the same time, it is checked again whether each time period of Task 1 is within the idle time period of Core 3. The memory access time period, 09:05:00 to 09:17:00, and the data write-back time period, 09:29:00 to 09:35:00, are both within the range of 09:05:00 to 10:30:00. Finally, the core scheduling allocation table is generated.
[0036] Please see Figure 5 The steps to obtain the adjusted scheduling plan are as follows: Step 401: Obtain task information from the core scheduling allocation table, and extract the planned start time, end time, and current execution status of each task. By determining whether a task is nearing its end time, monitor whether the task's execution progress has reached the predetermined plan. Based on the remaining execution time of the current core, identify tasks that are nearing their end but have not yet been completed. The task information in the core scheduling allocation table is retrieved, containing only task 1. The planned start time of task 1 is extracted as 09:05:00 and the planned end time as 09:35:00. The current execution status of task 1 is collected in real time through the core status monitoring module. The task end warning threshold is set to 5 minutes before the planned end time, i.e., 09:30:00. When the current time reaches 09:30:00, the execution progress of task 1 is monitored. The progress calculation module is called to calculate the current execution progress of task 1. The estimated execution time of task 1 is 30 minutes. As of 09:30:00, the actual execution time is 25 minutes. The execution progress is calculated as (25÷30)×100%≈83.3%. The progress qualification threshold is set as 90%. 83.3% is lower than 90%, so it is determined that task 1 is close to the end but has not yet been completed. At the same time, the remaining execution time of core 3 is calculated. The planned end time 09:35:00 minus the current time 09:30:00 equals 5 minutes. Tasks that are close to the end but have not yet been completed are identified.
[0037] Step 402: Call the monitoring system to further analyze the identified incomplete tasks. Based on the remaining execution capacity of the current core, compare the remaining time of the task with the current execution progress to determine whether there is a situation where the core cannot complete the task within the remaining time, and obtain the judgment result of whether the task needs to be adjusted. The monitoring system is invoked to further analyze the identified incomplete task 1. The current remaining execution capacity parameters of core 3 are collected. The rated processing rate of core 3 is 1000 instructions / minute, and the current remaining processing rate is 950 instructions / minute. The number of remaining instructions to be executed for task 1 is 8000. The remaining execution time required for task 1 is calculated as: Required time = Number of remaining instructions to be executed ÷ Current remaining processing rate, i.e., 8000 ÷ 950 ≈ 8.42 minutes. The remaining execution time of core 3 is 5 minutes. The remaining execution time required for task 1 is compared with the remaining execution time of core 3. Since 8.42 minutes is greater than 5 minutes, it is determined that core 3 cannot complete task 1 within the remaining time, and the judgment result is that the task needs to be adjusted.
[0038] Step 403: Based on the result of the task adjustment necessity judgment, adjust the execution order of the unfinished tasks, determine the tasks that can be executed in advance according to the urgency and priority of the current tasks, and optimize the execution order of the core tasks to finally obtain the adjusted task scheduling plan.
[0039] Based on the judgment result that the task needs adjustment, the order adjustment module is called to adjust the execution order of the incomplete task 1. The urgency of the task is set as the ratio of the number of remaining instructions to the remaining time. A ratio greater than 1500 instructions / minute is considered high urgency. The ratio of task 1 is 8000 ÷ 5 = 1600 instructions / minute, so it is judged as high urgency and its priority is set to level 1. At the same time, other available tasks in the system are checked. Assuming there is task 5 with a priority of level 2, a current execution progress of 60%, and a remaining execution time of 10 minutes, the execution of task 5 is paused to prioritize the execution of task 1. The task execution order of core 3 is adjusted to raise the priority of task 1 to the highest level. At the same time, other idle resources are called to assist core 3 in executing task 1, supplementing the processing rate of core 3 to 1700 instructions / minute. The remaining execution time of task 1 is recalculated as 8000 ÷ 1700 ≈ 4.71 minutes, which is less than the remaining execution time of core 3 by 5 minutes. Finally, the adjusted task scheduling plan is obtained.
[0040] Please see Figure 6 The steps to obtain the optimized scheduling and task allocation scheme are as follows: Step 501: Based on the adjusted task scheduling plan, obtain the task time window and priority information, monitor and analyze changes in task scheduling, and collect and update data such as resource requirements and execution time of all relevant tasks; based on this data, check whether the tasks are in line with the current resource allocation and determine whether there is an impact from changes in time windows. If there are changes, calculate the resource requirements of each task after the adjustment, and generate the resource requirement data of the adjusted tasks through this process. According to the adjusted task scheduling plan, the time window for extracting task 1 is from 09:05:00 to 09:35:00, with a priority of level 1. The scheduling monitoring module monitors the changes in task scheduling in real time and collects the adjusted resource requirements data for task 1. Before the adjustment, the memory requirement for task 1 was 2GB. After the adjustment, due to the supplementary processing resources, the memory requirement increased to 2.5GB. The execution time remains at 30 minutes. At the same time, other relevant data for task 1 are updated. Table 2 lists the resource requirements and execution time data of task 1 before and after the adjustment. Table 2 Comparison of parameters before and after adjustment for Task 1; As shown in Table 2, the time window of Task 1 has not changed, the priority has been increased, the memory requirement has increased slightly, and the execution time remains unchanged. Based on these data, we check whether Task 1 meets the current resource allocation. The current available memory of core 3 is 4GB, and 2.5GB is less than 4GB, which meets the resource allocation requirements. The time window has not changed, so there is no need to recalculate the resource requirement. This process generates the adjusted resource requirement data for the task.
[0041] Step 502: Based on the adjusted task resource requirement data, assess the availability and resource allocation of the cores, obtain the current load of each core, calculate the maximum task load that each core can accept based on its processing capacity, compare the core availability for each task's requirements, determine whether the task can be successfully allocated, and generate a task and core availability matching result through this process. Based on the adjusted task resource requirements, the evaluation module is invoked to assess the availability and resource allocation of the cores. The current load of each core is collected: Core 1 has a current load of 40%, Core 2 has a current load of 35%, and Core 3 has a current load of 75%. Each core has a processing capacity of 1000 instructions / minute. The maximum task load that each core can accept is calculated as: Maximum task load = (1 - Current load) × Rated processing capacity. Therefore, the maximum task load for Core 1 is (1 - 40%) × 1000 = 600 instructions / minute, for Core 2 it is (1 - 35%) × 1000 = 650 instructions / minute, and for Core 3 it is (1 - 75%) × 1000 = 250 instructions / minute. The remaining processing requirement for Task 1 after adjustment is 8000 instructions, with a remaining execution time of 5 minutes, requiring a processing rate of 1600 instructions / minute. A single core cannot meet this requirement; therefore, Core 1 and Core 2 are combined for auxiliary processing. Core 3 executes, and the sum of the maximum task loads of Cores 1, 2, and 3 is 600 + 650 + 250 = 1500 messages / minute. A slight increase in core processing speed is still needed. The load of Cores 1 and 2 is adjusted to 50%, at which point the maximum task load of Core 1 is (1-50%) × 1000 = 500 messages / minute, the maximum task load of Core 2 is (1-50%) × 1000 = 500 messages / minute, and the maximum task load of Core 3 remains at 250 messages / minute. The sum of these three is 1250 messages / minute, which is still insufficient. The load of Cores 1 and 2 is further adjusted to 60%, and the sum of the maximum task loads is 400 + 400 + 250 = 1050 messages / minute, which is still insufficient. Finally, it is decided to call upon system backup resources to increase the total processing speed to 1700 messages / minute, meeting the needs of Task 1. Based on the needs of Task 1, core availability is compared, and it is determined that Task 1 can be successfully allocated. This process generates a task and core availability matching result.
[0042] Step 503: Based on the availability matching results of tasks and cores, readjust the core scheduling scheme to ensure that each task can be assigned to a suitable core, further refine the core scheduling arrangement, update the task order and allocation information in the scheduling table, and generate an optimized core scheduling and task allocation scheme.
[0043] Based on the availability matching results of tasks and cores, the scheduling adjustment module is invoked to readjust the core scheduling scheme. Core 3 is designated as the primary execution core, with cores 1 and 2 as auxiliary execution cores. Core 3 handles 50% of the task processing load, core 1 handles 30%, and core 2 handles 20%. Task 1 has 8000 remaining instructions to be executed; core 3 needs to process 4000, core 1 needs to process 2400, and core 2 needs to process 1600. The processing rate of core 3 is adjusted to 800 instructions / minute, core 1 to 720 instructions / minute, and core 2 to 480 instructions / minute. The processing time for each core is calculated based on the number of tasks per minute. Core 3 takes 4000 ÷ 800 = 5 minutes, Core 1 takes 2400 ÷ 720 ≈ 3.33 minutes, and Core 2 takes 1600 ÷ 480 ≈ 3.33 minutes. All of these times are within the remaining execution time of the cores. The scheduling arrangement of the cores is further refined, specifying that Core 1 and Core 2 will begin auxiliary execution from 09:30:00, while Core 3 will continue primary execution. The task order and allocation information in the scheduling table are updated to generate an optimized core scheduling and task allocation scheme.
[0044] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the described technical solutions.
Claims
1. A method for allocating hardware resources in a smart chip, characterized in that, Includes the following steps: S1: Obtain the time requirements of the task, including start and end times, estimated duration, memory access and data write-back periods; obtain the execution status of each core, such as the end time of the current execution segment, the start time of the next available time period and the core rotation sequence number, and generate a task-core time period matching table; S2: Based on the matching table, compare the end time of the current execution segment of the core with the start time of the task to exclude unexecutable cores; then compare the expected execution time of the task with the idle time of the core to filter available cores and obtain a list of available core resources. S3: Sort available core resources by core rotation sequence number and idle time period, allocate tasks to appropriate cores, adjust start time to ensure tasks start as planned, and form a core scheduling allocation table; S4: Monitor whether there is time window compression during the execution of the task. If the task is nearing completion and the core cannot be completed, determine whether to execute it in advance and adjust the execution order to obtain the adjusted scheduling plan. S5: Based on the adjusted scheduling plan, update the core allocation table to ensure that tasks are executed smoothly according to the new arrangement. If the time window changes, reassess the core availability and generate an optimized scheduling and task allocation scheme.
2. The intelligent chip hardware resource allocation method according to claim 1, characterized in that: The task-core time period matching table specifically includes the task's start execution time, end execution time, estimated execution duration, memory access period, data write-back period, the end time of the current execution segment of the core, the start time of the next available time period, and the core rotation sequence number. The available core resource list includes the end time of the current execution segment of the core, the start execution time of the task, the remaining idle time period of the core, and the core's task capacity. The core scheduling allocation table includes the core rotation sequence number, idle time period, task start time, the core to which the task is allocated, and the arrangement for the task to start at a suitable time period. The adjusted task scheduling plan specifically includes adjusting the task execution order, arranging for tasks to be executed earlier, and monitoring the time window compression. The optimized core scheduling and task allocation scheme includes the updated core scheduling allocation table, the core availability assessment after the task time window changes, and the final task execution arrangement.
3. The intelligent chip hardware resource allocation method according to claim 1, characterized in that: The steps for obtaining the task-core time period matching table are as follows: S101: Obtain the start time, end time, and estimated execution duration of the task. Based on the task's time requirements, extract the task's memory access period and data write-back period. According to the specific time requirements of the task, calculate the time difference between the start time and end time to obtain the overall execution time span of the task. Further obtain the specific intervals of the task's memory access period and data write-back period, and divide them. S102: Obtain the current execution status of each core, monitor the end time of the current execution segment, the start time of the next available time period, and the core rotation sequence number, and obtain the execution segment time information of each core. Based on this information, list the end time of the current execution segment and the start time of the next available time period for each core, and record the rotation sequence number of each core; S103: Based on the task time requirement results and core current execution status results obtained in the previous two sub-steps, match the task time requirements with the idle time periods of each core. By comparing the degree of overlap between the task execution time period and the core idle time period, determine whether each task can be executed on the specified core, and generate a matching table between tasks and core time periods.
4. The intelligent chip hardware resource allocation method according to claim 1, characterized in that: The steps for obtaining the list of available core resources are as follows: S201: Based on the task and core time period matching results, compare the end time of the current execution segment of each core with the start time of the task to determine whether the end time of the current execution segment is later than the start time of the task. If the end time of the current execution segment is later than the start time of the task, exclude the core and continue to perform the same operation on other cores to exclude all cores that cannot execute tasks. S202: Based on the task and core time period matching results and the list of cores that cannot be executed, compare the idle time period of the remaining cores with the expected execution time of the task to determine whether the remaining idle time period of the core is sufficient to accommodate the expected execution time of the task. If it is sufficient, select the cores that can accommodate the task execution and continue to perform the same operation on other cores. S203: Based on the core resource list that can accommodate tasks, summarize all cores that can execute tasks to generate the final available core resource list, which includes the cores that can execute tasks and their idle time periods.
5. The intelligent chip hardware resource allocation method according to claim 1, characterized in that: The steps for obtaining the core scheduling allocation table are as follows: S301: Obtain the idle time slots of all available cores and sort the idle time slots of each core in chronological order to form an idle time schedule; select the most suitable core for allocation based on the idle time slots of the cores and the needs of the tasks, and adjust the start time of the tasks to the start time of the idle time slot of that core, thereby ensuring that the tasks can start at the appropriate time and generating a preliminary task allocation table. S302: Based on the idle timetable and task allocation table, calculate the start and end times of each core task, determine whether there are overlapping conflicts between tasks, and if there are conflicts, further adjust the start time of the task to prevent it from conflicting with other tasks, and obtain the adjusted core task timetable. S303: By comparing the task schedules of all cores, ensure that the task scheduling of each core does not exceed its idle time range, and finally generate the core scheduling allocation table.
6. The intelligent chip hardware resource allocation method according to claim 1, characterized in that: The steps for obtaining the adjusted scheduling plan are as follows: Step 401: Obtain task information from the core scheduling allocation table, and extract the planned start time, end time, and current execution status of each task. By determining whether a task is nearing its end time, monitor whether the task's execution progress has reached the predetermined plan. Based on the remaining execution time of the current core, identify tasks that are nearing their end but have not yet been completed. Step 402: Call the monitoring system to further analyze the identified incomplete tasks. Based on the remaining execution capacity of the current core, compare the remaining time of the task with the current execution progress to determine whether there is a situation where the core cannot complete the task within the remaining time, and obtain the judgment result of whether the task needs to be adjusted. Step 403: Based on the result of the task adjustment necessity judgment, adjust the execution order of the unfinished tasks, determine the tasks that can be executed in advance according to the urgency and priority of the current tasks, and optimize the execution order of the core tasks to finally obtain the adjusted task scheduling plan.
7. The intelligent chip hardware resource allocation method according to claim 1, characterized in that: The steps for obtaining the optimized scheduling and task allocation scheme are as follows: Step 501: Based on the adjusted task scheduling plan, obtain the task time window and priority information, monitor and analyze the changes in task scheduling, and collect and update the resource requirements, execution time and other data of all relevant tasks. Based on this data, check whether the tasks are in line with the current resource allocation and determine whether there is an impact from changes in the time window. If there are changes, calculate the resource requirements for each task after the adjustment, and generate the resource requirement data for the adjusted tasks through this process. Step 502: Based on the adjusted task resource requirement data, assess the availability and resource allocation of the cores, obtain the current load of each core, calculate the maximum task load that each core can accept based on its processing capacity, compare the core availability for each task's requirements, determine whether the task can be successfully allocated, and generate a task and core availability matching result through this process. Step 503: Based on the availability matching results of tasks and cores, readjust the core scheduling scheme to ensure that each task can be assigned to a suitable core, further refine the core scheduling arrangement, update the task order and allocation information in the scheduling table, and generate an optimized core scheduling and task allocation scheme.
