Heterogeneous processor frequency monitoring method and related device
By querying the registers of heterogeneous processors to obtain their frequency information and determining the frequency with the processor information, the problem that the prior art cannot monitor heterogeneous CPU frequency in real time is solved, and real-time monitoring and management of heterogeneous CPU frequency is realized.
Patent Information
- Application Number
- CN202411978106.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art cannot monitor the frequency of heterogeneous CPUs in real time, and cannot realize timely health monitoring of heterogeneous CPUs.
A heterogeneous processor frequency monitoring method is provided, by receiving a query request, querying the registers of the target processor, obtaining its frequency information, and determining the frequency in combination with the processor information. The method includes scanning each processor in the electronic device, obtaining its register information, determining the processor frequency, and saving the frequency.
Real-time monitoring and management of heterogeneous CPU frequency is realized, and can respond to frequency changes in time, improving the health monitoring capabilities of heterogeneous hardware platforms.
Smart Images

Figure CN119759974A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing, and in particular to a method and related device for monitoring the frequency of heterogeneous processors. Background Art
[0002] In order to enhance the market competitiveness of chips, 5G (5th-Generation Mobile Communication Technology) cloud base stations and next-generation cloud wireless network platforms need to have unified management and health monitoring of multiple heterogeneous resources.
[0003] In the actual use of cloud-based wireless network heterogeneous hardware platforms, high requirements are placed on the frequency of heterogeneous CPUs (central processing units) and high real-time performance. The premise of real-time performance is that the CPU needs to run stably at a constant frequency.
[0004] During the current use of heterogeneous CPUs, the CPU frequency cannot be viewed through the lscpu command. It can only be viewed by entering the system file. The actual CPU frequency cannot be viewed in real time, and timely monitoring of heterogeneous CPUs cannot be achieved. Summary of the invention
[0005] A first aspect of the present application provides a method for monitoring frequency of heterogeneous processors, which is applied to an electronic device provided with at least two processors, and the method comprises:
[0006] receiving a query request, the query request including a parameter to be queried in a specific parameter form for a target processor, the parameter to be queried being related to a frequency of the target processor, the target processor being at least one of the at least two processors;
[0007] Based on the parameters to be queried, at least a register corresponding to the target processor is queried to obtain a query result.
[0008] In a possible implementation, before receiving the query request, the method further includes:
[0009] Scan each processor in the electronic device to obtain processor information of each processor;
[0010] Obtaining register information corresponding to each processor in the electronic device;
[0011] Determining a processor frequency of a corresponding processor based on the register information in combination with the processor information;
[0012] The processor frequency is saved.
[0013] In a possible implementation, determining the processor frequency of the corresponding processor based on the register information in combination with the processor information includes:
[0014] Determine the structure information of the processor and the number of online processing cores according to the processor information;
[0015] Based on the register information, the structural information of the processor, and the number of online processing cores, a processor frequency of the corresponding processor is determined.
[0016] In a possible implementation, querying at least a register corresponding to the target processor based on the parameter to be queried to obtain a query result includes:
[0017] Based on the query parameter being the processor frequency, query the register corresponding to the target processor to obtain the processor frequency; and use the processor frequency as the query result;
[0018] Based on the fact that the parameter to be queried is a power policy, query the register corresponding to the target processor to obtain the processor frequency and the configured power policy within a set duration; determine the matching situation between the frequency fluctuation information of the processor and the configured power policy at least based on the processor frequency within the set duration; and use the matching situation as the query result.
[0019] In a possible implementation, determining, at least based on the processor frequency within a set time period, a matching condition between the frequency fluctuation information of the processor and the configured power supply policy includes:
[0020] Determining a predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on a correspondence between a preset power strategy and the frequency fluctuation information of the processor;
[0021] Based on the predicted power supply policy being the same as the configured power supply policy, determining a match between the frequency fluctuation information of the processor and the configured power supply policy;
[0022] Based on the difference between the predicted power policy and the configured power policy, it is determined that the frequency fluctuation information of the processor does not match the configured power policy.
[0023] In a possible implementation, determining the predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on the correspondence between the preset power strategy and the processor frequency fluctuation information includes:
[0024] Determine, based on the frequency fluctuation information, a relationship between the frequency and the maximum frequency / minimum frequency in the processor within a preset time period;
[0025] Based on the correspondence between the frequency of the processor and the maximum frequency / minimum frequency within a preset time period, a predicted power supply strategy of the processor is determined according to the maximum frequency / minimum frequency,
[0026] Based on the fact that the frequency of the processor does not correspond to the maximum frequency and the minimum frequency within a preset time period, the frequency fluctuation law of the processor is determined; based on the frequency fluctuation law of the processor and the processor utilization, the predicted power supply strategy of the processor is determined.
[0027] In a possible implementation, the receiving a query request includes:
[0028] The query request is received based on a specific interface, where the specific interface is used to connect the operating system and each processor.
[0029] A second aspect of the present application provides a heterogeneous processor frequency monitoring device, which is applied to an electronic device provided with at least two processors, and the device includes:
[0030] An interface module, configured to receive a query request, wherein the query request includes a parameter to be queried in a specific parameter form for a target processor, wherein the parameter to be queried is related to a frequency of the target processor, and the target processor is at least one of the at least two processors;
[0031] The query module is used to query at least the register corresponding to the target processor based on the parameter to be queried to obtain the query result.
[0032] A third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the heterogeneous processor frequency monitoring method of the first aspect or any implementation of the first aspect.
[0033] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0034] The memory is used to store computer programs;
[0035] The processor is used to execute the computer program so that the electronic device can implement the heterogeneous processor frequency monitoring method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0036] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the heterogeneous processor frequency monitoring method of the first aspect or any implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0038] Figure 1 It is a flowchart of a method for monitoring frequency of heterogeneous processors provided in an embodiment of the present application;
[0039] Figure 2 is a schematic diagram of a flow chart for precalculating the processor frequency of each processor provided in an embodiment of the present application;
[0040] Figure 3 It is a flowchart of determining the processor frequency of the corresponding processor based on the register information combined with the processor information provided by an embodiment of the present application;
[0041] Figure 4 It is a flowchart of obtaining a query result by querying at least a register corresponding to the target processor based on the query parameter provided by an embodiment of the present application;
[0042] Figure 5 It is a flowchart of determining the matching situation between the frequency fluctuation information of the processor and the configured power supply strategy according to at least the processor frequency within a set time period provided by an embodiment of the present application;
[0043] Figure 6 It is a flowchart of determining a predicted power strategy corresponding to the frequency fluctuation information of the processor based on at least a correspondence between a preset power strategy and the frequency fluctuation information of the processor provided by an embodiment of the present application;
[0044] Figure 7 It is a schematic diagram of a specific interface application scenario provided in an embodiment of the present application;
[0045] Figure 8 It is a structural schematic diagram of a heterogeneous processor frequency monitoring device provided in an embodiment of the present application;
[0046] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0048] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0049] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0050] Reference Figure 1 , Figure 1 is a flow chart of a method for monitoring frequency of heterogeneous processors provided in an embodiment of the present application. The method is applied to an electronic device having at least two processors, such as Figure 1 As shown, a method for monitoring frequency of heterogeneous processors provided in an embodiment of the present application may include steps 101 to 102, and these steps are described in detail below.
[0051] 101. Receive a query request, the query request including a parameter to be queried in a specific parameter form for a target processor, the parameter to be queried is related to a frequency of the target processor, and the target processor is at least one of the at least two processors;
[0052] The processors in the electronic device may be different processors, and the difference may be processors of different models produced by the same manufacturer, or processors produced by different manufacturers.
[0053] Among them, since the query request contains a parameter to be queried in a specific parameter form, the execution device of the present application can respond to the parameter in the specific parameter form to implement the query register.
[0054] In a possible implementation, the query request may be received from a system layer of the electronic device, and may be obtained by converting the received query information through a specific program or application of the system layer.
[0055] In a possible implementation, the query request may be that the execution device of the present application identifies characters in the received query request, determines that the characters contained therein belong to a specific parameter, and uses it as the parameter to be searched.
[0056] The parameter to be queried is related to the frequency of the target processor, and may be the frequency or other parameters related to the frequency.
[0057] In a possible implementation, the parameter to be queried may be information that the user wants to query according to actual conditions, such as the maximum frequency, minimum frequency, current frequency, power supply strategy, real-time frequency, etc. of the CPU.
[0058] As an example, corresponding formats are set in advance for various parameters to be queried. For example, parameter "1" is used to represent the maximum frequency of the CPU, and parameter "2" is used to represent the minimum frequency of the CPU. After receiving a request for the maximum frequency of the CPU, the request is converted into parameter "1", and the parameter "1" is sent to the register. The register can respond to the parameter "1" to feedback the maximum frequency of the CPU.
[0059] In a possible implementation, characters corresponding to the parameters to be queried may be input on the input interface, and characters corresponding to each parameter may be predefined.
[0060] As an example, characters corresponding to various parameters to be queried are prepared in advance. For example, monitor_freq is used to represent the query frequency, and max is used to represent the maximum frequency. Then, monitor_max can be used to represent the query maximum frequency, and get_max_freq can be used to represent the acquisition of the maximum frequency.
[0061] After receiving the query information, the characters contained in the query information can be compared. If max exists therein, it can be determined that the maximum frequency is queried, and "max" is added after "monitor_" in the parameter form to obtain "monitor_max".
[0062] In one possible implementation, the processor frequency of each processor can be pre-calculated and saved. Figure 2 This process is described in detail in .
[0063] 102. Based on the parameter to be queried, at least query a register corresponding to the target processor to obtain a query result.
[0064] Among them, since the query request includes the parameters to be queried in the form of specific parameters for the target processor, the parameters to be queried are passed from the system user state in the form of parameters, and the parameters to be queried are used to input the bottom layer to realize direct query of register information and obtain query results.
[0065] It should be noted that, since the register is encapsulated when the electronic device leaves the factory as the underlying hardware, the user state of the electronic device system cannot be accessed under normal circumstances, and it is impossible to access the encapsulation structure through system access commands such as lscpu, and the system file can only be accessed through system access commands. In this embodiment, the query information in the user state is passed in as a parameter to be queried in the form of a specific parameter, so that the parameter to be queried is queried in the form of a specific parameter, and data is directly queried from the register corresponding to the processor.
[0066] In a possible implementation, different methods can be used to obtain query results for different query parameters. Figure 4 This process is described in detail in .
[0067] In this embodiment, in an electronic device provided with multiple processors, a query request is received, the query request including a parameter to be queried in the form of a specific parameter for a target processor, the parameter to be queried is related to the frequency of the target processor, and the target processor is at least one of the at least two processors; based on the parameter to be queried, at least a register corresponding to the target processor is queried to obtain a query result, and by passing the query information in the user state of the system in the form of a parameter to be queried in the form of a specific parameter, it is possible to query the register with the parameter to be queried in the form of a specific parameter, and to directly query data from the register corresponding to the processor.
[0068] Figure 2 It is a flowchart of precalculating the processor frequency of each processor provided in an embodiment of the present application, which may include steps 201 to 204. These steps are described in detail below.
[0069] 201. Scan each processor in the electronic device to obtain processor information of each processor;
[0070] Among them, the processor information can be relevant information of the processor in the current environment, and the processor information includes fixed information of the processor and information generated during the operation process. The fixed information is information that is fixed after the processor leaves the factory and has nothing to do with its operation process; the information generated during the operation process is information generated during the operation of the processor and is affected by its operation process.
[0071] When the device executing the method in the embodiment of the present application is powered on, each processor in the electronic device is scanned to obtain processor information of each processor.
[0072] As an example, the processor information may include part or all of: manufacturer, model, topology, and number of online processing cores (coreonline). Of course, the processor information is not limited to the above content, and may also be other content, which is not limited in this application.
[0073] 202. Obtain register information corresponding to each processor in the electronic device;
[0074] Among them, each processor in the electronic device corresponds to one or more registers.
[0075] Generally, one parameter corresponds to one register, and each parameter of a processor can correspond to multiple registers.
[0076] In a possible implementation, since the present application monitors the frequency of each processor, only register information related to the frequency corresponding to each processor may be obtained.
[0077] The register information may be an identifier of a register, and each register has a different identifier, and the identifier can represent the corresponding register.
[0078] Among them, the corresponding register can be determined according to the register information to realize reading the value of the register.
[0079] 203. Determine a processor frequency of a corresponding processor based on the register information and the processor information;
[0080] Among them, different topological structures and the number of online processing cores in the processor affect the processor frequency.
[0081] For example, processor frequencies produced by different manufacturers are different, and the manufacturer information can be used to further determine the processor frequency; processor frequencies of different models are different, and the processor frequency can be further determined by the processor model; processor frequencies of different topologies are different, and the processor frequency can be further determined by the topology; processor frequencies of different online processing cores are different, and the processor frequency can be further determined by the online processing core situation.
[0082] The processor frequency determined in this embodiment is the real-time frequency of the processor during operation.
[0083] In a possible implementation, the processor structure and the number of online processing cores can be determined based on the processor information, and then the processor frequency can be calculated in combination with the register information. Figure 3 The process of determining the processor frequency for a processor is described in detail in .
[0084] 204. Save the processor frequency.
[0085] After the processor frequency of each processor is determined, the processor frequency is saved so as to be applied in a subsequent query process.
[0086] In this embodiment, each processor in the electronic device is scanned in advance to obtain processor information of each processor; register information corresponding to each processor in the electronic device is obtained; based on the register information and the processor information, the processor frequency of the corresponding processor is determined; and the processor frequency is saved, so that the frequency of each processor is pre-determined and saved, providing a basis for subsequent feedback of relevant query results for parameters to be queried related to the processor frequency.
[0087] Figure 3 It is a flowchart diagram of determining the processor frequency of the corresponding processor based on the register information combined with the processor information provided by an embodiment of the present application, which may include steps 301 to 302, and these steps are described in detail below.
[0088] 301. Determine the structural information of the processor and the number of online processing cores according to the processor information;
[0089] The processor information includes fixed information of the processor and information generated during operation.
[0090] The fixed information may include the processor manufacturer, model, etc., and the information generated during the operation process may be information that changes with the processor operation process, such as the number of online processing cores, etc.
[0091] The correspondence between the manufacturer, model and processor structure may be preset, and the structure information of the processor may be determined based on the manufacturer / model in the processor information.
[0092] In a possible implementation, the structural information may be a topological structure of the processor, where the topological structure includes a NUMA (Non-Uniform Memory Access) architecture adopted by the processor, the number of processing cores included in the processor, and the like.
[0093] Among them, by scanning the processors in the current environment, the number of online processing cores can be obtained.
[0094] 302. Determine a processor frequency of a corresponding processor based on the register information, the structural information of the processor, and the number of online processing cores.
[0095] The register stores information corresponding to the frequency of the processor, and the value of the register represents a value related to the frequency.
[0096] In a possible implementation, the processor frequency may be a current frequency of a processor, which is a frequency of the processor during operation.
[0097] In a possible implementation, the value of the register can be read according to the time period to determine the number of online processing cores, and then the frequency of the current cycle can be determined using the value of the register, the processor's structural information, and the online processing core data. After receiving the query request, if the query parameter to be queried in the query request is related to the frequency (such as the real-time frequency) of the processor during operation, the frequency determined in the most recent cycle can be directly used as the processor real-time frequency.
[0098] The processor frequency calculation formula can be as follows:
[0099] Main frequency = external frequency × frequency multiplier (1)
[0100] Among them, the external frequency refers to the external clock frequency of the processor, which is usually the operating frequency of the system bus and is used to synchronously run the calculation work of all components; the multiplier refers to the ratio of the internal clock frequency of the processor to the external clock frequency, which is an integer multiple relationship. The specific value of the multiplier can be found in the processor chip manual.
[0101] The operating frequency of the system bus can be stored in the corresponding register. Therefore, after the structure of each processor and the number of online processing cores are determined, the external frequency is obtained by reading the value of the corresponding register according to the register information related to the frequency of each processor. The value of the multiplier can be stored in a specific register. By reading the value of the register, the multiplier can be determined. Combined with the above formula (1), the processor frequency of the processor is obtained.
[0102] In a possible implementation, the determined processor frequency may be stored in a specific register, so that the register data may be directly read during subsequent inquiries to determine the processor frequency.
[0103] The designated register can be determined based on the register information, and the external frequency can be determined by reading the value of the designated register.
[0104] In a possible implementation, the maximum frequency and the minimum frequency of the processor are recorded by corresponding registers, and the value of the corresponding register can determine the maximum frequency and the minimum frequency of the processor.
[0105] In a possible implementation, the register information may be pre-written into the storage space of the electronic device. The register information requires the processor chip manufacturer to provide a chip data sheet and write relevant codes according to the data sheet. The code implements the process of reading the specified register value.
[0106] In this embodiment, the processor structure information and the number of online processing cores are determined based on the processor information; the processor frequency of the corresponding processor is determined based on the register information and the processor structure information and the number of online processing cores. The processor structure information and the number of online processing cores can be used in combination with the register information to calculate the processor frequency of the corresponding processor, thereby achieving pre-calculation of the processor and providing a basis for subsequent queries.
[0107] Figure 4 The embodiment of the present application provides a flow chart of querying at least the register corresponding to the target processor based on the query parameter to obtain the query result, which may include steps 401 to 405. These steps are described in detail below.
[0108] 401. Determine the parameters to be queried;
[0109] After receiving the query request, the query request is analyzed to obtain the query parameters carried by the query request.
[0110] The parameter to be queried may be a processor frequency or a power policy.
[0111] In a possible implementation, the processor frequency may be a maximum frequency or a minimum frequency of the processor.
[0112] In a possible implementation, the power policy adopted by the processor may be any one of multiple specific policies.
[0113] If the parameter to be queried is the frequency of the processor, steps 402-403 are executed; if the parameter to be queried is the energy strategy adopted by the processor, steps 404-406 are executed.
[0114] 402. Based on the query parameter being a processor frequency, query a register corresponding to the target processor to obtain the processor frequency;
[0115] When the processor frequency in the electronic device is a fixed value, a specific register may be used to record the processor frequency.
[0116] In a possible implementation, the processor frequency may be a maximum frequency / minimum frequency of the processor, which is a fixed value. When configuring parameters for the processor of the electronic device, the maximum frequency / minimum frequency may be recorded in corresponding registers, respectively.
[0117] Among them, after the device executing the method in the embodiment of the present application is powered on, the register information corresponding to each processor in the electronic device can be obtained, so as to determine the maximum frequency / minimum frequency of the processor of the parameter to be queried after receiving the query request, and determine the register corresponding to the maximum frequency / minimum frequency of the processor based on the register information, and then read the value of the register to obtain the processor frequency.
[0118] 403. Use the processor frequency as the query result;
[0119] After the frequency of the processor is obtained, the obtained processor frequency is used as a query result, and the query result is fed back to the system so that the query result can be output and displayed through the system.
[0120] 404. Based on the fact that the parameter to be queried is a power policy, query the register corresponding to the target processor to obtain the processor frequency and the configured power policy within a set time period;
[0121] If the parameter to be queried is a power policy, the query goal is to determine whether the current operation status of the processor matches the configured power policy.
[0122] In a possible implementation, a power policy may be pre-configured according to the performance of the processor, and the configured power policy may be a power policy that records the configuration in a specific register.
[0123] However, during the operation of the processor, due to various influences (such as system failure), the actual operation of the processor does not meet the configured power policy.
[0124] The register corresponding to the target processor is queried, and the register may be a register for recording the current frequency of the target processor.
[0125] Furthermore, the configured power supply strategy in the electronic device is also recorded in a specific register, and different power supply strategies may be represented by different values.
[0126] In one possible implementation, the value of the register configuring the power policy is read, and based on the correspondence between the value and the power policy, the power policy corresponding to the read register value can be determined, and the power policy corresponding to the register value is the power policy configured for the target processor.
[0127] Among them, during the operation of the processor, it can be used Figure 2-3 The process recorded in the figure determines the real-time frequency of the processor and records the real-time frequency in the corresponding register.
[0128] Correspondingly, the real-time frequency can be obtained by querying the register corresponding to the real-time frequency.
[0129] Among them, since whether the current operation status of the processor matches the configured power supply measurement strategy is determined based on the frequency fluctuation information during the operation of the processor, it is necessary to analyze the fluctuation status of the real-time frequency over a period of time.
[0130] In this embodiment, according to the set time, the register corresponding to the real-time frequency is queried to obtain multiple real-time frequencies of the processor in the set market, providing a calculation basis for subsequent determination of the fluctuation of the processor.
[0131] 405. Determine, based at least on the processor frequency within a set time period, whether the frequency fluctuation information of the processor matches the configured power supply policy;
[0132] Among them, according to the processor frequency within a set time period, the frequency fluctuation information of the processor can be determined.
[0133] The frequency fluctuation information of the processor may be that the frequency remains stable or changes. The stability may include maintaining stability at a low frequency, maintaining stability at a high frequency, maintaining stability at a medium frequency, etc. The change may be a linear change in frequency, a change in frequency following a certain parameter, etc.
[0134] After determining the frequency fluctuation information of the processor within the set time period, the matching status can be obtained based on whether the frequency fluctuation information matches the configured power supply policy.
[0135] In a possible implementation, standard frequency fluctuation information corresponding to each power supply strategy may be preset, and the frequency fluctuation information of the processor may be compared with the standard frequency fluctuation information of the configured power supply strategy to determine whether the two match.
[0136] In a possible implementation, the frequency fluctuation information can be represented according to the frequency fluctuation range of the processor, and the matching between the frequency fluctuation information of the processor and the configured power supply strategy can be determined according to the frequency fluctuation range of the processor. Figure 5 This process is described in detail in .
[0137] 406. Use the matching situation as a query result.
[0138] After determining the matching status of the frequency comparison of the processor and the configured power supply strategy, the matching status is used as the query result, and the query result is fed back to the system so that the query result can be output and displayed through the system.
[0139] In this embodiment, when the parameter to be queried is the processor frequency, the register corresponding to the target processor is queried to obtain the processor frequency; the processor frequency is used as the query result; it is realized that for querying the processor frequency, the corresponding register can be directly queried to obtain the processor frequency and feedback the query result. When the parameter to be queried is the power policy, the register corresponding to the target processor is queried to obtain the processor frequency and the configured power policy within the set time length; at least based on the processor frequency within the set time length, the matching of the processor frequency fluctuation information and the configured power policy is determined; the matching is used as the query result; for querying the power policy, the processor frequency is also determined by querying the corresponding register, and combined with the fluctuation of the processor frequency, its matching with the configured power policy is determined to obtain the query result, and different parameters to be queried are responded to separately.
[0140] Figure 5 The present application embodiment provides a flowchart for determining the matching situation between the frequency fluctuation information of the processor and the configured power supply strategy based on at least the processor frequency within a set time period, which may include steps 501 to 503. These steps are described in detail below.
[0141] 501. Determine a predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on a correspondence between a preset power strategy and the frequency fluctuation information of the processor;
[0142] The corresponding relationship is preset, and the corresponding relationship is the relationship between the power supply strategy and the processor frequency fluctuation information.
[0143] In a possible implementation, the processor frequency fluctuation information may specifically adopt a processor frequency fluctuation range. Since the frequency fluctuation information includes multiple real-time frequencies within a set time period, the frequency fluctuation range of the processor within the set time period can be determined based on the frequency fluctuation information. Accordingly, based on the corresponding relationship, the predicted power supply strategy corresponding to the frequency fluctuation range of the processor within the set time period is determined.
[0144] Of course, in some power supply strategies, the distinction may be made not only based on the frequency fluctuation information, but also in combination with other parameters. Accordingly, the frequency fluctuation information and the other parameters may be used to determine the predicted power supply strategy.
[0145] In this embodiment, the power policy corresponding to the actual operation of the processor is predicted based on the frequency fluctuation information of the actual operation of the processor. The power policy corresponding to the actual operation may be the same as or different from the power policy configured for the processor.
[0146] In a possible implementation, for a specific power strategy, only the processor frequency fluctuation information can be used to determine the corresponding predicted power strategy, while for other power strategies, it is necessary to combine the processor utilization to determine the corresponding predicted power strategy. Figure 6 The process of determining the predictive power strategy is described in detail in .
[0147] 502. Based on the fact that the predicted power policy is the same as the configured power policy, determine whether the frequency fluctuation information of the processor matches the configured power policy;
[0148] If the predicted power policy is the same as the configured power policy, it can be determined that the frequency fluctuation information during the operation of the processor matches the configured power policy.
[0149] Then, during the operation of the processor, the parameters corresponding to the configured power policy are used for operation, and therefore, the frequency fluctuation information during the operation matches the configured power policy.
[0150] Accordingly, due to the match, a query result may be generated, and the query result may be that the processor power policy is the configuration power policy, and the conclusion is normal.
[0151] As an example, if the predicted power policy is an energy-saving policy and the configured power policy is also an energy-saving policy, the query result may be: the processor adopts the energy-saving policy and the processor runs normally.
[0152] 503. Based on the fact that the predicted power policy is different from the configured power policy, determine that the frequency fluctuation information of the processor does not match the configured power policy.
[0153] If the predicted power policy is different from the configured power policy, it can be determined that the frequency fluctuation information during the operation of the processor does not match the configured power policy.
[0154] Then, during the operation of the processor, the processor cannot be operated using parameters corresponding to the configured power policy, and therefore, its frequency fluctuation information during operation does not match the configured power policy.
[0155] Accordingly, due to the mismatch, a query result may be generated, and the query result may be that the processor operates abnormally.
[0156] As an example, if the predicted power policy is a power saving policy and the configured power policy is also a performance policy, the query result may be: the processor runs abnormally.
[0157] In the present embodiment, based at least on the correspondence between the preset power policy and the processor frequency fluctuation information, the predicted power policy corresponding to the frequency fluctuation information of the processor is determined; based on the predicted power policy being the same as the configured power policy, the matching of the frequency fluctuation information of the processor and the configured power policy is determined; based on the predicted power policy being different from the configured power policy, the mismatch between the frequency fluctuation information of the processor and the configured power policy is determined. The frequency fluctuation information of the processor can be used to predict the power policy actually running the processor. By comparing whether the predicted power policy is the same as the configured power policy, it is determined whether the frequency fluctuation information of the processor matches the configured power policy, and the query result is obtained. This enables querying the power policy to obtain accurate query results.
[0158] Figure 6 The present application provides a flowchart of determining a predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on the correspondence between the preset power strategy and the processor frequency fluctuation information, which may include steps 601 to 604, and these steps are described in detail below.
[0159] 601. Determine, based on the frequency fluctuation information, a relationship between the frequency of the processor and the maximum frequency / minimum frequency within a preset time period;
[0160] The maximum frequency and the minimum frequency of the processor can be determined by querying the register corresponding to the target processor.
[0161] The register may include a register recording a maximum frequency of the target processor and a register recording a minimum frequency of the target processor.
[0162] The maximum frequency and the minimum frequency are set values, which are the maximum frequency and the minimum frequency set during the operation of the processor.
[0163] The frequency of the processor within a preset time period is compared with the maximum frequency and the minimum frequency to determine the relationship between the frequency within the preset time period and the maximum frequency and the relationship between the frequency within the preset time period and the minimum frequency.
[0164] If the frequency within the preset duration corresponds to the maximum frequency or the minimum frequency, the predicted power strategy of the processor is determined based only on the frequency within the preset duration, and the subsequent step 602 is executed.
[0165] If the preset market frequency does not correspond to the maximum frequency or the minimum frequency, steps 603-604 are executed.
[0166] 602. Based on the correspondence between the frequency of the processor and the maximum frequency / minimum frequency within a preset time period, determine a predicted power strategy of the processor according to the maximum frequency / minimum frequency;
[0167] If the frequency within the preset time period corresponds to the maximum frequency, it can be determined that the processor runs at the maximum frequency within the preset time period, and the predicted power supply strategy of the processor corresponding to the maximum frequency operation is determined.
[0168] As an example, the predicted power policy may be that the processor runs at maximum performance (which may be referred to as performace mode).
[0169] Among them, if the frequency within the preset time length corresponds to the minimum frequency, it can be determined that the processor runs at the minimum frequency within the preset time length, and the processor's predicted power strategy corresponding to the minimum frequency operation is determined (which can be called powersave mode).
[0170] As an example, the predicted power policy may be that the processor runs at a power-saving performance.
[0171] 603. Determine a frequency fluctuation rule of the processor based on the fact that the frequency of the processor does not correspond to the maximum frequency or the minimum frequency within a preset time period;
[0172] If the frequency of the processor is between the maximum frequency and the minimum frequency within a preset time period, the predicted power supply strategy of the processor is determined in combination with the processor utilization.
[0173] Among them, the power strategy is to meet the needs of different application scenarios and run various related parameters for the processor.
[0174] Among them, under different power strategies, due to different loads, the corresponding frequency fluctuation law and processor utilization are also different. Therefore, for the frequency between the maximum frequency and the minimum frequency within a preset time, the frequency fluctuation law of the processor is determined.
[0175] In a possible implementation, the frequencies at different time points can be arranged along a time axis, and the change in frequency over time can be used as a frequency fluctuation law. For example, if the current frequency is higher than the previous frequency, it indicates that the frequency is increasing, and vice versa.
[0176] The frequency fluctuation rules may include: fast frequency modulation, slow frequency modulation, fast frequency modulation and jump, and fast change following load fluctuation.
[0177] 604. Determine a predicted power strategy for the processor according to a frequency fluctuation rule of the processor and a processor utilization rate.
[0178] Among them, processor utilization is an important indicator to measure the effective use of the processor.
[0179] In a possible implementation, the frequency fluctuation law of the processor and the processor utilization may be combined to determine the frequency fluctuation law of the processor during the change from high utilization to low utilization / from low utilization to high utilization of the processor.
[0180] Furthermore, the predicted power strategy of the processor can be determined by combining the task type in the processor with the frequency fluctuation law for analysis.
[0181] In a possible implementation, the load and frequency of each online processing core in the processor can be obtained, and the relationship between the load and frequency fluctuation law can be analyzed. If the load and frequency changes are positively correlated, when the load is heavy, the processor frequency is high, and when the load is low, the processor frequency is low, and the load and utilization of the processor are positively correlated, it is determined that the predicted power policy of the processor is a scheduling mode (which can be called Schedutil mode) and is associated with scheduling.
[0182] In a possible implementation, a test thread may be used to test the frequency fluctuation pattern of the processor.
[0183] The test thread may be a high-computation-intensive task.
[0184] In one possible implementation, a test thread is started to obtain the frequency of the processor within a preset time length. If the frequency fluctuation pattern of the frequency is that the frequency fluctuates rapidly to the maximum frequency in a short period of time and remains constant at the maximum frequency, and the frequency decreases after the test thread exits, it is determined that the predicted power strategy of the processor is fast dynamic adjustment on demand (which can be called ondemand mode).
[0185] In one possible implementation, a test thread is started to obtain the frequency of the processor within a preset time period. If the frequency fluctuation pattern of the frequency is that the frequency fluctuates between the maximum frequency and the minimum frequency, it is determined that the predicted power strategy of the processor is smooth adjustment on demand (which can be called conservative mode).
[0186] Among them, the task type in the processor can be determined by traversing the processor speed regulator related registers to determine the assignment of specific variables in the task descriptor. Based on the assignment of the specific variable, it is determined whether there is a user-mode task. If it exists, and the frequency fluctuation pattern is rapid frequency modulation and jumping, it can be combined with the change in processor utilization to determine that the predicted power strategy of the processor is user-mode adjustment (which can be called userspace mode).
[0187] In this embodiment, a fuzzy matching method is adopted to analyze and match different power strategies and different frequency fluctuation laws by setting fuzzy variables and fuzzy sets, and defuzzification is performed according to the fuzzy matching rules combined with the configured power strategy to obtain specific query results. Among them, the fuzzy variables are the processor frequency and the processor utilization, and the fuzzy sets are the processor utilization range and the processor frequency range.
[0188] In one possible implementation, the processor frequency can be obtained by reading the register and the processor load can be obtained synchronously. The relationship between the processor frequency and the load corresponding to time is used to match the fuzzy relationship and determine the relationship between the two. For example, the relationship can be proportional, the coefficient changes slowly, and the peak value is the maximum frequency; the relationship can be proportional, the coefficient changes quickly, and the peak value is the maximum frequency; or the relationship can be irregular. According to the relationship between the processor frequency and the load, determine whether the corresponding power supply policy is the ondemand mode.
[0189] In one possible implementation, a test thread (such as a high-intensive computing task) can also be started to obtain the frequency and load of the processor, match the fuzzy relationship, and determine the relationship between the two. For example, it can be proportional, the coefficient changes slowly, and the peak is the maximum frequency; it can be proportional, the coefficient changes quickly, the peak is the maximum frequency, or it can be irregular. According to the relationship between the processor frequency and the load, determine whether the corresponding power policy is the ondemand mode.
[0190] In a possible implementation, the kernel parameter stepping frequency may be further read, and the power supply strategy of the processor may be determined by combining the fluctuation pattern of the stepping frequency and fuzzy matching.
[0191] In this embodiment, based on the frequency fluctuation information within a set time period during the operation of the processor, the relationship between the frequency and the maximum frequency / minimum frequency in the processor within the preset time period is determined; based on the correspondence between the frequency and the maximum frequency / minimum frequency in the processor within the preset time period, the predicted power supply strategy of the processor is determined based on the maximum frequency / minimum frequency, and based on the fact that the frequency in the processor within the preset time period does not correspond to both the maximum frequency and the minimum frequency, the frequency fluctuation pattern of the processor is determined; based on the frequency fluctuation pattern of the processor and the processor utilization, the predicted power supply strategy of the processor is determined, and a fuzzy matching method is used to correspond the predicted power supply strategy to the operating status of the processor, so as to realize the combination of the predicted power supply strategy and the configured power supply strategy to determine the query result, thereby realizing automatic analysis of the processor frequency and obtaining the query result.
[0192] In a possible implementation, receiving a query request includes:
[0193] The query request is received based on a specific interface, where the specific interface is used to connect the operating system and each processor.
[0194] Among them, the device for executing a heterogeneous processor frequency monitoring method provided in the present application may adopt a specific interface to receive query requests through the interface, and the specific interface can connect the operating system side and each processor.
[0195] The specific interface can establish data transmission channels with each processor in the electronic device through a hardware connection circuit, so as to control the processor to respond to the request received by the operating system.
[0196] In a possible implementation, the specific interface may predefine structures, specific instances, and definitions of common frequency operation-related operation implementations.
[0197] As an example, a class diagram may be pre-set and defined in the class diagram. For example, the class diagram specifies that cpu_freq_modules represents a structure definition, freq_mask represents a specific instance of model_mask, ptr_dev represents a structure definition, CPU_A and CPU_B are used to represent instances of ptr_dev, and freq_ops represents a definition of a general frequency-related operation implementation.
[0198] Among them, this specific interface serves as a unified abstract interface for various heterogeneous processors, merges the common parts of mainstream chips, and adopts a common definition class to achieve unified management of heterogeneous processors. The special properties of the processor can be customized by setting the class.
[0199] Figure 7 It is a schematic diagram of a specific interface application scenario provided in an embodiment of the present application. The application scenario includes a specific interface 701 and a heterogeneous processor 702 . The specific interface includes a first interface 7011 and a second interface 7012 .
[0200] The first interface 701 is used to receive the request from the operating system side and control the processor and corresponding registers to respond to the request through the second interface.
[0201] The second interface 701 is used to perform a query on each processor and the corresponding register, and execute each step in the query process in the aforementioned method embodiment.
[0202] The second interface can realize the following functions: power strategy configuration, frequency acquisition, frequency calculation, frequency analysis and frequency setting.
[0203] The power policy configuration is to configure the power policy of each processor into the corresponding register.
[0204] Among them, the frequency setting is to set the frequency for each processor, such as the maximum frequency, minimum frequency, etc.
[0205] Among them, frequency acquisition is to collect the frequency of each processor, which is specifically achieved by reading the data of the register.
[0206] The frequency calculation is to calculate the data read from the register to obtain the frequency of the processor.
[0207] The frequency analysis is to determine whether the operation of the processor matches the configured power policy based on the frequency of the processor.
[0208] The second interface is set with a fuzzy logic control algorithm, and the frequency analysis process utilizes the fuzzy logic control algorithm. For the analysis process, please refer to the corresponding steps in the aforementioned embodiment.
[0209] In a possible implementation, each function in the second interface can be loaded and used online or unloaded and disabled as required, and can be set according to actual conditions, and this application does not impose any restrictions.
[0210] The second interface can be connected to multiple heterogeneous processors. Figure 7 The processors include Intel, FP2000+, S2500, S5000C, Smartlogic and other CPUs.
[0211] In this embodiment, the query request is received based on a specific interface, and the specific interface is used to connect the operating system and each processor. Through the specific interface, the interaction between the operating system and the processor is realized, and the underlying registers can be read, providing software and hardware support for executing the heterogeneous processor frequency monitoring method.
[0212] A method for monitoring the frequency of a heterogeneous processor provided in an embodiment of the present application is introduced above. A device for executing the method for monitoring the frequency of a heterogeneous processor is introduced below.
[0213] See also Figure 8 , Figure 8 Schematic diagram of a heterogeneous processor frequency monitoring device provided in an embodiment of the present application. Figure 8 As shown, the heterogeneous processor frequency monitoring device 800 includes:
[0214] The interface module 801 is used to receive a query request, the query request including a parameter to be queried in a specific parameter form for a target processor, the parameter to be queried is related to a frequency of the target processor, and the target processor is at least one of the at least two processors;
[0215] For the specific structure of the interface module, please refer to the Figure 7 , which will not be described in detail in this embodiment.
[0216] The query module 802 is used to query at least the register corresponding to the target processor based on the parameter to be queried to obtain a query result.
[0217] In one possible implementation, it also includes:
[0218] A scanning module, used for scanning each processor in the electronic device to obtain processor information of each processor;
[0219] An acquisition module, used to acquire register information corresponding to each processor in the electronic device;
[0220] A first determination module, configured to determine a processor frequency of a corresponding processor based on the register information in combination with the processor information;
[0221] The saving module is used to save the processor frequency.
[0222] In one possible implementation, the first determining module includes:
[0223] According to the processor information, determine the structural information of the processor and the number of online processing cores;
[0224] Based on the register information, the structural information of the processor, and the number of online processing cores, the processor frequency of the corresponding processor is determined.
[0225] In a possible implementation, the query module includes:
[0226] A first obtaining unit is used to query the register corresponding to the target processor to obtain the processor frequency based on the parameter to be queried being the processor frequency; and use the processor frequency as the query result;
[0227] A second obtaining unit is used to query the register corresponding to the target processor based on the fact that the parameter to be queried is a power policy, and obtain the processor frequency and the configured power policy within a set time period;
[0228] The first determination unit is used to determine the matching situation between the frequency fluctuation information of the processor and the configured power supply strategy at least according to the processor frequency within a set time period; and use the matching situation as the query result.
[0229] In a possible implementation, the first determining unit is configured to:
[0230] Determining a predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on a correspondence between a preset power strategy and the frequency fluctuation information of the processor;
[0231] Based on the predicted power policy being the same as the configured power policy, determining a match between the frequency fluctuation information of the processor and the configured power policy;
[0232] Based on the fact that the predicted power policy is different from the configured power policy, it is determined that the frequency fluctuation information of the processor does not match the configured power policy.
[0233] In a possible implementation, the first determining unit determines the predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on the correspondence between the preset power strategy and the processor frequency fluctuation information, specifically including:
[0234] Determine, based on the frequency fluctuation information, a relationship between the frequency and the maximum frequency / minimum frequency in the processor within a preset time period;
[0235] Based on the correspondence between the frequency of the processor and the maximum frequency / minimum frequency within a preset time period, a predicted power strategy of the processor is determined according to the maximum frequency / minimum frequency,
[0236] Based on the fact that the frequency of the processor does not correspond to the maximum frequency and the minimum frequency within a preset time period, the frequency fluctuation law of the processor is determined; based on the frequency fluctuation law of the processor and the processor utilization, the predicted power supply strategy of the processor is determined.
[0237] In one possible implementation, the receiving module is specifically configured to:
[0238] The query request is received based on a specific interface, where the specific interface is used to connect the operating system and each processor.
[0239] It should be noted that, for the functional explanation of each component structure in a heterogeneous processor frequency monitoring device provided in this embodiment, please refer to the corresponding explanation in the aforementioned method embodiment, and it will not be repeated in this embodiment.
[0240] In this embodiment, in an electronic device provided with multiple processors, an interface module receives a query request, which includes a parameter to be queried in the form of a specific parameter for a target processor, the parameter to be queried is related to the frequency of the target processor, and the target processor is at least one of the at least two processors; the query module queries at least a register corresponding to the target processor based on the parameter to be queried to obtain a query result, and by passing the query information in the user state of the system in the form of a specific parameter as the parameter to be queried, it is possible to query the register with the parameter to be queried in the form of a specific parameter, and to directly query data from the register corresponding to the processor.
[0241] The present application also provides an electronic device in an embodiment. Fig. 9As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig. 9 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0242] like Fig. 9 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0243] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a memory card, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0244] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any heterogeneous processor frequency monitoring method provided in the embodiment of the present application.
[0245] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any heterogeneous processor frequency monitoring method provided in the embodiment of the present application.
[0246] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0247] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0248] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0249] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for monitoring frequency of heterogeneous processors, applied to an electronic device provided with at least two processors, the method comprising: receiving a query request, the query request including a parameter to be queried in a specific parameter form for a target processor, the parameter to be queried being related to a frequency of the target processor, the target processor being at least one of the at least two processors; Based on the parameters to be queried, at least a register corresponding to the target processor is queried to obtain a query result.
2. The method for monitoring frequency of heterogeneous processors according to claim 1, before receiving the query request, further comprising: Scan each processor in the electronic device to obtain processor information of each processor; Obtaining register information corresponding to each processor in the electronic device; Determining a processor frequency of a corresponding processor based on the register information in combination with the processor information; The processor frequency is saved.
3. The method for monitoring frequency of heterogeneous processors according to claim 2, wherein determining the processor frequency of the corresponding processor based on the register information combined with the processor information comprises: Determine the structure information of the processor and the number of online processing cores according to the processor information; Based on the register information, the structural information of the processor, and the number of online processing cores, a processor frequency of the corresponding processor is determined.
4. The method for monitoring frequency of heterogeneous processors according to claim 1, wherein based on the parameter to be queried, at least querying a register corresponding to the target processor to obtain a query result comprises: Based on the query parameter being the processor frequency, query the register corresponding to the target processor to obtain the processor frequency; Using the processor frequency as a query result; Based on the fact that the parameter to be queried is a power policy, query the register corresponding to the target processor to obtain the processor frequency and the configured power policy within a set time period; At least according to the processor frequency within a set time period, determine the matching situation between the frequency fluctuation information of the processor and the configured power supply strategy; and use the matching situation as the query result.
5. The method for monitoring frequency of heterogeneous processors according to claim 4, wherein the step of determining the matching between the frequency fluctuation information of the processor and the configured power supply strategy at least based on the processor frequency within a set time period comprises: Determining a predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on a correspondence between a preset power strategy and the frequency fluctuation information of the processor; Based on the predicted power supply policy being the same as the configured power supply policy, determining a match between the frequency fluctuation information of the processor and the configured power supply policy; Based on the difference between the predicted power policy and the configured power policy, it is determined that the frequency fluctuation information of the processor does not match the configured power policy.
6. The method for monitoring frequency of heterogeneous processors according to claim 5, determining the predicted power strategy corresponding to the frequency fluctuation information of the processor based at least on the correspondence between the preset power strategy and the processor frequency fluctuation information, comprising: Determine, based on the frequency fluctuation information, a relationship between the frequency and the maximum frequency / minimum frequency in the processor within a preset time period; Based on the correspondence between the frequency of the processor and the maximum frequency / minimum frequency within a preset time period, a predicted power supply strategy of the processor is determined according to the maximum frequency / minimum frequency, Based on the fact that the frequency of the processor does not correspond to the maximum frequency and the minimum frequency within a preset time period, the frequency fluctuation law of the processor is determined; based on the frequency fluctuation law of the processor and the processor utilization, the predicted power supply strategy of the processor is determined.
7. The method for monitoring frequency of heterogeneous processors according to claim 1, wherein receiving a query request comprises: The query request is received based on a specific interface, where the specific interface is used to connect the operating system and each processor.
8. A heterogeneous processor frequency monitoring device, applied to an electronic device provided with at least two processors, the device comprising: An interface module, configured to receive a query request, wherein the query request includes a parameter to be queried in a specific parameter form for a target processor, wherein the parameter to be queried is related to a frequency of the target processor, and the target processor is at least one of the at least two processors; The query module is used to query at least the register corresponding to the target processor based on the parameter to be queried to obtain the query result.
9. A computer program product, comprising computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the heterogeneous processor frequency monitoring method according to any one of claims 1 to 7.
10. An electronic device comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the heterogeneous processor frequency monitoring method as described in any one of claims 1 to 7.