Storage access control method and device

文档序号:1534987 发布日期:2020-02-14 浏览:22次 中文

阅读说明:本技术 一种存储访问控制方法和装置 (Storage access control method and device ) 是由 高宇 申航 陈二奇 于 2019-10-23 设计创作,主要内容包括:本公开提供了一种存储访问控制方法和装置,单位时间内,发生超时事件的数量超过预定义数量后,分别限定所述目标存储设备在不同后续时间段内,允许处理的访问请求的数量上限;当所述目标存储设备在任一划分出的时间段内接收的访问请求数量达到对应的允许处理的数量上限后,暂停处理后续访问请求。在存储设备的访问超时情况到达高峰后,开启针对该存储设备的访问保护,避免可能出现的短时访问高峰,有效防止大量并发访问导致的存储系统瘫痪。(The utility model provides a storage access control method and a device, which respectively limit the upper limit of the number of access requests allowed to be processed by the target storage device in different subsequent time periods after the number of overtime events exceeds the predefined number in unit time; and when the number of the access requests received by the target storage device in any divided time period reaches the corresponding upper limit of the number of the allowed processing, suspending the processing of the subsequent access requests. After the access overtime condition of the storage equipment reaches a peak, the access protection aiming at the storage equipment is started, the possible short-time access peak is avoided, and the storage system paralysis caused by a large number of concurrent accesses is effectively prevented.)

1. A storage access control method, comprising:

recording a detected timeout event occurring in a target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is timed out;

if the number of the recorded timeout events in the unit time exceeds the predefined number, taking the time that the number of the recorded timeout events exceeds the predefined number as an initial time point, dividing a plurality of continuous time periods in subsequent time periods of the initial time point, and respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

and when the number of the access requests received by the target storage device in any divided time period reaches the corresponding upper limit of the number of the allowed processing, controlling the target storage device to suspend processing of the subsequent access requests in the time period.

2. The storage access control method of claim 1, wherein said respectively defining an upper limit on the number of access requests that the target storage device is allowed to process during the divided different time periods comprises:

respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

for any time period, the shorter the time difference between the starting time of the time period and the initial time point, the lower the upper limit of the number of access requests allowed to be processed defined for the time period, and the longer the time difference between the starting time of the time period and the initial time point, the higher the upper limit of the number of access requests allowed to be processed defined for the time period.

3. The storage access control method of claim 1, wherein said dividing into successive time periods subsequent to the initial time point to define respective upper limits on the number of access requests the target storage device is allowed to process during the different divided time periods, comprises:

dividing two continuous time periods into a first protection time period and a second protection time period in a subsequent time period of the initial time point;

setting an upper limit of the number of access requests allowed to be processed by the target storage device to 0 in the first protection time period so that the target storage device suspends processing of the access requests in the first protection time period;

and in the second protection time period, setting the upper limit of the number of the access requests allowed to be processed by the target storage device to a specified number N so that the target storage device only processes the specified number of the access requests in the second protection time period, wherein N is a natural number greater than or equal to 1.

4. The storage access control method of claim 3, wherein the method further comprises:

within the second protection time period, when the number of the timeout events exceeds a predefined number, interrupting the protection process of the second protection time period;

and from the interruption time point, dividing the continuous first protection time period and the continuous second protection time period again in the subsequent time period, and executing the corresponding protection process again.

5. The storage access control method of claim 1, wherein said controlling the target storage device to suspend processing of subsequent access requests for the period of time comprises:

and in the time period, controlling the target equipment not to cache the subsequently received access request any more, and immediately returning an access timeout message to the corresponding process of the subsequent access request.

6. A storage access control apparatus, comprising:

the timeout recording unit is configured to record a timeout event occurring at a detected target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is exceeded;

an access limiting unit configured to divide a number of consecutive periods in a period subsequent to an initial point in time into a number of consecutive periods in a case where the number of the recorded timeout events per unit time exceeds a predefined number, the number of the recorded timeout events exceeding the predefined number, and to respectively define an upper limit on the number of access requests the target storage device is allowed to process in the divided different periods;

and the first execution unit is configured to control the target storage device to suspend processing of subsequent access requests in any divided time period after the number of the access requests received by the target storage device in the time period reaches the corresponding upper limit of the number of the allowed processing.

7. The storage access control device of claim 6, wherein the access limiting unit is to:

respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

for any time period, the shorter the time difference between the starting time of the time period and the initial time point, the lower the upper limit of the number of access requests allowed to be processed defined for the time period, and the longer the time difference between the starting time of the time period and the initial time point, the higher the upper limit of the number of access requests allowed to be processed defined for the time period.

8. The storage access control device of claim 6, wherein the access limiting unit is to:

dividing two continuous time periods into a first protection time period and a second protection time period in a subsequent time period of the initial time point;

setting an upper limit of the number of access requests allowed to be processed by the target storage device to 0 in the first protection time period so that the target storage device suspends processing of the access requests in the first protection time period;

and in the second protection time period, setting the upper limit of the number of the access requests allowed to be processed by the target storage device to a specified number N so that the target storage device only processes the specified number of the access requests in the second protection time period, wherein N is a natural number greater than or equal to 1.

9. The storage access control apparatus of claim 8, wherein the apparatus further comprises:

a second execution unit configured to interrupt a protection flow of the second protection period when the number of timeout events occurring exceeds a predefined number within the second protection period;

and from the interruption time point, dividing the continuous first protection time period and the continuous second protection time period again in the subsequent time period, and executing the corresponding protection process again.

10. The storage access control apparatus of claim 6, wherein the restriction execution unit is to:

and in the time period, controlling the target equipment not to cache the subsequently received access request any more, and immediately returning an access timeout message to the corresponding process of the subsequent access request.

11. A storage access control electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the storage access control method of any of claims 1 to 5.

12. A storage access control storage medium, characterized in that instructions in the storage medium, when executed by a processor of a storage access control electronic device, enable the storage access control electronic device to perform the storage access control method of any one of claims 1 to 5.

Technical Field

The present disclosure relates to the field of storage technologies, and in particular, to a storage access control method and apparatus.

Background

With the rapid development of computer technology, storage devices have also been developed as carriers for storing computer data, and with the proliferation of unstructured data volumes, storage devices often have short-term access peaks.

Due to the limited performance of the storage device, caching and processing overtime requests consume certain disk resources, when a part of access requests cannot be processed in time and overtime occurs, blocking is likely to occur, all subsequent access requests are processed overtime, a storage system is paralyzed, and the access requests cannot be processed normally.

Disclosure of Invention

In view of the foregoing technical problems, an embodiment of the present disclosure provides a storage access control method, and the technical solution is as follows:

according to a first aspect of the embodiments of the present disclosure, there is provided a storage access control method, including:

recording a detected timeout event occurring in a target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is timed out;

if the number of the recorded timeout events in the unit time exceeds the predefined number, taking the time that the number of the recorded timeout events exceeds the predefined number as an initial time point, dividing a plurality of continuous time periods in subsequent time periods of the initial time point, and respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

and when the number of the access requests received by the target storage device in any divided time period reaches the corresponding upper limit of the number of the allowed processing, controlling the target storage device to suspend processing of the subsequent access requests in the time period.

Optionally, the respectively defining an upper limit on the number of access requests allowed to be processed by the target storage device in the divided different time periods includes:

respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

for any time period, the shorter the time difference between the starting time of the time period and the initial time point, the lower the upper limit of the number of access requests allowed to be processed defined for the time period, and the longer the time difference between the starting time of the time period and the initial time point, the higher the upper limit of the number of access requests allowed to be processed defined for the time period.

Optionally, the dividing into a plurality of consecutive time periods in the time period subsequent to the initial time point, respectively defining an upper limit on the number of access requests allowed to be processed by the target storage device in the different divided time periods, includes:

dividing two continuous time periods into a first protection time period and a second protection time period in a subsequent time period of the initial time point;

setting an upper limit of the number of access requests allowed to be processed by the target storage device to 0 in the first protection time period so that the target storage device suspends processing of the access requests in the first protection time period;

and in the second protection time period, setting the upper limit of the number of the access requests allowed to be processed by the target storage device to a specified number N so that the target storage device only processes the specified number of the access requests in the second protection time period, wherein N is a natural number greater than or equal to 1.

Optionally, the storage access control method further includes:

within the second protection time period, when the number of the timeout events exceeds a predefined number, interrupting the protection process of the second protection time period;

and from the interruption time point, dividing the continuous first protection time period and the continuous second protection time period again in the subsequent time period, and executing the corresponding protection process again.

Optionally, the controlling the target storage device to suspend processing of a subsequent access request in the time period includes:

and in the time period, controlling the target equipment not to cache the subsequently received access request any more, and immediately returning an access timeout message to the corresponding process of the subsequent access request.

According to a second aspect of the embodiments of the present disclosure, there is provided a storage access control apparatus including:

the timeout recording unit is configured to record a timeout event occurring at a detected target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is exceeded;

an access limiting unit configured to divide a number of consecutive periods in a period subsequent to an initial point in time into a number of consecutive periods in a case where the number of the recorded timeout events per unit time exceeds a predefined number, the number of the recorded timeout events exceeding the predefined number, and to respectively define an upper limit on the number of access requests the target storage device is allowed to process in the divided different periods;

and the first execution unit is configured to control the target storage device to suspend processing of subsequent access requests in any divided time period after the number of the access requests received by the target storage device in the time period reaches the corresponding upper limit of the number of the allowed processing.

Optionally, the access limiting unit is configured to:

respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

for any time period, the shorter the time difference between the starting time of the time period and the initial time point, the lower the upper limit of the number of access requests allowed to be processed defined for the time period, and the longer the time difference between the starting time of the time period and the initial time point, the higher the upper limit of the number of access requests allowed to be processed defined for the time period.

Optionally, the access limiting unit is configured to:

dividing two continuous time periods into a first protection time period and a second protection time period in a subsequent time period of the initial time point;

setting an upper limit of the number of access requests allowed to be processed by the target storage device to 0 in the first protection time period so that the target storage device suspends processing of the access requests in the first protection time period;

and in the second protection time period, setting the upper limit of the number of the access requests allowed to be processed by the target storage device to a specified number N so that the target storage device only processes the specified number of the access requests in the second protection time period, wherein N is a natural number greater than or equal to 1.

Optionally, the storage access control apparatus further includes:

a second execution unit configured to interrupt a protection flow of the second protection period when the number of timeout events occurring exceeds a predefined number within the second protection period;

and from the interruption time point, dividing the continuous first protection time period and the continuous second protection time period again in the subsequent time period, and executing the corresponding protection process again.

Optionally, the restriction execution unit is configured to:

and in the time period, controlling the target equipment not to cache the subsequently received access request any more, and immediately returning an access timeout message to the corresponding process of the subsequent access request.

According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the storage access control method of the first aspect. :

according to a fourth aspect of embodiments of the present disclosure, there is provided a storage access control storage medium, wherein instructions that, when executed by a processor of a storage access control electronic device, enable the storage access control electronic device to perform the storage access control method according to the first aspect.

The embodiment of the disclosure provides a storage access control method and device. The utility model provides a storage access control method, which is characterized in that after the number of overtime events exceeds the predefined number in unit time, the upper limit of the number of access requests allowed to be processed by the target storage device in different subsequent time periods is respectively limited; and when the number of the access requests received by the target storage device in any divided time period reaches the corresponding upper limit of the number of the allowed processing, suspending the processing of the subsequent access requests. After the access overtime condition of the storage equipment reaches a peak, the access protection aiming at the storage equipment is started, the possible short-time access peak is avoided, and the storage system paralysis caused by a large number of concurrent accesses is effectively prevented.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of embodiments of the disclosure.

Moreover, any one of the embodiments of the present disclosure need not achieve all of the effects described above.

Drawings

In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.

FIG. 1 is a flow chart illustrating a method of memory access control according to an exemplary embodiment of the present disclosure;

FIG. 2 is another flow chart diagram of a method of memory access control according to an exemplary embodiment of the present disclosure;

FIG. 3 is a flow diagram illustrating a process for setting a two-segment protection flow for a target storage device in accordance with an exemplary embodiment of the present disclosure;

FIG. 4 is a flow chart illustrating a method for memory access control in a second segment of a protection flow according to an exemplary embodiment of the present disclosure;

FIG. 5 is a schematic diagram of a storage access control device shown in an exemplary embodiment of the present disclosure;

fig. 6 is a schematic diagram of an electronic device shown in an exemplary embodiment of the present disclosure.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.

With the rapid development of computer technology, storage devices have also been developed as carriers for storing computer data, and with the proliferation of unstructured data volumes, storage devices often have short-term access peaks.

Due to the limited performance of the storage device, caching and processing overtime requests consume certain disk resources, when a part of access requests cannot be processed in time and overtime occurs, blocking is likely to occur, all subsequent access requests are processed overtime, a storage system is paralyzed, and the access requests cannot be processed normally.

In view of the above problems, the present disclosure provides a storage access control method and a storage access control device to which the storage access control method is applied, which will be described first. Referring to fig. 1, the method comprises the following steps:

s101, recording a detected timeout event occurring in a target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is overtime;

the target storage device may be a storage device such as a disk, and the access request may be a read operation request or a write operation request of different processes to the target storage device.

In the existing magnetic disk storage mechanism, after receiving an access request for a magnetic disk, the access request needs to be added into a waiting queue first, and the access request of the waiting queue is scheduled through a magnetic disk scheduling algorithm.

In particular, in a distributed, etc. storage system, various processes may continually generate different requests for read/write operations to a disk. In some cases, the processes send requests faster than the disk responds, so a wait queue needs to be established for each disk device and the access requests in the wait queue are scheduled.

The commonly used disk scheduling algorithm includes: first come first served algorithm (FCFS), shortest seek time first algorithm (SSTF), scanning algorithm (SCAN), cyclic scanning algorithm (CSCAN), etc. Because different access requests need to specify different tracks on the disk, in order to efficiently process the access requests, different disk scheduling algorithms can determine the processing sequence of the different access requests according to parameters such as the track where the current head is located on the disk, the track closest to the current head, and the like.

Take the shortest seek time first algorithm (SSTF) as an example: the idea of the algorithm is as follows: the access request nearest to the current head is preferentially selected for service, and the seeking priority is mainly considered. The advantages are that: the average service time of the disk is improved. The disadvantages are that: may cause certain access requests to wait long periods of time without being serviced.

It can be known that, when the processing sequence of each access request in the disk wait queue is scheduled by using the disk scheduling algorithm, the processing resources of the disk are also consumed. Therefore, if the disk receives a large number of processing requests in a short time, it is likely that the access requests cannot be processed normally due to excessive consumption of processing resources, and the waiting access requests are timed out.

In this step, it is necessary to record a timeout event occurring in the access request received by the target storage device, and when the timeout event exceeds a certain number, it is determined that the target storage device enters a "processing peak time", and protection is opened when the "processing peak time" arrives.

S102, determining whether the number of the timeout events recorded per unit time exceeds a predefined number? If the number of the timeout events recorded in the unit time exceeds the predetermined number, executing step S103, and if the number of the timeout events recorded in the unit time does not exceed the predetermined number, returning to step S101 again;

s103, dividing a plurality of continuous time periods in the time period subsequent to the initial time point, and respectively limiting the upper limit of the number of access requests allowed to be processed by the target storage device in the divided different time periods;

specifically, the time in which the number of timeout events exceeds the predefined number in a unit time is taken as an initial time point, the initial time point is taken as a starting point of time, and a plurality of continuous time periods are divided in subsequent time periods.

In an alternative embodiment, after the number of recorded timeout events per unit time reaches a predefined number, the occurrence time point of the next timeout event is determined as an initial time point, and several consecutive time periods are divided in a time period subsequent to the initial time point.

For example, the following steps are carried out: setting the unit time as 60S and the predefined number as 20, determining the occurrence time point of the 21 st timeout event as an initial time point when the number of timeout events occurring reaches 21 in 60S, and dividing a plurality of continuous time periods in time subsequent to the initial time point, wherein the plurality of continuous time periods can be regarded as the protection time period of the target storage device.

Wherein, the following time can be divided into a plurality of continuous time periods according to a predetermined division strategy, and the predetermined division strategy may include: the number of divided consecutive time segments, the length of time of each consecutive time segment. For example, the following steps are carried out: three time periods can be divided in the subsequent time according to a preset division strategy, and the time lengths of the three time periods are respectively 20S, 20S and 10S.

After the division of the continuous time periods is finished, an upper limit of the number of the access requests allowed to be processed is respectively defined for each divided time period. The storage device is relieved of subsequent processing pressure, and the received access requests can be processed preferentially.

In an optional embodiment of the disclosure, the closer the subsequent time period is to the current time, the lower the upper limit of the number of access requests allowed to be processed is defined for it; the further the subsequent time period is from the current time, the higher the upper limit of the number of access requests allowed to be processed is defined for it.

By the limiting mode, the processing pressure of the access request of the target storage device in the processing peak period is firstly reduced as much as possible, the upper limit of the access request allowed to be processed by the target storage device is gradually increased along with the backward time, and the normal processing flow of the access request is recovered until the protection period is finished.

The overall access control flow of the storage device is illustrated as follows: setting unit time as 60S and predefined number as 20, and dividing three continuous time periods in a subsequent time period of the initial time point by taking a timeout time point of a 21 st timeout access request as the initial time point when the number of timeout events in 60S reaches 21, wherein the time lengths of the three time periods are respectively 20S, 20S and 10S;

setting the upper limit of the number of the access requests which are allowed to be processed by the target storage device to be 10 in 20S backward from the current time point; setting the upper limit of the number of the access requests which are allowed to be processed by the target storage device to be 20 within 20S-40S of the current time point; setting the upper limit of the number of the access requests which are allowed to be processed by the target storage device to be 40 within 40S-50S behind the current time point; after 50S later from the current time point, the upper limit of the number of access requests to be permitted to be processed is not set any more, and the normal processing flow is resumed.

And S104, when the number of the access requests received by the target storage device in any divided time period reaches the corresponding upper limit of the number of the allowed processing, controlling the target storage device to suspend processing of the subsequent access requests in the time period.

Specifically, when the number of access requests received in any divided time period reaches the corresponding upper limit of the number, the target storage device is controlled to suspend processing of subsequent access requests in the time period.

Wherein suspending processing of subsequent access requests may comprise: and no longer putting the subsequently received access request into a storage queue, and immediately returning an access timeout message to the corresponding process of the subsequent access request.

In one optional embodiment of the present disclosure, the subsequent access request may be processed by the current storage device continuously in case the timeout condition is resolved and the subsequent access request is not processed by other storage devices.

Referring to fig. 2, the present disclosure also provides a more specific storage access control method. The method comprises the following steps:

s201, recording a detected timeout event occurring in a target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is overtime;

s202, is the number of timeout events occurring within a predetermined unit time greater than a predefined number? If the number exceeds the predefined number, executing step S203, and if the number does not exceed the predefined number, returning to step S201;

s203, starting a two-stage protection process for the target storage device, and setting the upper limit of the access requests which can be processed by the target storage device to be a first number in the first stage protection process; in the second section of protection flow, setting the upper limit of the access requests which can be processed by the target storage device as a second number; wherein the first number is less than the second number.

S204, when the number of the access requests received by the target storage device in any section of the protection process reaches the corresponding upper limit of the number of the allowed processing, the subsequent access requests are suspended from processing.

Specifically, in the present embodiment, five parameters need to be set in advance:

the first parameter is: the unit time T has the following functions: continuously monitoring the target storage equipment, and starting a protection process aiming at the target disk when the number M of the access requests of the target storage equipment which are accumulated and overtime exceeds the number M in unit time T;

the second parameter is as follows: the number of overtime access requests M; the function is the same as above;

the third parameter is as follows: the first protection period T1 specifically functions as follows: after the protection flow for the target storage device is started, the number of subsequent access requests allowed to be processed by the storage device is limited to N1 within the subsequent time length T1 of the starting time point, so that the storage device can fully process the access requests already in the processing queue, and the hardware resource consumption generated by the storage device for scheduling the subsequent excess access requests is avoided.

The fourth parameter: the second protection period T2 specifically functions as: after the protection flow aiming at the target storage device is started, the number of the subsequent access requests allowed to be processed by the storage device is limited to N2 in the subsequent time length T1-T2 of the starting time point, so that the storage device can fully process the access requests already in the processing queue, and the hardware resource consumption generated by the storage device for scheduling the subsequent excess access requests is avoided.

The fifth parameter: an access request upper bound N1, which functions as above;

the sixth parameter: the request upper bound, N2, is accessed, which functions as above.

Wherein, reference parameter ranges can be respectively set for the six types of protection parameters, for example: the reference parameter range of the first parameter T is 60S-120S, the reference parameter range of the second parameter M is 10-20, the reference parameter range of the third parameter T1 is 10S-20S …, and so on.

In the actual application process, according to the specific performance of the disk and the current scene application requirements, a suitable value is selected from the reference parameter range of each parameter as the finally used parameter value.

For example, the following steps are carried out: when the performance of the disk a is good and the processing speed is high, the first parameter T may be set to 60S, and the second parameter M may be set to 20, that is, within the time 60S, after the disk a has overtime for 20 times of requests, the disk protection is started; when the performance of the disk B is poor and the processing speed is slow, the first parameter T may be set to 60S, and the second parameter N may be set to 10, that is, within the time 60S, after the disk B has 10 times of request timeout, the disk protection is started.

Setting reference parameter range can lead different performances, and different parameters can be selected by the disks in different working scenes, thus improving the processing speed as much as possible under the condition of avoiding the occurrence of access processing peak; meanwhile, an upper limit reference value and a lower limit reference value are provided for parameter setting, and the influence of over-high or over-low parameter setting on the disk protection effect is avoided.

Specifically, the storage access control method provided by the present disclosure may be applied to a distributed storage system, where a plurality of disks generally exist in the distributed storage system, and a set of different parameters may be set for each disk according to the above parameter setting manner, for the performance and application requirements of each disk in the system.

In an optional embodiment of the present disclosure, a set of default parameters may be set first, and in the use process of the disk, the parameter setting is adjusted in the reference parameter range according to the accessed condition of different disks, so as to determine the personalized parameter most suitable for each disk, and make the distributed storage system in a better operation state.

In an optional embodiment of the present disclosure, a visual image may be generated for the accessed condition of different disks, so that a user can adjust the protection parameter setting of the disk according to the visual image.

By way of example; taking the time information as a coordinate horizontal axis, and taking periodic interval time points (such as every 10S) as different coordinate points on the horizontal axis; taking the number information as a coordinate vertical axis, and taking the total access request number received by the storage device and the number of the overtime events as coordinate points on the vertical axis; and establishing a visual statistical image, wherein the visual statistical image is provided with two curves, namely a time variation curve of the access request totally received by the disk and a time variation curve of the overtime event.

Based on the visual statistical image, the user can correspondingly adjust each protection parameter of the disk according to the condition that the disk is accessed and the processing capacity of the access request. The disk is enabled to process more access requests without exceeding the processing capacity of the disk.

Referring to fig. 3, a specific manner of setting a two-stage protection process for a target storage device includes the following steps:

s301, starting from the protection starting time, dividing two continuous time periods into a first protection time period and a second protection time period in the subsequent time;

s302, in a first protection time period, setting an upper limit of the number of access requests allowed to be processed by the target storage device to 0, so that the target storage device suspends processing subsequent access requests in the first protection time period;

s303, in a second protection period, setting an upper limit of the number of access requests allowed to be processed by the target storage device to a specified number, so that the target storage device only processes the specified number of access requests in the second protection period.

In this embodiment, when the access request overtime in the unit time exceeds the predefined number and the target storage device enters the "storage peak period", the processing of all subsequent access requests is suspended directly in the first protection period, so that the target storage device can fully process the previously cached access requests.

In step S302, within the second protection duration of the second segment of protection flow, the following processing may be further performed, referring to fig. 4, including the following steps:

s3021, in a second protection period, when the number of timeout events exceeds a predefined number, interrupting a protection process of the second protection period;

and S3022, from the interruption time point, dividing the continuous first protection time period and the continuous second protection time period again in the subsequent time period, and executing the corresponding protection process again.

It can be seen that, according to the storage access control method provided by the embodiment of the present disclosure, when the processing capability of the storage device for the access request is about to reach the bottleneck, access protection for the storage device is started, so that a possible short-time access peak is avoided, and a storage system paralysis caused by a large number of concurrent accesses is effectively prevented.

Corresponding to the foregoing method embodiment, an embodiment of the present disclosure further provides a storage access control apparatus, and referring to fig. 5, the apparatus may include: a timeout recording unit 510, an access limiting unit 520 and a first execution unit 530.

The timeout recording unit is configured to record a timeout event occurring at a detected target storage device, wherein the timeout event is used for indicating that an access request initiated to the target storage device is exceeded;

an access limiting unit configured to divide a number of consecutive periods in a period subsequent to an initial point in time into a number of consecutive periods in a case where the number of the recorded timeout events per unit time exceeds a predefined number, the number of the recorded timeout events exceeding the predefined number, and to respectively define an upper limit on the number of access requests the target storage device is allowed to process in the divided different periods;

and the first execution unit is configured to control the target storage device to suspend processing of subsequent access requests in any divided time period after the number of the access requests received by the target storage device in the time period reaches the corresponding upper limit of the number of the allowed processing.

Further, the access limiting unit is specifically configured to:

respectively limiting the upper limit of the number of the access requests allowed to be processed by the target storage device in the divided different time periods;

for any time period, the shorter the time difference between the starting time of the time period and the initial time point, the lower the upper limit of the number of access requests allowed to be processed defined for the time period, and the longer the time difference between the starting time of the time period and the initial time point, the higher the upper limit of the number of access requests allowed to be processed defined for the time period.

Further, the access limiting unit is specifically configured to:

dividing two continuous time periods into a first protection time period and a second protection time period in a subsequent time period of the initial time point;

setting an upper limit of the number of access requests allowed to be processed by the target storage device to 0 in the first protection time period so that the target storage device suspends processing of the access requests in the first protection time period;

and in the second protection time period, setting the upper limit of the number of the access requests allowed to be processed by the target storage device to a specified number N so that the target storage device only processes the specified number of the access requests in the second protection time period, wherein N is a natural number greater than or equal to 1.

Further, the storage access control apparatus further includes: a second execution unit for executing the second execution unit,

a protection process configured to interrupt the second protection period when the number of timeout events occurring exceeds a predefined number within the second protection period;

and from the interruption time point, dividing the continuous first protection time period and the continuous second protection time period again in the subsequent time period, and executing the corresponding protection process again.

Further, the limitation execution unit is specifically configured to:

and in the time period, controlling the target equipment not to cache the subsequently received access request any more, and immediately returning an access timeout message to the corresponding process of the subsequent access request.

The embodiment of the present disclosure further provides an electronic device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the foregoing storage access control method when executing the program, and the method includes:

monitoring a target storage device, and counting access requests which are overtime on the target storage device;

after the number of the access requests which are overtime exceeds a predefined number in a preset unit time, dividing the subsequent time into a plurality of continuous time periods according to a preset dividing strategy, and respectively limiting the upper limit of the number of the access requests which can be processed by the target storage equipment in different subsequent time periods;

and rejecting subsequent access requests when the number of the access requests received by the target storage device in any divided time period reaches the corresponding processable number upper limit.

Fig. 6 shows a schematic block diagram of a master-based-side electronic device according to an exemplary embodiment of the present disclosure. Referring to fig. 6, at the hardware level, the electronic device includes a processor 602, an internal bus 604, a network interface 606, a memory 608 and a non-volatile memory 610, but may also include hardware required for other services. The processor 602 reads a corresponding computer program from the non-volatile memory 610 into the memory 602 and then runs the computer program, thereby forming a device for executing the storage access control method on a logical level. Of course, besides the software implementation, the present disclosure does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.

An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the foregoing storage access control method, and the method includes:

monitoring a target storage device, and counting access requests which are overtime on the target storage device;

after the number of the access requests which are overtime exceeds a predefined number in a preset unit time, dividing the subsequent time into a plurality of continuous time periods according to a preset dividing strategy, and respectively limiting the upper limit of the number of the access requests which can be processed by the target storage equipment in different subsequent time periods;

and rejecting subsequent access requests when the number of the access requests received by the target storage device in any divided time period reaches the corresponding processable number upper limit.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.

The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.

The foregoing is merely a detailed description of the embodiments of the disclosure, and it should be noted that modifications and decorations can be made by those skilled in the art without departing from the principle of the embodiments of the disclosure, and these modifications and decorations should also be regarded as the scope of protection of the embodiments of the disclosure.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:文件展示的实现方法、装置、系统、移动终端和显示终端

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类