Operation mode adjustment method, device, computer equipment and storage medium
By managing the use of the nuclear nuclear nuclear nuclear nuclear nuclear use, it is determined to meet the various monitoring conditions and adjust the operating mode, solve the problem of large energy consumption and waste of resources, and realize the optimization of energy consumption and resource saving.
Patent Information
- Application Number
- CN202411347151.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-26
AI Technical Summary
Servers consume a lot of energy, resulting in waste of resources.
By managing the use of the utilization of each nuclear cycle, the number of targets and utilization of the working nuclear is determined, and determine whether the multi -core processor meets multiple monitoring conditions, and then adjust the operating mode to reduce energy consumption.
A real -time adjustment of the operating mode of the multi -core processor is realized to avoid running the operation mode with high energy -consuming operations during business free, reducing waste of resources and saving electricity.
Smart Images

Figure CN118860805B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to an operation mode adjustment method, device, computer equipment, storage medium and program product. Background Art
[0002] With the continuous development of the Internet, the amount of network data has increased exponentially over the years. The storage and access of data requires a large number of servers, and the operation of servers requires a large amount of electricity. The production of electricity usually relies on limited natural resources, such as coal, hydropower and wind power.
[0003] In current business processing, in order to ensure timely processing of requests from clients, the major platforms generally run the central processing unit (CPU) at full load, which results in high energy consumption of the server and serious waste of resources. Summary of the invention
[0004] In view of this, the present invention provides an operation mode adjustment method, apparatus, computer equipment, storage medium and program product to solve the problems of high energy consumption and resource waste of the server.
[0005] In a first aspect, the present invention provides an operation mode adjustment method, the method is applied to a multi-core processor, the multi-core processor includes a management core and at least one service core, the method is executed by the management core, and the method includes:
[0006] In the current collection cycle, obtaining the utilization rate of each core of the multi-core processor;
[0007] Determining a target number of working cores in the multi-core processor that are in working state according to the utilization rate of each of the cores;
[0008] Determining whether the multi-core processor meets a target monitoring condition according to the target number and the utilization rate of each of the working cores, wherein the target monitoring condition is any one of a plurality of monitoring conditions corresponding to the target number;
[0009] When it is determined that the multi-core processor satisfies the target monitoring condition, acquiring an operation mode setting rule corresponding to the target monitoring condition according to the target monitoring condition;
[0010] The operating mode of at least one core in the multi-core processor is adjusted according to an operating mode setting rule corresponding to the target monitoring condition.
[0011] The operating mode adjustment method provided by the present invention has the following advantages:
[0012] The management core periodically collects the utilization of each core, and determines the working cores based on the utilization. Then, based on the target number of working cores and the utilization of each working core, it determines whether the multi-core processor meets one of the multiple monitoring conditions. When any monitoring condition is met, the operating mode of the multi-core processor can be adjusted according to the operating mode setting rules corresponding to the met target monitoring condition. In this way, by setting multiple monitoring conditions and adjusting the operating mode of the multi-core processor in real time according to the met monitoring conditions, the operating mode of the multi-core processor can be adjusted according to the actual situation, which can avoid the problem of running in a high-energy-consuming operating mode when the business is idle, that is, it can reduce resource waste and save electricity.
[0013] In an optional implementation, determining whether the multi-core processor meets a target monitoring condition according to the target number and the utilization rate of each of the working cores includes:
[0014] When it is determined that the target number is less than or equal to a first preset number threshold, obtaining a first monitoring condition and a second monitoring condition, and a target operating mode of the management core in the current acquisition cycle, wherein the target monitoring condition is the first monitoring condition or the second monitoring condition, and the target operating mode is a normal operating mode or a first-level energy-saving operating mode;
[0015] When the target operation mode is the normal operation mode, determining whether the multi-core processor satisfies the first monitoring condition according to the utilization rate of each of the working cores;
[0016] or,
[0017] When the target operation mode is the first-level energy-saving operation mode, it is determined whether the multi-core processor meets the second monitoring condition according to the utilization rate of each of the working cores.
[0018] Specifically, in different operation modes of the management core, different monitoring conditions are adopted, which can achieve fine division of the working state of the multi-core processor, facilitate subsequent adjustment of the operation mode, and further achieve fine control of the operation mode.
[0019] In an optional implementation, when the target operation mode is the normal operation mode, determining whether the multi-core processor satisfies the first monitoring condition according to the utilization rate of each of the working cores includes:
[0020] Determining whether the utilization rate of each of the working cores is less than a preset third-level energy-saving threshold;
[0021] When it is determined that the utilization rate of each of the working cores is less than the third-level energy-saving threshold, the count value of the first period statistical parameter corresponding to the first monitoring condition is increased by a preset value;
[0022] Determining whether the count value of the first period statistical parameter is equal to a second preset quantity threshold;
[0023] When it is determined that the count value of the first period statistical parameter is equal to the second preset number threshold, it is determined that the multi-core processor meets the first monitoring condition.
[0024] Specifically, since this scheme corresponds to the regulation of entering the energy-saving mode, therefore, by repeatedly determining that the utilization rate of each working core is less than the third level energy-saving threshold, it can be considered that the multi-core processor is idle for a period of time. At this time, it is considered that the first monitoring condition is met, and the energy-saving mode is regulated. This can avoid frequent changes in business volume in a short period of time, resulting in the need to switch the operating mode back and forth multiple times.
[0025] In an optional implementation, when the target operation mode is the first-level energy-saving operation mode, determining whether the multi-core processor satisfies the second monitoring condition according to the utilization rate of each of the working cores includes:
[0026] Determining whether there is any working core whose utilization is greater than a preset first-level exit energy saving threshold;
[0027] When it is determined that the utilization rate of any of the working cores is greater than the first-level exit energy saving threshold, it is determined that the multi-core processor meets the second monitoring condition.
[0028] Specifically, since this solution corresponds to the regulation of exiting the energy-saving mode, that is, the business volume of the multi-core processor increases, more cores are required to participate in the work. In this case, once it is determined that the utilization rate of any working core is greater than the first-level exit energy-saving threshold, more cores can be immediately regulated to enter the working state to complete the business processing in time.
[0029] In an optional implementation, when it is determined that the target number is greater than the first preset number threshold and is less than or equal to the total number of cores of the multi-core processor, the method further includes:
[0030] Acquiring a third monitoring condition, a fourth monitoring condition, and a fifth monitoring condition;
[0031] Determining whether the multi-core processor satisfies the third monitoring condition according to the utilization rate of each of the working cores;
[0032] When it is determined that the multi-core processor does not satisfy the third monitoring condition, determining a first utilization rate according to the utilization rate of each of the working cores and the target number;
[0033] determining, according to the first utilization rate, whether the multi-core processor satisfies the fourth monitoring condition;
[0034] When it is determined that the multi-core processor does not meet the fourth monitoring condition, calculating a second utilization rate according to the utilization rate of each of the working cores, the target number and a third preset number threshold;
[0035] Determine whether the multi-core processor satisfies the fifth monitoring condition according to the first utilization and the second utilization.
[0036] Specifically, by setting a variety of monitoring conditions, it is possible to achieve a fine division of the working state of the multi-core processor, facilitate the subsequent adjustment of the operating mode, and further achieve fine-grained regulation of the operating mode.
[0037] In an optional implementation, determining whether the multi-core processor satisfies the third monitoring condition according to the utilization rate of each of the working cores includes:
[0038] Determining whether there is any working core whose utilization is greater than a preset third-level exit energy saving threshold;
[0039] When it is determined that the utilization rate of any of the working cores is greater than the third-level exit energy saving threshold, it is determined that the multi-core processor meets the third monitoring condition.
[0040] Specifically, since this solution corresponds to the regulation of exiting the energy-saving mode, that is, the business volume of the multi-core processor increases, more cores are required to participate in the work. In this case, once it is determined that the utilization rate of any working core is greater than the third-level exit energy-saving threshold, more cores can be immediately regulated to enter the working state to complete the business processing in time.
[0041] In an optional implementation manner, determining whether the multi-core processor satisfies the fourth monitoring condition according to the first utilization rate includes:
[0042] Determining whether the first utilization rate is greater than a preset secondary exit energy saving threshold;
[0043] When it is determined that the first utilization rate is greater than the second-level energy-saving exit threshold, a preset value is added to the count value of the second period statistical parameter corresponding to the fourth monitoring condition;
[0044] Determining whether the count value of the second period statistical parameter is equal to a fourth preset quantity threshold;
[0045] When it is determined that the count value of the second period statistical parameter is equal to the fourth preset quantity threshold, it is determined that the multi-core processor meets the fourth monitoring condition.
[0046] Specifically, since this solution corresponds to the regulation of exiting the energy-saving mode, that is, the business volume of the multi-core processor increases, and more cores are required to participate in the work, in this case, the overall processing status of the multi-core processor (the first utilization rate) can be determined first, and when the first utilization rate is greater than the second-level exit energy-saving threshold for multiple times, more cores can be regulated to enter the state, which can avoid multiple adjustments and controls, resulting in waste of resources.
[0047] In an optional implementation, determining whether the multi-core processor satisfies the fifth monitoring condition according to the first utilization and the second utilization includes:
[0048] Determining whether the first utilization rate is less than a preset first-level energy-saving threshold, and whether the second utilization rate is less than a preset second-level energy-saving threshold;
[0049] When it is determined that the first utilization rate is less than the first level energy-saving threshold, and the second utilization rate is less than the second level energy-saving threshold, the count value of the third period statistical parameter corresponding to the fifth monitoring condition is increased by a preset value;
[0050] Determining whether the count value of the third period statistical parameter is equal to a fifth preset quantity threshold;
[0051] When it is determined that the count value of the third period statistical parameter is equal to the fifth preset quantity threshold, it is determined that the multi-core processor meets the fifth monitoring condition.
[0052] Specifically, since this scheme corresponds to the regulation of entering the energy-saving mode, therefore, when it is determined multiple times that the first utilization rate is less than the first-level energy-saving threshold, it can be considered that the multi-core processor is idle for a period of time. At this time, it is considered that the fifth monitoring condition is met, and the energy-saving mode is regulated. This can avoid the problem of frequent changes in business volume in a short period of time, resulting in the need to switch the operating mode back and forth multiple times.
[0053] In an optional implementation, when the target monitoring condition is the first monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes:
[0054] Setting the operation mode of each working core to a first-level energy-saving operation mode;
[0055] The other cores in the multi-core processor except the working core are all set to the third level energy-saving operation mode.
[0056] Specifically, since the first monitoring condition corresponds to a reduction in the traffic of the multi-core processor, energy consumption can be reduced to the greatest extent by adjusting all cores to a more advanced energy-saving operation mode.
[0057] In an optional implementation, when the target monitoring condition is the second monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes:
[0058] The operation mode of each working core is set to the normal operation mode.
[0059] Specifically, since the second monitoring condition corresponds to the increase in the business volume of the multi-core processor, the existing working cores are unable to efficiently execute the business. Therefore, by setting the operating mode of each working core to the normal operating mode, the working core can enter the efficient operating mode first without adjusting other non-working cores, which can both ensure the timely execution of the business and reduce energy consumption.
[0060] In an optional implementation, when the target monitoring condition is the third monitoring condition or the fourth monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes:
[0061] Determine whether there is a non-working core in a non-working state;
[0062] When it is determined that there is at least one non-working core, obtaining a sequence number of each non-working core;
[0063] Determine a minimum sequence number value according to the sequence number of each of the non-working cores;
[0064] Setting the first non-working core corresponding to the minimum sequence number value to a normal operating mode;
[0065] When the number of the non-working core is not one, obtaining a first mode indicator value corresponding to the normal operating mode;
[0066] Determine the mode index value of the m+1th non-working core according to the mode index value of the mth non-working core and a preset calculation rule, wherein m is greater than or equal to the minimum sequence number value and less than the total number of cores, and when the mth non-working core is the first non-working core, the mode index value of the mth non-working core is the first mode index value;
[0067] The operation mode of the second non-working core is set according to the mode indicator value of the second non-working core, wherein the second non-working core is any non-working core among at least one of the non-working cores except the first non-working core.
[0068] Specifically, by activating the non-working cores in order of sequence numbers, it is possible to ensure that the cores are activated in an orderly manner, thereby avoiding system performance fluctuations or resource waste that may be caused by disorderly activation.
[0069] In an optional implementation, when the target monitoring condition is the fifth monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes:
[0070] Get the serial number of each working core;
[0071] Determine a maximum sequence number value according to the sequence number of each of the working cores;
[0072] The target working core corresponding to the maximum sequence number value is set to the second-level energy-saving operation mode.
[0073] Specifically, by setting a portion of cores to the secondary energy-saving operation mode, power consumption can be reduced while meeting basic performance requirements.
[0074] In an optional implementation, when the target monitoring condition is the third monitoring condition or the fourth monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes:
[0075] Determining whether the target number is greater than or equal to a sixth preset number threshold, wherein the sixth preset number threshold is greater than the first preset number threshold and less than the total number of cores;
[0076] When it is determined that the target quantity is less than the sixth preset quantity threshold, determining an adjustment quantity according to the target quantity and the sixth preset quantity threshold;
[0077] According to the adjusted number, setting the non-working cores of a number equal to the adjusted number to a normal operating mode;
[0078] or,
[0079] When it is determined that the target number is greater than or equal to the third preset number threshold, determining the number of non-working cores according to the total number of cores and the target number;
[0080] Determining whether the number of the non-working cores is greater than or equal to a seventh preset number threshold;
[0081] When it is determined that the number of the non-working cores is greater than or equal to a seventh preset number threshold, the non-working cores having a number equal to the seventh preset number threshold are set to the normal operating mode.
[0082] Specifically, this solution can dynamically adjust the number of working cores according to the actual task load, avoiding the problem of excess or insufficient performance that may be caused by static configuration.
[0083] In an optional implementation, when it is determined that the multi-core processor does not satisfy all monitoring conditions among the multiple monitoring conditions corresponding to the target number, the method further includes:
[0084] Entering a next acquisition cycle corresponding to the current acquisition cycle, and clearing the count value of each of the multiple cycle statistical parameters.
[0085] Specifically, by regularly clearing periodic statistical parameters, performance decision deviations caused by old data can be avoided, ensuring that the management core always makes performance adjustments based on the latest operating conditions. This helps maintain the optimal performance level, especially in application scenarios where the load changes frequently.
[0086] In an optional embodiment, the operating mode includes multiple ones of a normal operating mode, a first-level energy-saving operating mode, a second-level energy-saving operating mode and a third-level energy-saving operating mode, and the power consumption of the normal operating mode, the power consumption of the first-level energy-saving operating mode, the power consumption of the second-level energy-saving operating mode and the power consumption of the third-level energy-saving operating mode decrease in sequence.
[0087] Specifically, by setting multiple operation modes, rather than simply adjusting to run or not run, fine-grained adjustments can be made according to the actual situation of the multi-core processor, which can save resources and ensure the normal execution of the business.
[0088] In an optional implementation, when it is determined that the multi-core processor does not satisfy the third monitoring condition, determining the first utilization rate according to the utilization rate of each of the working cores and the target number includes:
[0089] Determining the total utilization of the multi-core processor according to the utilization of each of the working cores;
[0090] The first utilization rate is determined according to the total utilization rate and the target quantity.
[0091] Specifically, the first utilization is determined by calculating the total utilization and combining it with the target quantity. This method is more accurate than considering only one working core or simply averaging the utilization of all working cores, and can more accurately reflect the actual load of the entire processor.
[0092] In a second aspect, the present invention provides an operation mode adjustment device, the device is applied to a multi-core processor, the multi-core processor includes a management core and at least one service core, the device includes:
[0093] An acquisition module, used to acquire the utilization rate of each core of the multi-core processor in a current acquisition cycle;
[0094] a determination module, configured to determine a target number of working cores in the multi-core processor that are in working state according to the utilization rate of each of the cores; and determine whether the multi-core processor satisfies a target monitoring condition according to the target number and the utilization rate of each of the working cores, wherein the target monitoring condition is any one of a plurality of monitoring conditions corresponding to the target number;
[0095] The acquisition module is further configured to acquire, when it is determined that the multi-core processor satisfies the target monitoring condition, an operation mode setting rule corresponding to the target monitoring condition according to the target monitoring condition;
[0096] The adjustment module is used to adjust the operation mode of at least one core in the multi-core processor according to the operation mode setting rule corresponding to the target monitoring condition.
[0097] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the operating mode adjustment method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0098] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the operating mode adjustment method of the first aspect or any corresponding embodiment thereof.
[0099] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the operating mode adjustment method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0101] Figure 1 is a schematic diagram of the architecture of a storage server according to an embodiment of the present invention;
[0102] Figure 2 is a schematic diagram of daily traffic trend of a target service platform according to an embodiment of the present invention;
[0103] Figure 3 is a schematic diagram of the architecture of a multi-core processor according to an embodiment of the present invention;
[0104] Figure 4 is a schematic diagram of an operating mode of a multi-core processor according to an embodiment of the present invention;
[0105] Figure 5 is a schematic diagram of an operating mode of another multi-core processor according to an embodiment of the present invention;
[0106] Figure 6 is a schematic diagram of an operating mode of another multi-core processor according to an embodiment of the present invention;
[0107] Figure 7 is a schematic diagram of an operating mode of another multi-core processor according to an embodiment of the present invention;
[0108] Figure 8 is a flow chart of an operation mode adjustment method according to an embodiment of the present invention;
[0109] Fig. 9 is a flow chart of another operation mode adjustment method according to an embodiment of the present invention;
[0110] Fig.10 is a flow chart of another operation mode adjustment method according to an embodiment of the present invention;
[0111] Fig.11 is a structural block diagram of an operating mode adjustment device according to an embodiment of the present invention;
[0112] Fig.12 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0113] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0114] In the field of storage technology, Figure 1As shown in the figure, a storage server can be equipped with two Redundant Array of Independent Disks (RAID) cards to provide RAID storage services. If the power consumption of each core of the central processing unit (Central Processing Unit) used by the RAID card is 0.3W / H, it will consume 24×0.3w=7.2w of electricity per day, and 3657.2W=2628w of electricity per year. The power consumed by N cores per year is f(N)=2628w×N. When N=8, the power consumed by an 8-core CPU per year is. In general, if a storage server is equipped with two RAID cards, taking 1 million storage servers as an example, the power consumed by 1 million storage servers per year is 420480000000W, that is, 420480000 kWh. If each kWh is 1 yuan, it will cost 4.2048 million yuan.
[0115] Figure 2 The daily traffic trend chart of the target service platform is shown. The peak traffic time is 20 o'clock, the traffic trough is 3 o'clock, and the traffic from 0 o'clock to 8 o'clock is less than 20%, averaging 10% of the peak time. The traffic at 9 o'clock, 10 o'clock, 14 o'clock, 15 o'clock, and 23 o'clock is less than 50%, averaging 45% of the peak time. In related technologies, in order to cope with peak traffic, storage devices need to be arranged according to the maximum computing power, that is, all cores in all CPUs run in normal operating mode, which will result in 55% of the computing power being invalid and wasted in a day, that is, about half of the electricity consumed above is wasted, resulting in large economic losses.
[0116] In this solution, the management core can be adjusted in time according to the real-time operation status of the multi-core processor, which can avoid waste of resources and ensure timely completion of business.
[0117] The embodiment of the present invention is applied to a multi-core processor, such as Figure 3As shown, the multi-core processor includes a management core and at least one service core. Each core can have a serial number for identifying itself. For example, the management core is CORE0 in the figure, and the service cores are CORE1 to CORE7. The management core can be used to receive or respond to IO requests from upper-layer services, and write IO requests to the send queue buffer (SQ Buffer) of the corresponding service core according to its own service allocation rules. The service core can poll and read the IO requests in its own SQ Buffer in a multi-threaded manner, and perform corresponding service processing (Handle) according to the read IO requests. After completing the service processing corresponding to each IO request, the service core places the completed IO request in its own completion queue buffer (CQBuffer). The management core polls and reads the IO requests of the CQ Buffer of each service core and forwards them to the upper-layer service.
[0118] The operation mode of the management core and the target service core may be a normal operation mode (NORMALMODE) or a first-level energy-saving operation mode (FIRSTMODE). The target service core may be any service core of at least one service core, for example, Figure 3 CORE1 in. The operation mode of other business cores except the target business core in at least one business core can be one of the normal operation mode, the second level energy-saving operation mode (SECONEDMODE) and the third level energy-saving operation mode (THIRDMODE). The cores whose operation modes are the normal operation mode and the first level energy-saving operation mode are in a working state, and the cores whose operation modes are the second level energy-saving operation mode and the third level energy-saving operation mode are in a non-working state. In this way, it can be ensured that the management core and the target business core are in a working state under any circumstances and complete basic work tasks. The power consumption of the normal operation mode, the power consumption of the first level energy-saving operation mode, the power consumption of the second level energy-saving operation mode to the power consumption of the third level energy-saving operation mode decreases in sequence. The wake-up and recovery time of the normal operation mode, the wake-up and recovery time of the first level energy-saving operation mode, the wake-up and recovery time of the second level energy-saving operation mode to the wake-up and recovery time of the third level energy-saving operation mode increase in sequence.
[0119] Level 1 power saving mode means that the core can dynamically adjust its operating frequency. Level 2 power saving mode means that the core is powered on and most clocks are stopped or gated. This means that almost all parts of the core are in a static state, and the only power is due to leakage current and the clocks used by a small amount of logic to monitor wake-up conditions. Level 3 power saving mode means that the core is powered off, leaving only the Translation Lookaside Buffer (TLB), instruction and data caches powered.
[0120] The management core may predefine multiple energy-saving entry thresholds and multiple energy-saving exit thresholds. The multiple energy-saving entry thresholds may include a first energy-saving entry threshold (FITV), a second energy-saving entry threshold (SITV), and a third energy-saving entry threshold (TITV). Among them, the first energy-saving entry threshold to the third energy-saving entry threshold decrease in sequence. The multiple energy-saving exit thresholds may include a first energy-saving exit threshold (FOTV), a second energy-saving exit threshold (SOTV), and a third energy-saving exit threshold (TOTV), and the first energy-saving exit threshold to the third energy-saving exit threshold increase in sequence.
[0121] In such Figure 3 Under the multi-core processor architecture shown in FIG. , the energy-saving operation mode combinations of each core may exist in the following situations: Example 1, such as Figure 4 As shown in the figure, CORE0 and CORE1 are in the first level energy-saving operation mode, and CORE2 to CORE7 are in the third level energy-saving operation mode. Figure 5 As shown, CORE0 and CORE1 are in normal operation mode, CORE2 to CORE3 are in secondary energy-saving operation mode, and CORE4 to CORE7 are in secondary energy-saving operation mode. Figure 6 As shown, CORE0 and CORE2 are in normal operation mode, CORE3 is in level 2 energy-saving operation mode, and CORE4 to CORE7 are in level 2 energy-saving operation mode. Figure 7 As shown, CORE0 to CORE3 are in the normal operation mode, and CORE4 to CORE7 are in the second-level energy-saving operation mode.
[0122] According to an embodiment of the present invention, an embodiment of an operation mode adjustment method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0123] In this embodiment, a method for adjusting an operation mode is provided, which can be executed by the above-mentioned management core. Figure 8 is a flow chart of a method for adjusting an operation mode according to an embodiment of the present invention. Figure 8 As shown, the process includes the following steps:
[0124] Step S801 : obtaining the utilization rate of each core of the multi-core processor in the current collection cycle.
[0125] The utilization rate may be the ratio of the core active time to the total CPU time.
[0126] Specifically, the management core can set a timer. When the timer reaches a preset time, the management core can collect the utilization of each core, reset the timer, and restart the timer. In this way, the management core can periodically collect the utilization of each core.
[0127] Step S802: Determine the target number of working cores in the multi-core processor that are in working state according to the utilization rate of each core.
[0128] Specifically, the management core may determine cores whose utilization is less than or equal to a preset utilization threshold (for example, the preset utilization threshold may be 0) as non-working cores, and determine cores whose utilization is greater than the preset utilization threshold as working cores.
[0129] Step S803: Determine whether the multi-core processor meets the target monitoring condition according to the target number and the utilization rate of each working core.
[0130] Specifically, the management core can be divided into multiple situations according to the number of targets and processed separately, as follows:
[0131] Case 1: The target number is less than or equal to a first preset number threshold, wherein the first preset number threshold may be 2, that is, the management core and the target service core are in working state.
[0132] Step 1: Obtain the first monitoring condition and the second monitoring condition, and the target operation mode of the management core in the current collection cycle.
[0133] Step 2: When the target operation mode is the normal operation mode, determine whether the multi-core processor meets the first monitoring condition according to the utilization rate of each working core.
[0134] Specifically, the management core can determine whether the utilization rate of each working core is less than the preset three-level energy-saving threshold. When it is determined that the utilization rate of each working core is less than the three-level energy-saving threshold, the count value of the first cycle statistical parameter corresponding to the first monitoring condition is increased by a preset value. Further, the management core can determine whether the count value of the first cycle statistical parameter is equal to the second preset number threshold. When it is determined that the count value of the first cycle statistical parameter is equal to the second preset number threshold, it is determined that the multi-core processor meets the first monitoring condition. At this time, it can be considered that the current business is less, and the multi-core processor can be adjusted to an operating mode with a higher energy-saving level.
[0135] Step three: when the target operation mode is the first-level energy-saving operation mode, determine whether the multi-core processor meets the second monitoring condition according to the utilization rate of each working core.
[0136] Specifically, the management core can determine whether there is any working core whose utilization is greater than a preset first-level exit energy-saving threshold, and when it is determined that there is any working core whose utilization is greater than the first-level exit energy-saving threshold, it is determined that the multi-core processor meets the second monitoring condition. At this time, the target number of working cores is insufficient to process the current business, and more cores are required to participate in business processing.
[0137] Case 2: the target number is greater than the first preset number threshold, and the target number is less than or equal to the total number of cores of the multi-core processor.
[0138] Step 1: Obtain the third monitoring condition, the fourth monitoring condition and the fifth monitoring condition.
[0139] Step 2: Determine whether the multi-core processor meets the third monitoring condition according to the utilization rate of each working core.
[0140] Step three: when it is determined that the multi-core processor does not meet the third monitoring condition, determine the first utilization rate according to the utilization rate and the target number of each working core.
[0141] Specifically, the management core can determine whether there is any working core whose utilization is greater than the preset third-level exit energy-saving threshold. When it is determined that there is any working core whose utilization is greater than the third-level exit energy-saving threshold, it is determined that the multi-core processor meets the third monitoring condition. Alternatively, when it is determined that the utilization of all working cores is less than or equal to the third-level exit energy-saving threshold, it is determined that the multi-core processor does not meet the third monitoring condition.
[0142] In the case of determining that the multi-core processor does not meet the third monitoring condition, the management core may continue to determine whether the multi-core processor meets the fourth monitoring condition. Accordingly, the management core may first calculate the first utilization rate through the following steps: first, determine the total utilization rate of the multi-core processor according to the utilization rate of each working core. Second, determine the first utilization rate according to the total utilization rate and the target number.
[0143] For example, the expression for the total utilization of a multi-core processor can be as follows:
[0144]
[0145] The expression of the first utilization rate can be as follows:
[0146]
[0147] in, is the first utilization rate, is the total utilization rate, is the target number. is the i-th working core among n working cores.
[0148] Step 4: Determine whether the multi-core processor meets a fourth monitoring condition based on the first utilization rate.
[0149] Specifically, the management core can determine whether the first utilization is greater than a preset secondary exit energy-saving threshold. When it is determined that the first utilization is greater than the secondary exit energy-saving threshold, the count value of the second cycle statistical parameter corresponding to the fourth monitoring condition is increased by a preset value. The management core can determine whether the count value of the second cycle statistical parameter is equal to the fourth preset quantity threshold. When it is determined that the count value of the second cycle statistical parameter is equal to the fourth preset quantity threshold, it can be determined that the multi-core processor meets the fourth monitoring condition. When it is determined that the count value of the second cycle statistical parameter is less than the fourth preset quantity threshold, it can be determined that the multi-core processor does not meet the fourth monitoring condition.
[0150] Although the third-level energy-saving exit threshold and the second-level energy-saving exit threshold indicate that the current load of the multi-core processor is high, since the third-level energy-saving exit threshold is greater than the second-level energy-saving exit threshold, setting the third monitoring condition to be more stringent than the fourth monitoring condition can achieve more refined regulation. For example, the third-level energy-saving exit threshold can be 95%, and the second-level energy-saving exit threshold can be 80%.
[0151] Step 5: When it is determined that the multi-core processor does not meet the fourth monitoring condition, a second utilization is calculated according to the utilization of each working core, the target number and the third preset number threshold.
[0152] For example, the expression of the second utilization rate may be as follows:
[0153]
[0154] in, is the second utilization rate, It is the difference between the target quantity and the third preset numerical threshold. For example, the third preset quantity threshold may be 1.
[0155] Step six: determine whether the multi-core processor meets a fifth monitoring condition based on the first utilization rate and the second utilization rate.
[0156] Specifically, when the management core determines that the multi-core processor does not meet the fourth monitoring condition, it can calculate the second utilization rate, and determine whether the management core meets the fifth monitoring condition based on the first utilization rate and the second utilization rate. Specifically, it can be: the management core can determine whether the first utilization rate is less than the preset first-level energy-saving threshold, and whether the second utilization rate is less than the preset second-level energy-saving threshold. When it is determined that the first utilization rate is less than the first-level energy-saving threshold, and the second utilization rate is less than the second-level energy-saving threshold, the count value of the third period statistical parameter corresponding to the fifth monitoring condition is increased by a preset value. Then, the management core can determine whether the count value of the third period statistical parameter is equal to the fifth preset number threshold. When it is determined that the count value of the third period statistical parameter is equal to the fifth preset number threshold, it is determined that the multi-core processor meets the fifth monitoring condition.
[0157] In some optional implementations, in case 2, the management core may first calculate the first utilization and the second utilization, and then simultaneously determine which of the third monitoring condition, the fourth monitoring condition and the fifth monitoring condition the multi-core processor satisfies. The specific process may be as follows: Fig. 9 shown.
[0158] Step S804: when it is determined that the multi-core processor meets the target monitoring condition, an operation mode setting rule corresponding to the target monitoring condition is obtained according to the target monitoring condition.
[0159] Among them, the target monitoring condition can be one of the above-mentioned first monitoring condition, second monitoring condition, third monitoring condition, fourth monitoring condition, and fifth monitoring condition. The operating mode setting rule corresponding to the first monitoring condition can be: h(j)=FIRSTMODE, h(k)=THIRDMODE, where j can be the serial number of the working core and k can be the serial number of the non-working core. The operating mode setting rule corresponding to the second monitoring condition can be: h(j)=NORMALMODE. The operating mode setting rules corresponding to the third monitoring condition and the fourth monitoring condition can be: the first one, find a=Min(k), h(a)=NORMALMODE, determine h(a+1) according to h(a), and refer to the following method one for details; the second one refers to the following method two.
[0160] Specifically, after determining that the multi-core processor meets the target monitoring condition among the above five monitoring conditions, the management core can determine the operation mode setting rule corresponding to the target monitoring condition according to the target monitoring condition and the corresponding relationship table between the monitoring condition and the operation mode setting rule. Alternatively, when the management core determines that the multi-core processor does not meet all the monitoring conditions among the multiple monitoring conditions corresponding to the target number, it can enter the next collection cycle corresponding to the current collection cycle and clear the count value of each cycle statistical parameter among the multiple cycle statistical parameters (including the first cycle statistical parameter, the second cycle statistical parameter, and the third cycle statistical parameter).
[0161] Step S805 , adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition.
[0162] Specifically, the management core can obtain the operation mode setting rules corresponding to the target monitoring conditions, and can adjust the operation mode of one or more cores in the multi-core processor. According to different monitoring conditions, it can be processed according to the following multiple situations:
[0163] When the target monitoring condition is the first monitoring condition, the management core can set the operating mode of each working core to the first-level energy-saving operating mode according to the operating mode setting rules corresponding to the first monitoring condition, and set all cores (non-working cores) in the multi-core processor except the working core to the third-level energy-saving operating mode.
[0164] When the target monitoring condition is the second monitoring condition, the management core can set the operating mode of each working core to the normal operating mode (the original operating mode of the working core can be the first-level energy-saving operating mode). For example, the management core and the target business core can be adjusted from the first-level energy-saving operating mode to the normal operating mode.
[0165] When the target monitoring condition is the third, the management core can adjust the operation mode in the following two ways.
[0166] Mode 1, corresponding to the first operation mode setting rule of the third monitoring condition and the fourth monitoring condition, the management core may first determine whether there is a non-working core in a non-working state (that is, a core whose utilization is less than or equal to a preset utilization threshold). When it is determined that there is at least one non-working core, the sequence number of each non-working core is obtained. Then, the management core may determine the minimum sequence number value according to the sequence number of each non-working core, and set the first non-working core corresponding to the minimum sequence number value to the normal operation mode. When there is more than one non-working core, the management core may obtain the first mode indicator value corresponding to the normal operation mode. Then, according to the mode indicator value of the mth non-working core and the preset calculation rule, the mode indicator value of the m+1th non-working core is determined. Wherein, m is greater than or equal to the minimum sequence number value and less than the total number of cores. When the mth non-working core is the first non-working core, the mode indicator value of the mth non-working core is the first mode indicator value. Finally, the management core may set the operation mode of the second non-working core according to the mode indicator value of the second non-working core. The second non-working core is any non-working core among the at least one non-working core except the first non-working core.
[0167] Among them, the first mode index value corresponding to the normal operation mode can be 1, the second mode index value corresponding to the first level energy-saving operation mode can be 0, the third mode index value corresponding to the second level energy-saving operation mode can be 2, and the fourth mode index value corresponding to the third level energy-saving operation mode can be 3.
[0168] For example, the preset calculation rule may be: h(m+1)=(((m+1)>>2)-(m>>2))+h[m]+(((((m+1)>>2)-(m>>2))&(h[m]==THIRDMODE))?-1:0).
[0169] Method 2: The management core may determine whether the target number is greater than or equal to the sixth preset number threshold (for example, it may be 4). The sixth preset number threshold is greater than the first preset number threshold and less than the total number of cores. When it is determined that the target number is less than the sixth preset number threshold, the management core may determine the adjustment number based on the target number and the sixth preset number threshold (it may be the adjustment number obtained by subtracting the target number from the sixth preset number threshold). Then, according to the adjustment number, the non-working cores equal to the adjustment number are set to the normal operating mode. Alternatively, when it is determined that the target number is greater than or equal to the third preset number threshold, the management core may determine the number of non-working cores based on the total number of cores and the target number, and determine whether the number of non-working cores is greater than or equal to the seventh preset number threshold. When it is determined that the number of non-working cores is greater than or equal to the seventh preset number threshold, the non-working cores equal to the seventh preset number threshold are set to the normal operating mode. For example, the seventh preset number threshold may be 4.
[0170] When the target monitoring condition is the fifth monitoring condition, the management core obtains the serial number of each working core, determines the maximum serial number value according to the serial number of each working core, and sets the target working core corresponding to the maximum serial number value to the second-level energy-saving operation mode.
[0171] In some optional implementations, the management core may determine the mode index value of the core to be regulated according to the operation mode adjustment rule, and generate an instruction according to the mode index value and send it to the corresponding core to adjust the operation mode of the core. For example, the instruction may be a Wait For Interrupt (WFI) instruction or a Wait For Event (WFE) instruction.
[0172] In some optional implementations, before the management core needs to adjust a core (the first core) from a working state to a non-working state, the management core may first stop distributing IO requests to the first core, wait for the first core to process all IO requests in its own SQ BUFFER, and then adjust the operating mode of the first core.
[0173] The operation mode adjustment method provided in this embodiment is that the management core periodically collects the utilization of each core, and determines the working core according to the utilization, and then determines whether the multi-core processor meets one of the multiple monitoring conditions according to the target number of working cores and the utilization of each working core. When any monitoring condition is met, the operation mode setting rules corresponding to the satisfied target monitoring condition can be used to adjust the operation mode of the multi-core processor. In this way, by setting multiple monitoring conditions and adjusting the operation mode of the multi-core processor in real time according to the satisfied monitoring conditions, the operation mode of the multi-core processor can be adjusted according to the actual situation, and the problem of still running in a high-energy-consuming operation mode when the business is idle can be avoided, that is, resource waste can be reduced and electric energy can be saved.
[0174] The following is a detailed description of the process of entering and exiting the energy-saving operation mode using a specific example. When the total number of cores of the multi-core processor is 8, namely CORE0 to CORE7, the first preset number threshold is 2. CORE0 is a management core, CORE1 to CORE7 are service cores, and CORE 1 is a target service core.
[0175] In such Fig.10In the steps of entering the energy-saving mode shown in the figure, CORE0-7 are in normal operation at the beginning. When it is monitored that the first utilization rate is less than the first-level energy-saving threshold in multiple consecutive (fifth preset number threshold) acquisition cycles, and the second utilization rate is less than the second-level energy-saving threshold in multiple acquisition cycles (i.e., the fifth monitoring condition is met), CORE0 can distribute new IO requests to CORE1-6, stop distributing IO requests to CORE7, and wait until CORE7 completes the processing of all IO requests in its own SQ BUFFER, and then CORE0 sets CORE7 to the second-level energy-saving operation mode. At this time, CORE0-6 are in working state, and CORE7 is in non-working state.
[0176] When it is again monitored that the first utilization rate is less than the first energy-saving threshold for multiple consecutive (fifth preset number threshold) collection cycles, and the second utilization rate is less than the second energy-saving threshold for multiple collection cycles (i.e., the fifth monitoring condition is met), CORE0 can distribute new IO requests to CORE1~5, stop distributing IO requests to CORE6, and wait for CORE6 to complete the processing of all IO requests in its own SQ BUFFER, and then CORE0 sets CORE6 to the second energy-saving operation mode. At this time, CORE0~5 are in working state, and CORE6~7 are in non-working state.
[0177] When it is again monitored that the first utilization rate is less than the first energy-saving threshold in multiple consecutive collection cycles, and the second utilization rate is less than the second energy-saving threshold in multiple (fifth preset number threshold) collection cycles (i.e., the fifth monitoring condition is met), CORE0 can distribute new IO requests to CORE1~4, stop distributing IO requests to CORE5, and wait for CORE5 to complete the processing of all IO requests in its own SQ BUFFER, and then CORE0 sets CORE5 to the second energy-saving operation mode. At this time, CORE0~4 are in working state, and CORE5~7 are in non-working state.
[0178] And so on, until only CORE0 and CORE1 are in working state, when it is detected that the utilization rates of CORE0 and CORE1 are less than the third-level energy-saving entry threshold value (i.e., the first monitoring condition is met) in a plurality of consecutive (second preset number threshold) collection cycles, CORE0 sets CORE0 and CORE1 to the first-level energy-saving operation mode, and sets CORE2~7 to the third-level energy-saving operation mode. At this time, CORE0~1 is in working state, and CORE2~7 is in working state.
[0179] In such Fig.10In the steps of exiting the energy-saving mode shown in the figure, CORE0-1 is in working state at the beginning, and CORE2-7 is in non-working state. When it is monitored in any collection cycle that the utilization rate of CORE0 is greater than the first-level exit energy-saving threshold or the utilization rate of CORE1 is greater than the first-level exit energy-saving threshold (that is, the second monitoring condition is met), CORE0 sets CORE0 and CORE1 to the first-level energy-saving operation mode, and can further set CORE2 and CORE3 to the second-level energy-saving operation mode. At this time, CORE0-1 is still in working state, and CORE2-7 is in non-working state.
[0180] When it is monitored in any collection cycle that the utilization of CORE0 is greater than the third-level energy-saving exit threshold, or when the utilization of CORE1 is greater than the third-level energy-saving exit threshold (i.e., the third monitoring condition is met), CORE0 can set CORE2 and CORE3 to normal operating mode, and can further adjust CORE4 to CORE7 to the second-level energy-saving operation mode. Alternatively, when it is monitored for multiple consecutive (fourth preset number threshold) collection cycles that the first utilization is greater than the second-level energy-saving exit threshold (i.e., the fourth monitoring condition is met), CORE0 can set CORE2 and CORE3 to normal operating mode, and can further adjust CORE4 to CORE7 to the second-level energy-saving operation mode. In this way, the number of cores in normal operating mode can be 4. At this time, CORE0~3 are in working state, and CORE4~7 are in non-working state.
[0181] Furthermore, when the utilization rate of any core in CORE0-3 is greater than the third-level energy-saving exit threshold (i.e., the third monitoring condition is met) during any collection cycle, CORE0 can adjust the four non-working cores (CORE4-7) to the normal operation mode. Alternatively, when the first utilization rate is greater than the second-level energy-saving exit threshold (i.e., the fourth monitoring condition is met) during multiple consecutive collection cycles (the fourth preset number threshold), CORE0 can also adjust the four non-working cores (CORE4-7) to the normal operation mode.
[0182] In this embodiment, an operation mode adjustment device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0183] This embodiment provides an operation mode adjustment device, such as Fig.11 As shown, including:
[0184] The acquisition module 1101 is used to acquire the utilization rate of each core of the multi-core processor in the current acquisition cycle;
[0185] The determination module 1102 is used to determine the target number of working cores in the multi-core processor that are in working state according to the utilization rate of each core; determine whether the multi-core processor meets the target monitoring condition according to the target number and the utilization rate of each working core, wherein the target monitoring condition is any one of the multiple monitoring conditions corresponding to the target number;
[0186] The acquisition module 1101 is further configured to acquire, when it is determined that the multi-core processor meets the target monitoring condition, an operation mode setting rule corresponding to the target monitoring condition according to the target monitoring condition;
[0187] The adjustment module 1103 is used to adjust the operation mode of at least one core in the multi-core processor according to the operation mode setting rule corresponding to the target monitoring condition.
[0188] In some optional implementations, the determination module 1102 is specifically configured to:
[0189] When it is determined that the target number is less than or equal to the first preset number threshold, the first monitoring condition and the second monitoring condition, as well as the target operation mode of the management core in the current collection cycle are obtained, wherein the target monitoring condition is the first monitoring condition or the second monitoring condition, and the target operation mode is the normal operation mode or the first-level energy-saving operation mode;
[0190] When the target operation mode is the normal operation mode, determining whether the multi-core processor meets the first monitoring condition according to the utilization rate of each working core;
[0191] or,
[0192] When the target operation mode is the first-level energy-saving operation mode, it is determined whether the multi-core processor meets the second monitoring condition according to the utilization rate of each working core.
[0193] In an optional implementation, the determination module 1102 is specifically configured to:
[0194] Determine whether the utilization rate of each working core is less than the preset level 3 energy saving threshold;
[0195] When it is determined that the utilization rate of each working core is less than the level 3 energy saving threshold, the count value of the first period statistical parameter corresponding to the first monitoring condition is increased by a preset value;
[0196] Determining whether the count value of the first period statistical parameter is equal to a second preset quantity threshold;
[0197] When it is determined that the count value of the first period statistical parameter is equal to the second preset number threshold, it is determined that the multi-core processor meets the first monitoring condition.
[0198] In an optional implementation, the determination module 1102 is specifically configured to:
[0199] Determine whether there is any working core whose utilization is greater than a preset first-level exit energy saving threshold;
[0200] When it is determined that the utilization rate of any working core is greater than the first-level exit energy saving threshold, it is determined that the multi-core processor meets the second monitoring condition.
[0201] In an optional implementation, the determination module 1102 is specifically configured to:
[0202] When it is determined that the target number is greater than the first preset number threshold and is less than or equal to the total number of cores of the multi-core processor, obtaining a third monitoring condition, a fourth monitoring condition, and a fifth monitoring condition;
[0203] Determining whether the multi-core processor satisfies a third monitoring condition according to the utilization rate of each working core;
[0204] When it is determined that the multi-core processor does not satisfy the third monitoring condition, determining a first utilization rate according to the utilization rate and the target number of each working core;
[0205] Determining, according to the first utilization rate, whether the multi-core processor satisfies a fourth monitoring condition;
[0206] When it is determined that the multi-core processor does not meet the fourth monitoring condition, calculating the second utilization rate according to the utilization rate of each working core, the target number and the third preset number threshold;
[0207] According to the first utilization and the second utilization, it is determined whether the multi-core processor satisfies a fifth monitoring condition.
[0208] In an optional implementation, the determination module 1102 is specifically configured to:
[0209] Determine whether there is any working core whose utilization is greater than a preset third-level exit energy saving threshold;
[0210] When it is determined that the utilization rate of any working core is greater than the third-level exit energy saving threshold, it is determined that the multi-core processor meets the third monitoring condition.
[0211] In an optional implementation, the determination module 1102 is specifically configured to:
[0212] Determining whether the first utilization rate is greater than a preset secondary exit energy saving threshold;
[0213] When it is determined that the first utilization rate is greater than the second-level exit energy-saving threshold, the count value of the second period statistical parameter corresponding to the fourth monitoring condition is increased by a preset value;
[0214] Determining whether the count value of the second period statistical parameter is equal to a fourth preset quantity threshold;
[0215] When it is determined that the count value of the second period statistical parameter is equal to the fourth preset quantity threshold, it is determined that the multi-core processor meets the fourth monitoring condition.
[0216] In an optional implementation, the determination module 1102 is specifically configured to:
[0217] Determine whether the first utilization rate is less than a preset first-level energy-saving threshold, and whether the second utilization rate is less than a preset second-level energy-saving threshold;
[0218] When it is determined that the first utilization rate is less than the first level energy-saving threshold, and the second utilization rate is less than the second level energy-saving threshold, the count value of the third period statistical parameter corresponding to the fifth monitoring condition is increased by a preset value;
[0219] Determining whether the count value of the third period statistical parameter is equal to a fifth preset quantity threshold;
[0220] When it is determined that the count value of the third period statistical parameter is equal to the fifth preset quantity threshold, it is determined that the multi-core processor meets the fifth monitoring condition.
[0221] In an optional implementation, when the target monitoring condition is the first monitoring condition, the adjustment module 1103 is specifically configured to:
[0222] Set the operation mode of each working core to the first-level energy-saving operation mode;
[0223] All cores except the working core in the multi-core processor are set to the third level energy-saving operation mode.
[0224] In an optional implementation, when the target monitoring condition is the second monitoring condition, the adjustment module 1103 is specifically configured to:
[0225] Set the operation mode of each working core to normal operation mode.
[0226] In an optional implementation, when the target monitoring condition is the third monitoring condition or the fourth monitoring condition, the adjustment module 1103 is specifically configured to:
[0227] Determine whether there is a non-working core in a non-working state;
[0228] When it is determined that there is at least one non-working core, obtaining a sequence number of each non-working core;
[0229] According to the sequence number of each non-working core, determine the minimum sequence number value;
[0230] Setting the first non-working core corresponding to the smallest sequence number value to a normal operating mode;
[0231] When the number of the non-working core is not one, obtaining a first mode indicator value corresponding to the normal operating mode;
[0232] Determine the mode index value of the m+1th non-working core according to the mode index value of the mth non-working core and the preset calculation rule, wherein m is greater than or equal to the minimum sequence number value and less than the total number of cores, and when the mth non-working core is the first non-working core, the mode index value of the mth non-working core is the first mode index value;
[0233] The operation mode of the second non-working core is set according to the mode indicator value of the second non-working core, wherein the second non-working core is any non-working core of the at least one non-working core except the first non-working core.
[0234] In an optional implementation, when the target monitoring condition is the fifth monitoring condition, the adjustment module 1103 is specifically configured to:
[0235] Get the serial number of each working core;
[0236] According to the sequence number of each working core, determine the maximum sequence number value;
[0237] The target working core corresponding to the maximum sequence number value is set to the second-level energy-saving operation mode.
[0238] In an optional implementation, when the target monitoring condition is the third monitoring condition or the fourth monitoring condition, the adjustment module 1103 is specifically configured to:
[0239] Determining whether the target number is greater than or equal to a sixth preset number threshold, wherein the sixth preset number threshold is greater than the first preset number threshold and less than the total number of cores;
[0240] When it is determined that the target quantity is less than a sixth preset quantity threshold, determining an adjustment quantity according to the target quantity and the sixth preset quantity threshold;
[0241] According to the adjustment number, a number of non-working cores equal to the adjustment number is set to a normal operation mode;
[0242] or,
[0243] When it is determined that the target number is greater than or equal to a third preset number threshold, determining the number of non-working cores according to the total number of cores and the target number;
[0244] Determining whether the number of non-working cores is greater than or equal to a seventh preset number threshold;
[0245] When it is determined that the number of the non-working cores is greater than or equal to a seventh preset number threshold, the non-working cores having a number equal to the seventh preset number threshold are set to the normal operation mode.
[0246] In an optional implementation, the determination module 1102 is specifically configured to:
[0247] When it is determined that the multi-core processor does not satisfy all monitoring conditions among the multiple monitoring conditions corresponding to the target number, enter the next collection cycle corresponding to the current collection cycle, and clear the count value of each cycle statistical parameter among the multiple cycle statistical parameters.
[0248] In an optional embodiment, the operating mode includes multiple ones of a normal operating mode, a first-level energy-saving operating mode, a second-level energy-saving operating mode and a third-level energy-saving operating mode, and the power consumption of the normal operating mode, the power consumption of the first-level energy-saving operating mode, the power consumption of the second-level energy-saving operating mode and the power consumption of the third-level energy-saving operating mode decreases in sequence.
[0249] In an optional implementation, the determination module 1102 is specifically configured to:
[0250] Determine the total utilization of the multi-core processor based on the utilization of each working core;
[0251] A first utilization rate is determined based on the total utilization rate and the target quantity.
[0252] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0253] The operation mode adjustment device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0254] The embodiment of the present invention also provides a computer device having the above Fig.11 The operating mode adjustment device shown.
[0255] See also Fig.12 , Fig.12 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.12As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.12 A processor 10 is taken as an example.
[0256] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0257] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0258] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0259] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0260] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0261] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0262] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0263] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for adjusting an operation mode, characterized in that: The method is applied to a multi-core processor, the multi-core processor includes a management core and at least one service core, the method is executed by the management core, and the method includes: In the current collection cycle, obtaining the utilization rate of each core of the multi-core processor; Determining a target number of working cores in the multi-core processor that are in working state according to the utilization rate of each core of the multi-core processor; When it is determined that the target number is less than or equal to a first preset number threshold, obtaining a first monitoring condition and a second monitoring condition, and a target operation mode of the management core in the current collection cycle, wherein the target operation mode is a normal operation mode or a first-level energy-saving operation mode; When the target operation mode is the normal operation mode, determining whether the multi-core processor satisfies a first monitoring condition according to the utilization rate of each of the working cores, wherein the first monitoring condition is a target monitoring condition, and the target monitoring condition is any one of a plurality of monitoring conditions corresponding to the target number; When it is determined that the multi-core processor satisfies the target monitoring condition, acquiring an operation mode setting rule corresponding to the target monitoring condition according to the target monitoring condition; The operating mode of at least one core in the multi-core processor is adjusted according to an operating mode setting rule corresponding to the target monitoring condition.
2. The method according to claim 1, characterized in that: The method further comprises: When the target operation mode is the first-level energy-saving operation mode, it is determined whether the multi-core processor satisfies the second monitoring condition according to the utilization rate of each of the working cores, wherein the second monitoring condition is the target monitoring condition.
3. The method according to claim 1 or 2, characterized in that: When the target operation mode is the normal operation mode, determining whether the multi-core processor satisfies the first monitoring condition according to the utilization rate of each of the working cores includes: Determining whether the utilization rate of each of the working cores is less than a preset third-level energy-saving threshold; When it is determined that the utilization rate of each of the working cores is less than the third-level energy-saving threshold, the count value of the first period statistical parameter corresponding to the first monitoring condition is increased by a preset value; Determining whether the count value of the first period statistical parameter is equal to a second preset quantity threshold; When it is determined that the count value of the first period statistical parameter is equal to the second preset number threshold, it is determined that the multi-core processor meets the first monitoring condition.
4. The method according to claim 2, characterized in that: When the target operation mode is the first-level energy-saving operation mode, determining whether the multi-core processor meets the second monitoring condition according to the utilization rate of each of the working cores includes: Determining whether there is any working core whose utilization is greater than a preset first-level exit energy saving threshold; When it is determined that the utilization rate of any of the working cores is greater than the first-level exit energy saving threshold, it is determined that the multi-core processor meets the second monitoring condition.
5. The method according to claim 1, characterized in that When it is determined that the target number is greater than the first preset number threshold and is less than or equal to the total number of cores of the multi-core processor, the method further includes: Acquiring a third monitoring condition, a fourth monitoring condition, and a fifth monitoring condition; Determining whether the multi-core processor satisfies the third monitoring condition according to the utilization rate of each of the working cores; When it is determined that the multi-core processor does not satisfy the third monitoring condition, determining a first utilization rate according to the utilization rate of each of the working cores and the target number; determining, according to the first utilization rate, whether the multi-core processor satisfies the fourth monitoring condition; When it is determined that the multi-core processor does not meet the fourth monitoring condition, calculating a second utilization rate according to the utilization rate of each of the working cores, the target number and a third preset number threshold; Determine whether the multi-core processor satisfies the fifth monitoring condition according to the first utilization and the second utilization.
6. The method according to claim 5, characterized in that The step of determining whether the multi-core processor satisfies the third monitoring condition according to the utilization rate of each of the working cores includes: Determining whether there is any working core whose utilization is greater than a preset third-level exit energy saving threshold; When it is determined that the utilization rate of any of the working cores is greater than the third-level exit energy saving threshold, it is determined that the multi-core processor meets the third monitoring condition.
7. The method according to claim 5, characterized in that The determining, according to the first utilization, whether the multi-core processor satisfies the fourth monitoring condition includes: Determining whether the first utilization rate is greater than a preset secondary exit energy saving threshold; When it is determined that the first utilization rate is greater than the second-level energy-saving exit threshold, a preset value is added to the count value of the second period statistical parameter corresponding to the fourth monitoring condition; Determining whether the count value of the second period statistical parameter is equal to a fourth preset quantity threshold; When it is determined that the count value of the second period statistical parameter is equal to the fourth preset quantity threshold, it is determined that the multi-core processor meets the fourth monitoring condition.
8. The method according to claim 5, characterized in that The determining, according to the first utilization and the second utilization, whether the multi-core processor satisfies the fifth monitoring condition includes: Determining whether the first utilization rate is less than a preset first-level energy-saving threshold, and whether the second utilization rate is less than a preset second-level energy-saving threshold; When it is determined that the first utilization rate is less than the first level energy-saving threshold, and the second utilization rate is less than the second level energy-saving threshold, the count value of the third period statistical parameter corresponding to the fifth monitoring condition is increased by a preset value; Determining whether the count value of the third period statistical parameter is equal to a fifth preset quantity threshold; When it is determined that the count value of the third period statistical parameter is equal to the fifth preset quantity threshold, it is determined that the multi-core processor meets the fifth monitoring condition.
9. The method according to claim 3, characterized in that: When the target monitoring condition is the first monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes: Setting the operation mode of each working core to a first-level energy-saving operation mode; The other cores in the multi-core processor except the working core are all set to the third level energy-saving operation mode.
10. The method according to claim 4, characterized in that When the target monitoring condition is the second monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes: The operation mode of each working core is set to the normal operation mode.
11. The method according to claim 6 or 7, characterized in that: When the target monitoring condition is the third monitoring condition or the fourth monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes: Determine whether there is a non-working core in a non-working state; When it is determined that there is at least one non-working core, obtaining a sequence number of each non-working core; Determine a minimum sequence number value according to the sequence number of each of the non-working cores; Setting the first non-working core corresponding to the minimum sequence number value to a normal operating mode; When the number of the non-working core is not one, obtaining a first mode indicator value corresponding to the normal operating mode; Determine the mode index value of the m+1th non-working core according to the mode index value of the mth non-working core and a preset calculation rule, wherein m is greater than or equal to the minimum sequence number value and less than the total number of cores, and when the mth non-working core is the first non-working core, the mode index value of the mth non-working core is the first mode index value; The operation mode of the second non-working core is set according to the mode indicator value of the second non-working core, wherein the second non-working core is any non-working core among at least one of the non-working cores except the first non-working core.
12. The method according to claim 8, characterized in that When the target monitoring condition is the fifth monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes: Get the serial number of each working core; Determine a maximum sequence number value according to the sequence number of each of the working cores; The target working core corresponding to the maximum sequence number value is set to the second-level energy-saving operation mode.
13. The method according to claim 6 or 7, characterized in that: When the target monitoring condition is the third monitoring condition or the fourth monitoring condition, adjusting the operating mode of at least one core in the multi-core processor according to the operating mode setting rule corresponding to the target monitoring condition includes: Determining whether the target number is greater than or equal to a sixth preset number threshold, wherein the sixth preset number threshold is greater than the first preset number threshold and less than the total number of cores; When it is determined that the target quantity is less than the sixth preset quantity threshold, determining an adjustment quantity according to the target quantity and the sixth preset quantity threshold; According to the adjusted number, setting the non-working cores of a number equal to the adjusted number to a normal operating mode; or, When it is determined that the target number is greater than or equal to the third preset number threshold, determining the number of non-working cores according to the total number of cores and the target number; Determining whether the number of the non-working cores is greater than or equal to a seventh preset number threshold; When it is determined that the number of the non-working cores is greater than or equal to a seventh preset number threshold, the non-working cores having a number equal to the seventh preset number threshold are set to the normal operating mode.
14. The method according to claim 1, characterized in that When it is determined that the multi-core processor does not satisfy all monitoring conditions among the plurality of monitoring conditions corresponding to the target number, the method further includes: Entering a next acquisition cycle corresponding to the current acquisition cycle, and clearing the count value of each of the multiple cycle statistical parameters.
15. The method according to claim 1, characterized in that The operating modes include multiple ones of a normal operating mode, a first-level energy-saving operating mode, a second-level energy-saving operating mode and a third-level energy-saving operating mode, and the power consumption of the normal operating mode, the power consumption of the first-level energy-saving operating mode, the power consumption of the second-level energy-saving operating mode and the power consumption of the third-level energy-saving operating mode decrease in sequence.
16. The method according to claim 5, 7 or 8, characterized in that: When it is determined that the multi-core processor does not satisfy the third monitoring condition, determining the first utilization rate according to the utilization rate of each of the working cores and the target number includes: Determining the total utilization of the multi-core processor according to the utilization of each of the working cores; The first utilization rate is determined according to the total utilization rate and the target quantity.
17. An operation mode adjustment device, characterized in that: The device is applied to a multi-core processor, the multi-core processor includes a management core and at least one service core, and the device includes: An acquisition module, used to acquire the utilization rate of each core of the multi-core processor in a current acquisition cycle; A determination module, configured to determine a target number of working cores in a working state in the multi-core processor according to the utilization rate of each of the cores of the multi-core processor, wherein the working cores include the management core and / or at least one of the service cores; when it is determined that the target number is less than or equal to a first preset number threshold, obtain a first monitoring condition and a second monitoring condition, as well as a target operating mode of the management core in the current acquisition cycle, wherein the target operating mode is a normal operating mode or a first-level energy-saving operating mode; when the target operating mode is the normal operating mode, determine whether the multi-core processor satisfies a first monitoring condition according to the utilization rate of each of the working cores, wherein the first monitoring condition is a target monitoring condition, and the target monitoring condition is any one of a plurality of monitoring conditions corresponding to the target number; The acquisition module is further configured to acquire, when it is determined that the multi-core processor satisfies the target monitoring condition, an operation mode setting rule corresponding to the target monitoring condition according to the target monitoring condition; The adjustment module is used to adjust the operation mode of at least one core in the multi-core processor according to the operation mode setting rule corresponding to the target monitoring condition.
18. A multi-core processor, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the operation mode adjustment method according to any one of claims 1 to 16 by executing the computer instructions.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the operation mode adjustment method according to any one of claims 1 to 16.
20. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the operation mode adjustment method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Processing method and device and electronic equipment
CN115033385A
Method and device for verifying cache consistency of multi-core processor system
CN116049034A