Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Embodiment one
Present embodiment provides a kind of controlling multi-data source access as shown in Figure 1, comprising:
S110: the request of access that receives at least one data source at any time in the sheet;
S120: according to the data source access privileges order that sets in advance in this timeslice, in the data source that proposes request of access, determine the data source of grant access rights, so that the data source of grant access rights visit external memory.
In the embodiment of the invention, the number of timeslice equals the number of data source, and the data source that has the highest access privileges in each timeslice is inequality.For example when data source has four, four timeslices are set, the time length of each timeslice is set according to actual needs.
The data source access privileges that sets in advance is included in and a different data source is set in each timeslice has the highest access privileges, and the access privileges order of the data source except that described data source with the highest access privileges is set at random.As shown in Figure 2, can be arranged to the highest data source of access privileges in the last timeslice, the access privileges of other data sources in the last timeslice one-level that in one timeslice of back, raises successively as the minimum data source of access privileges in one timeslice of back.Perhaps, also can be arranged to the minimum data source of access privileges in the last timeslice as the highest data source of access privileges in one timeslice of back, the access privileges of other data sources in the last timeslice is reducing one-level successively in one timeslice of back.
Present embodiment is by receiving the request of access of at least one data source in the sheet at any time, determine the data source of grant access rights in proper order according to the data source access privileges that sets in advance in the described timeslice, so that the technological means of the data source of described grant access rights visit external memory, organically in conjunction with priority and timeslice method, at the problem that the lower-priority data source in the fixed priority arbitration algorithm is difficult to have access to external memory storage and timeslice waste, promoted the efficient of a plurality of data sources visit external memories effectively.
Embodiment two
Present embodiment further specifies controlling multi-data source access, comprising:
S210: the request of access that receives at least one data source at any time in the sheet.
Wherein, timeslice is the time period with predetermined length.The number of timeslice is set according to the number of data source, has 4 as data source, and timeslice just is set at 4.The length of timeslice can be set according to actual needs.The random time sheet is at any one timeslice in the T.T. sheet.At least one data source is meant that the data source number that proposes request of access is more than 1.
S220: according to the data source access privileges order that sets in advance in this timeslice, in the data source that proposes request of access, determine the data source of grant access rights, so that the data source of grant access rights visit external memory.
The data source access privileges that sets in advance as shown in Figure 2, can be arranged to the highest data source of access privileges in the last timeslice as the minimum data source of access privileges in one timeslice of back, the access privileges of other data sources in the last timeslice one-level that in one timeslice of back, raises successively.For example, receive data source 1 in timeslice 2, the request of access that data source 3 and data source 5 are sent is according to the data source access privileges order (data source 2 of timeslice 2, data source 3, data source 4 ..., data source n, data source 0, data source 1) determining to authorize earlier the access rights of data source 3, is the access rights of data source 5 then, is the access rights of data source 1 at last.
In some embodiment, in S220, can request of access be proposed by access agent during data source visit external memory, comprise the visit data amount and the read-write sign of the first address of visit, first data (for write operation), this request of access, after the granted access, the input follow-up data.In addition, externally storer refreshes, during operation such as precharge, line feed, suspends the continuation visit of data source access agent, is ready to continue accessed up to external memory storage.Can be before the visit of request data quantity is not finished by the visit of data source access agent abort request.Present embodiment comes processings that conduct interviews of proxy data source by adopting the data source access agent, is convenient to transplanting seamlessly in different logical designs.
In some embodiment, can also the buffer memory interaction data in the access agent.For example, in the detailed process of data source visit external memory, the interaction data during the data source visit external memory of buffer memory grant access rights.Be specially when write data is visited, ask access external memory again after part is data cached; When read data is visited, buffer memory is read and the data that have little time to be read away by data source from external memory storage, the data of external memory storage and data source produce when having avoided external memory storage to be visited by the low speed data source and wait for and waste external memory storage bandwidth resources all by the buffer memory exchange.Present embodiment is complementary the transmission bandwidth of data source and the transmission bandwidth of external memory storage by using metadata cache, has effectively utilized the transmission bandwidth of external memory storage.
Embodiment three
Present embodiment provides a kind of access control apparatus of multi-data source.Below with reference to Fig. 3, describe the access control apparatus 300 of external device (ED) in detail, this device comprises:
Receiving element 310 is used for the request of access that sheet at any time receives at least one data source;
Arbitration unit 320, the data source access privileges that is used for setting in advance according to described timeslice order is determined the data source of grant access rights, so that the data source of described grant access rights visit external memory in the data source that proposes request of access.
Wherein the number of timeslice equals the number of data source, and the data source that has the highest access privileges in each timeslice is inequality.
As shown in Figure 2, the highest data source of the access privileges in the last timeslice is as the minimum data source of access privileges in one timeslice of back, the access privileges of other data sources in the last timeslice one-level that raises successively in one timeslice of back.Perhaps, the minimum data source of the access privileges in the last timeslice is as the highest data source of access privileges in one timeslice of back, and the access privileges of other data sources in the last timeslice is reducing one-level successively in one timeslice of back.But data source access privileges order can change according to the difference of practical application.With the timeslice among Fig. 22 is example, receiving element 310 receives data source 1 in timeslice 2, the request of access that data source 3 and data source 5 are sent, and arbitration unit 320 is according to the data source access privileges order (data source 2 of timeslice 2, data source 3, data source 4 ..., data source n, data source 0, data source 1) determining to authorize earlier the access rights of data source 3, is the access rights of data source 5 then, is the access rights of data source 1 at last.
The arbitration unit that present embodiment adopts combines the rules of arbitration of round-robin and priority, at the problem that lower-priority data source in the fixed priority arbitration algorithm is difficult to have access to external memory storage and timeslice waste, promoted the efficient of a plurality of data sources visit external memories effectively.
Embodiment four
Present embodiment provides a kind of access control apparatus of multi-data source.Below with reference to Fig. 4, describe the access control apparatus 400 of multi-data source in detail, this device comprises:
Receiving element 410 is used for the request of access that sheet at any time receives at least one data source;
Arbitration unit 420, the data source access privileges that is used for setting in advance according to described timeslice order is determined the data source of grant access rights, so that the data source of described grant access rights visit external memory in the data source that proposes request of access;
Access agent 430, its quantity is corresponding with the quantity of described data source, and is used to act on behalf of each data source and proposes request of access to external device (ED).
Wherein, the receiving element 410 of present embodiment and arbitration unit 420 are identical with embodiment's three, do not repeat them here.
When data source needs access external memory, data source proposes request of access by its access agent 430 to arbitration unit 420, the visit data amount of the first address of input reference simultaneously, first data (for write operation), this request of access and read-write sign, after the arbiter grants bus, the input follow-up data.In the process of data access, external memory storage may have refresh, operation such as precharge, line feed, the access control apparatus 400 of multi-data source suspends the continuation visit of data source access agent 430 in this case, is ready to continue accessed up to external memory storage.The visit that access agent 430 can abort request before the visit of request data quantity was not finished.
The data transfer bandwidth of internal data source is generally all far below external memory storage, when a plurality of data sources are shared external memory storage, if do not add processing, the transmission bandwidth of external memory storage is subject to the transmission bandwidth of external data source, and this is with the transmission bandwidth of serious waste external memory storage.For this reason, as shown in Figure 5, also comprise cache module 431 in the access agent 430 of present embodiment, the interaction data when being used for the described data source of buffer memory and visiting described external device (ED).Particularly, when write data is visited, earlier data portion is write metadata cache, ask access external memory again; Handle is read and is had little time to be write metadata cache by the data that data source is read away from external memory storage when read data is visited, the data of external memory storage and data source produce when having avoided external memory storage to be visited by the low speed data source and wait for and waste external memory storage bandwidth resources all by the buffer memory exchange.
Present embodiment has defined the clear interface of data source arbitration agency with memory arbitrator by the implementation structure of the cooperating of employing data source access agent and arbitration unit, is convenient to seamlessly transplant in different logical designs; By using metadata cache, the transmission bandwidth of data source and the transmission bandwidth of external memory storage are complementary, effectively utilize the transmission bandwidth of external memory storage.
Embodiment five
Present embodiment provides a kind of storage system.Below with reference to Fig. 6, describe this storage system 600 in detail, this system comprises:
A plurality of data sources 610 are used to send request of access, when described request of access is authorized to external memory are conducted interviews;
Access control apparatus 620 is used for the request of access that sheet at any time receives at least one data source; According to the data source access privileges order that sets in advance in the described timeslice, in the data source that proposes request of access, determine the data source of grant access rights, so that the data source of described grant access rights visit external memory; Wherein the number of timeslice equals the number of data source, and the data source that has the highest access privileges in each timeslice is inequality;
External memory 630 is used to store data, accepts the visit of the data source of described grant access rights.
The storage system 600 of present embodiment can further include access agent 640, and the data source that is used to act on behalf of described grant access rights is sent request of access to described external memory, and its number equals the number of data source.In some embodiment, comprise cache module, the interaction data the when data source that is used for the described grant access rights of buffer memory is visited described external memory at access agent 640.Particularly, when write data is visited, earlier data portion is write metadata cache, ask access external memory again; Handle is read and is had little time to be write metadata cache by the data that data source is read away from external memory storage when read data is visited, the data of external memory storage and data source produce when having avoided external memory storage to be visited by the low speed data source and wait for and waste external memory storage bandwidth resources all by the buffer memory exchange.
The lower-priority data source that present embodiment has solved fixed priority arbitration algorithm and round-robin arbitration algorithm effectively is difficult to have access to the problem of external memory storage and timeslice waste, promotes the efficient of a plurality of data sources visit external memories effectively; Adopt the implementation structure of the cooperating of data source access agent and external memory storage moderator, defined the clear interface of data source arbitration agency, be convenient in different logical designs, seamlessly transplant with memory arbitrator; Use metadata cache, the transmission bandwidth of data source and the transmission bandwidth of external memory storage are complementary, effectively utilize the transmission bandwidth of external memory storage.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method, can instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-OnlyMemory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is specific embodiments of the invention; and be not intended to limit the scope of the invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.