A multi-channel dynamic cache management method, system, device and medium thereof
Through the multi-channel dynamic cache management method, the resource processing channel cache resources in the AXI bus are dynamically allocated and managed, which solves the problem of cache resource waste caused by independent management of resource processing channels, and improves cache utilization and system efficiency.
Patent Information
- Application Number
- CN202411144816.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-20
AI Technical Summary
The independent management of resource processing channels in the existing AXI bus results in wasting cache resources, unable to make full use of idle caches, and busy channels cannot borrow cache resources from other channels, reducing cache utilization and system efficiency.
Using multi-channel dynamic cache management method, the cache management device responds to resource scheduling instructions, dynamically allocates and manages cache resources in each resource processing channel, and periodically allocates cache resources according to the channel working relationship and demand volume to ensure the unified scheduling of cache resources and Efficient use.
The utilization rate and working capacity of each resource processing channel for cache is improved, the working efficiency of the AXI bus is improved, and resource waste and system load fluctuations are avoided.
Smart Images

Figure CN118656313B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer cache, and in particular to a multi-channel dynamic cache management method, system, device and medium thereof. Background Art
[0002] In the prior art, the read and write caches of each resource processing channel in the AXI bus are managed independently by each resource processing channel. Based on this read and write architecture, there are often the following disadvantages: 1. When a resource processing channel is idle, its corresponding cache is also idle, and the idle cache of each resource processing cannot be fully utilized, resulting in resource waste; 2. When multiple resource processing channels are busy, the busy resource processing channels cannot borrow the cache resources of other resource processing channels. Therefore, this read and write architecture cannot uniformly adjust the cache resources of each resource processing channel, resulting in cache waste and reducing cache utilization. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a multi-channel dynamic cache management method, system, device and medium thereof, which can dynamically allocate and manage the cache resources of each resource processing channel, thereby improving the cache utilization of each resource processing channel, while also improving the working capacity of each resource processing channel and improving the working efficiency of the AXI bus.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a multi-channel dynamic cache management method, which is applied to a multi-channel dynamic cache management system. The multi-channel dynamic cache management system includes multiple resource processing channels, an AXI bus and a cache management device. The cache management device includes a distributor and a dynamic reference device. The AXI bus is communicatively connected to the cache management device. Each resource processing channel is communicatively connected to the cache management device. The distributor is communicatively connected to the dynamic reference device. The multi-channel dynamic cache management method includes:
[0005] The cache management device responds to the resource scheduling instruction of the AXI bus to obtain the cache requirements of multiple resource processing channels, the cache allocation parameters of the dynamic reference device and the resource application scenario; wherein the cache allocation parameters are parameters dynamically configured based on the burst transmission data transmitted by the AXI bus;
[0006] The cache management device determines the working relationship between each resource processing channel according to the resource application scenario, and obtains multiple channel working relationship indexes, where the channel working relationship indexes are relationship indexes of mutually synchronous working or mutually asynchronous working;
[0007] The cache management device determines the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each resource processing channel and the working relationship index of each channel;
[0008] The cache management device controls the allocator to periodically allocate cache resources to each resource processing channel and controls the corresponding resource processing channel to perform periodic work according to the cache allocation parameters, resource application scenarios and the working relationship index of each channel;
[0009] Among them, in the same cycle, controlling the corresponding resource processing channel to perform periodic work includes the following steps:
[0010] The sum of the cache requirements of each resource processing channel in synchronous operation is counted to obtain the target period cache requirement;
[0011] Compare the target period cache requirement with the total resource cache requirement;
[0012] When the target periodic buffer requirement is less than the total resource buffer requirement, the first buffer margin is dynamically allocated based on the buffer allocation parameter, and the first buffer margin is the difference between the total resource buffer requirement and the target periodic buffer requirement.
[0013] Further, in some embodiments, in the same cycle, according to the cache allocation parameters, resource application scenarios and the working relationship indexes of each channel, the allocator is controlled to periodically allocate cache resources to each resource processing channel, including:
[0014] According to the resource application scenario and the working relationship index of each channel, the control distributor determines the target cycle working channel list, which includes one or more resource processing channels that need to work synchronously in the current cycle;
[0015] According to the target period working channel list, control the corresponding resource processing channels to perform synchronous work.
[0016] Further, in some embodiments, determining the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each resource processing channel and the working relationship index of each channel includes:
[0017] Determine whether there is a relationship index of asynchronous work between each channel work relationship index;
[0018] If there are mutually asynchronous working relationship indexes among the working relationship indexes of each channel, the synchronous and asynchronous working relationships of each resource processing channel are classified to obtain multiple asynchronous relationship channel groups, wherein the asynchronous relationship channel group includes multiple resource processing channels that are mutually synchronous working relationships, and the resource processing channels between each asynchronous relationship channel group are mutually asynchronous working relationships;
[0019] The sum of the cache requirements of all resource processing channels corresponding to each asynchronous relationship channel group is counted respectively to obtain multiple asynchronous cache requirements, and the maximum value of the multiple asynchronous cache requirements is determined as the total resource cache requirement.
[0020] Furthermore, in some embodiments, determining the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each resource processing channel and the working relationship index of each channel also includes:
[0021] If there is no asynchronous working relationship index among the working relationship indexes of each channel, the sum of the cache requirements of each resource processing channel is counted to obtain the total resource cache requirement.
[0022] Further, in some embodiments, dynamically allocating the first cache margin based on the cache allocation parameter includes:
[0023] Get the number of resource processing channels in working state;
[0024] If the number of resource processing channels in the working state is one, allocating the first buffer margin to the resource processing channel in the working state;
[0025] Alternatively, if there are multiple resource processing channels in working state, the first buffer margin is evenly distributed to the multiple resource processing channels in working state;
[0026] Alternatively, if there are multiple resource processing channels in working state, the first cache margin is allocated to the low cache resource processing channel, which is the resource processing channel with the most scarce corresponding cache demand among the multiple resource processing channels in working state.
[0027] Furthermore, in some embodiments, in the same cycle, controlling the corresponding resource processing channel to perform periodic work also includes:
[0028] When a resource processing channel in a working state finishes its work and enters an idle state, the buffer demand occupied by the resource processing channel in an idle state is released;
[0029] The second cache margin is dynamically allocated based on the cache allocation parameter, wherein the second cache margin is the cache demand released by the resource processing channel in an idle state.
[0030] Further, in some embodiments, dynamically allocating the second cache margin based on the cache allocation parameter includes:
[0031] Get the number of resource processing channels in working state in the current cycle;
[0032] If the number of resource processing channels in the working state is one, allocating the second buffer margin to the resource processing channel in the working state;
[0033] Alternatively, if there are multiple resource processing channels in working state, the second buffer margin is evenly distributed to the multiple resource processing channels in working state;
[0034] Alternatively, if there are multiple resource processing channels in operation, the second cache margin is allocated to a low-cache resource processing channel, which is a resource processing channel having the most scarce cache demand among the multiple resource processing channels in operation.
[0035] To achieve the above object, a second aspect of an embodiment of the present application proposes a multi-channel dynamic cache management system, including:
[0036] AXI bus, AXI bus is used to transmit data;
[0037] Multiple resource processing channels, where the resource processing channels are used to configure cache resources to read and write data transmitted by the AXI bus;
[0038] A cache management device, the cache management device includes a distributor and a dynamic reference device, the AXI bus is connected to the cache management device for communication, each resource processing channel is connected to the cache management device for communication, and the distributor is connected to the dynamic reference device for communication;
[0039] The cache management device is used to respond to the resource scheduling instruction of the AXI bus, obtain the cache requirements of multiple resource processing channels, the cache allocation parameters of the dynamic reference device and the resource application scenario, and the cache allocation parameters are parameters dynamically configured for the burst transmission data transmitted through the AXI bus;
[0040] The cache management device is also used to determine the working relationship between each resource processing channel according to the resource application scenario, and obtain multiple channel working relationship indexes, where the channel working relationship indexes are relationship indexes of mutually synchronous working or mutually asynchronous working;
[0041] The cache management device is also used to determine the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each resource processing channel and the working relationship index of each channel;
[0042] The cache management device is also used to control the allocator to periodically allocate cache resources to each resource processing channel and control the corresponding resource processing channel to perform periodic work according to the cache allocation parameters, resource application scenarios and the working relationship index of each channel;
[0043] Among them, in the same cycle, controlling the corresponding resource processing channel to perform periodic work includes the following steps:
[0044] The sum of the cache requirements of each resource processing channel in synchronous operation is counted to obtain the target period cache requirement;
[0045] Compare the target period cache requirement with the total resource cache requirement;
[0046] When the target periodic buffer requirement is less than the total resource buffer requirement, the first buffer margin is dynamically allocated based on the buffer allocation parameter, and the first buffer margin is the difference between the total resource buffer requirement and the target periodic buffer requirement.
[0047] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the multi-channel dynamic cache management method of the above-mentioned first aspect embodiment is implemented.
[0048] To achieve the above-mentioned purpose, the fourth aspect of the embodiment of the present application proposes a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by the processor, it implements the multi-channel dynamic cache management method of the above-mentioned first aspect embodiment.
[0049] The embodiments of the present application have the following beneficial effects: the present application obtains the cache requirements of multiple resource processing channels, the cache allocation parameters of the dynamic reference device and the resource application scenario in response to the resource scheduling instructions of the AXI bus through the cache management device; wherein the cache allocation parameters are parameters dynamically configured based on the burst transmission data transmitted by the AXI bus; the cache management device determines the working relationship between each resource processing channel according to the resource application scenario, and obtains multiple channel working relationship indexes, and the channel working relationship indexes are relationship indexes of synchronous work or relationship indexes of asynchronous work; the cache management device determines the total resource cache requirement corresponding to the resource application scenario according to the cache requirements corresponding to each resource processing channel and the working relationship index of each channel; the cache management device controls the allocator to periodically allocate cache resources to each resource processing channel according to the cache allocation parameters, the resource application scenario and the working relationship index of each channel, and controls the corresponding resource processing channel to perform periodic work, thereby improving the working capacity of each resource processing channel and improving the working efficiency of the AXI bus.
[0050] Among them, in the same cycle, the corresponding resource processing channel is controlled to perform periodic work, including the following steps: the sum of the cache requirements of each resource processing channel in synchronous work is counted to obtain the target cycle cache requirement; the target cycle cache requirement is compared with the total resource cache requirement; when the target cycle cache requirement is less than the total resource cache requirement, the first cache margin is dynamically allocated based on the cache allocation parameter, and the first cache margin is the difference between the total resource cache requirement and the target cycle cache requirement. By uniformly allocating and managing cache resources for each resource processing channel, the utilization rate of the cache of each resource processing channel is improved, and at the same time, the working capacity of each resource processing channel is improved, and the working efficiency of the AXI bus is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flowchart of a multi-channel dynamic cache management method provided by some embodiments of the present application;
[0052] Figure 2 It is a schematic diagram of periodic operation of various resource processing channels provided in some embodiments of the present application;
[0053] Figure 3 It is a schematic diagram of periodic operation of various resource processing channels provided in other embodiments of the present application;
[0054] Figure 4 is a flowchart of periodically allocating cache resources provided by some embodiments of the present application;
[0055] Figure 5 Some embodiments of the present application provide Figure 1 Flow chart of step S130;
[0056] Figure 6 It is a statistical framework diagram of the total resource cache demand of each asynchronous relationship channel group provided in some embodiments of the present application;
[0057] Figure 7 Other embodiments of the present application provide Figure 1 Flow chart of step S130;
[0058] Figure 8 It is a statistical framework diagram of the cache demand of each resource processing channel provided in some embodiments of the present application;
[0059] Fig. 9 is a flow chart of dynamically allocating the first cache margin provided by some embodiments of the present application;
[0060] Fig.10 It is a flow chart of the resource processing channel performing periodic work provided by some embodiments of the present application;
[0061] Fig.11 is a flow chart of dynamically allocating the second cache margin provided by some embodiments of the present application;
[0062] Fig.12 A schematic diagram of the structure of a multi-channel dynamic cache management system provided by some embodiments of the present application;
[0063] Fig.13 It is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0066] It should also be noted that in the description of this application, "several" means more than one, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used to distinguish the technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0068] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0069] First, some nouns involved in this application are analyzed:
[0070] The AXI (Advanced eXtensible Interface) bus protocol is an on-chip bus protocol designed to meet the communication requirements of high bandwidth and low latency. It provides multi-channel, independent addressing and data transmission capabilities.
[0071] Burst Transfer is an important concept in the AXI bus protocol, which is used to improve the efficiency of data transmission. Burst transfer allows multiple data items to be transmitted continuously in one transaction, thereby reducing the overhead and delay required for the transmission of each data item.
[0072] In the prior art, the read and write caches of each resource processing channel in the AXI bus are managed independently by each resource processing channel. Based on this read and write architecture, there are often the following disadvantages: 1. When a resource processing channel is idle, its corresponding cache is also idle, and the idle cache of each resource processing cannot be fully utilized, resulting in resource waste; 2. When multiple resource processing channels are busy, the busy resource processing channels cannot borrow the cache resources of other resource processing channels. Therefore, this read and write architecture cannot uniformly adjust the cache resources of each resource processing channel, resulting in cache waste and reducing cache utilization.
[0073] Based on this, an embodiment of the present application provides a multi-channel dynamic cache management method, system, device and medium thereof. The present application obtains the cache requirements of multiple resource processing channels, the cache allocation parameters of the dynamic reference and the resource application scenarios through a cache management device in response to the resource scheduling instructions of the AXI bus. The cache allocation parameters are parameters dynamically configured based on the burst transmission data transmitted by the AXI bus; then, according to the resource application scenario, the working relationship between each resource processing channel is determined to obtain multiple channel working relationship indexes, and the channel working relationship indexes are relationship indexes for synchronous work or relationship indexes for asynchronous work; then, according to the cache requirements corresponding to each resource processing channel and the working relationship indexes of each channel, the total resource cache requirement corresponding to the resource application scenario is determined; then, according to the cache allocation parameters, the resource application scenario and the working relationship indexes of each channel, the allocator is controlled to allocate resources to each resource. The source processing channel performs periodic cache resource allocation, and controls the corresponding resource processing channel to perform periodic work; further, in the same cycle, the corresponding resource processing channel is controlled to perform periodic work, including the following steps: counting the sum of the cache requirements of each resource processing channel in synchronous work to obtain a target cycle cache requirement, comparing the target cycle cache requirement with the total resource cache requirement, and when the target cycle cache requirement is less than the total resource cache requirement, dynamically allocating the first cache margin based on the cache allocation parameter, the first cache margin being the difference between the total resource cache requirement and the target cycle cache requirement, and being able to uniformly dynamically allocate and manage cache resources for each resource processing channel, thereby improving the utilization rate of the cache for each resource processing channel, while also improving the working capacity of each resource processing channel and improving the working efficiency of the AXI bus.
[0074] A multi-channel dynamic cache management method, system, device and medium thereof provided in an embodiment of the present application are specifically described through the following embodiments. First, a multi-channel dynamic cache management method in an embodiment of the present application is described.
[0075] It should be noted that the multi-channel dynamic cache management method is applied to a multi-channel dynamic cache management system, which includes multiple resource processing channels, an AXI bus and a cache management device. The cache management device includes a distributor and a dynamic reference device. The AXI bus is communicatively connected to the distributor, and each resource processing channel is communicatively connected to the distributor, and the distributor is communicatively connected to the dynamic reference device.
[0076] Reference Figure 1 As shown, Figure 1 It is a flowchart of a multi-channel dynamic cache management method provided by some embodiments of the present application. The multi-channel dynamic cache management method may include but is not limited to steps S110 to S140.
[0077] Step S110: the cache management device obtains cache requirements, cache allocation parameters and resource application scenarios of multiple resource processing channels in response to the resource scheduling instruction of the AXI bus.
[0078] The cache allocation parameters are parameters dynamically configured based on burst transmission data transmitted by the AXI bus.
[0079] It should be noted that the cache requirement of each resource processing channel can be 32×64 bits, 64×64 bits, 128×64 bits, or 256×64 bits, and this application does not make any specific limitation.
[0080] At the same time, the application scenarios of the acquired resources can be application scenarios of high-concurrency computing tasks, application scenarios of real-time data processing tasks, and application scenarios of large-scale data storage and access tasks, which are not specifically limited in this application.
[0081] In some possible implementation examples, the multi-channel dynamic cache management system includes four resource processing channels, namely, ch0 resource processing channel, ch2 resource processing channel, ch3 resource processing channel and ch4 resource processing channel. When the cache management device responds to the resource scheduling instruction of the AXI bus, it obtains the cache requirements of the four resource processing channels, the cache allocation parameters of the dynamic reference device and the resource application scenario. Among them, the cache requirement of the ch0 resource processing channel is 64×64 bits, the cache requirement of the ch1 resource processing channel is 32×64 bits, the cache requirement of the ch2 resource processing channel is 128×64 bits and the cache requirement of the ch3 resource processing channel is 64×64 bits.
[0082] Step S120: The cache management device determines the working relationship between each resource processing channel according to the resource application scenario, and obtains multiple channel working relationship indexes.
[0083] The channel working relationship index is a relationship index of mutually synchronous working or a relationship index of mutually asynchronous working.
[0084] In some possible implementation examples, the resource application scenario is an application scenario of real-time data processing tasks. The cache management device determines, based on the resource application scenario, that the working relationship between the ch0 resource processing channel and the ch1 resource processing channel is a mutually synchronous working relationship, the working relationship between the ch2 resource processing channel and the ch3 resource processing channel is a mutually synchronous working relationship, the working relationship between the ch0 resource processing channel and the ch2 resource processing channel is a mutually asynchronous working relationship, and the working relationship between the ch0 resource processing channel and the ch3 resource processing channel is a mutually asynchronous working relationship; the working relationship between the ch1 resource processing channel and the ch2 resource processing channel is a mutually asynchronous working relationship, and the working relationship between the ch1 resource processing channel and the ch3 resource processing channel is a mutually asynchronous working relationship, thereby obtaining multiple channel working relationship indexes, which are the relationship index of ch0 / ch1 working synchronously, the relationship index of ch2 / ch3 working synchronously, and the relationship index of ch0-ch1 / ch2-ch3 working asynchronously.
[0085] In some other possible implementation examples, the resource application scenario is an application scenario of high-concurrency computing tasks. The cache management device determines, based on the resource application scenario, that the working relationship between the ch0 resource processing channel and the ch1 resource processing channel is a mutually synchronous working relationship, the working relationship between the ch1 resource processing channel and the ch2 resource processing channel is a mutually synchronous working relationship, the working relationship between the ch2 resource processing channel and the ch3 resource processing channel is a mutually asynchronous working relationship, and the working relationship between the ch3 resource processing channel and the ch4 resource processing channel is a mutually synchronous working relationship; the working relationship between the ch1 resource processing channel and the ch2 resource processing channel is a mutually synchronous working relationship, and the working relationship between the ch1 resource processing channel and the ch3 resource processing channel is a mutually synchronous working relationship, thereby obtaining multiple channel working relationship indexes, which are respectively the relationship index of ch0 / ch1 mutually synchronous working, the relationship index of ch1 / ch2 mutually synchronous working, the relationship index of ch2 / ch3 mutually synchronous working, and the relationship index of ch0 / ch1 / ch2 / ch3 mutually synchronous working.
[0086] Step S130: The cache management device determines the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each resource processing channel and the working relationship index of each channel.
[0087] Specifically, the cache management device determines the total resource cache demand corresponding to the resource application scenario based on the cache demand corresponding to each resource processing channel and the working relationship index of each channel, and then accurately calculates the cache demand of each resource processing channel through the cache demand and the channel working relationship index, avoiding over-allocation or under-allocation of resources, thereby maximizing the use of existing resources and improving the efficiency of the overall system.
[0088] Step S140: The cache management device controls the allocator to periodically allocate cache resources to each resource processing channel according to the cache allocation parameters, resource application scenarios and each channel working relationship index, and controls the corresponding resource processing channel to perform periodic work.
[0089] Specifically, the cache management device controls the allocator to periodically allocate cache resources to each resource processing channel and controls the corresponding resource processing channel to perform periodic work according to the cache allocation parameters, resource application scenarios and the working relationship indexes of each channel. Therefore, by periodically allocating cache resources, resource allocation can be dynamically adjusted to adapt to actual needs, ensuring efficient use of resources and avoiding waste of resources. At the same time, through periodic work control and resource allocation, the impact of system load fluctuations is reduced, and the stability and reliability of the system are improved.
[0090] It should be noted that a work cycle of the periodic work is a time period from when all resource processing channels in a synchronous relationship start working at the same time to when all resource processing channels in a synchronous relationship finish working.
[0091] Among them, refer to Figure 2 and Figure 3 As shown, Figure 2 is a schematic diagram of periodic operation of various resource processing channels provided in some embodiments of the present application, Figure 3 It is a schematic diagram of each resource processing channel performing periodic work provided by other embodiments of the present application, and in the same cycle, controlling the corresponding resource processing channel to perform periodic work includes the following steps:
[0092] Step a: Count the sum of the cache requirements of each resource processing channel in synchronous operation to obtain the target period cache requirement.
[0093] Specifically, the cache requirements of each resource processing channel currently working synchronously are summed to obtain the target cycle cache requirement. For example, when the resource processing channels currently working synchronously include the ch0 resource processing channel and the ch1 resource processing channel, the target cycle cache requirement is 64×64 bits+32×64 bits=96×64 bits; when the resource processing channels currently working synchronously include the ch2 resource processing channel and the ch3 resource processing channel, the target cycle cache requirement is 128×64 bits+64×64 bits=192×64 bits.
[0094] Step b: Compare the target period cache requirement with the total resource cache requirement.
[0095] Specifically, the target period cache requirement is compared with the total resource cache requirement.
[0096] Step c: When the target period cache requirement is less than the total resource cache requirement, the first cache margin is dynamically allocated based on the cache allocation parameter.
[0097] Specifically, when the target period cache requirement is less than the total resource cache requirement, the first cache margin is dynamically allocated based on the cache allocation parameter, thereby ensuring that cache resources are fully utilized and reducing resource idleness, thereby improving overall cache utilization.
[0098] The first cache margin is the difference between the total resource cache requirement and the target period cache requirement, that is, the first cache margin=total resource cache requirement-target period cache requirement.
[0099] Reference Figure 4 As shown, Figure 4 This is a flowchart of periodically allocating cache resources provided by some embodiments of the present application. The method of multi-periodically allocating cache resources may include but is not limited to steps S410 to S420.
[0100] Step S410: According to the resource application scenario and the working relationship index of each channel, the control distributor determines the target period working channel list.
[0101] The target period working channel list includes one or more resource processing channels that need to work synchronously in the current period.
[0102] In some possible implementation examples, when the resource application scenario is an application scenario of a real-time data processing task and the relationship indexes of ch0 / ch1 working synchronously, ch2 / ch3 working synchronously, and ch0-ch1 / ch2-ch3 working asynchronously are related, the control distributor determines that the target cycle working channel list includes the ch0 resource processing channel and the ch1 resource processing channel; or, determines that the target cycle working channel list includes the ch2 resource processing channel and the ch3 resource processing channel.
[0103] In some possible implementation examples, when the resource application scenario is an application scenario of high-concurrency computing tasks and the relationship index of ch0 / ch1 working synchronously, the relationship index of ch1 / ch2 working synchronously, the relationship index of ch2 / ch3 working synchronously, and the relationship index of ch0 / ch1 / ch2 / ch3 working synchronously, the control allocator determines that the target period working channel list includes ch0 resource processing channel, ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel.
[0104] Step S420: According to the target period working channel list, control the corresponding resource processing channel to perform synchronous work.
[0105] In some possible implementation examples, according to the target cycle working channel list including ch0 resource processing channel, ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel, the ch0 resource processing channel, ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel are controlled to work synchronously in the same cycle.
[0106] In some possible implementation examples, according to the target cycle working channel list including the ch0 resource processing channel and the ch1 resource processing channel, the ch0 resource processing channel and the ch1 resource processing channel are controlled to work synchronously in the same cycle.
[0107] In some possible implementation examples, according to the target cycle working channel list including the ch2 resource processing channel and the ch3 resource processing channel, the ch2 resource processing channel and the ch3 resource processing channel are controlled to work synchronously in the same cycle.
[0108] Reference Figure 5 As shown, Figure 5 Some embodiments of the present application provide Figure 1 In the flowchart of step S130, the multi-channel dynamic cache management method may include but is not limited to steps S510 to S530.
[0109] Step S510: Determine whether there are relationship indexes that work asynchronously with each other among the working relationship indexes of each channel.
[0110] Specifically, it is determined whether there are relationship indexes that work asynchronously with each other among the working relationship indexes of each channel.
[0111] Step S520: If there are relationship indexes of mutually asynchronous working among the working relationship indexes of each channel, classify the synchronous and asynchronous working relationships of each resource processing channel to obtain multiple asynchronous relationship channel groups.
[0112] The asynchronous relationship channel group includes a plurality of resource processing channels that are in a synchronous working relationship with each other, and the resource processing channels between each asynchronous relationship channel group are in an asynchronous working relationship with each other.
[0113] In some possible implementation examples, if it is determined that there is a relationship index of asynchronous working between ch0 / ch1, the relationship index of synchronous working between ch2 / ch3, and the relationship index of asynchronous working between ch0-ch1 / ch2-ch3, the ch0 resource processing channel, the ch1 resource processing channel, the ch2 resource processing channel, and the ch3 resource processing channel are classified into synchronous and asynchronous working relationships to obtain a ch0 / ch1 asynchronous relationship channel group and a ch2 / ch3 asynchronous relationship channel group, the ch0 / ch1 asynchronous relationship channel group includes the ch0 resource processing channel and the ch1 resource processing channel, and the ch2 / ch3 asynchronous relationship channel group includes the ch2 resource processing channel and the ch3 resource processing channel.
[0114] Step S530: Counting the sum of the buffer requirements of all resource processing channels corresponding to each asynchronous relationship channel group respectively to obtain multiple asynchronous buffer requirements, and determining the maximum value of the multiple asynchronous buffer requirements as the total resource buffer requirement.
[0115] In some possible implementation examples, refer to Figure 6 As shown, Figure 6This is a statistical framework diagram of the total resource cache demand of each asynchronous relationship channel group provided in some embodiments of the present application. The sum of the cache demand of the ch0 resource processing channel and the ch1 resource processing channel in the ch0 / ch1 asynchronous relationship channel group is calculated to obtain a first asynchronous cache demand of 96×64 bits=64×64 bits+32×64 bits; the sum of the cache demand of the ch2 resource processing channel and the ch3 resource processing channel in the ch2 / ch3 asynchronous relationship channel group is calculated to obtain a second asynchronous cache demand of 192×64 bits=128×64 bits+64×64 bits, and then the maximum value of the first asynchronous cache demand of 96×64 bits and the second asynchronous cache demand of 192×64 bits is determined as the total resource cache demand, that is, the total resource cache demand is 192×64 bits.
[0116] Reference Figure 7 As shown, Figure 7 Other embodiments of the present application provide Figure 1 In the flowchart of step S130, the multi-channel dynamic cache management method may include but is not limited to step S710.
[0117] Step S710: If there is no asynchronous working relationship index among the working relationship indexes of each channel, the sum of the buffer requirements of each resource processing channel is counted to obtain the total resource buffer requirement.
[0118] In some possible implementation examples, refer to Figure 8 As shown, Figure 8 This is a statistical framework diagram of the cache requirements of each resource processing channel provided by some embodiments of the present application. If it is determined that there is no relationship index for asynchronous working among the relationship indexes of ch0 / ch1 working synchronously, ch1 / ch2 working synchronously, ch2 / ch3 working synchronously, and ch0 / ch1 / ch2 / ch3 working synchronously, the sum of the cache requirements of the ch0 resource processing channel, ch1 resource processing channel, ch2 resource processing channel, and ch3 resource processing channel is counted to obtain a total resource cache requirement of 288×64 bits=(64+32+128+64)×64 bits.
[0119] Reference Fig. 9 As shown, Fig. 9 This is a flowchart of dynamically allocating the first cache margin provided by some embodiments of the present application. The method of dynamically allocating the first cache margin may include but is not limited to steps S910 to S940.
[0120] Step S910: Obtain the number of resource processing channels in working state.
[0121] Specifically, the number of resource processing channels in working state is obtained.
[0122] Step S920: If the number of the resource processing channel in the working state is one, the first buffer margin is allocated to the resource processing channel in the working state.
[0123] In some possible implementation examples, when the only resource processing channel in the working state is the ch0 resource processing channel, the first buffer margin is allocated to the ch0 resource processing channel.
[0124] Step S930: Alternatively, if there are multiple resource processing channels in working state, the first buffer margin is evenly distributed to the multiple resource processing channels in working state.
[0125] In some possible implementation examples, when the resource processing channels in working state include the ch0 resource processing channel and the ch1 resource processing channel, the first buffer margin is evenly distributed to the ch0 resource processing channel and the ch1 resource processing channel.
[0126] Step S940: Alternatively, if there are multiple resource processing channels in working state, the first buffer margin is allocated to the resource processing channel with low buffer.
[0127] The low-cache resource processing channel is a resource processing channel whose corresponding cache demand is the most scarce among multiple resource processing channels in working state.
[0128] In some possible implementation examples, when the resource processing channels in working state include the ch0 resource processing channel and the ch1 resource processing channel, the second cache margin is allocated to the low cache resource processing channel, wherein, among the ch0 resource processing channel and the ch1 resource processing channel, the cache demand corresponding to the ch1 resource processing channel is the most scarce, that is, the low cache resource processing channel is the ch1 resource processing channel.
[0129] Reference Fig.10 As shown, Fig.10 It is a flowchart of the resource processing channel performing periodic work provided by some embodiments of the present application. The method for the resource processing channel to perform periodic work may include but is not limited to steps S1010 to S1020.
[0130] Step S1010: When a resource processing channel in a working state finishes its work and enters an idle state, the buffer demand occupied by the resource processing channel in the idle state is released.
[0131] In some possible implementation examples, when the resource processing channel ch0 in the working state finishes its work and enters the idle state, the buffer demand occupied by the resource processing channel ch0 in the idle state is released.
[0132] Step S1020: dynamically allocating the second cache margin based on the cache allocation parameter.
[0133] The second buffer margin is the buffer demand released by the idle resource processing channel.
[0134] In some possible implementation examples, the second buffer margin is the buffer demand released by the resource processing channel ch0 which is in an idle state.
[0135] Specifically, the second cache margin is dynamically allocated based on the cache allocation parameter.
[0136] Reference Fig.11 As shown, Fig.11 This is a flowchart of dynamically allocating the second cache margin provided by some embodiments of the present application. The method of dynamically allocating the second cache margin may include but is not limited to steps S1110 to S1140.
[0137] Step S1110: Obtain the number of resource processing channels in working state in the current cycle.
[0138] Specifically, the number of resource processing channels in working state is obtained.
[0139] Step S1120: If the number of the resource processing channel in the working state is one, the second buffer margin is allocated to the resource processing channel in the working state.
[0140] In some possible implementation examples, when the only resource processing channel in the working state is the ch1 resource processing channel, the first buffer margin is allocated to the ch1 resource processing channel.
[0141] Step S1130: Alternatively, if there are multiple resource processing channels in working state, the second buffer margin is evenly distributed to the multiple resource processing channels in working state.
[0142] In some possible implementation examples, when the resource processing channels in working state include ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel, the first buffer margin is evenly distributed to ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel.
[0143] Step S1140: Alternatively, if there are multiple resource processing channels in working state, the second buffer margin is allocated to the resource processing channel with low buffer.
[0144] The low-cache resource processing channel is a resource processing channel whose corresponding cache demand is the most scarce among multiple resource processing channels in working state.
[0145] In some possible implementation examples, when the resource processing channels in working state include ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel, the second cache margin is allocated to the low cache resource processing channel, wherein, among the ch1 resource processing channel, ch2 resource processing channel and ch3 resource processing channel, the cache demand corresponding to the ch1 resource processing channel is the most scarce, that is, the low cache resource processing channel is the ch1 resource processing channel.
[0146] In a second aspect, the present application embodiment also provides a multi-channel dynamic cache management system, referring to Fig.12 , Fig.12 This is a schematic diagram of the structure of a multi-channel dynamic cache management system provided in some embodiments of the present application. The multi-channel dynamic cache management system 1200 includes:
[0147] AXI bus 1210;
[0148] Multiple resource processing channels 1220;
[0149] The cache management device 1230 includes a distributor 1231 and a dynamic reference device 1232. The AXI bus 1210 is connected to the cache management device 1230. Each resource processing channel 1220 is respectively communicated with the cache management device 1230. The distributor 1231 is communicated with the dynamic reference device 1232.
[0150] Among them, the cache management device 1230 is used to respond to the resource scheduling instructions of the AXI bus 1210, obtain the cache requirements of multiple resource processing channels 1220, the cache allocation parameters of the dynamic reference 1232 and the resource application scenarios, and the cache allocation parameters are parameters dynamically configured based on the burst transmission data transmitted by the AXI bus 1210.
[0151] The cache management device 1230 is also used to determine the working relationship between each resource processing channel 1220 according to the resource application scenario, and obtain multiple channel working relationship indexes, where the channel working relationship indexes are relationship indexes of synchronous work or asynchronous work.
[0152] The cache management device 1230 is also used to determine the total resource cache requirement corresponding to the resource application scenario based on the cache requirements corresponding to each resource processing channel 1220 and the working relationship index of each channel.
[0153] The cache management device 1230 is also used to control the allocator 1231 to periodically allocate cache resources to each resource processing channel 1220 according to cache allocation parameters, resource application scenarios and each channel working relationship index, and control the corresponding resource processing channel 1220 to perform periodic work.
[0154] Among them, under the same cycle, the corresponding resource processing channel 1220 is controlled to perform periodic work, including the following steps: counting the sum of the cache requirements of each resource processing channel 1220 in synchronous work to obtain the target cycle cache requirement; comparing the target cycle cache requirement with the total resource cache requirement; when the target cycle cache requirement is less than the total resource cache requirement, dynamically allocating the first cache margin based on the cache allocation parameters, the first cache margin being the difference between the total resource cache requirement and the target cycle cache requirement.
[0155] The above-mentioned multi-channel dynamic cache management system 1200 and the above-mentioned multi-channel dynamic cache management method are based on the same inventive concept. The above-mentioned process describes the multi-channel dynamic cache management system 1200 of the embodiment of the present application, which obtains the cache requirements of multiple resource processing channels, the cache allocation parameters of the dynamic reference device and the resource application scenario through the allocator in response to the resource scheduling instruction of the AXI bus; wherein the cache allocation parameters are parameters dynamically configured based on the burst transmission data transmitted by the AXI bus; the cache management device determines the working relationship between each resource processing channel according to the resource application scenario, and obtains multiple channel working relationship indexes, and the channel working relationship indexes are relationship indexes of synchronous work or relationship indexes of asynchronous work; the cache management device determines the total resource cache requirement corresponding to the resource application scenario according to the cache requirements corresponding to each resource processing channel and the working relationship index of each channel; the cache management device controls the allocator to perform periodic cache resource allocation to each resource processing channel according to the cache allocation parameters, resource application scenarios and each channel working relationship index, and controls the corresponding resource processing channel to perform periodic work, thereby improving the working capacity of each resource processing channel and improving the working efficiency of the AXI bus. Among them, under the same cycle, the corresponding resource processing channel is controlled to perform periodic work, including the following steps: counting the sum of the cache requirements of each resource processing channel in synchronous work to obtain the target cycle cache requirement; comparing the target cycle cache requirement with the total resource cache requirement; when the target cycle cache requirement is less than the total resource cache requirement, dynamically allocating the first cache margin based on the cache allocation parameter, the first cache margin being the difference between the total resource cache requirement and the target cycle cache requirement, which can improve the cache utilization of each resource processing channel by dynamically allocating and managing the cache resources of each resource processing channel.
[0156] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above multi-channel dynamic cache management method when executing the computer program. The electronic device can be any smart terminal including a mobile phone, a tablet computer, a car computer, etc.
[0157] See also Fig.13 , Fig.13 : is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present application, and the electronic device includes:
[0158] The processor 1301 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the multi-channel dynamic cache management method provided in the embodiment of the present application;
[0159] The memory 1302 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1302 can store an operating system and other applications. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1302, and the processor 1301 calls and executes the multi-channel dynamic cache management method provided in the embodiments of this application;
[0160] Input / output interface 1303, used to implement information input and output;
[0161] The communication interface 1304 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0162] A bus 1305 that transmits information between various components of the device (e.g., the processor 1301, the memory 1302, the input / output interface 1303, and the communication interface 1304);
[0163] The processor 1301 , the memory 1302 , the input / output interface 1303 and the communication interface 1304 are connected to each other in communication within the device via a bus 1305 .
[0164] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the multi-channel dynamic cache management method provided in the embodiment of the present application is implemented.
[0165] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0166] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0167] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0168] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0169] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0170] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0171] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0172] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0173] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0175] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0176] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A multi-channel dynamic cache management method, It is characterized in that The invention is applied to a multi-channel dynamic cache management system, the multi-channel dynamic cache management system comprises a plurality of resource processing channels, an AXI bus and a cache management device, the cache management device comprises a distributor and a dynamic reference device, the AXI bus is communicatively connected to the cache management device, each of the resource processing channels is communicatively connected to the cache management device, the distributor is communicatively connected to the dynamic reference device, and the multi-channel dynamic cache management method comprises: The cache management device obtains the cache requirements of the plurality of resource processing channels, the cache allocation parameters of the dynamic reference device, and the resource application scenario in response to the resource scheduling instruction of the AXI bus; wherein the cache allocation parameters are parameters dynamically configured based on the burst transmission data transmitted by the AXI bus; The cache management device determines the working relationship between each of the resource processing channels according to the resource application scenario, and obtains a plurality of channel working relationship indexes, wherein the channel working relationship indexes are relationship indexes of mutually synchronous working or relationship indexes of mutually asynchronous working; The cache management device determines the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each of the resource processing channels and the working relationship index of each of the channels; The cache management device controls the allocator to periodically allocate cache resources to each resource processing channel and controls the corresponding resource processing channel to perform periodic work according to the cache allocation parameter, the resource application scenario and the working relationship index of each channel; Furthermore, determining the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each of the resource processing channels and the working relationship index of each of the channels includes the following steps: Determine whether there are relationship indexes of mutually asynchronous operation among the channel working relationship indexes; If there are relationship indexes of mutually asynchronous working among the channel working relationship indexes, the synchronous and asynchronous working relationships of the resource processing channels are classified to obtain a plurality of asynchronous relationship channel groups, and the sum of the cache requirements of all the resource processing channels corresponding to each asynchronous relationship channel group is counted respectively to obtain a plurality of asynchronous cache requirements, and the maximum value of the plurality of asynchronous cache requirements is determined as the total resource cache requirement, wherein the asynchronous relationship channel group includes a plurality of resource processing channels in a synchronous working relationship, and the resource processing channels between each asynchronous relationship channel group are in an asynchronous working relationship with each other; Alternatively, if there is no relationship index of mutually asynchronous operation among the channel working relationship indexes, the sum of the cache requirements of the resource processing channels is counted to obtain the total resource cache requirement; Wherein, in the same cycle, the resource processing channel corresponding to the control performs periodic work, including the following steps: Counting the sum of the cache requirements of each of the resource processing channels in synchronous operation to obtain a target period cache requirement; Compare the target period cache requirement with the total resource cache requirement; When the target periodic buffer requirement is less than the total resource buffer requirement, a first buffer margin is dynamically allocated based on the buffer allocation parameter, where the first buffer margin is the difference between the total resource buffer requirement and the target periodic buffer requirement.
2. The multi-channel dynamic cache management method according to claim 1, It is characterized in that In the same cycle, controlling the allocator to periodically allocate cache resources to each of the resource processing channels according to the cache allocation parameter, the resource application scenario, and the working relationship index of each of the channels includes: According to the resource application scenario and the working relationship index of each channel, control the distributor to determine a target period working channel list, wherein the target period working channel list includes one or more resource processing channels that need to work synchronously in the current period; According to the target period working channel list, the corresponding resource processing channels are controlled to work synchronously.
3. The multi-channel dynamic cache management method according to claim 1, It is characterized in that The dynamically allocating the first cache margin based on the cache allocation parameter includes: Obtaining the number of resource processing channels in working state; If the number of the resource processing channels in working state is one, allocating the first buffer margin to the resource processing channels in working state; Alternatively, if there are multiple resource processing channels in working state, the first buffer margin is evenly distributed to the multiple resource processing channels in working state; Alternatively, if there are multiple resource processing channels in working state, the first cache margin is allocated to a low-cache resource processing channel, and the low-cache resource processing channel is the resource processing channel whose corresponding cache demand is the most scarce among the multiple resource processing channels in working state.
4. The multi-channel dynamic cache management method according to claim 1, It is characterized in that In the same cycle, the resource processing channel corresponding to the control performs periodic work, and further includes: When the resource processing channel in the working state finishes its work and enters the idle state, releasing the buffer demand occupied by the resource processing channel in the idle state; The second cache margin is dynamically allocated based on the cache allocation parameter, wherein the second cache margin is the cache demand released by the resource processing channel in an idle state.
5. The multi-channel dynamic cache management method according to claim 4, It is characterized in that The dynamically allocating the second cache margin based on the cache allocation parameter includes: Obtaining the number of resource processing channels in working state in the current cycle; If the number of the resource processing channels in working state is one, allocating the second buffer margin to the resource processing channels in working state; Alternatively, if there are multiple resource processing channels in working state, the second buffer margin is evenly distributed to the multiple resource processing channels in working state; Alternatively, if there are multiple resource processing channels in working state, the second cache margin is allocated to a low-cache resource processing channel, and the low-cache resource processing channel is the resource processing channel whose corresponding cache demand is the most scarce among the multiple resource processing channels in working state.
6. A multi-channel dynamic cache management system, It is characterized in that include: AXI bus; Multiple resource processing channels; A cache management device, the cache management device includes a distributor and a dynamic reference device, the AXI bus is communicatively connected to the cache management device, each of the resource processing channels is communicatively connected to the cache management device, and the distributor is communicatively connected to the dynamic reference device; The cache management device is used to respond to the resource scheduling instruction of the AXI bus, obtain the cache requirements of the plurality of resource processing channels, the cache allocation parameters of the dynamic reference device and the resource application scenario, and the cache allocation parameters are parameters dynamically configured for the burst transmission data transmitted through the AXI bus; The cache management device is also used to determine the working relationship between each of the resource processing channels according to the resource application scenario, and obtain multiple channel working relationship indexes, where the channel working relationship indexes are relationship indexes of mutually synchronous working or relationship indexes of mutually asynchronous working; The cache management device is also used to determine the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each of the resource processing channels and the working relationship index of each of the channels; The cache management device is further used to control the allocator to periodically allocate cache resources to each resource processing channel and control the corresponding resource processing channel to perform periodic work according to the cache allocation parameter, the resource application scenario and the working relationship index of each channel; Furthermore, determining the total resource cache requirement corresponding to the resource application scenario according to the cache requirement corresponding to each of the resource processing channels and the working relationship index of each of the channels includes the following steps: Determine whether there are relationship indexes of mutually asynchronous operation among the channel working relationship indexes; If there are relationship indexes of mutually asynchronous working among the channel working relationship indexes, the synchronous and asynchronous working relationships of the resource processing channels are classified to obtain a plurality of asynchronous relationship channel groups, and the sum of the cache requirements of all the resource processing channels corresponding to each asynchronous relationship channel group is counted respectively to obtain a plurality of asynchronous cache requirements, and the maximum value of the plurality of asynchronous cache requirements is determined as the total resource cache requirement, wherein the asynchronous relationship channel group includes a plurality of resource processing channels in a synchronous working relationship, and the resource processing channels between each asynchronous relationship channel group are in an asynchronous working relationship with each other; Alternatively, if there is no relationship index of mutually asynchronous operation among the channel working relationship indexes, the sum of the cache requirements of the resource processing channels is counted to obtain the total resource cache requirement; Wherein, in the same cycle, the resource processing channel corresponding to the control performs periodic work, including the following steps: Counting the sum of the cache requirements of each of the resource processing channels in synchronous operation to obtain a target period cache requirement; Compare the target period cache requirement with the total resource cache requirement; When the target periodic buffer requirement is less than the total resource buffer requirement, a first buffer margin is dynamically allocated based on the buffer allocation parameter, where the first buffer margin is the difference between the total resource buffer requirement and the target periodic buffer requirement.
7. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the multi-channel dynamic cache management method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a program executable by a processor, and when the program executable by the processor is executed by the processor, the multi-channel dynamic cache management method according to any one of claims 1 to 5 is implemented.
