Resource regulation and control method and device

By determining target performance events for the resource requesting subject in the system, monitoring their information and formulating allocation strategies, the problem of unscientific resource management and allocation in the existing technology is solved, and efficient and reasonable resource utilization is achieved.

CN119806840APending Publication Date: 2025-04-11SMARTER SILICON (SHANGHAI) TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411998773.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing technology lacks scientific solutions to complete the management and allocation of system resources, which makes it difficult to efficiently and rationally utilize system resources.

Method used

By determining the matching target performance events for each resource requesting subject from the performance event set, its monitoring information is obtained, and the target allocation strategy is determined based on this information, resource occupancy information is regulated, and the resource occupancy information is matched to the policy.

Benefits of technology

The scientific management and allocation of system resources is realized, the efficiency and rationality of resource utilization are improved, and the actual use of different resource requesting entities is adapted to the actual use of different resource requesting entities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806840A_ABST
    Figure CN119806840A_ABST
Patent Text Reader

Abstract

The invention discloses a resource regulation and control method and device, and belongs to the technical field of resource allocation and management, and the method comprises the steps: determining at least one matched target performance event for each resource request main body from a performance event set; obtaining target performance event monitoring information corresponding to each resource request main body; the target performance event monitoring information corresponding to the resource request main body is information obtained by monitoring a target performance event generated by the resource request main body based on access to a target resource; the target performance event is related to the utilization rate of a target resource; according to the target performance event monitoring information corresponding to each resource request main body, determining a target allocation strategy for allocating a target resource to each resource request main body; and regulating and controlling the resource occupation information of each resource request main body on the target resource based on the target allocation strategy, so that the resource occupation information of each resource request main body on the target resource is matched with the target allocation strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of resource allocation and management, and in particular, to a resource control method and device. Background Art

[0002] During the operation of electronic devices, system resources need to be managed and allocated so as to efficiently and reasonably utilize system resources in various scenarios. However, the known technologies lack scientific solutions to complete the management and allocation of system resources, making it difficult to efficiently and reasonably utilize system resources. Summary of the invention

[0003] To this end, this application discloses the following technical solutions:

[0004] A resource control method, comprising:

[0005] Determine at least one matching target performance event for each resource request subject from the performance event set;

[0006] Obtain target performance event monitoring information corresponding to each resource request subject; the target performance event monitoring information corresponding to the resource request subject is: information obtained by monitoring the target performance event matching the resource request subject generated by the resource request subject based on access to the target resource; the target performance event is related to the utilization rate of the target resource;

[0007] Determining a target allocation strategy for allocating the target resource to each resource request subject according to target performance event monitoring information corresponding to each resource request subject;

[0008] Based on the target allocation policy, the resource occupation information of the target resource by each resource request subject is regulated so that the resource occupation information of the target resource by each resource request subject matches the target allocation policy.

[0009] Optionally, before obtaining the target performance event monitoring information corresponding to each resource request subject, the method further includes:

[0010] Based on the configured request subject identifiers and the target performance event identifier corresponding to each request subject identifier, the target performance events generated by each resource request subject based on accessing the target resource are monitored respectively, and the target performance event monitoring information corresponding to each resource request subject is obtained.

[0011] Optionally, the monitoring of target performance events generated by accessing the target resource for each resource request subject includes:

[0012] Counting the number of each target performance event generated by each resource request subject to obtain counting information of each target performance event generated by each resource request subject;

[0013] Wherein, each resource request subject generates at least one target performance event, and different target performance events generated by the same resource request subject correspond to respective counting information;

[0014] The obtaining of target performance event monitoring information corresponding to each resource request subject includes:

[0015] Obtain count information of each target performance event generated by each resource request subject, and / or obtain information obtained based on processing the count information.

[0016] Optionally, obtaining target performance event monitoring information corresponding to each resource request subject includes:

[0017] Obtain monitoring information of target performance events generated by accessing storage resources corresponding to each resource request subject within a predetermined time period.

[0018] Optionally, determining at least one matching target performance event for each resource request subject from the performance event set includes:

[0019] According to the subject information and / or the application scenario of each resource request subject, at least one matching target performance event is determined for each resource request subject from the performance event set.

[0020] Optionally, based on the target allocation strategy, regulating resource occupation information of the target resource by each resource request subject includes:

[0021] Based on the target allocation strategy obtained by periodic monitoring, the resource occupation information of the target resource by each resource requesting subject is regulated;

[0022] The target performance events matched by the same resource request subject in different monitoring periods are the same or different, and the target allocation strategies corresponding to them are generated in different monitoring periods.

[0023] A resource control device, comprising:

[0024] A determination unit, configured to determine at least one matching target performance event for each resource request subject from the performance event set;

[0025] A performance monitoring unit, used to monitor target performance events generated by each resource request subject based on access to a target resource, and output target performance event monitoring information corresponding to each resource request subject; the target performance event is related to the utilization rate of the target resource;

[0026] A resource allocation unit, configured to determine a target allocation strategy for allocating the target resource to each resource request subject according to target performance event monitoring information corresponding to each resource request subject;

[0027] The regulating unit is used to regulate the resource occupation information of the target resource by each resource request subject based on the target allocation strategy, so that the resource occupation information of the target resource by each resource request subject matches the target allocation strategy.

[0028] Optionally, the performance monitoring unit includes multiple performance monitoring sub-units; each performance monitoring sub-unit is used to monitor the target performance event corresponding to the resource request subject indicated by the request subject identifier.

[0029] Optionally, each performance monitoring subunit includes: a matching unit and a statistical unit;

[0030] The matching unit is used to match the resource request subject and the target performance event generated by the resource request subject based on the configured request subject identifier and target performance event identifier, and output the matching result;

[0031] The statistical unit is used to collect statistics on the target performance events corresponding to the resource request subject based on the matching results output by the matching unit to obtain corresponding monitoring information.

[0032] Optionally, the matching unit includes:

[0033] A first selector, used to select a resource request subject based on a configured request subject identifier and output a first selection result;

[0034] A second selector is used to select a target performance event generated by the resource request subject based on a configured target performance event identifier to obtain a second selection result;

[0035] A judger, configured to match a resource request subject and a target performance event generated by the resource request subject based on the first selection result and the second selection result, and output a matching result;

[0036] The statistical unit includes a counter for counting the number of target performance events generated by the resource request subject based on the matching result output by the judge.

[0037] Optionally, each resource request subject corresponds to at least one performance monitoring subunit, which is used to monitor at least one target performance event corresponding to the resource request subject;

[0038] The target performance event monitoring information corresponding to each resource request subject includes the monitoring information corresponding to the at least one performance monitoring sub-unit corresponding to the resource request subject and / or the information obtained based on the monitoring information.

[0039] Optionally, the control unit is specifically used to:

[0040] Based on the target allocation strategy obtained by periodic monitoring, the resource occupation information of the target resource by each resource requesting subject is regulated;

[0041] The target performance events matched by the same resource request subject in different monitoring periods are the same or different; and the corresponding target allocation strategies are generated in different monitoring periods.

[0042] An electronic device, comprising:

[0043] Memory, used to store computer instruction sets;

[0044] The processor is used to implement the resource control method provided in any one of the above items by executing the computer instruction set in the memory.

[0045] A storage medium carries one or more computer instruction sets, which, when executed by an electronic device, can enable the electronic device to implement any resource control method as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0047] Figure 1 It is a flow chart of the resource control method provided by this application;

[0048] Figure 2 It is a composition structure diagram of the performance monitoring subunit provided by this application;

[0049] Figure 3 This is another composition structure diagram of the performance monitoring subunit provided by the present application;

[0050] Figure 4It is a composition structure diagram of the MPAM-PMU provided by this application;

[0051] Figure 5 It is a composition structure diagram of the resource control device provided by this application;

[0052] Figure 6 It is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] The known technologies lack scientific solutions to complete the management and allocation of system resources, which makes it difficult to use system resources efficiently and reasonably.

[0055] Taking storage resources as an example, in some implementations, storage resources are managed and monitored based on MPAM (Memory System Resource Partitioning and Monitoring). MPAM is a hardware extension implemented by ARM (Advanced RISC Machine). Its main function is to manage and monitor storage resources such as Cache, bus, DDR (Double Data Rate) memory, so as to efficiently and reasonably use storage resources in various scenarios. However, for MPAM, the known technology lacks a scientific solution to complete the allocation and configuration of storage resources, which makes it difficult for MPAM to fully play its role, and accordingly makes it difficult to efficiently and reasonably use storage resources. For example, in the known technology, software engineers usually infer the memory resources that each memory access subject may need based on the business scenario, and configure MPAM accordingly. However, modern processor systems generally adopt a hierarchical storage structure, which may include multiple levels of cache, span multiple buses, and include multiple memory controllers. The memory resources used by the memory access subject in various places are affected by many factors such as the locality of the software and the size of the caches at all levels on the hardware. It is difficult for software engineers to infer a reasonable configuration strategy.

[0056] In order to solve the above technical problems and to efficiently and reasonably utilize system resources such as storage resources, the embodiments of the present application provide a resource control method and device. The resource control method can be applied to electronic devices in many general or special computing device environments or configurations, such as personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, etc.

[0057] See also Figure 1 As shown in the method flow chart, the resource control method provided in the embodiment of the present application may at least include the following steps 101 to 104, and these steps are described in detail below.

[0058] Step 101: Determine at least one matching target performance event for each resource request subject from a performance event set.

[0059] The resource request subject is matched with the target resource to be accessed. For example, if the target resource is a storage resource such as Cache, bus, DDR, etc., the resource request subject can be various memory access subjects such as CPU (Central Processing Unit), GPU (Graphics Processing Unit) or NPU (Neural Processing Unit). In different scenarios, the target resources matched by different resource request subjects may change. For example, in the video viewing scenario, the target resources matched by the resource request subjects such as CPU / GPU may include but are not limited to storage resources such as Cache, bus, DDR, etc., so as to realize the acquisition and playback of video materials based on the request for these resources; in the document printing scenario, the target resources matched by the resource request subjects such as CPU may include but are not limited to input / output devices such as keyboard, mouse, printer, etc., so as to realize the printing of the required documents.

[0060] The target resource to be accessed by the resource request subject may include, but is not limited to, storage resources, network bandwidth, number of network connections, input / output devices (such as keyboards, mice, printers), file descriptors, processes or threads, and other hardware and software resources, depending on the actual application scenario. The embodiment of this application will mainly take the resource request subject as a memory access subject and the target resource requested to be accessed by the resource request subject as a storage resource as an example to illustrate the solution.

[0061] During implementation, the system of the electronic device may distinguish and identify different resource request subjects based on different request subject identifiers, and each resource request subject corresponds to a unique request subject identifier.

[0062] Taking the resource request subject as the memory access subject and performing storage resource monitoring and management based on MPAM as an example, MPAM uses PARTID (Partition Identifier) ​​to distinguish and identify different memory access subjects. Therefore, in this scenario, the request subject identifier of the memory access subject, the resource request subject, can be PARTID.

[0063] The memory access subject may be, but is not limited to, a device, a component (such as CPU, GPU), a process or even a block of code. In addition, it may be different tasks, such as video playback tasks, question-answering tasks based on intelligent agents such as large models, etc.

[0064] During implementation, the request subject identifier of each resource request subject with resource usage requirements can be pre-configured to support subsequent identification of the resource request subject based on the configured request subject identifier, and then monitor the target performance events corresponding to the resource request subject and perform resource regulation on this basis.

[0065] Specifically, but not limited to, the configuration of the request subject identifier can be performed based on a register. In this implementation, multiple registers can be pre-set, and the request subject identifier of each resource request subject can be configured in the corresponding register, for example, the PARTID of each access subject can be configured in the corresponding register to use the PARTID as the request subject identifier.

[0066] In the known technology, the monitoring unit inside the MPAM can only reflect the resource occupation of each memory access subject, but cannot explain whether such occupation meets the actual demand. For example, a process may have poor locality and allocate a large amount of cache during operation, but the cache hit rate is very low. At this time, allocating too much cache to the process according to the cache occupancy rate may cause overall performance degradation.

[0067] In response to the above problems, the method provided in the embodiment of the present application mainly monitors the target performance events of each resource request subject, and dynamically regulates the resource occupancy information of each resource request subject on the target resource based on the actual use of resources (not the occupancy) of each resource request subject represented by the target performance event monitoring information. That is, not only is it to monitor a certain / certain target performance events, but it is also to further determine whether these events have effectively used the resources / formed the actual use of the resources, such as continuing the cache retry in the case of a cache hit or miss, etc. For the request subject that effectively uses the resources / forms the actual use of the resources, the amount of resources allocated to it is positively adjusted (increased), and vice versa, the amount of resources allocated to it is negatively adjusted (reduced).

[0068] Among them, the target performance event is related to the utilization of the target resource. Taking the target resource as a storage resource as an example, the target performance event may include but is not limited to access request events to storage resources, cache hit events to storage resources, and access retry events to storage resources and other performance events related to the utilization of storage resources.

[0069] In view of the above technical concept, during implementation, optionally, a performance event set may be pre-set, and each performance event in the performance event set depends on the resource type of the target resource.

[0070] For each resource request subject with resource usage requirements, this step 101 determines at least one matching target performance event for each resource request subject from the performance event set. For example, the target performance event of "cache hit event for storage resources" is determined for the CPU and GPU respectively, and the two target performance events of "access request event for storage resources" and "access retry event for storage resources" are determined for the NPU.

[0071] After determining at least one target performance event that matches each resource request subject from the performance event set, at least one corresponding target performance event identifier can be configured for the request subject identifier of each resource request subject based on a configuration operation, and the configured at least one target performance event identifier is used to indicate at least one target performance event that matches the resource request subject. Based on this configuration operation, the request subject identifier of each resource request subject can correspond to at least one target performance event identifier.

[0072] In implementation, optionally, the target performance event identifier can also be configured based on the register. For example, the target performance event identifier corresponding to the request subject identifier of each resource request subject is configured in the corresponding register. One target performance event identifier can be configured in each register, or each target performance event identifier corresponding to the same request subject identifier can be configured. There is no restriction on this.

[0073] In this implementation, the request subject identifier can be associated with at least one matching target performance event identifier by establishing an association between the register corresponding to the request subject identifier and the register corresponding to the target performance event identifier. Exemplarily, a register unit can be constructed, each register unit includes a first register for configuring the request subject identifier and a second register for configuring the target performance event identifier, and the first register and the second register in the same register unit have an associated relationship by default.

[0074] For each request subject identifier that matches at least one target performance event identifier, optionally, a correspondence between the request subject identifier and the at least one target performance event identifier that matches it can be established by configuring the request subject identifier to a first register of a storage unit and configuring the at least one target performance event identifier corresponding to the request subject identifier to a second register of the storage unit.

[0075] Among them, each target performance event identifier can occupy a second register separately, or multiple target performance event identifiers corresponding to the same request subject identifier can also share a second register.

[0076] On this basis, based on the configured request subject identifiers and the target performance event identifiers corresponding to each request subject identifier, the target performance events generated by each resource request subject based on accessing the target resources can be monitored to obtain the target performance event monitoring information corresponding to each resource request subject.

[0077] Specifically, based on each configured request subject identifier and the target performance event identifier corresponding to the request subject identifier, the target performance events generated by each resource request subject based on access to the target resource can be monitored, and the number of each target performance event generated by each resource request subject can be counted based on a counter to obtain the counting information of each target performance event generated by each resource request subject, and then based on the counting information of each target performance event generated by each resource request subject, the target performance event monitoring information of each resource request subject can be obtained.

[0078] Optionally, in actual applications, the target performance events corresponding to each resource request subject can be monitored through a periodic monitoring method. For example, the target performance events generated by each resource request subject based on accessing storage resources can be monitored through a periodic monitoring method.

[0079] Each resource request subject generates at least one target performance event, and different target performance events generated by the same resource request subject correspond to respective counting information. For each resource request subject, the corresponding target performance event monitoring information may include the counting information of each target performance event generated by the resource request subject, and / or information obtained based on processing the counting information.

[0080] For example, the resource request subject is a storage access subject and the target resource to be used by the resource request subject is a storage resource. Assume that the resource request subject NPU is configured with a request subject identifier S r , and two target performance event identifiers: access request event identifier S e1 and access retry event identifier S e2, then based on the configured identifiers, the access request events and access retry events of the NPU to storage resources such as Cache, bus, and DDR can be monitored, and the number of access request events / access retry events generated by the NPU can be counted respectively, so as to obtain the counting information of the number of access request events and the number of access retry events of the NPU to the storage resources respectively, and the counting information and / or the processing result of the counting information can be used as the target performance event monitoring information of the NPU.

[0081] The processing result of the counting information may include but is not limited to frequency information obtained by performing frequency calculations based on the counting information (such as access request frequency, access retry frequency), or a change rate obtained by performing a change rate calculation between the counting information obtained by monitoring within the current monitoring cycle and the counting information within the adjacent previous monitoring cycle (such as the change rate of the number of access requests, the change rate of the number of access retries, etc.).

[0082] Step 102: Obtain target performance event monitoring information corresponding to each resource request subject; the target performance event monitoring information corresponding to the resource request subject is: information obtained by monitoring the target performance event matching the resource request subject generated by the resource request subject based on accessing the target resource.

[0083] In this step, the counting information of each target performance event generated by each resource request subject can be obtained, and / or the information obtained based on processing the counting information can be obtained. For example, the counting information of the number of access request events and the number of access retry events of the NPU to the storage resources can be obtained, and / or the frequency information, change rate, etc. obtained based on processing the counting information can be obtained.

[0084] For the periodic monitoring method, the target performance event monitoring information such as the count information and / or the change rate of the target performance events corresponding to each resource request subject in the predetermined time period can be obtained. For example, the number of count information and / or the change rate of the target performance events such as the access request events, cache hit events or access retry events generated by each resource request subject to the storage resource in the current monitoring period can be obtained, so as to timely and dynamically adjust the resource occupancy information of each resource request subject to the target resource based on the obtained target performance event monitoring information in the current monitoring period.

[0085] Step 103: Determine a target allocation strategy for allocating the target resource to each resource request subject according to the target performance event monitoring information corresponding to each resource request subject.

[0086] After obtaining the target performance event monitoring information corresponding to each resource request subject, the utilization rate of the target resources by each resource request subject can be determined based on the target performance event monitoring information corresponding to each resource request subject, and then according to the utilization rate of the target resources by each resource request subject, the target allocation strategy for allocating the target resources to each resource request subject can be determined.

[0087] Among them, in the target allocation strategy, the higher the utilization rate of the target resource by the resource request subject, the higher the target resource amount allocated to the resource request subject, that is, the target resource amount allocated to the resource request subject is positively correlated with the utilization rate of the target resource by the resource request subject.

[0088] Exemplarily, assuming that the resource request subject includes a first memory access subject and a second memory access subject, the target resource is a storage resource, and assuming that the target performance event monitoring information corresponding to the first memory access subject and the second memory access subject respectively is the number of cache hits for the storage resource in the current monitoring cycle, then the proportion of the number of cache hits of each memory access subject in the total number of cache hits of each memory access subject can be specifically determined as the utilization rate of the storage resource by each memory access subject, and then based on the utilization rate of the storage resource by each memory access subject, a target allocation strategy for allocating storage resources to each memory access subject can be determined.

[0089] Step 104: Based on the target allocation policy, the resource occupation information of the target resource by each resource request subject is regulated so that the resource occupation information of the target resource by each resource request subject matches the target allocation policy.

[0090] After determining the target allocation strategy, it can be specifically determined whether the actual occupation information of the target resource currently occupied by each resource request subject is consistent with the resource occupation information of the target resource represented by the target allocation strategy. If not, the resource occupation information of the target resource of each resource request subject is adjusted, and it is ensured that the resource occupation information of the target resource of each resource request subject after adjustment matches the target allocation strategy. On the contrary, if they are consistent, it is not necessary to adjust the resource occupation information of the target resource of each resource request subject.

[0091] For the periodic monitoring method, in an optional implementation, when the monitoring of the current monitoring cycle is completed, if the actual occupation information of the target resource by each resource request subject in the current monitoring cycle is inconsistent with the resource occupation information represented by the target allocation strategy, the resource occupation information of each resource request subject on the target resource can be adjusted in real time, so that in the next monitoring cycle, resource services are provided to each resource request subject based on the adjusted resource occupation information. That is, at the end of a monitoring cycle, the occupation information of each resource request subject on the target resource is adjusted in time, so that in the next monitoring cycle, resource services are provided to each resource request subject based on the adjusted resource occupation information, and the next round of monitoring is performed at the same time, so as to repeat this cycle, so as to ensure the reasonable allocation of target resources to each resource request subject at different times through periodic monitoring and dynamic resource adjustment.

[0092] However, it is not limited to this. In other implementations, in case that the actual occupancy information of the target resource by each resource request subject in the current monitoring cycle is inconsistent with the resource occupancy information represented by the target allocation strategy, it can also be delayed for a period of time until the next monitoring cycle begins, and then the resource occupancy information of the target resource by each resource request subject can be adjusted based on the target allocation strategy. In this implementation, there can be an adjustment cycle between two adjacent monitoring cycles. After a monitoring cycle ends, the occupancy information of the target resource by each resource request subject is adjusted based on the monitoring result corresponding to the monitoring cycle in the next adjustment cycle adjacent to the monitoring cycle, so that in the next monitoring cycle, resource services are provided to each resource request subject based on the adjusted resource occupancy information, and a new round of monitoring is started for the next monitoring cycle, and this cycle is repeated to ensure the reasonable allocation of target resources to each resource request subject on demand at different times through periodic monitoring and dynamic adjustment of resources.

[0093] In summary, the resource regulation method provided in the embodiment of the present application determines at least one matching target performance event for each resource request subject from the performance event set, obtains the target performance event monitoring information corresponding to each resource request subject, and determines the target allocation strategy for allocating the target resource to each resource request subject according to the target performance event monitoring information corresponding to each resource request subject, and then regulates the resource occupancy information of the target resource by each resource request subject based on the target allocation strategy. A solution for dynamically and adaptively adjusting the occupancy information of the target resource by the resource request subject based on the actual target performance event generated by the resource request subject for the target resource is proposed and implemented. Compared with the solution in the known technology in which software engineers speculate the system resources that may be needed by each resource request subject based on the business scenario, the solution of the present application can make the resource management and allocation of the resource request subject more scientific and more reliable, and more in line with the actual use of the system resources by the resource request subject, so that the system resources can be used more efficiently and reasonably based on the solution of the present application.

[0094] In an optional embodiment, for the periodic monitoring method, before each monitoring cycle starts, the corresponding monitoring information of the previous monitoring cycle in the monitoring device is cleared. For example, before each monitoring cycle starts, the relevant counting information of the previous monitoring cycle in the counter (such as the number of access requests, the number of cache hits, and the number of access retries) is cleared to zero, so that each newly started monitoring cycle can accurately count from 0.

[0095] In the case where it is necessary to rely on the counting information in the previous monitoring cycle to process the counting information in the current monitoring cycle (for example, it is necessary to determine the rate of change of the number of occurrences of an event in the current monitoring cycle based on the counting information of the number of occurrences of the event in the previous monitoring cycle), the recording of the monitoring information to be cleared (such as counting information) can be completed before clearing the corresponding monitoring information of the previous monitoring cycle in the monitoring device, so as to provide a data basis for subsequent data processing.

[0096] Among them, different monitoring periods generate their own corresponding target allocation strategies. It is easy to understand that the target allocation strategies generated by different monitoring periods are consistent with the actual target performance events generated by each resource request subject for the target resource in each monitoring period, so that the generated target allocation strategy and the actual target performance events generated by each resource request subject for the target resource have dynamic adaptability, thereby ensuring that the actual use needs of each resource request subject for the target resource can be effectively met at different times.

[0097] This embodiment is aimed at the periodic monitoring method. By clearing the corresponding monitoring information in the monitoring device such as the counter before the start of each monitoring cycle, it is convenient for each monitoring cycle to generate accurate target performance event monitoring information (for example, each monitoring cycle starts counting accurately from 0, so as to obtain accurate counting information within the monitoring cycle), and then it is convenient for each monitoring cycle to accurately generate its own target allocation strategy, so as to achieve reasonable allocation of resources.

[0098] In an optional embodiment, target performance events matched by the same resource request subject in different monitoring periods may be the same or different.

[0099] Different application scenarios may have different performance event monitoring requirements for the same resource request subject indicated by the same resource request identifier, such as PARTID. Based on this, optionally, in actual applications, when the application scenario corresponding to the same resource request subject changes, the matching target performance event can be re-determined and configured for the resource request subject based on the scenario change information of the scenario in which the resource request subject is located.

[0100] The different application scenarios may be different scenarios divided based on different scenario division dimensions, for example, intelligent processing scenarios based on intelligent agents and non-intelligent processing scenarios not based on intelligent agents divided based on the dimension of "whether it is intelligent processing", and video watching scenarios, game running scenarios, office document editing scenarios, etc. divided based on the user application dimension.

[0101] The performance event monitoring requirements for the same resource request subject may be different in different application scenarios. Specifically, the performance event monitoring requirements for the same resource request subject for each application scenario can be determined based on the main or core performance events generated by the same resource request subject for system resources in each application scenario. Based on this, when the application scenario in which the resource request subject is located changes, a matching target performance event is re-determined for the resource request subject. The determined target performance event should at least include the main or core performance events that the resource request subject will (or may) generate for system resources for the changed application scenario, so as to at least meet the resource usage requirements of the resource request subject for the main or core performance events of system resources in the application scenario in which it is located.

[0102] This embodiment can effectively meet the different performance event monitoring requirements of the same resource request subject in different application scenarios by dynamically matching the target performance events corresponding to the same resource request subject according to the application scenario, thereby further improving the dynamic adaptability of resource management to scenario changes and facilitating the efficient and reasonable use of system resources for different dynamically changing application scenarios.

[0103] In addition, for different application scenarios, the resource request subject that each application scenario focuses on can be adjusted based on the actual needs of each application scenario. For example, document processing mainly focuses on the CPU, while video playback mainly focuses on the GPU, or the shooting scenario mainly focuses on the ISP (Image Signal Processor). The adjustment of the resource request subject for different application scenarios can be achieved by adjusting the resource request subject identifier configured for different application scenarios, such as PARTID. The PARTID configuration for the application scenario can also depend on the number of performance monitoring subunits PMU units in the hardware. Among them, all PARTIDs involved in the application scenario can be configured to the corresponding PMU unit, or only some PARTIDs that the application scenario focuses on can be configured to the corresponding PMU unit. Specifically, the PARTID can be screened in combination with the actual application scenario and the number of PMU units.

[0104] In an optional embodiment, step 101 in the method provided by the present application, i.e., determining at least one matching target performance event for each resource request subject from the performance event set, can be implemented as follows:

[0105] According to the subject information and / or the application scenario of each resource request subject, at least one matching target performance event is determined for each resource request subject from the performance event set.

[0106] In this embodiment, the subject information of the resource request subject may include, but is not limited to, the device type (such as CPU, GPU, NPU), design goals, main adapted technical fields, calculation methods, etc. of the resource request subject.

[0107] For example, taking CPU and NPU as examples, CPU is the core of the computer, and its design goal is to process various types of data and instructions, including operating system management, application program operation, logical judgment, numerical calculation, etc. CPU is suitable for a wide range of computing tasks, with high flexibility and versatility. NPU is designed for neural network computing, and its design goal is to efficiently process large-scale parallel computing in deep learning models, such as convolution, pooling, tensor operations, etc. NPU is mainly used in artificial intelligence related fields, such as autonomous driving, image recognition, speech recognition, natural language understanding, recommendation systems, etc. In terms of computing methods, CPU emphasizes instruction-level parallelism and pipeline processing, and adopts complex branch prediction, cache management and multi-level pipeline technology to optimize the execution efficiency of general computing tasks; NPU integrates highly customized computing units, storage structures and data flow scheduling mechanisms at the hardware level, and can efficiently process operations such as feature extraction, weight update, and activation function calculation in deep learning models. NPU can accelerate complex calculations such as large-scale matrix operations and convolution operations in deep neural networks through large-scale parallel processing units and efficient interconnection structures.

[0108] Different resource request subjects may cause different main or core performance events for system resources due to their different corresponding subject information. For example, CPU / NPU may cause different main or core performance events for system storage resources, number of network connections, and input / output devices (such as keyboard, mouse, printer) resources due to their different corresponding design goals, main adapted technical fields, and calculation methods. Therefore, the subject information of each resource request subject can be used as a basis or one of the bases to determine at least one matching target performance event for each resource request subject from the performance event set, so that the target performance event determined for each resource request subject is adapted to the subject information of each resource request subject, thereby meeting the monitoring needs of different resource request subjects for different performance events caused by their own different subject information.

[0109] In addition, as mentioned above, different application scenarios may have different performance event monitoring requirements for the same resource request subject. Therefore, the application scenario in which each resource request subject is located can be used as a basis or one of the bases to determine at least one matching target performance event for each resource request subject from the performance event set, so that the target performance event determined for each resource request subject is adapted to the application scenario in which each resource request subject is located, thereby meeting different performance event monitoring requirements for different application scenarios.

[0110] Different application scenarios can be different scenarios divided based on different scenario division dimensions, such as different scenarios divided based on the dimension of "whether it is intelligent processing", different scenarios divided based on the user application dimension, etc. For details, please refer to the relevant instructions above and will not be repeated here.

[0111] This embodiment can effectively meet the monitoring needs of different resource request subjects for different performance events due to different subject information of the resource request subjects and / or different application scenarios by determining at least one matching target performance event for each resource request subject from the performance event set according to the subject information of each resource request subject and / or the application scenario in which it is located. Accordingly, resource allocation and regulation can be adapted to the subject information of different resource request subjects and / or the application scenarios in which they are located, thereby further improving the rationality of system resource allocation and regulation and making more efficient and reasonable use of system resources.

[0112] In an optional embodiment, a performance monitoring unit may be provided in hardware implementation, and the performance monitoring unit may be used to monitor target performance events corresponding to each resource request subject, so as to obtain performance event monitoring information corresponding to each resource request subject.

[0113] The performance monitoring unit includes a plurality of performance monitoring sub-units; each performance monitoring sub-unit is used to monitor a target performance event corresponding to a resource request subject indicated by a request subject identifier.

[0114] See also Figure 2 The composition structure diagram of the performance monitoring subunit shown in the figure, each performance monitoring subunit includes a matching unit 10 and a statistical unit 20. The matching unit 10 is used to match the resource request subject and the target performance event generated by the resource request subject based on the configured request subject identifier and the target performance event identifier, and output the matching result; the statistical unit 20 is used to count the target performance event corresponding to the resource request subject based on the matching result output by the matching unit to obtain the corresponding monitoring information.

[0115] Further, if Figure 3 As shown, the matching unit 10 includes:

[0116] The first selector 101 is used to select a resource request subject based on a configured request subject identifier and output a first selection result;

[0117] The second selector 102 is used to select the target performance event generated by the resource request subject based on the configured target performance event identifier to obtain a second selection result;

[0118] The judger 103 is used to match the resource request subject and the target performance event generated by the resource request subject based on the first selection result and the second selection result, and output the matching result.

[0119] Optionally, registers are respectively provided in the first selector 101 and the second selector 102, the first register provided in the first selector 101 is used to configure the request subject identifier, and the second register provided in the second selector 102 is used to configure the target performance event identifier.

[0120] Optionally, in this embodiment, each first register is used to configure a request subject identifier at a fixed time, and each second register is used to configure a target performance event identifier at a fixed time. The first register and the second register in the same matching unit 10 have an association relationship by default, so that the request subject identifier and the target performance event identifier configured in the first register and the second register of the same matching unit 10 have a corresponding relationship.

[0121] In actual applications, for at least one target performance event corresponding to a resource request subject, the request subject identifier and the target performance event identifier corresponding to the resource request subject can be matched to the first register and the second register in at least one matching unit 10 in a one-to-one relationship, thereby configuring the resource request subject identifier and the corresponding at least one target performance event identifier for the resource request subject.

[0122] For example, suppose the request subject identifier of the resource request subject NPU is S r , and its corresponding target performance event identifier includes the access request event identifier S e1 and access retry event identifier S e2 , then S r and S e1 The first register and the second register respectively included in the two selectors in the first matching unit are configured in a one-to-one relationship, and S r and S e2 The first register and the second register respectively included in the two selectors in the second matching unit are configured in a one-to-one relationship, so as to configure the request subject identifier S for the resource request subject NPU. r And the corresponding two target performance event identifiers S e1 and S e2 .

[0123] like Figure 3As shown, the statistical unit 20 includes a counter 201, which is used to count the number of target performance events generated by the resource request subject based on the matching result output by the judge. The counting information in the counter and / or the information obtained by processing the counting information (such as the change rate of the count value) can be used as the target performance event monitoring information of the resource request subject, so as to be used for the subsequent generation of the target allocation strategy and the resource regulation based on this.

[0124] Optionally, for the scenario of storage resource management and allocation based on MPAM, the embodiment of the present application implements the performance monitoring unit as an MPAM-PMU (MPAM Performance Monitoring Unit), wherein, see Figure 4 As shown in the MPAM-PMU composition structure diagram, the MPAM-PMU includes multiple performance monitoring sub-units MPAM-PMU unit, each performance monitoring sub-unit MPAM-PMU unit includes a matching unit and a statistical unit, the matching unit further includes two selectors SEL1, SEL2 and a judge DET, and the statistical unit includes a counter CNT.

[0125] Of course, in actual applications, it is not limited to the MPAM architecture. If a non-MPAM architecture is adopted, a configuration monitoring module for the resource request subject identifier that is compatible with the adopted non-MPAM architecture can be designed separately. Based on the designed configuration monitoring module, the target performance events matching the resource request subject can be configured, and the target performance event monitoring based on this can be realized. Then, based on the actual usage of resources (not occupancy) of the resource request subject represented by the target performance event monitoring information, the resource occupancy information of the resource request subject can be dynamically adjusted.

[0126] Each performance monitoring subunit MPAM-PMU unit has three main registers:

[0127] a. The first register PARTID_SEL in the selector SEL1 is used to configure the access subject identifier PARTID;

[0128] b. The second register EVENT_SEL in the selector SEL2 is used to configure the target performance event identifier EVENTID, such as the identifier of the event such as request access, cache hit, access retry, etc.;

[0129] c. The third register MPAMPMU_CNT in the counter CNT is used to store the counting information of the number of occurrences of the target performance event in the monitoring cycle.

[0130] For each performance monitoring subunit MPAM-PMU unit, when it is monitored that the memory access subject indicated by the PARTID configured internally initiates the target performance event indicated by the configured target performance event identifier, the count value in the counter increases by the set increment, such as adding 1 to the count value.

[0131] Specifically, for selector SEL1, its input information is a group of PARTID signals on the bus, which respectively represent different monitored memory access subjects. When the input PARTID signal contains the same PARTID as the PARTID configured in the register of SEL1, the selector SEL1 outputs 1, otherwise the output is 0; similarly, the target performance event is monitored based on the EVENTID configured in the selector SEL2. When the input EVENTID signal of SEL2 contains the same EVENTID as the EVENTID configured in the register of SEL2, the selector SEL2 outputs 1, otherwise the output is 0. Optionally, the outputs of the two selectors are both single-bit signals. The judge performs an AND operation on the outputs of the two selectors and outputs the corresponding operation results to the statistical unit. It is easy to understand that the judge output result of 1 indicates that the target performance event corresponding to the memory access subject indicated by the configured PARTID is monitored, otherwise, the judge output result of 0 indicates that the target performance event corresponding to the memory access subject indicated by the configured PARTID is not monitored.

[0132] In actual applications, the MPAMPM U_CNT value in the statistical unit can be periodically read based on a periodic monitoring method, and the target allocation strategy for storage resources can be determined based on the MPAMPMU_CNT value or the result obtained by processing the MPAMPMU_CNT value (such as the rate of change of the MPAMPMU_CNT value in this cycle compared to the previous cycle), and the allocation of MPAM resources can be dynamically adjusted based on the target allocation strategy.

[0133] Among them, the device supporting MPAM can control the storage resources that can be used by each memory access subject represented by PARTID by providing a set of registers based on the target allocation strategy, for example, limiting the cache way that can be allocated to the memory access subject represented by a certain PARTID, the cache size that can be used, the bandwidth that can be occupied, etc. Among them, the cache way represents the cache way, and the cache resources can be divided into multiple ways, each of which corresponds to a cache area of ​​corresponding size.

[0134] The following further takes the CPU and GPU designed on the SoC (System on Chip) as an example to illustrate the storage resource regulation process based on MPAM-PMU.

[0135] Among them, suppose that in a certain SoC design, the CPU and GPU share an SLC (System Level Cache), and a certain business requires the CPU and GPU to participate in processing together. During the processing, both the CPU and GPU have a large amount of memory access, which leads to serious cache thrashing problems on the SLC. Now we want to use the MPAM function to isolate the CPU and GPU cache to alleviate this problem. At this time, MPAM-PM U can be used to reasonably allocate SLC Way (i.e., SLC cache way). The process is as follows:

[0136] 1) Set the CPU's PARTID to 1 and the GPU's PARTID to 2.

[0137] 2) Configure the EVENT_SEL register of MPAM-PMU unit1 as the "cache hit" event identifier, and the PARTID_SEL register is configured to 1, indicating that the memory access subject is the CPU.

[0138] 3) Configure the EVENT_SEL register of MPAM-PMU unit2 as the "cache hit" event identifier, and the PARTID_SEL register is configured to 2, indicating that the memory access subject is the GPU.

[0139] 4) After waiting for a time T (such as T=100ms) corresponding to a complete monitoring cycle, read the MPAMPMU_CNT registers of MPAM-PMUunit1 and unit2, and set their values ​​to val1 and val2 respectively.

[0140] 5) Calculate the SLC ways allocated to the CPU and GPU respectively:

[0141]

[0142] W gpu =SLC ways -W cpu

[0143] 6) Through the registers used for resource control in MPAM, the CPU and GPU are configured to occupy Wcpu and Wgpu SLC ways respectively and the two are isolated from each other.

[0144] Assume that SLC ways = 16, Wcpu = 4, and Wgpu = 12. Then the CPU can allocate Way0 to Ways3 of SLC, and the GPU can allocate Way4 to Way15 of SLC.

[0145] 7) Repeat steps 4) to 6) with a duration T as a period to achieve dynamic on-demand allocation of SLC resources to the CPU and GPU.

[0146] During the monitoring process, the target performance event identifier in the EVENT_SEL register can be dynamically adjusted as needed based on scene changes.

[0147] Compared with the known technology, the hardware implementation of this embodiment has at least the following technical advantages:

[0148] 1) Performance monitoring units such as MPAM-PMU can directly and comprehensively monitor the usage of target resources such as storage resources by a specified resource request subject in a target performance event, so that the configuration of system resources is simpler and more reliable. For example, MPAM-PMU can count the cache hit rate, access retry and other information of a memory access subject under a certain configuration. Using these indicators, it is more intuitive and accurate to evaluate whether the MPAM configuration is reasonable.

[0149] 2) Based on the automatic allocation of system resources by the performance monitoring unit, it is not easily affected by environmental changes, and the software designed based on this has better portability. Taking MPAM-PMU as an example, the automatic allocation of MPAM resources by MPAM-PMU is not easily affected by SoC changes, and the software designed based on this has better portability.

[0150] 3) Many components already contain PMU units, and implementing MPAM-PMU on this basis is low-cost and easy.

[0151] The present application also provides a resource control device, whose composition structure is as follows: Figure 5 As shown, including:

[0152] A determination unit 501 is used to determine at least one matching target performance event for each resource request subject from a performance event set;

[0153] The performance monitoring unit 502 is used to monitor the target performance events generated by each resource request subject based on access to the target resource, and output the target performance event monitoring information corresponding to each resource request subject; the target performance event is related to the utilization rate of the target resource;

[0154] A resource partitioning unit 503 is used to determine a target allocation strategy for allocating the target resource to each resource request subject according to target performance event monitoring information corresponding to each resource request subject;

[0155] The regulating unit 504 is configured to regulate the resource occupation information of the target resource by each resource request subject based on the target allocation policy, so that the resource occupation information of the target resource by each resource request subject matches the target allocation policy.

[0156] In an optional implementation, the performance monitoring unit 502 is specifically used to: based on the configured request subject identifiers and the target performance event identifier corresponding to each request subject identifier, monitor the target performance events generated by each resource request subject based on access to the target resource, and obtain the target performance event monitoring information corresponding to each resource request subject.

[0157] In an optional implementation manner, the performance monitoring unit 502, when monitoring the target performance events generated by each resource request subject based on accessing the target resource, is specifically configured to:

[0158] Counting the number of each target performance event generated by each resource request subject to obtain counting information of each target performance event generated by each resource request subject;

[0159] Wherein, each resource request subject generates at least one target performance event, and different target performance events generated by the same resource request subject correspond to respective counting information;

[0160] The obtaining of target performance event monitoring information corresponding to each resource request subject includes:

[0161] Obtain count information of each target performance event generated by each resource request subject, and / or obtain information obtained based on processing the count information.

[0162] In an optional implementation, the target performance event monitoring information corresponding to each resource request subject includes: monitoring information of the target performance events generated based on access to storage resources corresponding to each resource request subject within a predetermined time period.

[0163] In an optional implementation, the determination unit 501 is specifically used to: determine at least one matching target performance event for each resource request subject from the performance event set according to the subject information of each resource request subject and / or the application scenario in which it is located.

[0164] In an optional implementation, the performance monitoring unit 502 includes a plurality of performance monitoring sub-units; each performance monitoring sub-unit is used to monitor a target performance event corresponding to a resource request subject indicated by a request subject identifier.

[0165] In an optional implementation, each performance monitoring subunit includes: a matching unit and a statistical unit;

[0166] The matching unit is used to match the resource request subject and the target performance event generated by the resource request subject based on the configured request subject identifier and target performance event identifier, and output the matching result;

[0167] The statistical unit is used to collect statistics on the target performance events corresponding to the resource request subject based on the matching results output by the matching unit to obtain corresponding monitoring information.

[0168] In an optional implementation, the matching unit includes:

[0169] A first selector, used to select a resource request subject based on a configured request subject identifier and output a first selection result;

[0170] A second selector is used to select a target performance event generated by the resource request subject based on a configured target performance event identifier to obtain a second selection result;

[0171] A judger, configured to match a resource request subject and a target performance event generated by the resource request subject based on the first selection result and the second selection result, and output a matching result;

[0172] The statistical unit includes a counter for counting the number of target performance events generated by the resource request subject based on the matching result output by the judge.

[0173] In an optional implementation, each resource request subject corresponds to at least one performance monitoring subunit, which is used to monitor at least one target performance event corresponding to the resource request subject;

[0174] The target performance event monitoring information corresponding to each resource request subject includes the monitoring information corresponding to the at least one performance monitoring sub-unit corresponding to the resource request subject and / or the information obtained based on the monitoring information.

[0175] In an optional implementation manner, the control unit is specifically used to:

[0176] Based on the target allocation strategy obtained by periodic monitoring, the resource occupation information of the target resource by each resource requesting subject is regulated;

[0177] The target performance events matched by the same resource request subject in different monitoring periods are the same or different; and the corresponding target allocation strategies are generated in different monitoring periods.

[0178] The control unit 504 is specifically used for:

[0179] Based on the target allocation strategy obtained by periodic monitoring, the resource occupation information of the target resource by each resource requesting subject is regulated;

[0180] The target performance events matched by the same resource request subject in different monitoring periods are the same or different, and the target allocation strategies corresponding to them are generated in different monitoring periods.

[0181] The present application also discloses an electronic device, the composition structure of the electronic device, such as Figure 6 As shown, including at least:

[0182] Memory 601, used for storing computer instruction sets;

[0183] A set of computer instructions can be implemented in the form of a computer program.

[0184] The processor 602 is used to implement the resource control method provided in any of the above method embodiments by executing the computer instruction set in the memory.

[0185] The processor 602 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a neural network processor (NPU), a deep learning processor (DPU) or other programmable logic devices, etc.

[0186] Optionally, the electronic device also includes storage resources such as memory and cache.

[0187] Optionally, the electronic device also includes a camera assembly, and / or is connected to an external camera assembly.

[0188] In addition, the electronic device may also include components such as a communication interface and a communication bus. The memory, the processor and the communication interface communicate with each other through the communication bus.

[0189] The communication interface is used for communication between electronic devices and other devices. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0190] An embodiment of the present application further discloses a storage medium, which carries one or more computer instruction sets. When the one or more computer instruction sets are executed by an electronic device, the electronic device can implement the resource control method as described in any one of the above items.

[0191] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0192] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0193] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0194] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0195] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A resource control method, comprising: Determine at least one matching target performance event for each resource request subject from the performance event set; Obtain target performance event monitoring information corresponding to each resource request subject; The target performance event monitoring information corresponding to the resource request subject is: information obtained by monitoring the target performance event matching the resource request subject generated by the resource request subject based on accessing the target resource; The target performance event is related to the utilization rate of the target resource; Determining a target allocation strategy for allocating the target resource to each resource request subject according to target performance event monitoring information corresponding to each resource request subject; Based on the target allocation policy, the resource occupation information of the target resource by each resource request subject is regulated so that the resource occupation information of the target resource by each resource request subject matches the target allocation policy.

2. According to the resource control method of claim 1, before obtaining the target performance event monitoring information corresponding to each resource request subject, the method further comprises: Based on the configured request subject identifiers and the target performance event identifier corresponding to each request subject identifier, the target performance events generated by each resource request subject based on accessing the target resource are monitored respectively, and the target performance event monitoring information corresponding to each resource request subject is obtained.

3. According to the resource control method of claim 2, the monitoring of target performance events generated by each resource request subject based on access to the target resource comprises: Counting the number of each target performance event generated by each resource request subject to obtain counting information of each target performance event generated by each resource request subject; Wherein, each resource request subject generates at least one target performance event, and different target performance events generated by the same resource request subject correspond to respective counting information; The obtaining of target performance event monitoring information corresponding to each resource request subject includes: Obtain count information of each target performance event generated by each resource request subject, and / or obtain information obtained based on processing the count information.

4. According to the resource control method of claim 1, the step of obtaining target performance event monitoring information corresponding to each resource request subject comprises: Obtain monitoring information of target performance events generated by accessing storage resources corresponding to each resource request subject within a predetermined time period.

5. According to the resource control method of claim 1, the step of determining at least one matching target performance event for each resource request subject from the performance event set comprises: According to the subject information and / or the application scenario of each resource request subject, at least one matching target performance event is determined for each resource request subject from the performance event set.

6. The resource control method according to claim 1, based on the target allocation strategy, controls the resource occupation information of the target resource by each resource request subject, including: Based on the target allocation strategy obtained by periodic monitoring, the resource occupation information of the target resource by each resource requesting subject is regulated; The target performance events matched by the same resource request subject in different monitoring periods are the same or different, and the target allocation strategies corresponding to them are generated in different monitoring periods.

7. A resource control device, comprising: A determination unit, configured to determine at least one matching target performance event for each resource request subject from the performance event set; The performance monitoring unit is used to monitor the target performance events generated by each resource request subject based on accessing the target resource, and output the target performance event monitoring information corresponding to each resource request subject; The target performance event is related to the utilization rate of the target resource; A resource allocation unit, configured to determine a target allocation strategy for allocating the target resource to each resource request subject according to target performance event monitoring information corresponding to each resource request subject; The regulating unit is used to regulate the resource occupation information of the target resource by each resource request subject based on the target allocation strategy, so that the resource occupation information of the target resource by each resource request subject matches the target allocation strategy.

8. According to the resource regulation device according to claim 7, the performance monitoring unit includes multiple performance monitoring sub-units; each performance monitoring sub-unit is used to monitor the target performance event corresponding to the resource request subject indicated by the request subject identifier.

9. The resource control device according to claim 8, each performance monitoring subunit comprises: Matching unit and statistics unit; The matching unit is used to match the resource request subject and the target performance event generated by the resource request subject based on the configured request subject identifier and target performance event identifier, and output the matching result; The statistical unit is used to collect statistics on the target performance events corresponding to the resource request subject based on the matching results output by the matching unit to obtain corresponding monitoring information.

10. The resource control device according to claim 9, wherein the matching unit comprises: A first selector, used to select a resource request subject based on a configured request subject identifier and output a first selection result; A second selector is used to select a target performance event generated by the resource request subject based on a configured target performance event identifier to obtain a second selection result; A judger, configured to match a resource request subject and a target performance event generated by the resource request subject based on the first selection result and the second selection result, and output a matching result; The statistical unit includes a counter for counting the number of target performance events generated by the resource request subject based on the matching result output by the judge.

11. The resource control device according to claim 8, each resource request subject corresponds to at least one performance monitoring subunit, which is used to monitor at least one target performance event corresponding to the resource request subject; The target performance event monitoring information corresponding to each resource request subject includes the monitoring information corresponding to the at least one performance monitoring sub-unit corresponding to the resource request subject and / or the information obtained based on the monitoring information.

12. The resource control device according to claim 7, wherein the control unit is specifically configured to: Based on the target allocation strategy obtained by periodic monitoring, the resource occupation information of the target resource by each resource requesting subject is regulated; in, The target performance events matched by the same resource request subject in different monitoring periods are the same or different; and different monitoring periods generate their own corresponding target allocation strategies.

Citation Information

Cited By

  • Method and equipment for acquiring correction coefficient of instruction execution efficiency and storage medium

    CN121349786A