Data processing method and device, electronic equipment and storage medium

By dynamically setting the core frequency of a multi-core processor to match the load type, the problem of excessive power consumption in multi-core processors when pursuing performance is solved, achieving optimal power consumption and performance matching.

CN114138461BActive Publication Date: 2026-02-27LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111284680.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-01
Publication Date
2026-02-27
Estimated Expiration
2041-11-01

AI Technical Summary

Technical Problem

Existing multi-core processors consume excessive power in pursuit of performance. How can we save processor power while ensuring performance?

Method used

By determining the target load type of the multi-core processor, the maximum processing frequency of different cores is dynamically set, and the frequency of each core is reasonably configured to match the current load type, thereby achieving optimal performance and reducing power consumption.

Benefits of technology

It effectively reduces the power consumption of multi-core processors while ensuring that each core operates at its optimal performance, avoiding resource waste and stuttering issues caused by excessive frequency of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114138461B_ABST
    Figure CN114138461B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method applied to a multi-core processor, the multi-core processor comprising a first core and a second core, the processing capability of the first core being greater than the processing capability of the second core; the method comprising: determining a target load type of the multi-core processor; wherein different load types correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency being a maximum processing frequency corresponding to the first core; the second processing frequency being a maximum processing frequency of the second core; and controlling the first core and the second core to perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the target load type. Embodiments of the present application also disclose a data processing device, an electronic device and a computer storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to, but is not limited to, the technical field of computer technology, and in particular to a data processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] At present, the processor for data processing is mainly oriented to performance, that is, the processor gives priority to guarantee the processing performance of data, thereby causing the power consumption of the processor to be too large. Therefore, how to save the power consumption of the processor while guaranteeing the performance is an urgent problem to be solved. SUMMARY

[0003] Embodiments of the present application aim to provide a data processing method and device, electronic equipment and computer storage medium.

[0004] The technical solution of the present application is implemented as follows:

[0005] In a first aspect, a data processing method is provided, applied to a multi-core processor, the multi-core processor comprising a first core and a second core, the processing capability of the first core being greater than the processing capability of the second core; the method comprising:

[0006] determining a target load type of the multi-core processor; wherein different load types correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency being a maximum processing frequency corresponding to the first core; the second processing frequency being a maximum processing frequency of the second core;

[0007] controlling the first core and the second core to perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the target load type.

[0008] In a second aspect, a data processing device is provided, applied to a multi-core processor, the multi-core processor comprising a first core and a second core, the processing capability of the first core being greater than the processing capability of the second core;

[0009] The device comprises:

[0010] a load type determination unit configured to determine a target load type of the multi-core processor; wherein different load types correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency being a maximum processing frequency corresponding to the first core; the second processing frequency being a maximum processing frequency of the second core;

[0011] a control unit configured to control the first core and the second core to perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the target load type.

[0012] In a third aspect, an electronic device is provided, including a processor and a memory, wherein the memory is configured to store program instructions, and the processor is configured to execute the program instructions to cause the above data processing method to be performed.

[0013] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to perform the above data processing method.

[0014] The data processing method provided by the embodiments of the present application is applied to a multi-core processor, the multi-core processor includes a first core and a second core, the processing capability of the first core is greater than the processing capability of the second core; the method includes: determining a target load type of the multi-core processor; wherein different load types correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency is a maximum processing frequency corresponding to the first core; the second processing frequency is a maximum processing frequency of the second core; based on the first processing frequency and / or the second processing frequency corresponding to the target load type, the first core and the second core are controlled to perform data processing. That is, the data processing method provided by the embodiments of the present application can obtain the load type of the multi-core processor, dynamically set the maximum processing frequency of different cores according to the load type, and by reasonably configuring the processing frequencies of different cores, each core can achieve the best performance and reduce the power consumption of the multi-core processor. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 Flowchart of a data processing method provided by the embodiments of the present application Figure One ;

[0016] Figure 2 Performance and power consumption curve diagram of a first processing core and a second processing core provided by the embodiments of the present application;

[0017] Figure 3 Flowchart of a data processing method provided by the embodiments of the present application Figure Two ;

[0018] Figure 4 Flowchart of a data processing method provided by the embodiments of the present application Figure Three ;

[0019] Figure 5 Flowchart of a data processing method provided by the embodiments of the present application Figure Four ;

[0020] Figure 6 Application framework diagram provided by the embodiments of the present application;

[0021] Figure 7A data processing device structure schematic diagram provided by an embodiment of the present application;

[0022] Figure 8 A hardware structure composition schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0023] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application.

[0024] It should be noted that the terms “first”, “second” and the like in the specification and claims of the present application and the above-described drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the terms “include” and “have” and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally further include steps or units not listed, or can optionally further include other steps or units inherent to the process, method, product or device. In addition, the term “and / or” describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character “ / ” generally represents an “or” relationship between the associated objects. The step number in the present application is only for example, which can correspond to different embodiments, and does not limit the order in the case of no conflict. The technical features in the embodiments and implementation manners provided by the present application can be combined with each other in the case of no conflict.

[0025] At present, the performance is still oriented in the multi-core processor, and all processes running under the operating system are allocated on demand on each core. Only when the processes of all cores are processed, the core can enter a low-power state, and the efficiency of core data processing is not the highest at any time.

[0026] Based on this, the present application provides a data processing method, device, electronic equipment and storage medium, which can obtain the load type of the multi-core processor, dynamically set the maximum processing frequency of different cores according to the load type, and reasonably configure the processing frequency of different cores, so that each core can achieve the best performance and reduce the power consumption of the multi-core processor.

[0027] The data processing method provided by the embodiments of the present application will be described below with reference to the drawings.

[0028] An embodiment of the present application provides a data processing method applied in a multi-core processor, which can include two types of cores with different processing capabilities, for example, a first core and a second core. The processing capability of the first core is greater than that of the second core.

[0029] Reference Figure 1 As shown in the data processing method flowchart, the data processing method provided by the embodiment of the present application can include the following steps:

[0030] Step 101, determining a target load type of the multi-core processor; wherein different load types correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency is the maximum processing frequency corresponding to the first core; and the second processing frequency is the maximum processing frequency of the second core.

[0031] In the embodiment of the present application, the multi-core processor can determine the current target load type based on its own load amount at the current time. Here, the load amount can be obtained based on the data amount of the data to be processed, the kernel state ratio, the user state ratio, the user interaction frequency, and the memory requirement, etc. The load amount of the multi-core processor is not limited in the embodiment of the present application.

[0032] Here, the multi-core processor can classify different load amounts to obtain multiple load types. For example, when the load types include a high load type and a low load type, the load amount greater than a first threshold value can be regarded as the high load type, and the load amount less than or equal to the first threshold value can be regarded as the low load type. When the load types include a high load type, a medium load type and a low load type, the load amount greater than a first threshold value can be regarded as the high load type, the load amount less than or equal to the first threshold value and greater than a second threshold value can be regarded as the medium load type, and the load amount less than or equal to the second threshold value can be regarded as the low load type.

[0033] In the embodiment of the present application, the target load type can be any one of the multiple load types.

[0034] It should be understood that different load types have different processing requirements for the multi-core processor. For example, the high load type has a large load amount, so it has a large processing requirement for the multi-core processor, while the low load type has a small load amount, so it has a small requirement for the multi-core processor.

[0035] Based on this, in the embodiment of the present application, the multi-core processor can configure the maximum processing frequency of the core for each load type. Here, the maximum processing frequency of the core includes the maximum processing frequency of the first core (i.e. the first processing frequency) and / or the maximum processing frequency of the second core (i.e. the second processing frequency).

[0036] That is, the multi-core processor sets the maximum frequency that the first core and / or the second core can work at under each load type, which is the upper limit of the working frequency of the first core and / or the second core.

[0037] It should be noted that the maximum processing frequency of the first core and the maximum processing frequency of the second core configured for each load type can meet the maximum processing requirement corresponding to the load type. In this way, the maximum operating frequency of different cores is set for each load type, which can avoid the problem of power waste caused by running the processor at the maximum frequency during data processing.

[0038] In the embodiment of the application, the first processing frequency and / or the second processing frequency corresponding to different load types are different. In addition, the first processing frequency and the second processing frequency in the same load type can be the same or different, which is not limited in the embodiment of the application.

[0039] In some embodiments, the load types can include: a high load type, a medium load type and a low load type.

[0040] The first processing frequency corresponding to the high load type is greater than the first processing frequency corresponding to the medium load type and the first processing frequency corresponding to the low load type.

[0041] The first processing frequency corresponding to the medium load type is greater than the first processing frequency corresponding to the low load type.

[0042] The second processing frequency corresponding to the high load type is greater than the second processing frequency corresponding to the medium load type and the second processing frequency corresponding to the low load type.

[0043] The second processing frequency corresponding to the medium load type is greater than or equal to the second processing frequency corresponding to the low load type.

[0044] The second frequency corresponding to the medium load type is less than or equal to the second processing frequency corresponding to the medium load type.

[0045] It should be understood that the processing frequency of the core in the multi-core processor is the clock frequency. The higher the clock frequency of the core, the faster the processing speed, and the greater the corresponding power consumption. Conversely, the lower the clock frequency of the core, the slower the processing speed, and the smaller the corresponding power consumption.

[0046] In the embodiment of the application, different cores can run simultaneously during data processing of the multi-core processor. Therefore, the maximum processing frequency of the first core and the second core under different load types can be flexibly set.

[0047] Figure 2A schematic diagram illustrating the performance and power consumption curves of a first processing core and a second processing core is shown. Curve 21 represents the relationship between the performance and power consumption of the first processing core, and curve 22 represents the relationship between the performance and power consumption of the second processing core. The three load types correspond to different power consumption levels: the power consumption for high load is greater than that for medium and low load types, and the power consumption for medium load is greater than that for low load type. Specifically, under the same power consumption in high and medium load types, the performance of the first core is greater than that of the second core. In other words, for the first and second cores to achieve the same performance in high and medium load types, the power consumption of the second core must be greater than that of the first core. Furthermore, under the same power consumption in low load type, the performance of the first core is greater than that of the second core; or, for the first and second cores to achieve the same performance in low load type, the power consumption of the first core must be greater than that of the second core.

[0048] In this embodiment of the application, based on Figure 2 The performance-power curves shown illustrate how to set higher first and second processing frequencies for high-load scenarios. This allows both the first and second cores to operate at higher frequencies to match the heavier workload and achieve optimal performance. For example, setting both the first and second processing frequencies to 3.8GHz corresponds to a high-load scenario. For medium-load scenarios, a moderate first processing frequency and a relatively high second processing frequency can be set, allowing the first core to operate at a lower frequency while the second core operates at a higher frequency. For example, setting the first processing frequency to 2.5GHz and the second to 2.7GHz. For low-load scenarios, a lower first processing frequency and a relatively high second processing frequency can be set to maximize data processing by the second core, thus reducing power consumption. For example, setting the maximum processing frequency for the first core to 1GHz and the maximum processing frequency for the second core to 2.7GHz.

[0049] It should be noted that the first processing frequency and / or the second processing frequency corresponding to each load type can be a fixed value or a value dynamically determined by the multi-core processor based on historical operating information. This application embodiment does not limit this.

[0050] In some embodiments, the multi-core processor may maintain a mapping table that indicates the mapping relationship between load types and a first processing frequency and / or a second processing frequency. This allows the multi-core processor to directly access the mapping table when needed, quickly determining the first and / or second processing frequencies corresponding to each load type.

[0051] Step 102, control the first core and the second core to process data based on the first processing frequency and / or the second processing frequency corresponding to the target load type.

[0052] It can be understood that after the multi-core processor determines the current target load type, the first processing frequency and / or the second processing frequency corresponding to the target load type can be further determined.

[0053] In some embodiments, the multi-core processor can read a pre-stored mapping relationship table, and determine the first processing frequency and / or the second processing frequency corresponding to the current target load type based on the mapping relationship table.

[0054] Further, after the multi-core processor determines the first processing frequency and / or the second processing frequency, the working frequency of the first core when processing data can be controlled to not exceed the first processing frequency, and / or the working frequency of the second core when processing data can be controlled to not exceed the second processing frequency.

[0055] That is, in the data processing method provided by the embodiments of the present application, the maximum processing frequency of each core in the multi-core processor can be dynamically set according to the load type of the multi-core processor, so that the maximum processing frequency of each core can match the current load type of the multi-core processor. In this way, by reasonably configuring the processing frequencies of different cores, each core can achieve the best performance and reduce the power consumption of the multi-core processor.

[0056] Based on the foregoing embodiments, in an embodiment of the present application, referring to the data processing flow diagram shown in Figure 3 , step 101 of determining the target load type of the multi-core processor can be implemented by the following steps: Figure Two

[0057] Step 1011, determine the occupancy rate of the user mode in the multi-core processor.

[0058] Step 1012, determine the target load type of the multi-core processor based on the occupancy rate.

[0059] In actual applications, the processing state of the multi-core processor can be divided into kernel mode and user mode. In the kernel mode, the multi-core processor specifically runs the operating system program and operates the hardware, while in the user mode, the multi-core processor specifically runs the application program.

[0060] It should be noted that the occupancy rate of the user mode can refer to the time proportion of the multi-core processor in the user mode within a period of time.

[0061] ​It can be understood that the user state needs to process the user's application, and the kernel state only processes the operating system program, so the user state has a greater demand for the multi-core processor than the kernel state. That is, the higher the user state occupancy rate, the greater the load, and the higher the demand for the multi-core processor. Conversely, the lower the user state occupancy rate, the smaller the load, and the lower the demand for the multi-core processor.

[0062] Therefore, the multi-core processor can determine the target load type of the multi-core processor according to the occupancy rate of the user state.

[0063] In some embodiments, the multi-core processor can determine the target load type in step 1012 by the following way:

[0064] In step 1012a, if the occupancy rate is greater than or equal to the first threshold value, the target load type of the multi-core processor is determined as the first load type; the load corresponding to the first load type is greater than the load corresponding to the second load type; and the second load type is the current load type of the multi-core processor.

[0065] In step 1012b, if the occupancy rate is less than or equal to the second threshold value, the target load type of the multi-core processor is determined as the third load type; the load corresponding to the third load type is less than the load corresponding to the second load type.

[0066] It can be understood that the multi-core processor can determine the target load type based on the relationship between the occupancy rate of the kernel state and the first threshold value and the second threshold value.

[0067] Specifically, if the occupancy rate of the kernel state is greater than or equal to the first threshold value, it can be considered that the current load of the multi-core processor is heavy, and the first processing frequency and / or the second processing frequency corresponding to the current second load type for data processing may cause the problem of processing lag. Therefore, the multi-core processor can take the first load type with a load greater than the load corresponding to the second load type as the target load type, and perform data processing at the first processing frequency and / or the second processing frequency corresponding to the first load type.

[0068] It can be understood that the load corresponding to the first load type is greater than the load corresponding to the second load type, so the first processing frequency and / or the second processing frequency corresponding to the first load type can match the greater processing demand relative to the second load type. In this way, after taking the first load type as the target load type, the multi-core processor can continue to process the data at the first processing frequency and / or the second processing frequency corresponding to the first load type, thereby alleviating the problem of processing lag and improving the processing efficiency of the data.

[0069] That is, when the load amount corresponding to the first load type is greater than or equal to the first threshold value, the maximum processing frequency of the current first core and / or second core can be updated to the maximum processing frequency of the first core and / or second core under the first load type to adapt to heavier load.

[0070] For example, the current load type of the multi-core processor is a low load type, and the multi-core processor performs data processing based on the first processing frequency and / or the second processing frequency corresponding to the low load type. When it is detected that the proportion of the kernel mode is greater than the first threshold value, it is determined that the load amount of the current multi-core processor is rising. At this time, the processor can update the load type to a medium load type and perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the medium load type. Further, the multi-core processor detects that the proportion of the kernel mode is greater than the first threshold value during data processing based on the first processing frequency and / or the second processing frequency corresponding to the medium load type, and updates the load type to a high load type to perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the high load type.

[0071] Here, the first threshold value can be a pre-configured parameter value, or a value set by the multi-core processor according to actual data processing conditions, and the embodiments of the present application do not limit this.

[0072] In addition, if the kernel mode occupancy rate is less than or equal to the second threshold value, it means that the load of the multi-core processor is light, and the first processing frequency and / or the second processing frequency corresponding to the current second load type is continued to be used for data processing, which may cause a problem of waste of processing resources. Therefore, the multi-core processor can take a third load type corresponding to a load amount smaller than that of the second load type as a target load type, and perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the third load type.

[0073] It can be understood that the load amount corresponding to the third load type is smaller than the load amount corresponding to the second load type, and therefore the first processing frequency and / or the second processing frequency corresponding to the third load type can match less processing demand relative to the second load type. In this way, after taking the third load type as the target load type, the multi-core processor can continue to process the subsequent data based on the first processing frequency and / or the second processing frequency corresponding to the third load type, which can enable the first core and the second core to work at a suitable frequency, thereby avoiding the problem of waste of processing resources.

[0074] For example, the current load type of the multi-core processor is a high load type, and the multi-core processor performs data processing based on the first processing frequency and / or the second processing frequency corresponding to the high load type. If the proportion of the kernel mode is less than the second threshold value, it is determined that the load of the multi-core processor is reduced. At this time, the processor can update the load type to a medium load type, and perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the medium load type. Further, the multi-core processor detects that the proportion of the kernel mode is less than the second threshold value during data processing based on the first processing frequency and / or the second processing frequency corresponding to the medium load type, and updates the load type to a low load type, and performs data processing based on the first processing frequency and / or the second processing frequency corresponding to the low load type.

[0075] Here, the second threshold value can be a preconfigured parameter value, or a value set by the multi-core processor according to actual data processing conditions, and the embodiments of the present application do not limit this.

[0076] It should be noted that the first threshold value is different from the second threshold value. For example, the first threshold value can be 35%, and the second threshold value can be 17%.

[0077] In some embodiments, in order to avoid the multi-core processor frequently switching between different load types and producing a ping-pong effect, the multi-core processor can detect that the proportion of the kernel mode is greater than or equal to the first threshold value for a certain time period, or the proportion of the kernel mode is less than or equal to the second threshold value for a certain time period, and then update the load type.

[0078] Based on the foregoing embodiments, in an embodiment of the present application, referring to the flowchart shown in Figure 4 Before step 101 determines the target load type of the multi-core processor, the following steps can also be performed.

[0079] Step 100, determining a load type set of the multi-core processor according to historical running information of the multi-core processor.

[0080] Correspondingly, step 101 of determining the target load type of the multi-core processor can be implemented in the following manner:

[0081] Step 101', determining the target load type of the multi-core processor from the load type set.

[0082] Here, the historical running information can include the processing frequency of the first core and / or the second core of the multi-core processor in a first preset time period, the usage rate of the first core and / or the second core, etc., and the embodiments of the present application do not limit this.

[0083] In the embodiments of the present application, the multi-core processor can maintain a load type set, and when it is necessary to switch the load type of the multi-core processor, the multi-core processor can switch between multiple load types in the load type set.

[0084] It can be understood that in the embodiments of the present application, the multi-core processor can determine the historical use habit of the user according to the historical running information, and predict the processing demand of the user for the multi-core processor. Further, the multi-core processor can adjust which load types the multi-core processor switches between in the future according to the predicted processing demand of the multi-core processor, thereby achieving the effect of adjusting the first core and / or the second core.

[0085] For example, if the multi-core processor is often in a high load type in the past period of time, it can be considered that the user has a high processing demand for the multi-core processor, and at this time, the high load type and the low load type can be included in the load type set, that is, the multi-core processor only switches between the high load type and the medium load type in the candidate data processing process, avoiding switching to the low load type. If the multi-core processor is often in a medium load type in the past period of time, the high load type, the medium load type and the low load type can be included in the load type set, so that the multi-core processor can flexibly switch between the three load types.

[0086] In some embodiments, the step of determining the load type set of the multi-core processor according to the historical running information of the multi-core processor in step 100 can be implemented in the following manner:

[0087] If the historical running information represents that the time length of the high load type in the first preset time period is greater than the preset time length, it is determined that the load type set includes the high load type and the medium load type.

[0088] Here, the first preset time period can be the past week or the past 24 hours, and the present embodiments do not limit this. The preset time length can be eighty percent or fifty percent of the total time length of the first preset time period, and the present embodiments do not limit this.

[0089] It can be understood that when the time length of the high load type is greater than the preset time length, it is considered that the multi-core processor is often in the high load type, and the user has a high demand for data processing. In this scenario, the multi-core processor can only switch between the high load type and the medium load type, avoiding switching to the first processing frequency and / or the second processing frequency corresponding to the low load type, so as to ensure the demand of the user.

[0090] It can be seen that in the data processing method provided in the embodiments of the present application, the maximum processing frequency of the first core and / or the second core can be reasonably set according to the use habit of the user, and the user experience is optimized.

[0091] In some embodiments, before step 101 determines the target load type of the multi-core processor, the following steps can also be performed:

[0092] According to the historical running information of the multi-core processor, the first processing frequency and / or the second processing frequency corresponding to each load type is determined.

[0093] It can be understood that the maximum processing frequency of the first core and the second core in each load type can be determined by the historical running information of the multi-core processor.

[0094] In the embodiments of the present application, the historical running information can include the processing frequency of the first core and / or the second core in the second preset time period, the usage rate of the first core and / or the second core, which is not limited in the embodiments of the present application.

[0095] For example, the multi-core processor can take the maximum value of the processing frequency of the first core and the maximum value of the processing frequency of the second core in the second time period as the first processing frequency and the second processing frequency corresponding to the high load type. The average value of the processing frequency of the first core and the average value of the processing frequency of the second core in the past second time period can be taken as the first processing frequency and the second processing frequency corresponding to the medium load type. The minimum value of the processing frequency of the first core and the minimum value of the processing frequency of the second core in the second time period can also be taken as the first processing frequency and the second processing frequency corresponding to the low load type.

[0096] It should be noted that there are many ways to set the first processing frequency and the second processing frequency corresponding to each load type based on historical information, which is not limited in the embodiments of the present application.

[0097] In some embodiments, the multi-core processor can determine the first average frequency corresponding to the first core and / or the second average frequency corresponding to the second core in the second preset time period according to the historical running information.

[0098] The first working frequency corresponding to the low load type is set to the first average frequency, and / or the second working frequency corresponding to the low load type is set to the second average working frequency.

[0099] In the embodiments of the present application, the multi-core processor can take the average processing frequency of the first core in the second time period as the first processing frequency corresponding to the low load type, and take the average frequency of the second core in the second time period as the second processing frequency corresponding to the low load type. In this way, the basic needs of the user under the low load type can be guaranteed.

[0100] In some embodiments, the number of the first cores includes multiple, and the number of the second cores includes multiple; the data processing method provided by the embodiments of the present application can further include the following steps:

[0101] determine the first dormancy parameter and / or the second dormancy parameter based on the target load type;

[0102] control part of the first cores to enter the dormancy state based on the first dormancy parameter; or

[0103] control part of the second cores to enter the dormancy state based on the second dormancy parameter.

[0104] Here, the dormancy parameter can include, but is not limited to, the proportion of the number of cores entering the dormancy state in the total number of cores, the number of cores entering the dormancy state, the dormancy time, etc.

[0105] It can be understood that the multi-core processor can control different cores in the multi-core processor to enter dormancy or continue to work based on the determined target load type. For example, if the target load type is a high load type, the first dormancy parameter can be that the number of first cores entering the dormancy state is 0, and the second dormancy parameter can be that the number of second cores entering the dormancy state is 0, that is, in the high load type, the first cores and the second cores are all in the working state. If the target load type is a low load type, the first dormancy parameter can be that the proportion of the first cores entering the dormancy state is 80%, and the second dormancy parameter can be that the proportion of the second cores entering the dormancy state is 0. That is, in the low load type, most of the first cores enter the dormancy state, and all the second cores are in the working state.

[0106] Therefore, in the data processing method provided by the embodiments of the present application, the multi-core processor can dynamically determine the dormancy parameters of different cores according to the load type, realize reasonable configuration of the dormancy parameters, and further reduce the power consumption of the multi-core processor.

[0107] The data processing method provided by the embodiments of the present application will be described below in combination with specific application scenarios.

[0108] Reference Figure 5 The data processing method provided by the embodiments of the present application can include the following steps, as shown in the data processing method flowchart.

[0109] Step 501, the multi-core processor acquires an application process.

[0110] Step 502, determine the application process type.

[0111] Here, the application type includes user interaction type (such as keyboard, mouse input), media playback type (such as audio and video, etc.), etc.

[0112] Step 503, when the type of the application process is the media playback type, the user state occupancy rate can be acquired.

[0113] When the type of the application process is the user interaction type, the user state occupancy is set to twice the current user state occupancy, and the user state occupancy is obtained.

[0114] It can be understood that when the type is the user interaction type, the multi-core processor needs to respond in time, and the demand for data processing is high, so the user state occupancy can be set to twice the current user state occupancy, so that the multi-core processor can process the user interaction request in time.

[0115] In step 504, the load type of the current multi-core processor is determined based on the user state occupancy.

[0116] In step 505, the maximum processing frequency of the first core and the maximum processing frequency of the second core are set based on the load type.

[0117] If the load type is the high load type, the maximum processing frequency of the first core is set to A1, and the maximum processing frequency of the second core is set to A2. If the load type is the medium load type, the maximum processing frequency of the first core is set to B1, and the maximum processing frequency of the second core is set to B2. If the load type is the low load type, the maximum processing frequency of the first core is set to C1, and the maximum processing frequency of the second core is set to C2.

[0118] In step 506, in the case of data processing based on the maximum processing frequencies C1 and C2 corresponding to the low load type, it is determined whether the current user state occupancy is greater than or equal to a first threshold value. If it is greater than or equal to the first threshold value, the maximum processing frequencies B1 and B2 corresponding to the medium load type are switched to for data processing.

[0119] In the case of data processing based on the maximum processing frequencies A1 and A2 corresponding to the high load type, it is determined whether the current user state occupancy is less than or equal to a second threshold value. If it is less than or equal to the second threshold value, the maximum processing frequencies B1 and B2 corresponding to the medium load type are switched to for data processing.

[0120] In addition, Figure 6 An application framework diagram to which the embodiment of the application is applicable is shown.

[0121] Referring to Figure 6 In the embodiment of the application, the multi-core processor can obtain a plurality of historical running information, including historical running information 1 to historical running information n, n is an integer greater than 1. The multi-core processor can determine a load type set of the current multi-core processor and the maximum processing frequencies of the first core and the second core under each load type in the load type set according to the plurality of historical running information.

[0122] Specifically, the multi-core processor can determine, according to the historical running information 1 to the historical running information n, a high load type, a maximum processing frequency of the first core being A1 and a maximum processing frequency of the second processing core being A2; a medium load type, a maximum processing frequency of the first core being B1 and a maximum processing frequency of the second processing core being B2; and a low load type, a maximum processing frequency of the first core being C1 and a maximum processing frequency of the second processing core being C2.

[0123] Further, the multi-core processor can obtain the user state occupancy rate. In the process distributor of the multi-core processor, based on the user state occupancy rate and the maximum processing frequency of the first core and the second core corresponding to each load type, the maximum processing frequency of the first core and the maximum processing frequency of the second core are determined by Figure 5 The method determines the maximum processing frequency of the first core and the maximum processing frequency of the second core. Further, the multi-core processor sends the result to the operating system through an application programming interface (API) interface, and the operating system actively sets the maximum processing frequency of the first core and the maximum processing frequency of the second core through a PPM interface.

[0124] To sum up, in the data processing method provided by the embodiments of the present application, the load type of the multi-core processor can be obtained, and the maximum processing frequency of different cores is dynamically set according to the load type, so that the processing frequency of different cores is reasonably configured, each core can achieve the best performance, and the power consumption of the multi-core processor is reduced.

[0125] Based on the foregoing embodiments, the embodiments of the present application also provide a data processing apparatus applied to the multi-core processor, the multi-core processor including a first core and a second core, the processing capability of the first core being greater than the processing capability of the second core.

[0126] Referring to Figure 7 The data processing apparatus provided by the embodiments of the present application can include:

[0127] A load type determination unit 701 is configured to determine a target load type of the multi-core processor; different load types correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency is a maximum processing frequency corresponding to the first core; and the second processing frequency is a maximum processing frequency of the second core.

[0128] A control unit 702 is configured to control the first core and the second core to perform data processing based on the first processing frequency and / or the second processing frequency corresponding to the target load type.

[0129] In some embodiments, the load type determination unit 701 is specifically configured to determine an occupancy ratio of a user mode in the multi-core processor; and determine a target load type of the multi-core processor based on the occupancy ratio.

[0130] In some embodiments, the load type determination unit 701 is further configured to determine that the target load type of the multi-core processor is a first load type if the occupancy ratio is greater than or equal to a first threshold value; the load amount corresponding to the first load type is greater than a load amount corresponding to a second load type; the second load type is a current load type of the multi-core processor; and determine that the target load type of the multi-core processor is a third load type if the occupancy ratio is less than or equal to a second threshold value; the load amount corresponding to the third load type is less than the load amount corresponding to the second load type.

[0131] In some embodiments, the load type includes a high load type, a medium load type, and a low load type.

[0132] In some embodiments, the first processing frequency corresponding to the high load type is greater than the first processing frequency corresponding to the medium load type and the first processing frequency corresponding to the low load type.

[0133] In some embodiments, the first processing frequency corresponding to the medium load type is greater than the first processing frequency corresponding to the low load type.

[0134] In some embodiments, the second processing frequency corresponding to the high load type is greater than the second processing frequency corresponding to the medium load type and the second processing frequency corresponding to the low load type.

[0135] In some embodiments, the second processing frequency corresponding to the medium load type is greater than or equal to the second processing frequency corresponding to the low load type.

[0136] In some embodiments, the second frequency corresponding to the medium load type is less than or equal to the second processing frequency corresponding to the medium load type.

[0137] In some embodiments, the data processing apparatus further includes a load type set determination unit configured to determine a load type set of the multi-core processor according to historical running information of the multi-core processor.

[0138] The load type determination unit 701 is further configured to determine the target load type of the multi-core processor from the load type set.

[0139] In some embodiments, the load type set determination unit is further configured to determine that the load type set includes the high load type and the medium load type if the historical running information represents that a time length of the high load type in a first preset time period is greater than a preset time length.

[0140] In some embodiments, the data processing apparatus further comprises a frequency determination unit configured to determine the first processing frequency and / or the second processing frequency corresponding to each load type according to historical running information of the multi-core processor.

[0141] In some embodiments, the frequency determination unit is configured to determine, according to the historical running information, a first average frequency corresponding to the first core and / or a second average frequency corresponding to the second core in a second preset time period; set the first working frequency corresponding to the low load type as the first average frequency, and / or set the second working frequency corresponding to the low load type as the second average working frequency.

[0142] In some embodiments, the number of the first cores comprises a plurality, and the number of the second cores comprises a plurality.

[0143] The control unit 702 is further configured to determine a first sleep parameter and / or a second sleep parameter based on the target load type; control part of the first cores to enter a sleep state based on the first sleep parameter; or control part of the second cores to enter a sleep state based on the second sleep parameter.

[0144] Based on the foregoing embodiments, the embodiments of the present application further provide an electronic device. Figure 8 is a schematic structural diagram of an electronic device provided by the embodiments of the present application. The electronic device shown in FIG. 800 comprises a multi-core processor 801, which can call and run a computer program from a memory to implement the method in the embodiments of the present application.

[0145] Optionally, as shown in Figure 8 The electronic device can further comprise a memory 802. The multi-core processor 801 can call and run a computer program from the memory 802 to implement the method in the embodiments of the present application.

[0146] The memory 802 can be a separate device independent of the multi-core processor 801, or can be integrated in the multi-core processor 801.

[0147] It should be understood that the multi-core processor of the embodiments of the present application can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the method embodiments described above can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware coding processor for execution, or a combination of hardware and software modules in the coding processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method.

[0148] It is to be understood that the memory in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (Random Access Memory, RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the system and method described herein is intended to include, but not limited to, these and any other suitable types of memory.

[0149] It should be understood that the above-mentioned memory is exemplary but not limiting, for example, the memory in the embodiments of the present application can also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and the like. That is, the memory in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.

[0150] In an example embodiment, the embodiments of the present application also provide a computer readable storage medium, for example, the memory 802 including a computer program executable by the multi-core processor 801 of the electronic device 800 to complete the steps of the foregoing method. The computer readable storage medium can be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), and the like.

[0151] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0152] The present application is described with reference to the flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure One The functions specified in a flow or multiple flows and / or blocks Figure One The device that implements the functions specified in a flow or multiple flows and / or blocks.

[0153] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure One The flow or flows and / or blocks Figure One The flow or flows and / or blocks

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that execute on the computer or other programmable apparatus provide steps for implementing the flow Figure One The flow or flows and / or blocks Figure One The flow or flows and / or blocks

[0155] The above specification, examples and data provide essential information for constructing and using the application. They are not intended to limit the scope of the application, which is defined by the appended claims.

Claims

1. A data processing method, characterized by, The application is applied to a multi-core processor, the multi-core processor comprises a first core and a second core, the processing capacity of the first core is greater than the processing capacity of the second core; the method comprises: obtaining a plurality of historical running information of the multi-core processor, and determining a load type set of the current multi-core processor and a first processing frequency of the first core and a second processing frequency of the second core under each load type in the load type set according to the plurality of historical running information; wherein different load types in the load type set correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency is the maximum processing frequency corresponding to the first core; the second processing frequency is the maximum processing frequency of the second core; obtaining an application process, and obtaining a user state occupancy rate when the type of the application process is a media playing type; in a process distributor of the multi-core processor, determining a target load type of the multi-core processor based on the user state occupancy rate and the maximum processing frequency of the first core and the maximum processing frequency of the second core corresponding to each load type in the load type set; the multi-core processor sends the target load type of the multi-core processor to an operating system, so that the operating system actively sets the maximum processing frequency of the first core and the maximum processing frequency of the second core; dynamically controlling the working frequency of the first core according to the maximum processing frequency of the first core and dynamically controlling the working frequency of the second core according to the maximum processing frequency of the second core, so that the working frequency of each core of the multi-core processor is dynamically adjusted according to the corresponding maximum processing frequency.

2. The method of claim 1, wherein, the method comprises: if the occupancy rate is greater than or equal to a first threshold value, it is determined that the target load type of the multi-core processor is a first load type; the load amount corresponding to the first load type is greater than the load amount corresponding to a second load type; the second load type is the current load type of the multi-core processor; if the occupancy rate is less than or equal to a second threshold value, it is determined that the target load type of the multi-core processor is a third load type; the load amount corresponding to the third load type is less than the load amount corresponding to the second load type.

3. The method according to claim 1 or 2, characterized in that, the load type comprises a high load type, a medium load type and a low load type; wherein the first processing frequency corresponding to the high load type is greater than the first processing frequency corresponding to the medium load type and the first processing frequency corresponding to the low load type; and / or, the first processing frequency corresponding to the medium load type is greater than the first processing frequency corresponding to the low load type; and / or, the second processing frequency corresponding to the high load type is greater than the second processing frequency corresponding to the medium load type and the second processing frequency corresponding to the low load type; And / or, the second processing frequency corresponding to the medium load type is greater than or equal to the second processing frequency corresponding to the low load type. And / or, the second frequency corresponding to the medium load type is less than or equal to the second processing frequency corresponding to the medium load type.

4. The method of claim 1, wherein, The method further includes: If the historical running information represents that the duration of the high load type in a first preset time period is greater than a preset duration, the load type set is determined to include the high load type and the medium load type.

5. The method of claim 1, wherein, The method further includes: According to the historical running information, a first average frequency corresponding to the first core and / or a second average frequency corresponding to the second core in a second preset time period are determined. The first working frequency corresponding to the low load type is set to be the first average frequency, and / or the second working frequency corresponding to the low load type is set to be the second average working frequency.

6. The method of claim 1 or 2, wherein, The number of the first cores includes a plurality, and the number of the second cores includes a plurality. The method further includes: Based on the target load type, a first sleep parameter and / or a second sleep parameter are determined. Based on the first sleep parameter, part of the first cores are controlled to enter a sleep state; or, Based on the second sleep parameter, part of the second cores are controlled to enter a sleep state.

7. A data processing apparatus, characterized by The method is applied to a multi-core processor, and the multi-core processor includes first cores and second cores. The device includes: A load type set determination unit is configured to obtain a plurality of historical running information of the multi-core processor, and determine, according to the plurality of historical running information, a load type set of the multi-core processor and a first processing frequency of the first cores and a second processing frequency of the second cores under each load type in the load type set; wherein different load types in the load type set correspond to different first processing frequencies and / or second processing frequencies; the first processing frequency is a maximum processing frequency corresponding to the first cores; and the second processing frequency is a maximum processing frequency of the second cores. The load type determination unit is configured to acquire an application process, acquire a user state occupancy rate when a type of the application process is a media playing type, determine a target load type of the multi-core processor based on the user state occupancy rate and maximum processing frequencies of the first core and the second core corresponding to each load type in the load type set in a process distributor of the multi-core processor, wherein different load types correspond to different first processing frequencies and / or second processing frequencies, the first processing frequency is a maximum processing frequency corresponding to the first core, the second processing frequency is a maximum processing frequency of the second core, and the multi-core processor sends the target load type of the multi-core processor to an operating system, so that the operating system actively sets the maximum processing frequencies of the first core and the second core. The control unit is configured to dynamically control a working frequency of the first core according to the maximum processing frequency of the first core and dynamically control a working frequency of the second core according to the maximum processing frequency of the second core, so that the working frequencies of each core of the multi-core processor are dynamically adjusted according to the respective maximum processing frequencies.

Citation Information

Patent Citations

  • Terminal control method, device, terminal device, and storage medium

    CN109151966A

  • Domestic server power consumption real-time dynamic adjustment method

    CN112394803A