A method and device for allocating kernel timers in a multi-core system

By dynamically selecting the core with the least congestion degree to add timers in a multi-core system based on the timer mode and core load state, the problem of untimely execution caused by timer concentration is solved, and more efficient timer allocation and system burden reflection is achieved.

CN119046020BActive Publication Date: 2025-02-11WEAPON EQUIP RES INST OF CHINA NAT WEAPON EQUIP GRP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411541512.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-11
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

In multi-core systems, it is difficult for the prior art to accurately allocate timers, resulting in the timers concentrated on certain cores, untimely execution, and unable to effectively reflect the actual burden of the system.

Method used

By determining the timer mode (periodic or non-periodic), obtain the current load and state of each core, predict the load state when the timer is started, and select the core with the least congestion to add the timer.

Benefits of technology

The allocation efficiency of timers in multi-core systems is improved, ensuring that timers can be executed in a timely manner, and more accurately reflect the actual burden of the system, achieving the optimal effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046020B_ABST
    Figure CN119046020B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for allocating kernel timers in a multi-core system, and belongs to the technical field of multi-core systems. The method comprises: when the timer mode is a periodic timer, obtaining the period interval and period duration, and determining the current load and current state of each core; for each core, determining the load state of each core on the premise of adding a periodic timer, and selecting the core with the least congestion as the core to be deployed; when the timer mode is a non-periodic timer, determining the current load and current state of each core; based on the load state of all cores within a preset time period, selecting the core with the least congestion as the core to be deployed, and adding the non-periodic timer to the core to be deployed. The present invention improves the performance of selecting timers in a multi-core system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of multi-core systems, and in particular relates to a method and device for allocating kernel timers of a multi-core system. Background Art

[0002] In a multi-core system, each core can configure a timer according to the usage scenario and needs, so the system timer is often used. The timer is an important function of the system. When using a timer, you can specify the expiration time interval of the timer and the callback function to be executed after the time expires.

[0003] When allocating timers for a multi-core system, there is a phenomenon that the timers are concentrated on certain cores, resulting in untimely execution. Therefore, it is necessary to select which core to allocate the timer. In the prior art, there are usually two ways to allocate timers for a multi-core system. One way is to manually specify a specific core, and the timer adder explicitly specifies which core the timer is added to, or uses the core currently executing the timer addition. The other way is to select by the Linux system, and the selection method is that the Linux system selects which core the timer is added to.

[0004] The timer adder explicitly specifies which core the timer is added to. This requires the adder to have accurate information about the task allocation of each core in the multi-core system in order to maximize the performance of the multi-core system. If the adder cannot know the operating status of the system's multi-cores, it cannot accurately specify which core to run the timer on. This may have the opposite effect, causing a large number of timers to be added to the same core, resulting in them not being executed in a timely manner.

[0005] The current core for adding timers is used, and the current code execution path is determined by which core the user-mode process is assigned to if the interrupt is triggered by a user-mode process; if it is triggered by a hardware interrupt, it is determined by which core the interrupt system is assigned to. Either way does not reflect the actual load of the current system, so the actual effect cannot be optimal.

[0006] The current system provides very limited options, which is similar to polling in the available multi-cores. Although this method has a certain effect, it still cannot accurately reflect the actual load of the current system, so the actual effect cannot be optimal. Summary of the invention

[0007] The present invention proposes a multi-core system kernel timer allocation method and device, which are used to solve the technical problem of existing multi-core system kernel timer allocation.

[0008] A first aspect of the present invention provides a method for allocating kernel timers in a multi-core system, the method comprising:

[0009] Determine a timer mode, wherein the timer mode includes a periodic timer and an aperiodic timer;

[0010] Among them, when the timer mode is periodic timer:

[0011] Obtain the cycle interval T1 and cycle duration T2 to determine the current load and current state of each core; the cycle interval is the interval duration between two cycles, and the cycle duration is the duration of one cycle;

[0012] For each core, the periodic timer is added, and based on the current load, period interval T1 and period duration T2 of each core, the load state of the core is predicted when each periodic timer starts.

[0013] Based on the load status of all cores, selecting a core with the least congestion as a core to be deployed, and adding the periodic timer to the core to be deployed;

[0014] The same periodic timer has multiple start times;

[0015] Among them, when the timer mode is a non-periodic timer:

[0016] Determine the current load and current status of each core;

[0017] For each core, the non-periodic timer is added, and based on the current load of each core, the load state of the core within a preset time period is determined when the non-periodic timer start time is reached;

[0018] Based on the load status of all cores within a preset time period, a core with the least congestion is selected as a core to be deployed, and the non-periodic timer is added to the core to be deployed.

[0019] Preferably, in the method, the timer mode also includes a specified mode, in which the timer is added to a specific core specified by the user by calling system parameters of the multi-core system.

[0020] Preferably, in the method:

[0021] Deploy a callback function for each core in the multi-core system, and determine the time that the core is occupied when the timer is run on the core based on the callback function;

[0022] The callback function is a function called by the timer when the timer start time is exceeded.

[0023] Based on the callback function, determine the time that the core is occupied when the timer is run on the core;

[0024] The determining of the time that the core is occupied when the timer is run on the core specifically includes: estimating the running time of the callback function based on the state of the core, and using the running time as the time that the core is occupied.

[0025] Preferably, in the method, the running time of the callback function is obtained multiple times and an average is calculated, and the average is used as the time occupied by the core.

[0026] Preferably, in the method, the current load of each core is calculated as follows: the running time of the timer / the cycle duration T2.

[0027] Preferably, in the method, based on the load status of all cores, a core with the least congestion is selected as a core to be deployed, and the periodic timer is added to the core to be deployed; wherein:

[0028] If some cores are in a non-crowded state, then among the cores in a non-crowded state, the core with the lowest load is used as the core with the least congestion;

[0029] If all cores are in a crowded state, the core whose callback function occupies the least time is taken as the core with the least congestion;

[0030] Among them, the first preset threshold is used as the judgment basis for the congested state and the non-congested state. The first preset threshold is dynamically adjusted. The first preset threshold is set according to historical experience or determined according to historical data; the core whose load is greater than the first preset threshold is a core in a congested state, and the core whose load is less than or equal to the first preset threshold is a core in a non-congested state.

[0031] A second aspect of the present invention provides a multi-core system kernel timer allocation device, the device comprising:

[0032] The mode determination module is configured to: determine a timer mode, wherein the timer mode includes a periodic timer and a non-periodic timer;

[0033] The periodic timing module is configured to, when the timer mode is the periodic timer:

[0034] Obtain the cycle interval T1 and cycle duration T2 to determine the current load and current state of each core; the cycle interval is the interval duration between two cycles, and the cycle duration is the duration of one cycle;

[0035] For each core, the periodic timer is added, and based on the current load, period interval T1 and period duration T2 of each core, the load state of the core is predicted when each periodic timer starts.

[0036] Based on the load status of all cores, a core with the least congestion is selected as a core to be deployed, and the periodic timer is added to the core to be deployed; the same periodic timer has multiple start times;

[0037] The non-periodic timing module is configured as follows:

[0038] Determine the current load and current status of each core;

[0039] For each core, the non-periodic timer is added, and based on the current load of each core, the load state of the core within a preset time period is determined when the non-periodic timer start time is reached;

[0040] Based on the load status of all cores within a preset time period, a core with the least congestion is selected as a core to be deployed, and the non-periodic timer is added to the core to be deployed.

[0041] Preferably, the timer mode also includes a specified mode, in which the timer is added to a specific core specified by the user by calling the system parameters of the multi-core system.

[0042] Preferably, a callback function is deployed for each core in the multi-core system, and based on the callback function, the time occupied by the core when the timer is run on the core is determined;

[0043] The callback function is a function called by the timer when the timer start time is exceeded.

[0044] Based on the callback function, determine the time that the core is occupied when the timer is run on the core;

[0045] The determining of the time that the core is occupied when the timer is run on the core specifically includes: estimating the running time of the callback function based on the state of the core, and using the running time as the time that the core is occupied.

[0046] Preferably, the running time of the callback function is obtained multiple times and an average is calculated, and the average is used as the time occupied by the core.

[0047] Preferably, the current load of each core is calculated as follows: the running time of the timer / the cycle length T2.

[0048] Preferably, based on the load status of all cores, a core with the least congestion is selected as the core to be deployed, and the periodic timer is added to the core to be deployed; wherein:

[0049] If some cores are in a non-crowded state, then among the cores in a non-crowded state, the core with the lowest load is used as the core with the least congestion;

[0050] If all cores are in a crowded state, the core whose callback function occupies the least time is taken as the core with the least congestion;

[0051] Among them, the first preset threshold is used as the judgment basis for the congested state and the non-congested state. The first preset threshold is dynamically adjusted. The first preset threshold is set according to historical experience or determined according to historical data; the core whose load is greater than the first preset threshold is a core in a congested state, and the core whose load is less than or equal to the first preset threshold is a core in a non-congested state.

[0052] A third aspect of the present invention provides an electronic device, the electronic device comprising:

[0053] at least one processor; and

[0054] a memory communicatively connected to the at least one processor; wherein,

[0055] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.

[0056] A fourth aspect of the present invention provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0057] The present invention improves the performance of selecting timers in a multi-core system by counting the execution time of the timer callback function and predicting the congestion of each core when adding a timer. The present invention obtains the expected execution time of the callback function specified in the timer by continuously counting the execution of the callback function, and more accurately estimates the congestion.

[0058] In addition, the present invention takes into account the impact of subsequent cycles on other timers for periodic timers that specify specific cores. When there are multiple cores that are not crowded, the present invention selects the core with the lowest load on the designated core timer, and copes with the impact of other higher priority events through load sharing. When all cores are crowded, the present invention selects the core with the smallest sum of the running time of the timer callback function to minimize the loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A schematic diagram of a flow chart of a multi-core system kernel timer allocation method provided by the present invention;

[0060] Figure 2 A schematic diagram of the architecture of a multi-core system kernel timer allocation device provided by the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0062] Figure 1 FIG. 1 shows a schematic diagram of a multi-core system core timer allocation method. Figure 1 As shown, the method includes:

[0063] Determine a timer mode, wherein the timer mode includes a periodic timer and an aperiodic timer;

[0064] Among them, when the timer mode is periodic timer:

[0065] Obtain the cycle interval T1 and cycle duration T2 to determine the current load and current state of each core; the cycle interval is the interval duration between two cycles, and the cycle duration is the duration of one cycle;

[0066] For each core, the periodic timer is added, and based on the current load, period interval T1 and period duration T2 of each core, the load state of the core is predicted when each periodic timer starts.

[0067] Based on the load status of all cores, selecting a core with the least congestion as a core to be deployed, and adding the periodic timer to the core to be deployed;

[0068] The same periodic timer has multiple start times;

[0069] Among them, when the timer mode is a non-periodic timer:

[0070] Determine the current load and current status of each core;

[0071] For each core, the non-periodic timer is added, and based on the current load of each core, the load state of the core within a preset time period is determined when the non-periodic timer start time is reached;

[0072] Based on the load status of all cores within a preset time period, a core with the least congestion is selected as a core to be deployed, and the non-periodic timer is added to the core to be deployed.

[0073] In the present invention, the periodic timer refers to a timer that is added and executed periodically, and the non-periodic timer is a timer that is executed only once. The periodic timer is designated as a periodic timer by a user inputting parameters.

[0074] Furthermore, the timer mode also includes a specified mode, in which the timer is added to a specific core specified by the user by calling the system parameters of the multi-core system.

[0075] For timers that are not explicitly designated as periodic timers by the user, they are considered to be non-periodic timers.

[0076] In the present invention, a callback function is deployed for each core in a multi-core system, and based on the callback function, the time occupied by the core when a timer is run on the core is determined;

[0077] The callback function is a function called by the timer when the timer start time is exceeded.

[0078] Based on the callback function, determine the time that the core is occupied when the timer is run on the core;

[0079] The determining of the time that the core is occupied when the timer is run on the core specifically includes: estimating the running time of the callback function based on the state of the core, and using the running time as the time that the core is occupied.

[0080] Furthermore, the running time of the callback function is obtained multiple times and an average is calculated, and the average is used as the time of occupying the core.

[0081] In the present invention, for the callback function specified when adding the timer, the running time is counted when it is running. When calculating the running time of the callback function, the net execution time is obtained, that is, it is not the difference between the start and end time of the function, but the time that the function occupies the core, that is, the actual time of scheduling execution.

[0082] For each callback function, its statistical running time is maintained independently. To adapt to the changes in the callback function execution time, the most recent N calls are counted and the average value is taken for statistics. N is a configurable parameter of the system.

[0083] After the system has been running for a period of time, most timer callback functions can obtain relatively accurate running time.

[0084] The operation of timers requires CPU time. If there are too many timers on a core, or its callback function runs too long, exceeding the processing capacity of the core, the processing of its timers will be delayed.

[0085] Furthermore, the current load of each core is calculated as follows: the running time of the timer / the cycle length T2.

[0086] In the present invention, the load calculation method is: for a periodic timer of a specified core, its occupancy is the running time of its callback function / timer period. For example, if a timer runs once every 10 milliseconds and each time runs for 1 millisecond, its occupancy is 0.1. For a core, its load is the sum of the occupancy of the periodic timers of the specified cores running on it.

[0087] When adding a timer, calculate the congestion when its timer expires.

[0088] In order to handle the situation where the overall load of a core is not high but the timers are too concentrated at a certain point in time, it is necessary to count the time points at which the timers expire to see if there is timer congestion. For example, if the sum of the expected running time of the callback functions of the expired timers of a core at a certain point in time exceeds the time period of the timer of the system, it is considered to be congested at this moment.

[0089] For a periodic timer with a specified core, it is necessary to consider not only its most recent expiration at the current time point, but also whether the expiration time point of its subsequent period will collide with the expiration time point of the added timer.

[0090] Furthermore, based on the load status of all cores, a core with the least congestion is selected as a core to be deployed, and the periodic timer is added to the core to be deployed; wherein:

[0091] If some cores are in a non-crowded state, then among the cores in a non-crowded state, the core with the lowest load is used as the core with the least congestion;

[0092] If all cores are in a crowded state, the core whose callback function occupies the least time is taken as the core with the least congestion;

[0093] Among them, the first preset threshold is used as the judgment basis for the congested state and the non-congested state. The first preset threshold is dynamically adjusted. The first preset threshold is set according to historical experience or determined according to historical data; the core whose load is greater than the first preset threshold is a core in a congested state, and the core whose load is less than or equal to the first preset threshold is a core in a non-congested state.

[0094] In the present invention, when adding a timer, the core to be run is dynamically selected based on the load of each core and the timer expiration congestion. If adding the timer will cause timer expiration congestion in some cores, but not in other cores, the core that will not be congested is preferred. If all cores will experience expiration congestion, the core with the smallest sum of the expiration time of the timer callback function is preferred. If multiple cores will not experience expiration congestion, the core with the lowest timer load is selected.

[0095] The present invention can distinguish between one-time timers and periodic timers. For a periodic timer of a specified core, the influence of its subsequent period on other timers is considered. Therefore, the same periodic timer has multiple start times. The present invention can count the execution time of the timer callback function to obtain its average running time. When adding a timer, the present invention calculates the congestion of multiple cores at the time point and tries to avoid the core that causes congestion.

[0096] The following is a description of the device for executing the present invention. The specific implementation process and technical effects are as mentioned above and will not be repeated below.

[0097] Optionally, an embodiment of the present invention provides a device, such as Figure 2 As shown, the device comprises:

[0098] The mode determination module is configured to: determine a timer mode, wherein the timer mode includes a periodic timer and a non-periodic timer;

[0099] The periodic timing module is configured to, when the timer mode is the periodic timer:

[0100] Obtain the cycle interval T1 and cycle duration T2 to determine the current load and current state of each core; the cycle interval is the interval duration between two cycles, and the cycle duration is the duration of one cycle;

[0101] For each core, the periodic timer is added, and based on the current load, period interval T1 and period duration T2 of each core, the load state of the core is predicted when each periodic timer starts.

[0102] Based on the load status of all cores, a core with the least congestion is selected as a core to be deployed, and the periodic timer is added to the core to be deployed; the same periodic timer has multiple start times;

[0103] The non-periodic timing module is configured as follows:

[0104] Determine the current load and current status of each core;

[0105] For each core, the non-periodic timer is added, and based on the current load of each core, the load state of the core within a preset time period is determined when the non-periodic timer start time is reached;

[0106] Based on the load status of all cores within a preset time period, a core with the least congestion is selected as a core to be deployed, and the non-periodic timer is added to the core to be deployed.

[0107] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0108] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0109] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in the present invention.

[0110] It should be noted that the above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For example, when a module is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0111] The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0112] The present invention also provides a program product, such as a computer-readable storage medium, comprising a program, which is used to perform the above method embodiment when executed by a processor.

[0113] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0116] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access memory (English: Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program codes.

Claims

1. A method for allocating kernel timers in a multi-core system, characterized in that: The method comprises: Determine a timer mode, wherein the timer mode includes a periodic timer and an aperiodic timer; Among them, when the timer mode is periodic timer: Obtain the cycle interval T1 and cycle duration T2 to determine the current load and current state of each core; the cycle interval is the interval duration between two cycles, and the cycle duration is the duration of one cycle; For each core, the periodic timer is added, and based on the current load, period interval T1 and period duration T2 of each core, the load state of the core is predicted when each periodic timer starts. Based on the load status of all cores, selecting a core with the least congestion as a core to be deployed, and adding the periodic timer to the core to be deployed; The same periodic timer has multiple start times; Among them, when the timer mode is a non-periodic timer: Determine the current load and current status of each core; For each core, the non-periodic timer is added, and based on the current load of each core, the load state of the core within a preset time period is determined when the non-periodic timer start time is reached; Based on the load status of all cores within a preset time period, a core with the least congestion is selected as a core to be deployed, and the non-periodic timer is added to the core to be deployed; Wherein, a callback function is deployed for each core in the multi-core system, and based on the callback function, the time occupied by the core when the timer is run on the core is determined; The callback function is a function called by the timer when the timer start time is exceeded. The step of determining the time that the core is occupied when the timer is run on the core specifically includes: estimating the running time of the callback function based on the state of the core, and using the running time as the time that the core is occupied; Based on the load status of all cores, a core with the least congestion is selected as a core to be deployed, and the periodic timer is added to the core to be deployed; wherein: If some cores are in a non-crowded state, then among the cores in a non-crowded state, the core with the lowest load is used as the core with the least congestion; If all cores are in a crowded state, the core whose callback function occupies the least time is taken as the core with the least congestion; Among them, the first preset threshold is used as the judgment basis for the congested state and the non-congested state. The first preset threshold is dynamically adjusted. The first preset threshold is set according to historical experience or determined according to historical data; the core whose load is greater than the first preset threshold is a core in a congested state, and the core whose load is less than or equal to the first preset threshold is a core in a non-congested state.

2. The method according to claim 1, characterized in that In the method, the timer mode also includes a specified mode, in which the timer is added to a specific core specified by a user by calling a system parameter of the multi-core system.

3. The method according to claim 1, characterized in that In the method, the running time of the callback function is obtained multiple times and an average is calculated, and the average is used as the time of occupying the core.

4. The method according to claim 1, characterized in that In the method, the current load of each core is calculated as follows: the running time of the timer / the cycle length T2.

5. A multi-core system kernel timer allocation device for implementing the multi-core system kernel timer allocation method as claimed in claim 1, characterized in that: The device comprises: The mode determination module is configured to: determine a timer mode, wherein the timer mode includes a periodic timer and a non-periodic timer; The periodic timing module is configured to, when the timer mode is the periodic timer: Obtain the cycle interval T1 and cycle duration T2 to determine the current load and current state of each core; the cycle interval is the interval duration between two cycles, and the cycle duration is the duration of one cycle; For each core, the periodic timer is added, and based on the current load, period interval T1 and period duration T2 of each core, the load state of the core is predicted when each periodic timer starts. Based on the load status of all cores, a core with the least congestion is selected as a core to be deployed, and the periodic timer is added to the core to be deployed; the same periodic timer has multiple start times; The non-periodic timing module is configured as follows: Determine the current load and current status of each core; For each core, the non-periodic timer is added, and based on the current load of each core, the load state of the core within a preset time period is determined when the non-periodic timer start time is reached; Based on the load status of all cores within a preset time period, a core with the least congestion is selected as a core to be deployed, and the non-periodic timer is added to the core to be deployed.

6. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-core timer implementation method and multi-core system

    CN106020333A

  • Load balancing method and apparatus of multi-core CPU

    CN106713185A