Memory access control method, device, electronic device and storage medium

By obtaining the transmission traffic data of the memory channel in the artificial intelligence processor and allocating memory channels for the access path, the problem of low memory access efficiency is solved and more efficient data transmission and computing capabilities are achieved.

CN116010292BActive Publication Date: 2025-07-01NANJING ILUVATAR COREX TECH CO LTD (DBA ILUVATAR COREX INC NANJING)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211539702.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2025-07-01
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

In artificial intelligence processors, memory access efficiency is low, resulting in limited peak computing power.

Method used

By obtaining the transmission traffic data of each memory channel in the memory access control device, and allocating memory channels for each access path based on these data, ensuring that the transmission traffic of the memory channel connected to each access path is more in line with the actual usage requirements.

Benefits of technology

It improves the processor's access efficiency to memory modules, reduces the problem of excessive or too small load on some access path traffic, and improves the data transmission efficiency between the processing module and the memory module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010292B_ABST
    Figure CN116010292B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a memory access control method, apparatus, electronic device, and computer-readable storage medium, which relate to the field of computer technologies. Among them, the memory access control method is applied to a memory access control device, and the memory access control device is used to connect a processing module and a memory module. The memory module includes a plurality of memory channels, and the memory access control device and the plurality of memory channels are connected via a plurality of access paths. Each of the access paths is connected to at least one of the memory channels. The method includes: obtaining transmission traffic data of each of the memory channels to obtain a plurality of first traffic volumes; and allocating the memory channels to each of the access paths according to the plurality of first traffic volumes. Compared with the prior art, the memory access control method, apparatus, electronic device, and computer-readable storage medium provided by the embodiments of the present invention have the advantage of effectively improving the memory access efficiency of a processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technologies, and in particular, to a memory access control method, apparatus, electronic device, and storage medium. Background Art

[0002] There are a large number of computing core units in an artificial intelligence processor. Artificial intelligence algorithms are usually used in the artificial intelligence processor to optimize the configuration of these computing core units to improve the peak computing power of the artificial intelligence processor. However, artificial intelligence algorithms usually need to process a large amount of data, and there is frequent data interaction between the memory and the computing core units. During the data interaction process between the memory and the computing core units, the memory access efficiency becomes a key factor in improving the peak computing power. Therefore, how to improve the memory access efficiency is a key technology for artificial intelligence processors. Summary of the Invention

[0003] The purpose of the present invention is to provide a memory access control method, apparatus, electronic device, and computer-readable storage medium, which can effectively improve the memory access efficiency of a processor.

[0004] In a first aspect, an embodiment of the present invention provides a memory access control method, which is characterized in that it is applied to a memory access control device, the memory access control device is used to connect a processing module and a memory module, the memory module includes a plurality of memory channels, the memory access control device and the plurality of memory channels are connected via a plurality of access paths, each of the access paths is connected to at least one of the memory channels, and the method includes: obtaining transmission traffic data of each of the memory channels to obtain a plurality of first traffic volumes; allocating the memory channels to each of the access paths according to the plurality of first traffic volumes.

[0005] In an optional embodiment, before obtaining the transmission traffic data of each of the memory channels, the method further includes: obtaining a sampling condition; determining whether the sampling condition is satisfied; in response to the sampling condition being satisfied, performing the step of: obtaining the transmission traffic data of each of the memory channels as the first traffic volume.

[0006] Obtaining the sampling condition before obtaining the transmission traffic data of each memory channel, and determining whether the sampling condition is satisfied, and only obtaining the transmission traffic data of each memory channel when the sampling condition is satisfied, so as to avoid continuously detecting the transmission traffic data of each memory channel in real time, reducing the detection frequency of the transmission traffic data of each memory channel, and reducing the power consumption generated by detecting the transmission traffic data of each memory channel.

[0007] In an alternative embodiment, the sampling condition includes a preset flow threshold; determining whether the sampling condition is met includes: obtaining in real time the transmission flow data of each of the access paths to obtain a plurality of second flows; determining whether each of the second flows is greater than the preset flow threshold; if there is a second flow greater than the preset flow threshold, determining whether the sampling condition is met according to the number of the second flows greater than the preset flow threshold; if each of the second flows is less than or equal to the preset flow threshold, determining that the sampling condition is not met.

[0008] Setting the sampling condition to include a preset flow threshold, by obtaining in real time the second flows of each access path, it is possible to determine whether each access path is working properly based on the comparison result between the second flow and the preset flow threshold. If each of the second flows is less than or equal to the preset flow threshold, that is, each access path is working properly, it is determined that the sampling condition is not met, and there is no need to obtain the transmission flow data of each of the memory channels. Only when there is a second flow greater than the preset flow threshold, that is, when some access paths cannot work properly, it is determined whether the sampling condition is met according to the number of the second flows greater than the preset flow threshold. When the preset condition is met, the transmission flow data of each of the memory channels is obtained, so as to subsequently allocate the memory channels to each access path according to a plurality of first flows, thereby effectively ensuring the normal operation of each access path and improving the reliability of data transmission during memory access.

[0009] In an alternative embodiment, determining whether the sampling condition is met according to the number of the second flows greater than the preset flow threshold includes: obtaining a preset number; determining whether the number of the second flows greater than the preset flow threshold is greater than the preset number; if the number of the second flows greater than the preset flow threshold is greater than the preset number, determining that the sampling condition is met; if the number of the second flows greater than the preset flow threshold is less than or equal to the preset number, determining that the sampling condition is not met.

[0010] According to the comparison between the number of the second flows greater than the preset flow threshold and the preset number, when the number of the second flows greater than the preset flow threshold is greater than the preset number, it is determined that the preset condition is met. On the contrary, if the number of the second flows greater than the preset flow threshold is less than or equal to the preset number, it is determined that the preset condition is not met, thereby reducing the unnecessary detection of the transmission flow data of each memory channel, reducing the detection frequency of the transmission flow data of each memory channel, and reducing the power consumption generated by detecting the transmission flow data of each memory channel.

[0011] In an alternative embodiment, the number of preset traffic thresholds is multiple; obtaining the sampling condition includes: obtaining a plurality of the preset traffic thresholds corresponding one by one to the several access paths; determining whether the sampling condition is satisfied according to the several second traffic volumes and the preset traffic thresholds includes: respectively determining whether the second traffic volume of each access path is greater than the preset traffic threshold corresponding to the access path; if there is a second traffic volume greater than the preset traffic threshold, determining whether the sampling condition is satisfied according to the number of second traffic volumes greater than the preset traffic threshold; if each second traffic volume is less than or equal to the preset traffic threshold, determining that the sampling condition is not satisfied.

[0012] Setting the number of preset traffic thresholds to be multiple, with each access path corresponding to a preset traffic threshold respectively, can judge the data transmission capacity of each access path, so that the judgment result of whether the preset condition is satisfied is more accurate, thereby reducing unnecessary detection of the transmission traffic data of each memory channel, reducing the detection frequency of the transmission traffic data of each memory channel, and reducing the power consumption generated by detecting the transmission traffic data of each memory channel.

[0013] In an alternative embodiment, determining whether the sampling condition is satisfied according to the number of second traffic volumes greater than the preset traffic threshold includes: obtaining a preset number; judging whether the number of second traffic volumes greater than the preset traffic threshold is greater than the preset number; if the number of second traffic volumes greater than the preset traffic threshold is greater than the preset number, determining that the sampling condition is satisfied; if the number of second traffic volumes greater than the preset traffic threshold is less than or equal to the preset number, determining that the sampling condition is not satisfied.

[0014] According to the comparison of the number of second traffic volumes greater than the preset traffic threshold with the preset number, when the number of second traffic volumes greater than the preset traffic threshold is greater than the preset number, it is determined that the preset condition is satisfied. On the contrary, if the number of second traffic volumes greater than the preset traffic threshold is less than or equal to the preset number, it is determined that the preset condition is not satisfied, thereby reducing unnecessary detection of the transmission traffic data of each memory channel, reducing the detection frequency of the transmission traffic data of each memory channel, and reducing the power consumption generated by detecting the transmission traffic data of each memory channel.

[0015] In an alternative embodiment, the sampling condition includes a sampling time window; determining whether the sampling condition is satisfied according to the several second traffic volumes includes: judging whether the acquisition moments of the several second traffic volumes belong to the sampling time window; in response to the acquisition moment belonging to the sampling time window, performing the steps of: obtaining the transmission traffic data of each memory channel.

[0016] Set the sampling conditions to include a sampling time window. Only when the current moment belongs to the sampling time window, determine whether the preset conditions are met, and obtain the transmission traffic data of each of the memory channels, thereby reducing unnecessary detection of the transmission traffic data of each memory channel, reducing the detection frequency of the transmission traffic data of each memory channel, and reducing the power consumption generated by detecting the transmission traffic data of each memory channel.

[0017] In an alternative embodiment, the obtaining the sampling conditions includes: obtaining the instructions currently executed by the processing module; estimating the usage requirements of each of the memory channels according to the instructions, and obtaining the sampling time window according to the usage requirements.

[0018] In an alternative embodiment, the estimating the usage requirements of each of the memory channels according to the instructions and obtaining the sampling time window according to the usage requirements includes: estimating the usage duty cycle of each of the memory channels according to the instructions; using the time when the usage duty cycle is continuously greater than a preset duty cycle as the sampling time window.

[0019] In an alternative embodiment, the allocating the memory channels to each of the access paths according to the several first traffic volumes includes: allocating the memory channels to each of the access paths according to the magnitudes of the first traffic volumes of each of the memory channels, so that the difference between the sums of the first traffic volumes of the memory channels connected to each of the access paths is less than a preset difference.

[0020] The sum of the first traffic volumes of the memory channels connected to each access path is the load traffic transmitted in that access path. The difference between the sums of the first traffic volumes of the memory channels connected to each of the access paths being less than a preset difference means that the difference between the load traffic of each access path and the load traffic of other access paths is less than a preset difference. Analyzing and allocating the memory channels in this way can ensure that the path resources of each access path can be effectively utilized, and there will be no situation where the data transmission volume of some access paths is too large while the data transmission volume of other access paths is too small.

[0021] In an alternative embodiment, after allocating the memory channels to each of the access paths according to the several first traffic volumes, the method further includes: obtaining the rated bandwidth of each of the memory channels; determining whether the first traffic volume of each of the memory channels is greater than the rated bandwidth of the memory channel; if the first traffic volume of the memory channel is greater than the rated bandwidth of the memory channel, reducing the data transmission to the memory channel.

[0022] Obtain the rated bandwidth of each memory channel. For a memory channel where the corresponding first traffic is greater than the corresponding rated bandwidth, the amount of data transmitted is too large. At this time, reduce the amount of data transmitted to this memory channel, so as to ensure the normal data transmission of this memory channel and avoid data loss during data transmission.

[0023] In a second aspect, an embodiment of the present invention provides a memory access control device for connecting a processing module and a memory module. The memory module includes a plurality of memory channels. The memory access control device and the plurality of memory channels are connected via a plurality of access paths, and each access path is connected to at least one of the memory channels. The device includes: a traffic statistics unit connected to the memory channels, and the traffic statistics unit is used to obtain the transmission traffic data of each memory channel to obtain a plurality of first traffic; an arbitration unit connected to both the processing module and the memory module, and the arbitration unit is used to allocate the memory channels for each access path according to the plurality of first traffic.

[0024] In a third aspect, an embodiment of the present invention provides an electronic device, including: a processing module, a memory module, and the memory access control device as described above for connecting the processing module and the memory module; the memory module includes a plurality of memory channels, and the memory access control device and the plurality of memory channels are connected via a plurality of access paths, and each access path is connected to at least one of the memory channels.

[0025] In a fourth aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the memory access control method as described above.

[0026] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, and the computer program is executed by a processor to implement the memory access control method as described above.

[0027] Compared with the prior art, in the memory access control method, device, electronic device, and storage medium provided by the embodiments of the present invention, by analyzing the transmission traffic data of each memory channel in the memory module and allocating memory channels to each access path according to the transmission traffic data of each memory channel, the memory channels connected to each access path are made to better meet the actual usage requirements, avoiding the negative impact on the memory access efficiency caused by excessive traffic load on some access paths and too little traffic load on some other access paths, thereby improving the data transmission efficiency between the processing module and the memory module and enhancing the memory access efficiency of the processing module to the memory module. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can be obtained based on these drawings.

[0029] Figure 1 Schematic diagram of the connection method between the processing module and the storage module in the prior art;

[0030] Figure 2 Schematic diagram of the memory access control device to which the memory access control method provided in the first embodiment of the present invention is applied;

[0031] Figure 3 Schematic flowchart of the memory access control method provided in the first embodiment of the present invention;

[0032] Figure 4 Schematic flowchart of the memory access control method provided in the second embodiment of the present invention;

[0033] Figure 5 Schematic flowchart of obtaining the sampling time window in the memory access control method provided in the second embodiment of the present invention;

[0034] Figure 6 Schematic flowchart of determining whether a preset condition is met in the memory access control method provided in one embodiment of the present invention;

[0035] Figure 7 Schematic flowchart of determining whether a preset condition is met in the memory access control method provided in another embodiment of the present invention;

[0036] Figure 8 Schematic flowchart of the memory access control method provided in the third embodiment of the present invention;

[0037] Figure 9Schematic diagram of the memory access control device provided in the fourth embodiment of the present invention;

[0038] Figure 10 Schematic diagram of the electronic device provided in the fifth embodiment of the present invention;

[0039] Figure 11 Schematic diagram of the electronic device provided in the sixth embodiment of the present invention. Detailed implementation manners

[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0041] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0043] In the description of the present invention, it should be noted that if terms such as "upper", "lower", "inner", "outer", etc. are used to indicate the orientation or positional relationship, it is based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of the present invention is usually placed during use. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present invention.

[0044] In addition, terms such as "first" and "second" are only used for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0045] It should be noted that the features in the embodiments of the present invention can be combined with each other without conflict.

[0046] Such as Figure 1The figure shows a schematic diagram of the connection method and memory access process between a processing module and a storage module in the prior art. Among them, the processing module 101 includes multiple computing units A1, A2, A3, A4... An. The multiple computing units are used to execute the arithmetic tasks assigned by the system. During the process of the computing units executing the arithmetic tasks assigned by the system, arithmetic result data will be generated and stored in the memory, or parameters required for executing the arithmetic tasks will be read from the memory. Therefore, data interaction is required between the processing module 101 and the storage module 102. The storage module 102 includes multiple memory channels B1, B2, B3, B4... Bn. The processing module 101 writes data into the storage module or reads data from the storage module through these memory channels. The arbitration module 103 is arranged between the processing module 101 and the storage module 102 and is connected to the processing module 101 and the storage module 102. Since the storage areas inside the storage module 102 connected by each memory channel are different, and the computing units need to write data and read data for a specified storage area, the arbitration module 103 is used to allocate memory channels for each computing unit according to the specified storage area required for the computing units to write data and read data. After the arbitration module 103 allocates memory channels for each computing unit, data interaction is carried out with each memory channel through several different access paths C1, C2... Cn. In the prior art, the memory channels allocated to each access path are fixed after the system initialization is completed. For example, the access path C1 is connected to the memory channels B1 and B2, and the data interaction between the processing module 101 and the memory channels B1 and B2 needs to be transmitted through the access path C1. The access path C2 is connected to the memory channels B3 and B4, and the data interaction between the processing module 101 and the memory channels B3 and B4 needs to be transmitted through the access path C2. In this prior art, when the data traffic in the memory channels B1 and B2 is large, while the data traffic in the memory channels B3 and B4 is small, the traffic load in the access path C1 is large, while the traffic load in the access path C2 is small. The large traffic load in the access path C1 may lead to a reduction in the traffic transmission efficiency, thereby resulting in a reduction in the memory access efficiency of the processing module. At this time, a large number of transmission channels in the access path C2 are vacant, and the allocation of the access paths is unreasonable.

[0047] To solve the above technical problems, Embodiment 1 of the present invention provides a memory access control method, which is applied to as Figure 2The memory access control device 203 shown is used to connect the processing module 201 and the memory module 202. The memory module 202 includes several memory channels B1, B2, B3, B4... Bn. The memory access control device 203 and several memory channels B1, B2, B3, B4... Bn are connected via several access paths C1, C2... Cn. Each access path C1, C2... Cn is connected to at least one memory channel B1, B2, B3, B4... Bn. The memory access control method is as follows Figure 3 shown, and includes the following steps:

[0048] Step S301: Obtain the transmission traffic data of each memory channel to obtain several first traffic volumes.

[0049] As Figure 2 shown, an arbitration unit 2031 and several traffic detection units 2032 are provided in the memory access control device applied in this embodiment. The traffic detection units 2032 are connected to each memory channel B1, B2, B3, B4... Bn. By the traffic detection units 2032, the transmission traffic data of each memory channel B1, B2, B3, B4... Bn is detected to obtain the first traffic volume of each memory channel.

[0050] In some embodiments of the present invention, the traffic detection unit 2032 can collect all the data transmitted in each memory channel B1, B2, B3, B4... Bn, and then perform data analysis on the collected all data according to a pre-trained traffic detection model to obtain the first traffic volume of each memory channel. The size of the first traffic volume is the amount of data currently transmitted in each memory channel.

[0051] Step S302: Allocate memory channels for each access path according to several first traffic volumes.

[0052] In some embodiments of the present invention, it may be to allocate memory channels for each access path according to the size of the first traffic volume of each memory channel, so that the difference between the sum of the first traffic volumes of the memory channels connected to each access path is less than a preset difference. That is, the memory channels are evenly allocated. The sum of the first traffic volumes of the memory channels connected to each access path is the load traffic transmitted in that access path. The difference between the sum of the first traffic volumes of the memory channels connected to each access path being less than a preset difference means that the difference between the load traffic of each access path and the load traffic of other access paths is less than a preset difference. For example Figure 2As shown, when the data traffic in memory channels B1 and B2 is large while the data traffic in memory channels B3 and B4 is small, memory channel B2 is reallocated to access path C2, thereby reducing the load traffic of access path C1 and increasing the load traffic of access path C2, reducing the difference between the load traffic of access path C1 and the load traffic of access path C2, and better utilizing the data transmission capabilities of access path C1 and access path C2.

[0053] It can be understood that the above example of evenly distributing several memory channels to each access path according to the first traffic of the memory channels is only an illustrative example in some embodiments of the present invention and does not constitute a limitation. In some other embodiments of the present invention, the memory channels can also be allocated according to the data transmission capabilities of each access path, that is, the memory channels with a larger first traffic are allocated to be connected to the access path with a larger data transmission capability, and the memory channels with a smaller first traffic are allocated to be connected to the access path with a smaller data transmission capability, as long as it is ensured that the sum of the first traffic of the memory channels allocated in each access path does not exceed the upper limit value of the data transmission capability of the access path. In this way, the memory channels can be flexibly allocated according to the sizes of the transmission capabilities of different access paths, ensuring that the data transmission capabilities of each access path can be fully utilized.

[0054] Compared with the prior art, in the memory access control method provided in the first embodiment of the present invention, by analyzing the transmission traffic data of each memory channel in the memory module and allocating memory channels to each access path according to the transmission traffic data of each memory channel, the memory channels connected to each access path better meet the actual usage requirements, avoiding the negative impact on the memory access efficiency caused by some access paths having too large a traffic load while some access paths having too small a traffic load, thereby improving the data transmission efficiency between the processing module and the memory module and improving the memory access efficiency of the processing module to the memory module.

[0055] The second embodiment of the present invention provides a memory access control method, which is also applied to the memory access control device as Figure 2 shown. As Figure 4 shown, the memory access control method includes the following steps:

[0056] Step S401: Obtain sampling conditions.

[0057] In some embodiments of the present invention, the sampling condition may include a preset flow threshold. The preset flow threshold is a flow threshold set in advance according to actual needs. The number of preset flow thresholds may be one or multiple. When the number of preset flow thresholds is one, that is, several access paths share one preset flow threshold. When the number of preset flow thresholds is multiple, that is, according to the different data transmission capabilities of each access path, the preset flow thresholds corresponding to each access path are respectively obtained.

[0058] In addition, in some other embodiments of the present invention, the sampling condition may also include other conditions such as a sampling time window, which can be flexibly set according to actual needs. When the sampling condition includes a sampling time window, the sampling time window can be obtained through the steps as Figure 5 shown, specifically as Figure 5 shown, including:

[0059] Step S501: Obtain the instructions currently running in the processing module.

[0060] Step S502: Estimate the usage requirements of each memory channel according to the instructions, and obtain the sampling time window according to the usage requirements.

[0061] Specifically, in this step, the memory channels that may need to perform data interaction during the execution of the instructions currently running in the processing module can be predicted according to the instructions currently running in the processing module, as well as the data volume size and data interaction time period of the data transmitted with the memory channels that may need to perform data interaction. For example, if the instructions currently running in the processing module indicate that a certain amount of data needs to be read from a certain storage area of the storage module, then according to this indication, it can be estimated that the instructions currently running in the processing module need to perform data interaction with this storage area, that is, the memory channels connected to this storage area are the memory channels that may need to perform data interaction. And according to the data volume size of the data that needs to be read from this storage area by the instructions currently running in the processing module, the data flow size and data interaction time period during the data interaction with these memory channels can be estimated. The estimated data interaction time period can be used as the sampling time window.

[0062] In addition to estimating the memory channels that need to perform data transmission and the data traffic volume in each memory channel according to the currently running instructions in the processing module as illustrated above, in some embodiments of the present invention, it may also be to estimate the usage duty cycle of each memory channel during data interaction according to the currently running instructions in the processing module, and use the time period during which the usage duty cycle is continuously greater than the preset duty cycle as the sampling time window. That is, the overall usage time period of each memory channel is subdivided into time periods, the duty cycle in each subdivided time period is estimated, and multiple subdivided time periods with a duty cycle greater than the preset duty cycle and continuous in time sequence are integrated into one time period as the sampling time window. For example, the duty cycles of multiple subdivided time periods are 0.8, 0.9, 0.7, 0.8, 0.6, 0.3, 0.5, 0.7, 0.8, 0.8, 0.9... respectively. If the preset duty cycle is 0.6, then the two time periods of "0.8, 0.9, 0.7, 0.8" and "0.7, 0.8, 0.8, 0.9" with a duty cycle greater than 0.6 and continuous in time sequence can be used as the sampling time window.

[0063] Step S402: Determine whether the sampling condition is satisfied. If so, execute Step S403; if not, execute Step S402 again.

[0064] In some embodiments of the present invention, according to different sampling conditions, the method for determining whether the sampling condition is satisfied is also different.

[0065] Specifically, when the sampling condition includes a preset traffic threshold, the transmission traffic data of each access path is obtained in real time to obtain a number of second traffic volumes, and then it is determined whether the preset condition is satisfied according to the magnitude relationship between the second traffic volume and the preset traffic threshold.

[0066] For example Figure 6 As shown in a specific embodiment of the present invention, when the number of preset traffic thresholds is one, an example of the method for determining whether the preset condition is satisfied according to the magnitude relationship between the second traffic volume and the preset traffic threshold is illustrated. The specific steps are as Figure 6 shown, including:

[0067] Step S601: Obtain the transmission traffic data of each access path in real time to obtain a number of second traffic volumes.

[0068] In this step, part of the flow detection unit 2032 may be connected to each access path, and the transmission flow data in each access path may be measured in real time through the flow detection unit 2032 to obtain the second flow. It is understandable that connecting part of the flow detection unit 2032 to each access path and measuring the transmission flow data in each access path in real time through the flow detection unit 2032 is only an example in some embodiments of the present invention and does not constitute a limitation. In other embodiments of the present invention, a detection unit separately connected to each access path may be provided to realize real-time detection of the transmission flow data of each access path.

[0069] Step S602: Determine whether each second flow rate is greater than a preset flow rate threshold, if so, execute step S603, if not, execute step S604.

[0070] In this step, each second flow detected is compared with the preset flow threshold to determine whether all second flows are greater than the preset flow threshold. If all second flow thresholds are less than or equal to the preset flow threshold, step S604 is executed. If some second flows are greater than the preset flow threshold or all second flows are greater than the preset flow threshold, step S603 is executed.

[0071] Step S603: judging whether a sampling condition is satisfied according to the amount of the second flow rate greater than the preset flow rate threshold.

[0072] Specifically, in this step, a preset number is first obtained, and the preset number is a predetermined value pre-set and stored in the memory access control device. It is determined whether the number of second flows greater than the preset flow threshold is greater than the preset number. If the number of second flows greater than the preset flow threshold is greater than the preset number, it is determined that the preset condition is met; if the number of second flows greater than the preset flow threshold is less than or equal to the preset number, it is determined that the preset condition is not met.

[0073] It can be understood that when the preset number is 0, that is, as long as there is a second flow rate greater than the preset flow rate threshold, it is determined that the preset condition is met.

[0074] Step S604: Determine whether the sampling condition is not met.

[0075] Understandably, Figure 6 This is only an example of the case where the number of preset traffic thresholds is one. In other embodiments of the present invention, when the preset traffic thresholds are sorted into multiple ones, that is, when a plurality of preset traffic thresholds corresponding to a plurality of access paths are obtained when the sampling conditions are obtained, the specific steps of the judgment method for judging whether the preset conditions are met according to the magnitude relationship between the second traffic and the preset traffic threshold are as follows: Figure 7 As shown, including:

[0076] Step S701: Obtain the transmission traffic data of each access path in real time to obtain a number of second traffic volumes.

[0077] It can be understood that the specific steps of this step for obtaining the transmission traffic data of each access path are substantially the same as those in step S601. For details, reference can be made to the specific description in step S601, which will not be elaborated here.

[0078] Step S702: Determine whether the second traffic volume of each access path is greater than the preset traffic threshold corresponding to the access path one by one. If so, execute step S703; if not, execute step S704.

[0079] In this step, for each access path, there is a corresponding second traffic volume and a corresponding preset traffic threshold. The second traffic volume corresponding to each access path and the corresponding preset traffic threshold are respectively compared in size. If the second traffic volume corresponding to each access path is less than or equal to the corresponding preset traffic threshold, then execute step S704; if there are some access paths whose corresponding second traffic volumes are greater than the corresponding preset traffic thresholds, then execute step S703.

[0080] Step S703: Determine whether the sampling condition is met according to the number of second traffic volumes greater than the preset traffic threshold.

[0081] Specifically, in this step, first obtain the preset quantity, which is a fixed value pre-set and stored in the memory access control device. Then obtain the number of access paths whose corresponding second traffic volumes are greater than the corresponding preset traffic thresholds, and determine whether the number of access paths whose corresponding second traffic volumes are greater than the corresponding preset traffic thresholds is greater than the preset quantity. If it is greater than the preset quantity, it is determined that the preset condition is met; if it is less than or equal to the preset quantity, it is determined that the preset condition is not met.

[0082] It can be understood that when the preset quantity is 0, that is, as long as there is an access path whose corresponding second traffic volume is greater than the corresponding preset traffic threshold, it is determined that the preset condition is met.

[0083] Step S704: Determine that the sampling condition is not met.

[0084] It can be understood that the above is only an illustrative example of the specific steps for determining whether the sampling conditions are met when the foregoing sampling conditions include a preset flow threshold. According to step S401, in other embodiments of the present invention, the sampling conditions may also include other conditions such as a sampling time window. When the sampling conditions include a sampling time window, it can be determined whether the preset conditions are met by determining whether the current moment belongs to the sampling time window. If the current moment belongs to the sampling time window, it is determined that the preset conditions are met. If the current moment does not belong to the sampling time window, it is determined that the preset conditions are not met. In addition, the sampling conditions may also include multiple conditions simultaneously. For example, when including both a preset flow threshold and a sampling time window simultaneously, it is necessary to determine whether the preset conditions are met according to the preset flow threshold and the sampling time window respectively, and make a comprehensive determination based on the judgment results of both. For example, only when the sampling conditions of the preset flow threshold and the sampling conditions of the sampling time window are simultaneously met is it determined that the sampling conditions are met, or only when one of them is met is it determined that the sampling conditions are met, etc. Specifically, it can be flexibly applied according to different sampling conditions.

[0085] Step S403: Obtain the transmission flow data of each memory channel to obtain a number of first flows.

[0086] Step S404: Allocate memory channels for each access path according to the number of first flows.

[0087] It can be understood that steps S403 and S404 in the memory access control method provided in the second embodiment of the present invention are substantially the same as steps S301 and S302 in the first embodiment. Specifically, reference can be made to the specific description in the foregoing first embodiment, and details will not be repeated here.

[0088] Compared with the prior art, the memory access control method provided in the second embodiment of the present invention retains the technical features in the first embodiment and also has the same technical effects as the first embodiment. In addition, in the memory access control method provided in the second embodiment of the present invention, the sampling conditions are obtained first before obtaining the transmission flow data of each memory channel, and it is determined whether the sampling conditions are met according to the second flows of each access path. Only when the sampling conditions are met will the transmission flow data of each memory channel be obtained, thereby avoiding continuous real-time detection of the transmission flow data of each memory channel, reducing the detection frequency of the transmission flow data of each memory channel, and reducing the power consumption generated by detecting the transmission flow data of each memory channel.

[0089] Embodiment 3 of the present invention provides a memory access control method applied to a Figure 2 memory access control device as shown in Figure 8 and includes the following steps:

[0090] Step S801: Obtain the transmission traffic data of each memory channel to obtain a number of first traffic volumes.

[0091] Step S802: Allocate memory channels for each access path according to the number of first traffic volumes.

[0092] It can be understood that Step S801 and Step S802 in Embodiment 3 of the present invention are substantially the same as Step S301 and Step S302 in Embodiment 1. For specific details, reference can be made to the specific description in Embodiment 1, and details will not be elaborated here.

[0093] Step S803: Obtain the rated bandwidth of each memory channel.

[0094] In this step, the rated bandwidth of each memory channel is the maximum data transmission traffic that each memory channel can reach when transmitting data normally. The rated bandwidth of each memory channel is usually determined by the hardware physical properties of each memory channel and is pre-stored in the memory access control device.

[0095] Step S804: Determine whether the first traffic volume of each memory channel is greater than the rated bandwidth of the memory channel. If so, execute Step S805; if not, execute Step S804.

[0096] In this step, compare the first traffic volume corresponding to each memory channel with the rated bandwidth of each memory channel one by one. When there is a memory channel whose corresponding first traffic volume is greater than the corresponding rated bandwidth, execute Step S805. If the first traffic volumes corresponding to all memory channels are less than or equal to their respective rated bandwidths, continue to execute Step S804.

[0097] Step S805: Reduce the data transmission to the memory channel.

[0098] Specifically, in this step, for the memory channel whose corresponding first traffic volume is greater than the corresponding rated bandwidth, reduce the amount of data transmitted to this memory channel.

[0099] Compared with the prior art, the memory access control method provided in Embodiment 3 of the present invention retains the technical features in Embodiment 1 and also has the same technical effects as Embodiment 1. In addition, in the memory access control method provided in Embodiment 3 of the present invention, the rated bandwidth of each memory channel is also obtained. For the memory channel whose corresponding first traffic volume is greater than the corresponding rated bandwidth, the amount of data transmitted is too large. At this time, reduce the amount of data transmitted to this memory channel, so as to ensure the normal data transmission of this memory channel and avoid data loss during data transmission.

[0100] Embodiment 4 of the present invention provides a memory access control device, as Figure 9As shown in the figure, the memory access control device 903 is used to connect the processing module 901 and the memory module 902. The memory module 902 includes several memory channels B1, B2, B3, B4... Bn. The memory access control device 903 and several memory channels B1, B2, B3, B4... Bn are connected via several access paths C1, C2... Cn. Each access path C1, C2... Cn is connected to at least one memory channel B1, B2, B3, B4... Bn. The memory access control device 903 includes: a traffic statistics unit 9032, which is connected to the memory channels B1, B2, B3, B4... Bn. The traffic statistics unit 9032 is used to obtain the transmission traffic data of each memory channel B1, B2, B3, B4... Bn to obtain several first traffic volumes; an arbitration unit 9031, which is connected to both the processing module 901 and the memory module 902. The arbitration unit 9031 is used to allocate the memory channels B1, B2, B3, B4... Bn to each access path C1, C2... Cn according to the several first traffic volumes.

[0101] In the memory access control device provided in the fourth embodiment of the present invention, the traffic statistics unit 9032 analyzes the transmission traffic data of each memory channel in the memory module. The arbitration unit 9031 allocates memory channels to each access path according to the transmission traffic data of each memory channel, so that the memory channels connected to each access path better meet the actual usage requirements, avoiding the negative impact on the memory access efficiency caused by the over-large traffic load of some access paths and the over-small traffic load of some other access paths, thereby improving the data transmission efficiency between the processing module and the memory module and enhancing the memory access efficiency of the processing module to the memory module.

[0102] The fifth embodiment of the present invention provides an electronic device, as Figure 10 shown, including: a processing module 100, a memory module 200, and a memory access control device 300 as provided in the fourth embodiment, which connects the processing module 100 and the memory module 200.

[0103] The sixth embodiment of the present invention relates to an electronic device, as Figure 11 shown, including: at least one processor 400; and a memory 500 communicatively connected to the at least one processor 400; wherein, the memory 500 stores instructions executable by the at least one processor 400, and the instructions are executed by the at least one processor 400 so that the at least one processor 400 can execute the memory access control method in each of the above embodiments.

[0104] Among them, the memory and the processor are connected in a bus manner. The bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and the memory together. The bus can also connect various other circuits together, such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art. Therefore, further description thereof will not be provided herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a component or multiple components, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor.

[0105] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory can be used to store the data used by the processor when executing operations.

[0106] Embodiment 7 of the present invention relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiments are implemented.

[0107] That is, those skilled in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.

[0108] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A memory access control method, characterized in that, Applied to a memory access control device, the memory access control device is used to connect a processing module and a memory module. The memory module includes a plurality of memory channels, and the storage areas inside the memory module connected by each memory channel are different. The memory access control device and the plurality of memory channels are connected via a plurality of access paths, and each access path is connected to at least one of the memory channels. The method includes: Obtain the transmission traffic data of each of the memory channels to obtain a plurality of first traffic volumes; Allocate the memory channels to each access path according to the plurality of first traffic volumes; Among them, the step of allocating the memory channels to each access path according to the plurality of first traffic volumes includes: Allocate the memory channels to each access path according to the magnitudes of the first traffic volumes of each of the memory channels, so that the difference between the sums of the first traffic volumes of the memory channels connected to each access path is less than a preset difference.

2. The method according to claim 1, wherein Before obtaining the transmission traffic data of each of the memory channels, the method further includes: Obtain sampling conditions; Judge whether the sampling conditions are satisfied; In response to satisfying the sampling conditions, execute the step: obtain the transmission traffic data of each of the memory channels as the first traffic volume.

3. The method according to claim 2, characterized in that, The sampling conditions include a preset traffic threshold; The step of judging whether the sampling conditions are satisfied includes: Obtain the transmission traffic data of each of the access paths in real time to obtain a plurality of second traffic volumes; Judge whether each of the second traffic volumes is greater than the preset traffic threshold; If there is a second traffic volume greater than the preset traffic threshold, judge whether the sampling conditions are satisfied according to the number of second traffic volumes greater than the preset traffic threshold; If each of the second traffic volumes is less than or equal to the preset traffic threshold, it is determined that the sampling conditions are not satisfied.

4. The method according to claim 3, wherein The step of judging whether the sampling conditions are satisfied according to the number of second traffic volumes greater than the preset traffic threshold includes: Obtain a preset number; Judge whether the number of second traffic volumes greater than the preset traffic threshold is greater than the preset number; If the number of second traffic volumes greater than the preset traffic threshold is greater than the preset number, it is determined that the sampling conditions are satisfied; If the number of second traffic volumes greater than the preset traffic threshold is less than or equal to the preset number, it is determined that the sampling conditions are not satisfied.

5. The method according to claim 3, characterized in that, The number of preset traffic thresholds is multiple; The step of obtaining the sampling conditions includes: obtaining a plurality of the preset traffic thresholds corresponding one-to-one to the plurality of access paths; The step of judging whether the sampling conditions are satisfied according to the plurality of second traffic volumes and the preset traffic threshold includes: Respectively judge whether the second traffic volume of each access path is greater than the preset traffic threshold corresponding to the access path; If there is a second traffic volume greater than the preset traffic threshold, judge whether the sampling conditions are satisfied according to the number of second traffic volumes greater than the preset traffic threshold; If each of the second traffic volumes is less than or equal to the preset traffic threshold, it is determined that the sampling conditions are not satisfied.

6. The method according to claim 5, wherein Determining whether the sampling condition is satisfied according to the quantity of the second traffic greater than the preset traffic threshold includes: Obtaining a preset quantity; Judging whether the quantity of the second traffic greater than the preset traffic threshold is greater than the preset quantity; If the quantity of the second traffic greater than the preset traffic threshold is greater than the preset quantity, determining that the sampling condition is satisfied; If the quantity of the second traffic greater than the preset traffic threshold is less than or equal to the preset quantity, determining that the sampling condition is not satisfied.

7. The method according to claim 2, wherein The sampling condition includes a sampling time window; Judging whether the sampling condition is satisfied includes: Judging whether the current moment belongs to the sampling time window; In response to the current moment belonging to the sampling time window, performing the steps of: obtaining the transmission traffic data of each of the memory channels.

8. The method according to claim 7, wherein Obtaining the sampling condition includes: Obtaining the instructions currently executed by the processing module; Estimating the usage requirements of each of the memory channels according to the instructions, and obtaining the sampling time window according to the usage requirements.

9. The method according to claim 8, wherein Estimating the usage requirements of each of the memory channels according to the instructions, and obtaining the sampling time window according to the usage requirements includes: Estimating the usage duty cycle of each of the memory channels according to the instructions; Taking the time period during which the usage duty cycle is continuously greater than the preset duty cycle as the sampling time window.

10. The method according to claim 1, characterized in that, After allocating the memory channels for each of the access paths according to the several first traffic, the method further includes: Obtaining the rated bandwidth of each of the memory channels; Judging whether the first traffic of each of the memory channels is greater than the rated bandwidth of the memory channel; If the first traffic of the memory channel is greater than the rated bandwidth of the memory channel, reducing the data transmission to the memory channel.

11. A memory access control device, characterized in that, For connecting a processing module and a memory module, the memory module includes several memory channels, the storage areas inside the memory modules connected by each memory channel are different, the memory access control device and the several memory channels are connected via several access paths, each access path is connected to at least one of the memory channels, and the device includes: A traffic statistics unit, the traffic statistics unit is connected to the memory channel, and the traffic statistics unit is used to obtain the transmission traffic data of each of the memory channels to obtain several first traffic; An arbitration unit, the arbitration unit is connected to both the processing module and the memory module, and the arbitration unit is used to allocate the memory channels for each of the access paths according to the several first traffic; The traffic statistics unit is used to allocate the memory channels for each of the access paths according to the magnitudes of the first traffic of each of the memory channels, so that the difference between the sums of the first traffic of the memory channels connected to each of the access paths is less than a preset difference.

12. An electronic device, characterized in that, Includes: A processing module, a memory module, and a memory access control device as claimed in claim 11 connecting the processing module and the memory module.

13. An electronic device, characterized in that, Includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions, when executed by the at least one processor, enable the at least one processor to execute the memory access control method according to any one of claims 1 to 10.

14. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the memory access control method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Memory system, memory module, memory module access method and computer system

    CN103988186A