Cache control method, allocation method and electronic equipment

By grouping process groups and dynamically adjusting cache group access parameters, the problem of inaccurate cache allocation is solved and the performance and energy efficiency of electronic devices are improved.

CN120653434APending Publication Date: 2025-09-16LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510726351.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the prior art, the cache allocation method of electronic devices cannot be accurately configured, which affects the performance and energy efficiency of the devices.

Method used

By grouping and managing process groups, we can obtain information about each process group and dynamically adjust cache group access parameters, including storage location range and bandwidth, when parameter adjustment conditions are met, to ensure the adaptation of process groups and caches.

Benefits of technology

It achieves precise allocation of cache, improves the operating efficiency of process groups, and enhances the overall performance and energy efficiency of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653434A_ABST
    Figure CN120653434A_ABST
Patent Text Reader

Abstract

The invention discloses a cache control method, an allocation method and electronic equipment. The cache control method comprises the following steps: respectively acquiring first process group information and second process group information corresponding to a first process group and a second process group; if the first process group information and / or the second process group information meet the parameter adjustment condition, adjusting first cache group access parameter information corresponding to the first process group and / or second cache group access parameter information corresponding to the second process group; wherein the first cache group access parameter information at least comprises a first storage position range, and the second cache group access parameter information at least comprises a second storage position range; the processes contained in the first process group can be allocated to access the cache of the first storage position range, and the processes contained in the second process group can be allocated to access the cache of the second storage position range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cache control of electronic devices, and in particular to a cache control method, a cache allocation method, and an electronic device. Background Art

[0002] The target device (such as the CPU) in an electronic device (such as a mobile phone) has a cache. The cache has a significant impact on the performance and energy efficiency of the target device. For example, on mobile phones, the CPU cache is getting larger and larger, but the cache is not accurately allocated to which tasks or processes to use and how the cache usage is distributed. This will affect the performance and energy efficiency of the electronic device. Summary of the Invention

[0003] The present invention provides a cache control method, a cache allocation method, and an electronic device. The cache control method includes:

[0004] Get the first process group information and the second process group information corresponding to the first process group and the second process group respectively;

[0005] If the first process group information and / or the second process group information meets the parameter adjustment condition, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group;

[0006] Among them, the first cache group access parameter information includes at least a first storage location range, and the second cache group access parameter information includes at least a second storage location range; the processes included in the first process group can be assigned to access the cache in the first storage location range, and the processes included in the second process group can be assigned to access the cache in the second storage location range.

[0007] Optionally, the method further includes:

[0008] In response to creating a new first target process, obtaining task type information of the first target process;

[0009] Based on the task type information, the target process is added to the first process group or the second process group.

[0010] Optionally, the method further includes:

[0011] In response to a change in task type information of a second target process, if the second target process belongs to the first process group, the second target process is moved from the first process group to the second process group; if the second target process belongs to the second process group, the second target process is moved from the second process group to the first process group.

[0012] Optionally, the method further includes:

[0013] In response to the third target process ending, the third target process is deleted from the first process group, or the third target process is deleted from the second process group.

[0014] Optionally, if the first process group information and / or the second process group information meets the parameter adjustment condition, adjusting the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group includes:

[0015] If the actual access parameter information of the first process group and / or the second process group does not match the corresponding expected cache group access parameter information, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

[0016] Optionally, the method further includes:

[0017] Determining expected cache group access parameter information corresponding to the first process group and the second process group based on weight parameters of the first process group and the second process group;

[0018] The weight parameter of the process group is related to the function and / or service information of the process group.

[0019] Optionally, determining expected cache group access parameter information corresponding to the first process group and the second process group based on weight parameters of the first process group and the second process group includes:

[0020] Determining expected cache sub-bandwidths corresponding to the first process group and the second process group, respectively, based on weight parameters of the first process group and the second process group, and an association between the weight parameters and cache bandwidth;

[0021] Based on the expected cache sub-bandwidth, the total bandwidth of the cache, and the total cache capacity of the cache, expected cache group access parameter information corresponding to the first process group and the second process group is determined.

[0022] Optionally, adjusting first cache group access parameter information corresponding to the first process group and / or second cache group access parameter information corresponding to the second process group includes:

[0023] Determining normalized virtual parameters using a virtual controller based on the expected cache sub-bandwidth, the expected cache occupancy, and the expected storage location range respectively corresponding to the first process group and the second process group;

[0024] Determining, based on the virtual parameter and preset mapping data, a plurality of adjustment parameters corresponding to the first process group and the second process group, respectively, wherein the preset mapping data is used to indicate an association relationship between the virtual parameter and the plurality of adjustment parameters;

[0025] Using the multiple adjustment parameters, the first cache sub-bandwidth, the first cache occupancy, the first cache usage priority and / or the first storage location range corresponding to the first process group are adjusted, and the second cache sub-bandwidth, the second cache occupancy, the second cache usage priority and / or the second storage location range corresponding to the second process group are adjusted.

[0026] The present application also provides a cache allocation method, including:

[0027] In response to a target process accessing a cache, obtaining a target process group to which the target process belongs;

[0028] If the target process group is the first process group, allocating a cache in a first storage location range to the target process using first cache group access parameter information corresponding to the first process group;

[0029] If the target process group is the second process group, allocating a cache in a second storage location range to the target process using the second cache group access parameter information corresponding to the second process group;

[0030] Among them, the first cache group access parameter information corresponding to the first process group and the second cache group access parameter information corresponding to the second process group are updated based on the first process group information and the second process group information corresponding to the first process group and the second process group.

[0031] An embodiment of the present application further provides an electronic device, including:

[0032] an acquisition module configured to respectively acquire first process group information and second process group information corresponding to the first process group and the second process group;

[0033] a processing module configured to adjust first cache group access parameter information corresponding to the first process group and / or second cache group access parameter information corresponding to the second process group if the first process group information and / or the second process group information meet a parameter adjustment condition;

[0034] Among them, the first cache group access parameter information includes at least a first storage location range, and the second cache group access parameter information includes at least a second storage location range; the processes included in the first process group can be assigned to access the cache in the first storage location range, and the processes included in the second process group can be assigned to access the cache in the second storage location range. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flowchart of a cache control method according to an embodiment of the present application;

[0036] Figure 2 This is a flowchart of an embodiment of the cache control method of the present application;

[0037] Figure 3 This is a flowchart of another embodiment of the cache control method according to the embodiment of the present application;

[0038] Figure 4 For the embodiment of this application Figure 1 Flowchart of an embodiment of step S200;

[0039] Figure 5 This is a flowchart of a cache allocation method according to an embodiment of the present application;

[0040] Figure 6 This is a flowchart of another specific embodiment of the cache control method of the embodiment of the present application;

[0041] Figure 7 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0043] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0044] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0045] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0046] It should also be understood that although the present application has been described with reference to certain specific examples, those skilled in the art will readily be able to implement many other equivalent forms of the present application.

[0047] The above and other aspects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.

[0048] Specific embodiments of the present application will be described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments described are merely examples of the present application and may be implemented in a variety of ways. Familiar and / or repetitive functions and structures are not described in detail to avoid obscuring the present application with unnecessary or redundant details. Therefore, the specific structural and functional details described herein are not intended to be limiting, but rather serve merely as a basis and representative basis for the claims to teach those skilled in the art to variously utilize the present application with substantially any suitable detailed structure.

[0049] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may all refer to one or more of the same or different embodiments according to the present application.

[0050] A cache control method in an embodiment of the present application can be applied to an electronic device having a cache, or a device in the electronic device (such as a CPU) having a cache, and the process of a related program on the electronic device needs to use the cache during operation.

[0051] The method includes grouping various processes of an electronic device to form multiple process groups, including at least one first process group and at least one second process group. Different process groups may utilize different levels of cache. The electronic device obtains first process group information corresponding to the first process group and second process group information corresponding to the second process group. The first process group information represents actual access parameter information of the first process group to the electronic device. The second process group information represents actual access parameter information of the second process group to the electronic device. During the operation of the first and second process groups, when the actual access parameter information meets a parameter adjustment condition, the first process group information and / or the second process group information are adjusted. This dynamically adjusts the cache usage of the first and second process groups. This includes adjusting a first storage location range and a second storage range for storing the cache. This ensures that cache usage is compatible with both the first and second process groups, improving the operating efficiency of processes in each process group and enhancing the performance of the electronic device.

[0052] The cache control method of the present application is described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of the cache control method according to an embodiment of the present application. Figure 1 As shown, the method includes the following steps:

[0053] S100, obtaining first process group information and second process group information corresponding to the first process group and the second process group respectively.

[0054] Exemplarily, after the process of the program in the electronic device is established, it can be grouped according to the attribute information of the process, and exemplary, it can be grouped according to the type of process. For example, processes of the same or similar type can be grouped together. In this embodiment, after the processes are grouped, at least one first process group and at least one second process group are formed. Different process groups are allocated different cache sizes and bandwidths. The process groups with relatively higher importance are allocated larger cache amounts and wider bandwidths; while the process groups with relatively lower importance are allocated smaller cache amounts and narrower bandwidths. The electronic device obtains first process group information corresponding to the first process group, and second process group information corresponding to the second process group.

[0055] The first process group information includes at least actual access parameter information of the first process group currently targeting the electronic device. The second process group information includes at least actual access parameter information of the second process group currently targeting the electronic device. In one embodiment, the actual access parameter information of the electronic device includes at least one of the following: current cache occupancy and actual cache bandwidth usage.

[0056] S200: If the first process group information and / or the second process group information meets the parameter adjustment condition, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

[0057] For example, the need for using cache may change during the running of a process, or the user may need to adjust the cache usage of the first process group and / or the second process group based on actual usage. This will cause the first process group information and / or the second process group information to change. In this case, it is necessary to analyze the content of the first process group information and / or the second process group information and determine whether it meets the parameter adjustment conditions. If the first process group information and / or the second process group information meets the parameter adjustment conditions, it indicates that the expectation of the first process group and / or the second process group to use cache is significantly different from the actual usage, and it is necessary to adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

[0058] In one embodiment, the first cache group access parameter information includes at least one of the following: the first cache sub-bandwidth corresponding to the first process group, the first cache occupancy, the first cache usage priority and / or the first storage location range. Among them, the first cache sub-bandwidth is the bandwidth information of the current first process group in the total cache bandwidth, the first cache occupancy is the quantitative information of the cache actually used by the current first process group, the first cache usage priority is the priority of the current first process group for cache usage relative to other process groups, and the first storage location range is the cache location information that the processes included in the current first process group can be allocated to access. Similarly, the second cache sub-bandwidth is the bandwidth information of the current second process group in the total cache bandwidth, the second cache occupancy is the quantitative information of the cache actually used by the current second process group, the second cache usage priority is the priority of the current second process group for cache usage relative to other process groups, and the second storage location range is the cache location information that the processes included in the current second process group can be allocated to access.

[0059] In this embodiment, the first cache group access parameter information includes at least a first storage location range, and the second cache group access parameter information includes at least a second storage location range; the processes included in the first process group can be assigned to access the cache in the first storage location range, and the processes included in the second process group can be assigned to access the cache in the second storage location range.

[0060] Exemplarily, the first cache group access parameter information includes at least a first storage location range, which is the access range of processes in the first process group when using the cache. The cache within the first storage location range is accessible to processes included in the first process group. Differences in the first storage location range can affect the progress of processes accessing the cache. Therefore, adjusting the first storage location range will improve the efficiency of the processes in the first process group in using the cache.

[0061] Similarly, the second cache group access parameter information includes at least a second storage location range, which is the access range of processes in the second process group when using the cache. The cache within the second storage location range is accessible to processes included in the second process group. Differences in the second storage location range can affect the progress of processes accessing the cache. Therefore, adjusting the second storage location range can improve the efficiency of cache use by processes in the second process group.

[0062] The cache control method of the embodiment of the present application can adaptively adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group when the expected use of the cache by the first process group and / or the second process group differs significantly from the actual use, thereby accurately configuring the use of the cache for the first process group and / or the second process group. This avoids the practice of fixedly allocating cache to each process and can flexibly configure the use of cache for different process groups based on information such as the importance and actual needs of different process groups, thereby meeting the needs of each process and improving the performance of the electronic device.

[0063] In one embodiment of the present application, Figure 2 As shown, the method further includes the following steps:

[0064] S300: In response to creating a new first target process, obtaining task type information of the first target process.

[0065] For example, during the process of starting, running, or ending a program on an electronic device, a new related process may be created. After a first target process is created, the electronic device responds to the first target process and obtains task type information for the first target process. The task type information characterizes the type, function, and user relevance of the first target process. Processes with the same task type have similar cache usage.

[0066] The task type of the first target process can be determined and obtained by analyzing multiple aspects such as the source, task target, related program information, and registration information of the first target process.

[0067] S400: Add the target process to the first process group or the second process group based on the task type information.

[0068] Exemplarily, the task type information represents the type, function, and / or user relevance of the target process. After obtaining the task type information of the first target process, the first target process can be added to the first process group or the second process group based on the task type information of the first target process. Processes in the same process group have the same or similar task type information.

[0069] In one embodiment, the first process group and the second process group have different requirements for using the cache. For example, processes in the first process group have a higher priority for using the cache, while processes in the second process group have a lower priority for using the cache.

[0070] In one embodiment, the processes and the number of processes in the first process group and the second process group can be dynamically adjusted. For example, the processes in the first process group and the second process group can be adjusted based on an adjustment strategy, including mutually allocating the processes in the first process group and the second process group. For example, the first process group is more important, and the second process group is less important. The number of processes in the first process group can be configured higher, and when grouping the newly created target processes, if conditions permit, they can be allocated to the first process group as much as possible, so that more processes can meet their cache usage needs. If the number of processes in the first process group exceeds the limit, the newly created target process can no longer be added to the first process group, or some of the processes can be added to the second process group instead.

[0071] In one embodiment of the present application, the method further comprises the following steps:

[0072] In response to a change in task type information of a second target process, if the second target process belongs to the first process group, moving the second target process from the first process group to the second process group;

[0073] If the second target process belongs to the second process group, the second target process is moved from the second process group to the first process group.

[0074] For example, the task type information represents the type, function, and / or user relevance of the target process. The second target process may already be assigned a process group. As related programs change or user requirements change, the task type information of the second target process may change. This allows the second target process to be reassigned to a different process group to adapt to the changed second target process, increasing the flexibility of process group configuration.

[0075] Specifically, if the task type information of the second target process changes, and the second target process originally belonged to the first process group, the second target process can be moved from the first process group to the second process group to adapt to the change in the task type information of the second target process. The task type information of the second target process is the same as or similar to that of other processes in the second process group. Conversely, if the task type information of the second target process changes, and the second target process originally belonged to the second process group, the second target process can be moved from the second process group to the first process group to adapt to the change in the task type information of the second target process. The task type information of the first target process is the same as or similar to that of other processes in the second process group.

[0076] In one embodiment of the present application, the method further includes the following steps: in response to the end of the third target process, deleting the third target process from the first process group, or deleting the third target process from the second process group.

[0077] Exemplarily, a process has a life cycle. For example, after the third target process is assigned to the first process group or the second process group, the third target process will end as the related program runs. The electronic device can delete the third target process from the first process group in response to the end of the third target process, or delete it from the second process group so that the third target process does not occupy the resources of the first process group or the second process group, thereby facilitating the management of other processes in the first process group or the second process group, and also saving system resources.

[0078] In one embodiment of the present application, if the first process group information and / or the second process group information satisfies the parameter adjustment condition, adjusting the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group includes:

[0079] If the actual access parameter information of the first process group and / or the second process group does not match the corresponding expected cache group access parameter information, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

[0080] Exemplarily, the first process group and the second process group both have expected cache group access parameter information, which characterizes the expected amount of cache resources, including expected cache sub-bandwidth, expected cache occupancy, expected cache usage priority, and expected storage location range. The first process group and the second process group both have their own actual access parameter information. In one embodiment, the actual access parameter information corresponding to the first process group is the first process group information, and the actual access parameter information corresponding to the second process group is the second process group information. The actual access parameter information includes at least one of the following: the current cache occupancy and the actual occupied bandwidth of the cache. In another embodiment, the actual access parameter information may also include other buffer usage information of the process group, such as the cache sub-bandwidth, cache occupancy, cache usage priority, and cache storage location range currently corresponding to the process group.

[0081] If the actual access parameter information of the first process group and / or the second process group does not match the corresponding expected cache group access parameter information, it is determined that the first process group information and / or the second process group information meet the parameter adjustment conditions. This indicates that the current cache utilization of the first process group and / or the second process group cannot reach the expected utilization, and the first cache group access parameter information and / or the second cache group access parameter information can be adjusted, including adjusting the cache sub-bandwidth, cache occupancy, cache usage priority, and cache storage location range currently corresponding to the process group. This ensures that the actual access parameter information of the first process group and / or the second process group is compatible with the corresponding expected cache group access parameter information.

[0082] In one embodiment of the present application, the method further comprises the following steps:

[0083] Based on the weight parameters of the first process group and the second process group, the expected cache group access parameter information corresponding to the first process group and the second process group is determined; wherein the weight parameters of the process group are related to the function and / or service information of the process group.

[0084] Exemplarily, the first process group and the second process group both have their functions and service information, and their functions and service information can characterize the importance of the process group. Among them, the function is the function that can be achieved after the process in the process group is run, and the service information can be whether the process type in the process group is a service type, such as whether it is a system service of an electronic device. In this embodiment, the weight parameter of the first process group can be determined based on the function and / or service information of the first process group, and the weight parameter of the second process group can be determined based on the function and / or service information of the second process group. The weight parameter characterizes the importance of the process group. Among them, the higher the weight, the higher the expectation of using the corresponding cache, and vice versa.

[0085] The weight parameters of the process group have a corresponding relationship with the expected cache group access parameter information, and the corresponding relationship can be quantified to calculate the expected cache group access parameter information corresponding to each process group. In one embodiment, the weight parameters of the process group include positive weight parameters and negative weight parameters, and the expected cache usage information indicated by the positive weight parameters and the negative weight parameters are different. The expected cache sub-bandwidth and expected cache occupancy corresponding to the positive weight parameters are higher, while the expected cache sub-bandwidth and expected cache occupancy corresponding to the negative weight parameters are lower. Based on the positive weight parameters or negative weight parameters, and the corresponding relationship between them and the expected cache group access parameter information, the corresponding expected cache group access parameter information is calculated.

[0086] In one embodiment of the present application, based on the weight parameters of the first process group and the second process group, the expected cache group access parameter information corresponding to the first process group and the second process group is determined, such as Figure 3 As shown, the following steps are included:

[0087] S500 : Determine expected cache sub-bandwidths corresponding to the first process group and the second process group, respectively, based on weight parameters of the first process group and the second process group, and an association between the weight parameters and cache bandwidth.

[0088] Exemplarily, there is a correlation between the weight parameter of the process group and the cache bandwidth. The higher the weight, the larger the corresponding cache bandwidth, and the lower the weight, the smaller the corresponding cache bandwidth.

[0089] Based on the weight parameter of the first process group and its correlation with the cache bandwidth, the expected cache sub-bandwidth corresponding to the first process group is determined. Based on the weight parameter of the second process group and its correlation with the cache bandwidth, the expected cache sub-bandwidth corresponding to the second process group is determined. For example, the process group of a process running in the foreground has a higher weight and a corresponding higher expected cache sub-bandwidth, while the process group of a process running in the background has a lower weight and a corresponding lower expected cache sub-bandwidth.

[0090] S600 : Determine expected cache group access parameter information corresponding to the first process group and the second process group respectively based on the expected cache sub-bandwidth, the total bandwidth of the cache, and the total cache capacity of the cache.

[0091] For example, obtain the cache sub-bandwidth actually used by all process groups, add up the cache sub-bandwidth actually used by all process groups, calculate the total cache bandwidth, then divide the expected cache sub-bandwidth of the current process group by the total cache bandwidth, and multiply the result by the total cache capacity to obtain the expected cache occupancy of the current process group.

[0092] In one embodiment of the present application, Figure 4 Shown and combined Figure 7 , adjusting the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group includes:

[0093] S210 : Determine normalized virtual parameters using a virtual controller based on the expected cache sub-bandwidth, the expected cache occupancy, and the expected storage location range respectively corresponding to the first process group and the second process group.

[0094] Exemplarily, a virtual controller (Vctrl) is provided in the electronic device, and the virtual controller (Vctrl) is used to virtualize the expected cache group access parameter information corresponding to each process group to obtain virtual data that can be recognized and logically processed by the electronic device. In this embodiment, the virtual controller is used to determine the corresponding normalized first virtual parameter for the expected cache sub-bandwidth, the expected cache occupancy, and the expected storage location range corresponding to the first process group. The expected cache sub-bandwidth, the expected cache occupancy, and the expected storage location range corresponding to the second process group are used to determine the corresponding normalized second virtual parameter.

[0095] S220 : Determine a plurality of adjustment parameters corresponding to the first process group and the second process group respectively based on the virtual parameter and preset mapping data, wherein the preset mapping data is used to indicate an association relationship between the virtual parameter and the plurality of adjustment parameters.

[0096] Exemplarily, the preset mapping data is used to map virtual parameters to adjustment parameters. For example, the preset mapping data may be represented by a mapping table that records virtual parameters and their corresponding adjustment parameters. Based on the virtual parameters and the preset mapping data, multiple adjustment parameters for the first process group and multiple adjustment parameters corresponding to the second process group may be determined.

[0097] The adjustment parameter may be intermediate data used to adjust the current cache usage status of the process group.

[0098] S230: Using the multiple adjustment parameters, adjust the first cache sub-bandwidth, the first cache occupancy, the first cache usage priority and / or the first storage location range corresponding to the first process group, and adjust the second cache sub-bandwidth, the second cache occupancy, the second cache usage priority and / or the second storage location range corresponding to the second process group.

[0099] Exemplarily, multiple adjustment parameters are used to adjust the first cache sub-bandwidth, first cache occupancy, first cache usage priority, and / or first storage location range corresponding to the first process group, so that the adjusted information is closer to the expected cache group access parameter information of the first process group, thereby meeting the first process group's need for cache usage. Similarly, the second cache sub-bandwidth, second cache occupancy, second cache usage priority, and / or second storage location range corresponding to the second process group are adjusted, thereby meeting the second process group's need for cache usage.

[0100] The embodiment of the present application also provides a cache allocation method, such as Figure 5 As shown, the following steps are included:

[0101] S10, in response to the target process accessing the cache, obtaining a target process group to which the target process belongs;

[0102] S20: If the target process group is the first process group, allocate a cache in a first storage location range to the target process using first cache group access parameter information corresponding to the first process group;

[0103] S30: If the target process group is the second process group, allocate a cache in a second storage location range to the target process using the second cache group access parameter information corresponding to the second process group;

[0104] Among them, the first cache group access parameter information corresponding to the first process group and the second cache group access parameter information corresponding to the second process group are updated based on the first process group information and the second process group information corresponding to the first process group and the second process group.

[0105] Exemplarily, when a target process requests access to a cache, the electronic device, in response to the request, obtains the target process group to which the target process belongs, determines the cache group access parameter information corresponding to the target process group, and then allocates a storage location range in the cache to the target process group based on the cache group access parameter information. If the target process group is a first process group, a first storage location range of the corresponding cache is determined based on the first cache group access parameter information corresponding to the first process group, and cache within the first storage location range is allocated to the processes in the first process group, allowing the processes in the first process group to use the cache within the first storage location range. If the target process group is a second process group, a second storage location range of the corresponding cache is determined based on the second cache group access parameter information corresponding to the second process group, and cache within the second storage location range is allocated to the processes in the second process group, allowing the processes in the second process group to use the cache within the second storage location range. After the cache is allocated, both the first process group and the second process group can use the cache within the storage location range that is compatible with them, thereby improving the cache access efficiency of the processes in the process groups and improving the performance of the electronic device.

[0106] In addition, during the operation of the process group, the actual cache occupancy of the process group and the actual occupied bandwidth of the cache may change, that is, the first process group information of the first process group and the second process group information of the second process group may change. In this embodiment, based on the first process group information corresponding to the first process group, the first cache group access parameter information corresponding to the first process group is updated, thereby dynamically and flexibly adjusting the first cache group access parameter information. Similarly, based on the second process group information corresponding to the second process group, the second cache group access parameter information corresponding to the second process group is updated, thereby dynamically and flexibly adjusting the second cache group access parameter information.

[0107] The present application also provides an electronic device, such as Figure 7 Shown and combined Figure 6 ,include:

[0108] an acquisition module configured to respectively acquire first process group information and second process group information corresponding to the first process group and the second process group;

[0109] Exemplarily, after the process of the program in the electronic device is established, it can be grouped according to the attribute information of the process, and exemplary, it can be grouped according to the type of process. For example, processes of the same or similar type can be grouped together. In this embodiment, after the processes are grouped, at least one first process group and at least one second process group are formed. Different process groups are allocated different cache sizes and bandwidths. The process groups with relatively higher importance are allocated larger cache amounts and wider bandwidths; while the process groups with relatively lower importance are allocated smaller cache amounts and narrower bandwidths. The acquisition module obtains the first process group information corresponding to the first process group, and the second process group information corresponding to the second process group.

[0110] The first process group information includes at least actual access parameter information of the first process group currently targeting the electronic device. The second process group information includes at least actual access parameter information of the second process group currently targeting the electronic device. In one embodiment, the actual access parameter information of the electronic device includes at least one of the following: current cache occupancy and actual cache bandwidth usage.

[0111] A processing module is configured to adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group if the first process group information and / or the second process group information meet the parameter adjustment conditions.

[0112] For example, the need for using cache may change during the running of a process, or the user may need to adjust the cache usage of the first process group and / or the second process group based on actual usage. This will cause the first process group information and / or the second process group information to change. In this case, the processing module needs to analyze the content of the first process group information and / or the second process group information and determine whether it meets the parameter adjustment conditions. If the first process group information and / or the second process group information meets the parameter adjustment conditions, it indicates that the expectation of the first process group and / or the second process group to use cache is significantly different from the actual usage, and the processing module needs to adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

[0113] In one embodiment, the first cache group access parameter information includes at least one of the following: the first cache sub-bandwidth corresponding to the first process group, the first cache occupancy, the first cache usage priority and / or the first storage location range. Among them, the first cache sub-bandwidth is the bandwidth information of the current first process group in the total cache bandwidth, the first cache occupancy is the quantitative information of the cache actually used by the current first process group, the first cache usage priority is the priority of the current first process group for cache usage relative to other process groups, and the first storage location range is the cache location information that the processes included in the current first process group can be allocated to access. Similarly, the second cache sub-bandwidth is the bandwidth information of the current second process group in the total cache bandwidth, the second cache occupancy is the quantitative information of the cache actually used by the current second process group, the second cache usage priority is the priority of the current second process group for cache usage relative to other process groups, and the second storage location range is the cache location information that the processes included in the current second process group can be allocated to access.

[0114] In this embodiment, the first cache group access parameter information includes at least a first storage location range, and the second cache group access parameter information includes at least a second storage location range; the processes included in the first process group can be assigned to access the cache in the first storage location range, and the processes included in the second process group can be assigned to access the cache in the second storage location range.

[0115] Exemplarily, the first cache group access parameter information includes at least a first storage location range, which is the access range of processes in the first process group when using the cache. The cache within the first storage location range is accessible to processes included in the first process group. Differences in the first storage location range can affect the progress of processes accessing the cache. Therefore, adjusting the first storage location range will improve the efficiency of the processes in the first process group in using the cache.

[0116] Similarly, the second cache group access parameter information includes at least a second storage location range, which is the access range of processes in the second process group when using the cache. The cache within the second storage location range is accessible to processes included in the second process group. Differences in the second storage location range can affect the progress of processes accessing the cache. Therefore, adjusting the second storage location range can improve the efficiency of cache use by processes in the second process group.

[0117] In one embodiment of the present application, the electronic device further includes a distribution module, which is configured to:

[0118] In response to creating a new first target process, obtaining task type information of the first target process;

[0119] Based on the task type information, the target process is added to the first process group or the second process group.

[0120] In one embodiment of the present application, the allocation module is further configured to:

[0121] In response to a change in task type information of a second target process, if the second target process belongs to the first process group, the second target process is moved from the first process group to the second process group; if the second target process belongs to the second process group, the second target process is moved from the second process group to the first process group.

[0122] In one embodiment of the present application, the allocation module is further configured to:

[0123] In response to the third target process ending, the third target process is deleted from the first process group, or the third target process is deleted from the second process group.

[0124] In one embodiment of the present application, the processing module is further configured to: if the actual access parameter information of the first process group and / or the second process group does not match the corresponding expected cache group access parameter information, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

[0125] In one embodiment of the present application, the processing module is further configured to: determine the expected cache group access parameter information corresponding to the first process group and the second process group based on the weight parameters of the first process group and the second process group; wherein the weight parameters of the process group are related to the function and / or service information of the process group.

[0126] In one embodiment of the present application, the processing module is further configured to: determine the expected cache sub-bandwidth corresponding to each of the first process group and the second process group based on weight parameters of the first process group and the second process group, and the association between the weight parameters and the cache bandwidth; and determine the expected cache group access parameter information corresponding to the first process group and the second process group based on the expected cache sub-bandwidth, the total bandwidth of the cache, and the total cache amount of the cache.

[0127] In one embodiment of the present application, the processing module is further configured to: determine, using a virtual controller, normalized virtual parameters based on the expected cache sub-bandwidth, the expected cache occupancy, and the expected storage location range respectively corresponding to the first process group and the second process group;

[0128] Determining, based on the virtual parameter and preset mapping data, a plurality of adjustment parameters corresponding to the first process group and the second process group, respectively, wherein the preset mapping data is used to indicate an association relationship between the virtual parameter and the plurality of adjustment parameters;

[0129] Using the multiple adjustment parameters, the first cache sub-bandwidth, the first cache occupancy, the first cache usage priority and / or the first storage location range corresponding to the first process group are adjusted, and the second cache sub-bandwidth, the second cache occupancy, the second cache usage priority and / or the second storage location range corresponding to the second process group are adjusted.

[0130] The above embodiments are merely exemplary embodiments of the present application and are not intended to limit the scope of the present application. The scope of protection of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and scope of protection of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of the present application.

Claims

1. A cache control method, comprising: Get the first process group information and the second process group information corresponding to the first process group and the second process group respectively; If the first process group information and / or the second process group information meets the parameter adjustment condition, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group; Among them, the first cache group access parameter information includes at least a first storage location range, and the second cache group access parameter information includes at least a second storage location range; the processes included in the first process group can be assigned to access the cache in the first storage location range, and the processes included in the second process group can be assigned to access the cache in the second storage location range.

2. The cache control method according to claim 1, further comprising: In response to creating a new first target process, obtaining task type information of the first target process; Based on the task type information, the target process is added to the first process group or the second process group.

3. The cache control method according to claim 1, further comprising: In response to a change in task type information of a second target process, if the second target process belongs to the first process group, the second target process is moved from the first process group to the second process group; if the second target process belongs to the second process group, the second target process is moved from the second process group to the first process group.

4. The cache control method according to claim 3, further comprising: In response to the third target process ending, the third target process is deleted from the first process group, or the third target process is deleted from the second process group.

5. The cache control method according to claim 1, wherein if the first process group information and / or the second process group information satisfies a parameter adjustment condition, adjusting first cache group access parameter information corresponding to the first process group and / or second cache group access parameter information corresponding to the second process group comprises: If the actual access parameter information of the first process group and / or the second process group does not match the corresponding expected cache group access parameter information, adjust the first cache group access parameter information corresponding to the first process group and / or the second cache group access parameter information corresponding to the second process group.

6. The cache control method according to claim 1, further comprising: Determining expected cache group access parameter information corresponding to the first process group and the second process group based on weight parameters of the first process group and the second process group; The weight parameter of the process group is related to the function and / or service information of the process group.

7. The cache control method according to claim 6, wherein determining the expected cache group access parameter information corresponding to the first process group and the second process group based on the weight parameters of the first process group and the second process group comprises: Determining expected cache sub-bandwidths corresponding to the first process group and the second process group, respectively, based on weight parameters of the first process group and the second process group, and an association between the weight parameters and cache bandwidth; Based on the expected cache sub-bandwidth, the total bandwidth of the cache, and the total cache capacity of the cache, expected cache group access parameter information corresponding to the first process group and the second process group is determined.

8. The cache control method according to claim 5, wherein adjusting first cache group access parameter information corresponding to the first process group and / or second cache group access parameter information corresponding to the second process group comprises: Determining normalized virtual parameters using a virtual controller based on the expected cache sub-bandwidth, the expected cache occupancy, and the expected storage location range respectively corresponding to the first process group and the second process group; Determining, based on the virtual parameter and preset mapping data, a plurality of adjustment parameters corresponding to the first process group and the second process group, respectively, wherein the preset mapping data is used to indicate an association relationship between the virtual parameter and the plurality of adjustment parameters; Using the multiple adjustment parameters, the first cache sub-bandwidth, the first cache occupancy, the first cache usage priority and / or the first storage location range corresponding to the first process group are adjusted, and the second cache sub-bandwidth, the second cache occupancy, the second cache usage priority and / or the second storage location range corresponding to the second process group are adjusted.

9. A cache allocation method, comprising: In response to a target process accessing a cache, obtaining a target process group to which the target process belongs; If the target process group is the first process group, allocating a cache in a first storage location range to the target process using first cache group access parameter information corresponding to the first process group; If the target process group is the second process group, allocating a cache in a second storage location range to the target process using the second cache group access parameter information corresponding to the second process group; Among them, the first cache group access parameter information corresponding to the first process group and the second cache group access parameter information corresponding to the second process group are updated based on the first process group information and the second process group information corresponding to the first process group and the second process group.

10. An electronic device comprising: an acquisition module configured to respectively acquire first process group information and second process group information corresponding to the first process group and the second process group; a processing module configured to adjust first cache group access parameter information corresponding to the first process group and / or second cache group access parameter information corresponding to the second process group if the first process group information and / or the second process group information meet a parameter adjustment condition; Among them, the first cache group access parameter information includes at least a first storage location range, and the second cache group access parameter information includes at least a second storage location range; the processes included in the first process group can be assigned to access the cache in the first storage location range, and the processes included in the second process group can be assigned to access the cache in the second storage location range.