Load balancing method, device, electronic device and storage medium for multi-core system
By performing load balancing on multi-core systems based on instances, the problems of high resource allocation complexity and high power consumption in existing technologies are solved, efficient load balancing and resource utilization are achieved, adapting to complex scenarios and reducing software load overhead.
Patent Information
- Application Number
- CN202210634093.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-06
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-06-06
AI Technical Summary
In the existing technology, the load balancing method of multi-core system is difficult to achieve effective resource allocation in complex scenarios, resulting in high power consumption and increased software complexity. In addition, the existing method is performed in threads, which requires a lot of development work.
Resource deployment is performed on an instance-by-instance basis. By obtaining the total number of instances and the deployment table, the instance deployment information of each core is obtained. Cache locality and time locality are used to improve operational efficiency, adapt to complex scenarios, and reduce software load overhead.
It achieves load balancing based on instances in multi-core systems, saves power consumption, improves operating efficiency, adapts to complex scenarios, reduces software complexity, and reduces development workload.
Smart Images

Figure CN114968589B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to load balancing technology, and in particular to a load balancing method, device, electronic device and storage medium for a multi-core system. Background Art
[0002] In related technologies, load balancing is typically achieved through static or dynamic deployment. However, static deployment is suitable for simple scenarios but difficult to adapt to more complex ones. Dynamic deployment increases software complexity and is generally performed on a thread-by-thread basis, requiring significant development effort. Summary of the Invention
[0003] The embodiments of the present application provide a load balancing method, device, electronic device, and storage medium for a multi-core system.
[0004] The load balancing method according to the embodiment of the present application includes: obtaining the total number of current instances, wherein the instance includes at least one thread;
[0005] Obtaining a deployment table based on the total number of the current instances, wherein the deployment table is used to represent the type distribution of the instances within the core and the maximum number of the instances;
[0006] According to the total number of the current instances and the deployment table, instance deployment information of each core is obtained.
[0007] The load balancing device of the embodiment of the present application includes:
[0008] A first processing module is configured to obtain a total number of current instances, wherein the instance includes at least one thread;
[0009] A second processing module is configured to obtain a deployment table according to the total number of the current instances, wherein the deployment table is used to represent the type distribution of the instances in the core and the maximum number of the instances;
[0010] The third processing module is used to obtain instance deployment information of each core according to the number of the current instances and the deployment table.
[0011] The electronic device of the embodiment of the present application includes one or more processors and a memory. The memory stores a computer program. When the computer program is executed by the processor, the steps of the load balancing method for the multi-core system described in the above embodiment are implemented.
[0012] The computer-readable storage medium of the embodiment of the present application stores a computer program thereon, and when the program is executed by a processor, the steps of the load balancing method for a multi-core system described in the above embodiment are implemented.
[0013] In the load balancing method, device, electronic device and storage medium of the above-mentioned multi-core system, resources can be deployed on an instance basis, and instance deployment information of each core can be obtained to provide a basis for load balancing. This not only saves power consumption, but also can adapt to more complex scenarios without causing excessive load overhead to the system software. In addition, resources with high correlation can be integrated into instances. In this way, resource deployment on an instance basis can also deepen the utilization of cache affinity and achieve higher operating efficiency.
[0014] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0016] Figure 1 is a flow chart of a load balancing method according to certain embodiments of the present application;
[0017] Figure 2 is a schematic diagram of an electronic device according to some embodiments of the present application;
[0018] Figure 3 is a schematic diagram of a load balancing device according to certain embodiments of the present application;
[0019] Figure 4 is a schematic diagram of a load balancing device according to certain embodiments of the present application;
[0020] Figure 5 is a schematic diagram of a deployment table of certain embodiments of the present application;
[0021] Figure 6 is a flow chart of a load balancing method according to certain embodiments of the present application;
[0022] Figure 7 is a schematic diagram of a load balancing device according to certain embodiments of the present application;
[0023] Figure 8 is a flow chart of a load balancing method according to certain embodiments of the present application;
[0024] Figure 9 is a schematic diagram of a load balancing device according to certain embodiments of the present application;
[0025] Figure 10 This is a schematic diagram of the correspondence between the number of carriers deployed in the core and the frequency gears in certain embodiments of the present application;
[0026] Figure 11This is a diagram illustrating the binding relationship between downlink instances and cores in static deployment;
[0027] Figure 12 This is a diagram of the instance distribution in a static deployment;
[0028] Figure 13 This is a schematic diagram of the instance distribution in the load balancing method of certain embodiments of the present application. DETAILED DESCRIPTION
[0029] The embodiments of the present application are described in detail below. Implementations of the embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present application.
[0030] In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly specifying the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of the embodiments of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0031] See also Figure 1 The load balancing method for a multi-core system according to an embodiment of the present application includes:
[0032] 01: Get the total number of current instances, where an instance includes at least one thread;
[0033] 02: Get the deployment table based on the total number of current instances. The deployment table is used to indicate the type distribution of instances within the core and the maximum number of instances.
[0034] 03: Get the instance deployment information for each core based on the total number of current instances and the deployment table.
[0035] See also Figure 2 and Figure 3 The load balancing device 30 of the multi-core system according to the embodiment of the present application includes a first processing module 31 , a second processing module 32 , and a third processing module 33 .
[0036] The load balancing method of the present application can be implemented by the load balancing device 30 of the embodiment of the present application, wherein step 01 can be implemented by the first processing module 31, step 02 can be implemented by the second processing module 32, and step 03 can be implemented by the third processing module 33. In other words, the first processing module 31 can be used to obtain the total number of current instances, wherein an instance includes at least one thread. The second processing module 32 can be used to obtain a deployment table based on the total number of current instances, wherein the deployment table is used to represent the type distribution of instances within the core and the maximum number of instances. The third processing module 33 can be used to obtain instance deployment information for each core based on the total number of current instances and the deployment table.
[0037] In the above-mentioned load balancing method and load balancing device 30, resources can be deployed on an instance basis, and instance deployment information of each core can be obtained to provide a basis for load balancing. This not only saves power consumption, but also adapts to more complex scenarios and does not cause excessive load overhead to the system software. In addition, resources with high correlation can be integrated into instances. In this way, resource deployment on an instance basis can also deepen the utilization of cache affinity and achieve higher operating efficiency.
[0038] In certain embodiments, the load balancing device 30 can be applied to an electronic device 100. The electronic device 100 can include a multi-core system. The electronic device 100 can include a smartphone, a tablet computer, a smartwatch, a smart bracelet, and other devices, which are not specifically limited herein. The electronic device 100 in the embodiments of this application is illustrated using a smartphone as an example, and this should not be construed as limiting this application.
[0039] In the related art, load balancing in multi-core systems is typically achieved through static or dynamic deployment. Specifically, static deployment binds a fixed number of threads to a designated core. Typically, threads performing related tasks are placed on the same core. Placing threads performing related tasks on the same core allows for faster cache availability of relevant data, code, and other information required for thread execution. This leverages the spatial and temporal locality of caches, accelerating program execution efficiency. Understandably, in more complex scenarios, it's common for many threads to be bound to some cores in a multi-core system, while few threads are bound to other cores. Static deployment struggles to achieve optimal load balancing and power savings. Dynamic deployment can include cycle balancing and idle balancing. In cycle balancing, the kernel traverses the entire domain hierarchy, checking each scheduling domain, starting with the current core's domain, to see if balancing is required. Balancing is performed when necessary. In idle balancing, idle balancing is performed once a core enters idle mode. However, dynamic deployment relies on a load balancing algorithm. To achieve optimal load, thread migrations may be frequent, increasing software complexity and incurring additional load overhead, making it difficult to meet the performance requirements of timing-critical scenarios. In addition, load balancing algorithms are usually based on threads, which requires a lot of software development work.
[0040] This application performs load balancing on an instance-by-instance basis, meaning that threads that perform related work can be marked as the same instance so that the threads that perform related work can be assigned to the same core for execution. Unlike static deployment, instances are not bound to specified cores, and the deployment of each core is obtained by looking up the deployment table based on the number of instances.
[0041] The deployment table can be in the form of a table or other forms, and this application does not impose specific limitations. It is understandable that the total number of instances varies, and the type distribution of instances within a core and the maximum number of instances vary. Therefore, based on the total number of current instances, a deployment table corresponding to the current total number of instances can be obtained, providing a basis for obtaining instance deployment information for each core. It is worth noting that the correspondence between the total number of current instances and the deployment table can be obtained through experiments, simulations, etc., and this application does not impose specific limitations.
[0042] It's worth noting that assigning instances of the same type to the same core increases processing speed. Therefore, the deployment table represents the type distribution of instances within the core, facilitating load balancing based on instance type and improving processing efficiency. Because load balancing can consider factors other than the total number of instances, the configuration table can indicate the maximum number of instances, facilitating balancing other factors while also considering the total number of instances.
[0043] This application uses a communication system as an example. Many threads in the system belong to a specific carrier. When threads belonging to the same carrier are deployed on the same core, when executing multiple threads belonging to the same carrier, the cache of related data, code, etc. can be located on the same core, that is, the spatial locality of the cache can be utilized to improve operational efficiency. In addition, under normal circumstances, threads belonging to the same carrier are processed after the threads belonging to other carriers are processed. Therefore, this can also utilize the temporal locality of the cache to improve operational efficiency. Therefore, threads belonging to the same carrier can be regarded as threads performing related work, and an instance can include all threads belonging to the same carrier. It is understandable that threads performing related work can belong to the same carrier or to different carriers. Therefore, an instance can also include multiple threads belonging to different carriers, and this application does not impose specific restrictions. Specifically, in the process of marking multiple threads as an instance, not only the number of carriers can be considered, but also factors such as the carrier attributes, NR (New Radio) or LTE (Long Term Evolution), and the primary carrier or secondary carrier can be considered to further balance the system load and save power.
[0044] In some embodiments, the load balancing method further includes:
[0045] Threads belonging to the same carrier are marked as an instance.
[0046] See also Figure 4 In some embodiments, the load balancing device 30 further includes a fourth processing module 34. The above steps can be implemented by the fourth processing module 34. That is, the fourth processing module 34 can be used to mark threads belonging to the same carrier as an instance.
[0047] In this way, it is convenient to allocate threads belonging to the same carrier to the same core.
[0048] In some embodiments, step 02 includes:
[0049] After creating a carrier and / or after deleting a carrier, get the total number of current instances.
[0050] In some implementations, the above steps may be implemented by the second processing module 32 , that is, the second processing module 32 may be configured to obtain the total number of current instances after a carrier is created and / or deleted.
[0051] In this way, the total number of current instances can be updated in a timely manner, providing a basis for updating the instance deployment information of each core.
[0052] Specifically, the number of instances will change after a carrier is created and / or deleted. Therefore, after a carrier is created and / or deleted, timely obtaining and updating the total number of current instances can provide a basis for updating the instance deployment information of each core. In addition, if the total number of instances is obtained too frequently, it will increase the complexity of the software and generate more additional load overhead. If the frequency of obtaining the total number of instances is too low, it will be difficult to achieve a good load balancing effect. Therefore, the present application obtains the total number of instances after creating and / or deleting a carrier, and can timely update the total number of instances, thereby reducing additional load overhead and achieving a better load balancing effect.
[0053] In some embodiments, the instances include uplink instances and downlink instances, and the deployment table is used within the core to represent the maximum number of uplink instances and the maximum number of downlink instances.
[0054] In this way, instances can be classified according to their functions, providing a basis for considering the functions of the instances when configuring the instances, thereby improving execution efficiency to a certain extent.
[0055] Specifically, in some embodiments, instances can be divided into uplink instances and downlink instances according to the type of instance, that is, the type distribution of instances within the core can be understood as the distribution of uplink instances and downlink instances within the core.
[0056] In one embodiment, please combine Figure 5 , Figure 5 The following table shows the deployment table for one uplink instance scenario and the deployment table for two uplink instance scenarios when the system includes four logical cores (i.e., core 0, core 1, core 2, and core 3). Figure 5 The table after "UL 1CC deployment table" in the upper part represents the deployment table for one uplink instance scenario. Figure 5The table after "UL 2CC deployment table" at the bottom represents the deployment table for the scenario of 2 uplink instances. In the figure, CORE represents core, and the numbers 0 to 3 below CORE ID represent core 0, core 1, core 2, and core 3 respectively. DL represents downlink instance, UL represents uplink instance, CC represents carrier, the number after uplink instance represents the maximum number of uplink instances that can be accommodated on the core, and the number after downlink instance represents the maximum number of downlink instances that can be accommodated on the core. Specifically, the deployment table in the scenario of one uplink instance indicates that core 1 can accommodate a maximum of 3 downlink instances, core 2 can accommodate 2 downlink instances, and core 3 can accommodate 2 downlink instances and 1 uplink instance; the deployment table in the scenario of two uplink instances indicates that core 1 can accommodate a maximum of 3 downlink instances, core 2 can accommodate a maximum of 3 downlink instances, and core 3 can accommodate a maximum of 1 downlink instance and 2 uplink instances. Core 0 can be reserved for other purposes, so Figure 5 The content of core 0 in the deployment table shown is independent of the number of uplink instances and the number of downlink instances, i.e. Figure 5 This application does not impose any specific restrictions on the content of core 0 in the deployment table shown.
[0057] It's worth noting that the deployment table includes the number of uplink and downlink instances that each core can contain, but does not specify the carriers associated with each uplink or downlink instance. This is because the creation and deletion of multiple carriers are not sequential, so the specific carriers deployed to each core cannot be determined before runtime; they can only be determined at runtime.
[0058] Furthermore, in some embodiments, step 03 includes:
[0059] According to the actual number of uplink instances, the actual number of downlink instances and the deployment table at runtime, the instance deployment information of each core is obtained, wherein the instance deployment information includes the number of uplink instances and carrier number mapping and the number of downlink instances and carrier number mapping.
[0060] In some embodiments, the above steps can be implemented by the third processing module 33, that is, the third processing module 33 can be used to obtain the instance deployment information of each core based on the actual number of uplink instances, the actual number of downlink instances and the deployment table at runtime, wherein the instance deployment information includes the number of uplink instances and carrier number mapping and the number of downlink instances and carrier number mapping.
[0061] In this way, the number of uplink instances and carrier number mapping and the number of downlink instances and carrier number mapping that should be deployed in each core can be obtained.
[0062] Specifically, for ease of understanding, the following examples are given. Figure 6 , the system includes four cores, and obtains three newly added downlink instances. The carrier numbers of the three newly added downlink instances are CC0, CC1 and CC2, where CC represents the carrier and the downlink instance is represented by the DL prefix. A new uplink instance is added. The carrier number of the newly added uplink instance is CC0 and the uplink instance is represented by the UL prefix. According to the total number of uplink instances is 3 and the total number of downlink instances is 1, the query is as follows Figure 5 In the deployment table shown in the figure, in the scenario of obtaining an uplink instance, core 1 can accommodate up to 3 downlink instances, core 2 can accommodate up to 2 downlink instances, and core 3 can accommodate up to 2 downlink instances and 1 uplink instance. According to the deployment strategy algorithm, the three newly added downlink instances are evenly distributed to cores 1, 2, and 3, that is, one downlink instance is deployed on each of cores 1, 2, and 3, and the newly added uplink instance is distributed to core 3. The final mapping relationship (i.e., instance deployment information) can be referred to Figure 6 . It is worth noting that when the uplink instances are usually distributed on the same core, in the process of obtaining the instance deployment information of each core, the number of downlink instances of each core can be calculated according to the deployment table, and since the uplink instances are distributed on the same core, the number of uplink instances of each core can be obtained by looking up in the deployment table without calculation. It can be understood that the deployment table can contain the maximum number of uplink instances and the number of downlink instances that can be accommodated in each core. Under the restrictions of the deployment table, the downlink instances can be allocated according to the deployment strategy algorithm. The deployment strategy algorithm can be obtained by simulation, experiment, etc., and this application does not make specific restrictions. It should be noted that in the process of obtaining the instance deployment information of each core, certain fixed instances that are not related to the carrier can also be mapped to the corresponding cores.
[0063] There are many ways to obtain the actual number of uplink instances and the actual number of downlink instances during runtime. In one embodiment, the actual number of uplink instances and the actual number of downlink instances can be obtained based on the conversion bitmap of the uplink carrier and the conversion bitmap of the downlink carrier.
[0064] It is worth noting that after obtaining the instance deployment information of each core, pre-deployment can be performed, that is, the upper-level module can perform corresponding preparations, such as waking up the sleeping core, increasing the core operating frequency, etc.
[0065] In some embodiments, the load balancing method further includes:
[0066] Control the configuration of the core based on the instance deployment information of the core and the current deployment information of the core.
[0067] See also Figure 7 In some embodiments, the load balancing device 30 includes a control module 35, and the above steps can be implemented by the control module 35, that is, the control module 35 can be used to control the configuration of the core based on the instance deployment information of the core and the current deployment information of the core.
[0068] In this way, the core configuration can be updated to achieve load balancing.
[0069] Specifically, the current deployment information of the core can represent the current load deployment status of each core.
[0070] Further, please combine Figure 8 In some embodiments, controlling the configuration of the core based on the instance deployment information of the core and the current deployment information of the core includes:
[0071] 041: If the instance deployment information of the core does not increase or decrease the number of instances compared to the current deployment information of the core, the configuration of the core remains unchanged;
[0072] 042: When the instance deployment information of the core increases instances and / or decreases instances compared to the current deployment information of the core, update the configuration of the core.
[0073] See also Figure 9 In some embodiments, the control module 35 includes a first control unit 351 and a second control unit 352. Step 41 can be implemented by the first control unit 351, and step 42 can be implemented by the second control unit 352. That is, the first control unit 351 can be used to keep the core configuration unchanged when the instance deployment information of the core does not increase or decrease the number of instances compared to the current deployment information of the core. The second control unit 352 can be used to update the core configuration when the instance deployment information of the core increases and / or decreases the number of instances compared to the current deployment information of the core.
[0074] In this way, instances with status changes can be processed accordingly to achieve load balancing.
[0075] Specifically, in some embodiments, updating the core configuration includes at least one of the following steps:
[0076] Create an instance in the kernel;
[0077] Delete the instance in the kernel;
[0078] Migrate instances from one core to another.
[0079] In some embodiments, the above steps can be implemented by the second control unit 352, that is, the second control unit 352 can be used to create an instance in the core; delete an instance in the core; and migrate an instance in the core to another core.
[0080] In this way, update and configuration operations can be implemented based on the instance deployment information of the core.
[0081] Specifically, when the instance deployment information of a core increases the number of instances compared to the current deployment information of the core, an instance can be created in the core. When the instance deployment information of a core decreases the number of instances compared to the current deployment information of the core, an instance can be deleted in the core. In some cases, an instance in a core can be migrated to another core. Specifically, for ease of understanding, the following example discusses the case of migrating an instance in a core to another core. In a certain embodiment, please combine Figure 5 In the deployment table shown in the upper part, when the number of downlink instances is seven and the number of uplink instances is one, the deployment can be carried out in the manner that core 1 includes three downlink instances, core 2 includes two downlink instances, and core 3 includes two downlink instances and one uplink instance. When the number of downlink instances is seven but the number of uplink instances becomes two, that is, when the number of downlink instances is seven and the number of uplink instances is two, the deployment can be carried out in the manner that core 1 includes three downlink instances, core 2 includes two downlink instances, and core 3 includes two downlink instances and one uplink instance. Figure 5 In the deployment table shown in the lower part, the maximum number of downlink instances that core 3 can accommodate becomes one, that is, at least one of the two downlinks in core 3 needs to be migrated to other cores. At this time, the core configuration is changed to core 1 including three downlink instances, core 2 including three downlink instances, and core 3 including one downlink instance and two uplink instances.
[0082] It is worth noting that when creating, deleting, or migrating, operations are not limited to the instance, but also include physical resources related to the instance, such as interrupts and peripherals.
[0083] In one embodiment, the system includes four logical cores. Figure 10 , Figure 10 Indicates the relationship between the frequency level and the number of instances deployed in the core. Figure 11 , Figure 11 Indicates the binding relationship between downlink instances and cores in static deployment. In the figure, DL represents downlink, CC represents carrier, CC0 to CC7 represent downlink instances with different carrier numbers, Core represents core, Core 1 to 3 represent three logical cores, and core 0 is reserved for other purposes. If static deployment is used, during system operation, after multiple carrier creation and deletion, the instance distribution at a certain moment will be as follows: Figure 12 As shown, due to the fixed mapping of instances and cores belonging to the same carrier, core 1 includes three downlink instances, which is obviously redundant with the other two cores. Therefore, the system operating frequency must be at gear 2 to meet the needs of all cores. In the same case, if the load balancing method of this application is used, the core configuration can be referred to Figure 13, instances can be evenly distributed across cores, and the system's operating frequency can be reduced to gear 1, effectively saving corresponding power.
[0084] See also Figure 2 The load balancing method of the embodiment of the present application can be implemented by the electronic device 100 of the embodiment of the present application. Specifically, the electronic device 100 includes one or more processors 50 and a memory 40. The memory 40 stores a computer program. When the computer program is executed by the processor 50, the steps of the load balancing method of any of the above embodiments are implemented.
[0085] For example, when the computer program is executed by the processor 50, the following steps of the load balancing method are implemented:
[0086] 01: Get the total number of current instances, where an instance includes at least one thread;
[0087] 02: Get the deployment table based on the total number of current instances. The deployment table is used to indicate the type distribution of instances within the core and the maximum number of instances.
[0088] 03: Get the instance deployment information for each core based on the total number of current instances and the deployment table.
[0089] It is understood that a computer program includes computer program code. The computer program code may be in source code form, object code form, executable file or some intermediate form, etc. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution medium, etc. The processor may be a central processing unit, or other general-purpose processor, digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc.
[0090] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0091] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0092] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A load balancing method, characterized in that: The load balancing method includes: Obtaining a total number of current instances, wherein the instance includes at least one thread, threads executing associated work are marked as the same instance, the threads executing associated work belong to different carriers, and the instance includes an uplink instance and a downlink instance; Obtaining a deployment table according to the total number of the current instances, wherein the deployment table is used to indicate a maximum number of the uplink instances and a maximum number of the downlink instances within a core, and does not indicate carriers of the uplink instances and the downlink instances; According to the actual number of uplink instances, the actual number of downlink instances and the deployment table at runtime, the instance deployment information of each core is obtained, wherein the instance deployment information includes the number of uplink instances and carrier number mapping and the number of downlink instances and carrier number mapping.
2. The load balancing method according to claim 1, wherein: The method of obtaining the number of current instances includes: After a carrier is created and / or after a carrier is deleted, the total number of the current instances is obtained.
3. The load balancing method according to claim 1, wherein: The load balancing method further includes: The configuration of the core is controlled according to the instance deployment information of the core and the current deployment information of the core.
4. The load balancing method according to claim 3, wherein: The controlling the configuration of the core according to the instance deployment information of the core and the current deployment information of the core includes: When the instance deployment information of the core does not increase or decrease the instance compared to the current deployment information of the core, keeping the configuration of the core unchanged; When the instance deployment information of the core increases the instance and / or decreases the instance compared to the current deployment information of the core, the configuration of the core is updated.
5. The load balancing method according to claim 4, wherein: Updating the configuration of the core comprises at least one of the following steps: creating the instance in the core; deleting the instance in the core; Migrate the instance in the core to another core.
6. A load balancing device for a multi-core system, characterized in that: The device comprises: A first processing module is configured to obtain a total number of current instances, wherein the instance includes at least one thread, threads that execute associated work are marked as the same instance, the threads that execute associated work belong to different carriers, and the instances include uplink instances and downlink instances; A second processing module is configured to obtain a deployment table based on the total number of the current instances, wherein the deployment table is used to indicate a maximum number of the uplink instances and a maximum number of the downlink instances in a core, and does not indicate carriers of the uplink instances and the downlink instances; The third processing module is used to obtain the instance deployment information of each core based on the actual number of uplink instances, the actual number of downlink instances and the deployment table at runtime, wherein the instance deployment information includes the number of uplink instances and carrier number mapping and the number of downlink instances and carrier number mapping.
7. An electronic device, characterized in that: The electronic device includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the load balancing method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the load balancing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Load balancing system and method, and equipment
CN113886072A