Disk read-write control method, device, electronic equipment and storage medium

文档序号:1755009 发布日期:2019-11-29 浏览:5次 中文

阅读说明:本技术 硬盘读写控制方法、装置、电子设备及存储介质 (Disk read-write control method, device, electronic equipment and storage medium ) 是由 张宏海 余高峰 吴海波 严杰 于 2018-05-22 设计创作,主要内容包括:本发明实施例提供了硬盘读写控制方法、装置、电子设备及存储介质,该方法包括:若计算节点针对目标硬盘的操作状态为非允许状态,获取目标硬盘的令牌深度;判断目标硬盘的令牌深度与深度阈值的大小关系;若目标硬盘的令牌深度小于深度阈值,将计算节点针对目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加目标硬盘的令牌深度。在本发明实施例的硬盘读写控制方法中,根据目标硬盘的令牌深度判定目标硬盘是否还能够允许计算节点的访问,在目标硬盘的令牌深度小于深度阈值时,允许计算节点对目标硬盘进行相应的读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。(The embodiment of the invention provides disk read-write control method, device, electronic equipment and storage mediums, this method comprises: obtaining the token depth of target hard disk if the mode of operation that calculate node is directed to target hard disk is non-permitted state;Judge the token depth of target hard disk and the size relation of depth threshold;If the token depth of target hard disk is less than depth threshold, calculate node is changed to permission state for the mode of operation of target hard disk, and increase rule according to predetermined depth, increases the token depth of target hard disk.In the disk read-write control method of the embodiment of the present invention, determine whether target hard disk can also allow the access of calculate node according to the token depth of target hard disk, when the token depth of target hard disk is less than depth threshold, calculate node is allowed to carry out corresponding read-write operation to target hard disk, multiple calculate nodes may be implemented while accessing a hard disk, it can be improved the working efficiency of calculate node, to improve the operational efficiency of network entirety.)

1. a kind of disk read-write control method, which is characterized in that the described method includes:

It determines to the target hard disk where operation data;

The judgement request operation calculate node to operation data is directed to the mode of operation of the target hard disk;

If the calculate node is non-permitted state for the mode of operation of the target hard disk, the order of the target hard disk is obtained Board depth, wherein the token depth of the target hard disk is for characterizing occupied read-write resource in the target hard disk;

Judge the token depth of the target hard disk and the size relation of depth threshold;

If the token depth of the target hard disk is less than the depth threshold, by the calculate node for the target hard disk Mode of operation is changed to permission state, and increases rule according to predetermined depth, increases the token depth of the target hard disk.

2. the method according to claim 1, wherein in the judgement request operation meter to operation data After operator node is for the mode of operation of the target hard disk, the method also includes:

If the calculate node is permission state for the mode of operation of the target hard disk, pass through calculate node completion pair To the read-write operation of operation data in the target hard disk.

3. method according to claim 1 or 2, which is characterized in that the method also includes:

When the calculate node meets default token release rule, the calculate node is directed to the operation of the target hard disk Status Change is non-permitted state, and reduces rule according to predetermined depth, reduces the token depth of the target hard disk.

4. according to the method described in claim 3, it is characterized in that, judging whether the calculate node meets default token release The step of rule is as follows:

After the calculate node is completed to the read-write operation of the target hard disk or the calculate node is hard for the target The mode of operation of disk is to determine that the calculate node meets default token and releases when the time of permission state reaching preset time threshold Put rule.

5. the method according to claim 1, wherein in the token depth and depth of the judgement target hard disk It spends after the size relation of threshold value, the method also includes:

If the token depth of the target hard disk is not less than the depth threshold, forbid the calculate node to the target hard disk It is written and read.

6. the method according to claim 1, wherein in the token depth and depth of the judgement target hard disk It spends before the size relation of threshold value, the method also includes:

Determine the calculate node to described when operation data is written and read, the read-write of the occupied target hard disk Resource, as read-write resource to be used;

The read-write resource to be used is removed in total read-write resource of the target hard disk, obtains the depth threshold.

7. a kind of disk read-write control device, which is characterized in that described device includes:

Hard disk determining module, for determining to the target hard disk where operation data;

State determination module, for judging that the request operation calculate node to operation data is directed to the behaviour of the target hard disk Make state;

Depth obtains module, if being directed to the mode of operation of the target hard disk for the calculate node is non-permitted state, obtains Take the token depth of the target hard disk, wherein the token depth of the target hard disk is for characterizing quilt in the target hard disk The read-write resource of occupancy;

Threshold-discrimination module, for judging the token depth of the target hard disk and the size relation of depth threshold;

State demarcating module, if the token depth for the target hard disk is less than the depth threshold, by the calculate node It is changed to permission state for the mode of operation of the target hard disk, and increases rule according to predetermined depth, increases the target The token depth of hard disk.

8. device according to claim 7, which is characterized in that described device further include:

Operation allows module, if being directed to the mode of operation of the target hard disk for the calculate node is permission state, passes through The calculate node is completed to the read-write operation in the target hard disk to operation data.

9. device according to claim 7 or 8, which is characterized in that described device further include:

Depth release module, for when the calculate node meets default token release rule, the calculate node to be directed to The mode of operation of the target hard disk is changed to non-permitted state, and reduces rule according to predetermined depth, and it is hard to reduce the target The token depth of disk.

10. device according to claim 9, which is characterized in that the depth release module is specifically used for:

After the calculate node is completed to the read-write operation of the target hard disk or the calculate node is hard for the target The mode of operation of disk is that when the time of permission state reaching preset time threshold, the calculate node is directed to the target hard disk Mode of operation be changed to non-permitted state, and reduce rule according to predetermined depth, reduce the token depth of the target hard disk.

11. device according to claim 7, which is characterized in that described device further include:

Attendant exclusion module forbids the calculating if the token depth for the target hard disk is not less than the depth threshold Node is written and read the target hard disk.

12. device according to claim 7, which is characterized in that described device further include:

Resource determination module, for determine the calculate node to described when operation data is written and read, it is occupied The read-write resource of the target hard disk, as read-write resource to be used;

Threshold determination module is obtained for removing the read-write resource to be used in total read-write resource of the target hard disk The depth threshold.

13. a kind of electronic equipment, which is characterized in that including processor and memory;

The memory, for storing computer program;

The processor when for executing the program stored on the memory, realizes any side claim 1-6 Method step.

14. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-6 any method and step when the computer program is executed by processor.

Technical field

The present invention relates to reading and writing data technical field, more particularly to disk read-write control method, device, electronic equipment and Storage medium.

Background technique

SAN (Storage Area Network, storage area network) is a kind of by storage equipment, connection equipment and interface The storage network integrated, assumes responsibility for data store tasks.Pass through SCSI (Small Computer System in SAN Interface, small computer system interface) complete data transmission.SAS (Serial Attached SCSI, serial connection SCSI) it is SCSI technology of new generation, higher transmission speed is obtained by using serial technology, and by shortening connection Line is to improve inner space etc..

In related SAN network, each hard disk same time only allow a calculate node I/O (Input/Output, it is defeated Enter/export) operation, but with the rise of SAS technology, the quantity of calculate node is increased significantly in SAN network, each hard disk is same The phenomenon that one time only allowed the I/O operation of a calculate node, and a large amount of calculate nodes is caused to wait in line, meter is seriously affected The working efficiency of operator node, network overall operation efficiency are low.

Summary of the invention

Be designed to provide a kind of disk read-write control method, device, electronic equipment and the storage of the embodiment of the present invention are situated between Matter, to realize that raising network overall operation efficiency is low.Specific technical solution is as follows:

In a first aspect, the embodiment of the invention provides a kind of disk read-write control methods, which comprises

It determines to the target hard disk where operation data;

The judgement request operation calculate node to operation data is directed to the mode of operation of the target hard disk;

If the calculate node is non-permitted state for the mode of operation of the target hard disk, the target hard disk is obtained Token depth, wherein the token depth of the target hard disk is for characterizing occupied read-write resource in the target hard disk;

Judge the token depth of the target hard disk and the size relation of depth threshold;

It is if the token depth of the target hard disk is less than the depth threshold, the calculate node is hard for the target The mode of operation of disk is changed to permission state, and increases rule according to predetermined depth, increases the token depth of the target hard disk.

Optionally, the behaviour of the target hard disk is directed in the judgement request operation calculate node to operation data After making state, the method also includes:

If the calculate node is permission state for the mode of operation of the target hard disk, complete by the calculate node Read-write operation in the pairs of target hard disk to operation data.

Optionally, the disk read-write control method of the embodiment of the present invention further include:

When the calculate node meets default token release rule, by the calculate node for the target hard disk Mode of operation is changed to non-permitted state, and reduces rule according to predetermined depth, reduces the token depth of the target hard disk.

Optionally, in the disk read-write control method of the embodiment of the present invention, it is pre- to judge whether the calculate node meets If the step of token release rule is as follows:

After the calculate node is completed to the read-write operation of the target hard disk or the calculate node is directed to the mesh The mode of operation of mark hard disk is when the time of permission state reaching preset time threshold, to determine that the calculate node meets default enable Board release rule.

Optionally, described after the token depth of the judgement target hard disk and the size relation of depth threshold Method further include:

If the token depth of the target hard disk is not less than the depth threshold, forbid the calculate node to the target Hard disk is written and read.

Optionally, described before the token depth of the judgement target hard disk and the size relation of depth threshold Method further include:

Determine the calculate node to described when operation data is written and read, the occupied target hard disk Resource is read and write, as read-write resource to be used;

The read-write resource to be used is removed in total read-write resource of the target hard disk, obtains the depth threshold.

Second aspect, the embodiment of the invention provides a kind of disk read-write control device, described device includes:

Hard disk determining module, for determining to the target hard disk where operation data;

State determination module, for judging the request operation calculate node to operation data for the target hard disk Mode of operation;

Depth obtains module, if being non-permitted shape for the mode of operation that the calculate node is directed to the target hard disk State obtains the token depth of the target hard disk, wherein the token depth of the target hard disk is for characterizing the target hard disk In occupied read-write resource;

Threshold-discrimination module, for judging the token depth of the target hard disk and the size relation of depth threshold;

State demarcating module, if the token depth for the target hard disk is less than the depth threshold, by the calculating Node is changed to permission state for the mode of operation of the target hard disk, and regular according to predetermined depth increase, described in increase The token depth of target hard disk.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Operation allows module, if being permission state for the mode of operation that the calculate node is directed to the target hard disk, It is completed by the calculate node to the read-write operation in the target hard disk to operation data.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Depth release module is used for when the calculate node meets default token release rule, by the calculate node It is changed to non-permitted state for the mode of operation of the target hard disk, and reduces rule according to predetermined depth, reduces the mesh Mark the token depth of hard disk.

Optionally, the depth release module, is specifically used for:

After the calculate node is completed to the read-write operation of the target hard disk or the calculate node is directed to the mesh The mode of operation of mark hard disk is that when the time of permission state reaching preset time threshold, the calculate node is directed to the target The mode of operation of hard disk is changed to non-permitted state, and reduces rule according to predetermined depth, reduces the token of the target hard disk Depth.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Attendant exclusion module is forbidden described if the token depth for the target hard disk is not less than the depth threshold Calculate node is written and read the target hard disk.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Resource determination module, for determine the calculate node to described when operation data is written and read, it is shared The read-write resource of the target hard disk, as read-write resource to be used;

Threshold determination module, for removing the read-write resource to be used in total read-write resource of the target hard disk, Obtain the depth threshold.

The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor and memory;

The memory, for storing computer program;

The processor when for executing the program stored on the memory, realizes any institute of above-mentioned first aspect The disk read-write control method stated.

Fourth aspect, the embodiment of the invention provides a kind of storage medium, storage in the computer readable storage medium There is computer program, the computer program realizes any disk read-write control of above-mentioned first aspect when being executed by processor Method processed.

Disk read-write control method, device, electronic equipment and storage medium provided in an embodiment of the present invention are determined wait operate Target hard disk where data;Judgement request operation is directed to the mode of operation of target hard disk to the calculate node of operation data;If Calculate node is non-permitted state for the mode of operation of target hard disk, obtains the token depth of target hard disk, wherein target is hard The token depth of disk is for characterizing occupied read-write resource in target hard disk;Judge the token depth and depth threshold of target hard disk The size relation of value;If the token depth of target hard disk is less than depth threshold, calculate node is directed to the operation shape of target hard disk State is changed to permission state, and increases rule according to predetermined depth, increases the token depth of target hard disk.According to target hard disk Token depth determines whether target hard disk can also allow the access of calculate node, is less than depth in the token depth of target hard disk When threshold value, allows calculate node to carry out corresponding read-write operation to target hard disk, multiple calculate nodes may be implemented while accessing One hard disk, can be improved the working efficiency of calculate node, to improve the operational efficiency of network entirety.Certainly, implement this hair It is not absolutely required to reach above all advantages simultaneously for bright any product or method.

Detailed description of the invention

In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.

Fig. 1 is a kind of flow diagram of the disk read-write control method of the embodiment of the present invention;

Fig. 2 is a kind of schematic diagram of the data-storage system of the embodiment of the present invention;

Fig. 3 is another flow diagram of the disk read-write control method of the embodiment of the present invention;

Fig. 4 is a kind of schematic diagram of the disk read-write control device of the embodiment of the present invention;

Fig. 5 is the schematic diagram of the electronic equipment of the embodiment of the present invention.

Specific embodiment

Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.

In related SAN network, in order to guarantee hard disk bandwidth, each hard disk same time only allows the IO of a calculate node Operation, other calculate node needs for needing to read and write the hard disk are waited in line.But with the development of the technologies such as SAS, hard disk band Width greatly increases, while the quantity of calculate node also increases substantially in SAN network, and a hard disk same time only allows a meter Operator node carries out I/O operation, and the utilization efficiency for reducing hard disk is low, seriously affects SAN network overall operation speed.

In view of this, the embodiment of the invention provides a kind of disk read-write control methods, referring to Fig. 1, this method comprises:

S101 is determined to the target hard disk where operation data.

Disk read-write control method in the embodiment of the present invention can realize that control system is any energy by control system Enough realize the system of the disk read-write control method of the embodiment of the present invention.Such as:

Control system can be a kind of equipment, comprising: processor, memory, communication interface and bus;Processor, storage Device is connected by bus with communication interface and completes mutual communication;Memory stores executable program code;Processor is logical It crosses and reads in memory the executable program code that stores to run program corresponding with executable program code, for executing The disk read-write control method of the embodiment of the present invention.

Control system can also be a kind of application program, for executing the disk read-write control of the embodiment of the present invention at runtime Method processed.

Control system can also be a kind of storage medium, and for storing executable code, executable code is for executing sheet The disk read-write control method of inventive embodiments.

Control system can be determined according to the data requesting instructions of acquisition to the target hard disk where operation data, wherein Include the mark to operation data in data requesting instructions.Optionally, in data requesting instructions can also include request operation to The mark of the calculate node of operation data.

S102 judges that request operates the mode of operation that the above-mentioned calculate node to operation data is directed to above-mentioned target hard disk.

Control system judges that calculate node is directed to the mode of operation of target hard disk, and calculate node is directed to the operation of target hard disk State is permission state or non-permitted state.For example, control system establishes the mode of operation table of hard disk and calculate node, operating Each hard disk is directed in state table, recording needle is each calculate node of permission state to the mode of operation of the hard disk;Or it is operating Each calculate node is directed in state table, recording the calculate node for the mode of operation of which hard disk is permission state.It is optional , control system is calculate node, and the mode of operation being directed in the mode of operation table of control system including the calculate node is fair Perhaps the mark of each hard disk of state.

Control system can also be by judging whether calculate node holds the token of target hard disk to determine calculate node The no permission mode of operation in target hard disk determines that calculate node is directed to if calculate node holds the token of target hard disk The mode of operation of target hard disk is permission state;If calculate node does not hold the token of target hard disk, determine that calculate node is directed to The mode of operation of target hard disk is non-permitted state.

S103 obtains above-mentioned mesh if above-mentioned calculate node is non-permitted state for the mode of operation of above-mentioned target hard disk Mark the token depth of hard disk, wherein the token depth of above-mentioned target hard disk is for characterizing occupied reading in above-mentioned target hard disk Write resource.

Token depth is for characterizing occupied read-write resource in hard disk.Such as: the token depth of target hard disk can be The token depth of the occupied bandwidth of target hard disk or target hard disk can also be written and read target hard disk The quantity of calculate node.

S104 judges the token depth of above-mentioned target hard disk and the size relation of depth threshold.

It is deep when the token depth of target hard disk is the quantity for the calculate node being written and read to target hard disk Degree threshold value can be set in advance, and the setting of depth threshold will guarantee to meet at least two calculate nodes while access one A hard disk, for example, depth threshold can be set as 2,3,4 or 5 etc..

Depth threshold can also be obtained according to Resource Calculations such as the bandwidth of target hard disk.Optionally, above-mentioned in above-mentioned judgement Before the token depth of target hard disk and the size relation of depth threshold, the disk read-write control method of the embodiment of the present invention is also wrapped It includes:

Step 1, determine above-mentioned calculate node to above-mentioned when operation data is written and read, occupied above-mentioned mesh The read-write resource for marking hard disk, as read-write resource to be used.

Control system determines that calculate node executes when the read-write operation of operation data for target hard disk, needs to be used The read-write resource of target hard disk, i.e., read-write resource to be used.

Step 2 removes above-mentioned read-write resource to be used in total read-write resource of above-mentioned target hard disk, obtains above-mentioned depth Spend threshold value.

Control system removes above-mentioned read-write resource to be used on the basis of target hard disk always reads and writes resource, will be remaining Resource is as depth threshold.For example, the total bandwidth of target hard disk is 100MB (MByte/ Mbytes)/second, calculate node executes number Hard disk bandwidth needed for read-write operation according to request instruction is 20MB/ seconds, then depth threshold is 100-20=80MB/ seconds.

In the present invention is implemented, it according to operation data, determines depth threshold, can make full use of the read-write money of hard disk Source.

S105, if the token depth of above-mentioned target hard disk is less than above-mentioned depth threshold, by above-mentioned calculate node for above-mentioned The mode of operation of target hard disk is changed to permission state, and increases rule according to predetermined depth, increases the order of above-mentioned target hard disk Board depth.

Target hard disk token depth be less than depth threshold when, by calculate node for target hard disk mode of operation by Non-permitted Status Change is permission state, for example, calculate node is enabled to hold the token of target hard disk;Increase simultaneously according to predetermined depth Add rule, increases the token depth of target hard disk.Mode of operation for target hard disk is that the calculate node of permission state can Target hard disk is written and read.

Predetermined depth increases rule can be with are as follows: in the calculate node that the mode of operation for target hard disk is non-permitted state In, when often thering is a calculate node to change permission state for the mode of operation of the target hard disk, in the current order of target hard disk Increase the token depth of calculate node occupancy on the basis of board depth.For example, the token depth in target hard disk is right It when the quantity for the calculate node that target hard disk is written and read, can set: in the mode of operation for target hard disk to be non- In the calculate node of permission state, when often thering is a calculate node to change permission state for the mode of operation of the target hard disk, Increase by 1 on the basis of the current token depth of target hard disk.For example, being the occupied bandwidth of target hard disk in token depth When, it can set: in the mode of operation for target hard disk often to have a calculate node in the calculate node of non-permitted state For the target hard disk mode of operation change permission state when, on the basis of the current token depth of target hard disk increase should The bandwidth etc. that calculate node occupies.

In embodiments of the present invention, determine whether target hard disk can also allow to calculate according to the token depth of target hard disk The access of node allows calculate node to execute target hard disk corresponding when the token depth of target hard disk is less than depth threshold Read-write operation, may be implemented multiple calculate nodes and meanwhile access a hard disk, can be improved the working efficiency of calculate node, from And improve the operational efficiency of network entirety.

Optionally, the behaviour that the above-mentioned calculate node to operation data is directed to above-mentioned target hard disk is operated in above-mentioned judgement request After making state, the above method further include:

If above-mentioned calculate node is permission state for the mode of operation of above-mentioned target hard disk, complete by above-mentioned calculate node Read-write operation in pairs of above-mentioned target hard disk to operation data.

If calculate node is permission state for the mode of operation of above-mentioned target hard disk, for example, calculate node holds target The token of hard disk, then allow calculate node to be written and read target hard disk.

In embodiments of the present invention, when calculate node is in the permission mode of operation of target hard disk, pass through calculate node Target hard disk is written and read according to data requesting instructions, multiple calculate nodes may be implemented while accessing a hard disk, It can be improved the working efficiency of calculate node, to improve the operational efficiency of network entirety.

Optionally, the disk read-write control method of the embodiment of the present invention further include:

When above-mentioned calculate node meets default token release rule, by above-mentioned calculate node for above-mentioned target hard disk Mode of operation is changed to non-permitted state, and reduces rule according to predetermined depth, reduces the token depth of above-mentioned target hard disk.

Default token release rule can be set according to actual needs, optionally, whether judge above-mentioned calculate node The step for meeting default token release rule is as follows:

After above-mentioned calculate node is completed to the read-write operation of above-mentioned target hard disk or above-mentioned calculate node is directed to above-mentioned mesh The mode of operation of mark hard disk is when the time of permission state reaching preset time threshold, to determine that above-mentioned calculate node meets default enable Board release rule.

Preset time threshold can be set according to the actual situation, for example, being set as 1 second, 5 seconds or 10 seconds etc..It is counting When operator node meets default token release rule, the mode of operation by the calculate node for target hard disk is changed to non-permitted shape State, and discharge the token depth of the target hard disk of calculate node occupancy.

Predetermined depth reduces the rule that rule is any token depth for reducing target hard disk, can be set as: being directed to The mode of operation of target hard disk is often to have a calculate node to be directed to the operation shape of target hard disk in the calculate node of permission state When state is changed to non-permitted state, the token of calculate node release is subtracted on the basis of the current token depth of target hard disk Depth.For example, when the token depth of target hard disk is the quantity for the calculate node being written and read to target hard disk, It can set: in the mode of operation for target hard disk often to there is a calculate node to be directed in the calculate node of permission state When the mode of operation of target hard disk is changed to non-permitted state, subtract 1 on the basis of the current token depth of target hard disk.Example Such as, it is the occupied bandwidth of target hard disk in token depth, can sets: in the mode of operation for target hard disk to allow shape In the calculate node of state, when often thering is a calculate node to be changed to non-permitted state for the mode of operation of target hard disk, in mesh The bandwidth etc. of calculate node occupancy is subtracted on the basis of the current token depth of mark hard disk.

In embodiments of the present invention, when calculate node meets default token release rule, calculate node is directed to target The mode of operation of hard disk is changed to non-permitted state, and reduces rule according to predetermined depth, reduces the token depth of target hard disk, It ensure that the release of hard disk token, to guarantee that new calculate node has an opportunity to be written and read target hard disk.

Optionally, above-mentioned after the token depth of the above-mentioned target hard disk of above-mentioned judgement and the size relation of depth threshold Method further include:

If the token depth of above-mentioned target hard disk is not less than above-mentioned depth threshold, forbid above-mentioned calculate node to above-mentioned target Hard disk is written and read.

In embodiments of the present invention, it is not less than depth threshold in the token depth of target hard disk, forbids calculate node to mesh Mark hard disk is written and read, and ensure that the bandwidth for the calculate node being written and read to target hard disk.

The embodiment of the invention also provides a kind of data-storage systems, and referring to fig. 2, above-mentioned data-storage system is cluster point Cloth storage system, each computing resource of calculate node be it is distributed, the data storage resource hard disk of memory node is also point Cloth, it is routed by single or multiple SAS switch networks, mutually as it can be seen that each calculate node can also be between each calculate node See each hard disk.

Calculate node includes: software-service application layer, software-IO flow management layer, software-SAS-HBA driving layer, hardware Mainboard and SAS-HBA card etc..

Software-service application layer: for realizing various computer application softwares, the read-write requests of data storage, hair are initiated Rise or response data communication request.

Software-IO flow management layer: for will be polymerize or split from software-service application layer data, after group packet It is sent to software-SAS-HBA (Host Bus Adapter, host bus adaptor) driving layer, and software-SAS-HBA is driven The dynamic data packet back fed back is to software-service application layer.

Software-SAS-HBA drives layer: when for as originating end, IO stream being sent to hard disk, or IO stream is sent to mesh End calculate node;When holding as a purpose, the IO that response originating end calculate node is sent flows request, soft through this calculate node Part-IO flow management layer passes to the software-service application layer of this calculate node.

Hardware mainboard and SAS-HBA card: being the particular hardware resource for load capacity calculation node, including hardware mainboard, place Manage device and SAS-HBA card etc..

SAS switch: being responsible for the hardware device of SAS IO routing, and software program has recorded the number of the embodiment of the present invention According to the address the SAS routing table of SAS devices all in storage system, SAS IO exchange may be implemented.

SAS expander: being the hardware device of memory node, can extend connection muti-piece hard disk, the software journey of SAS expander Sequence has recorded the address the SAS routing table of all SAS devices in the data-storage system of the embodiment of the present invention, can control SAS IO Exchange.

The data-storage system of the embodiment of the present invention, the data that calculate node and hard disk both may be implemented are transmitted, can also be with The data transmission between each calculate node is realized, to realize cluster communication.Distributed management is used to calculate node, works as part When calculate node is lost because of reasons such as crash, other calculate nodes do not need the switching for doing storing data, it is only necessary to average adapter tube Lose the hard disc data storage resource that node manages above, and the traffic very little of the information for triggering average adapter tube.It is right Hard disk carries out distributed management, when hard disk causes the resource of the hard disk to be lost due to power-down and other reasons, the case where meeting redundancy Under, for example, calculate node is based on RAID (Redundant Arrays of Independent Disks, disk array) data Redundancy backup principle, the data of the hard disk of reconstruction of lost enhance redundancy ability into other hard disks.

Based on above-mentioned data-storage system, referring to Fig. 3, the disk read-write control method of the embodiment of the present invention includes:

S301 periodically acquires data requesting instructions.

For each calculate node, the software-SAS-HBA of the calculate node drives the HBA queue of layer periodic queries, example Such as, software-SAS-HBA drives layer every the HBA queue of 10 milliseconds of polls, and it is hard to be sent to target for acquisition from HBA queue The data requesting instructions of disk.

S302, judges whether calculate node holds the token of target hard disk, if the token for holding target hard disk executes S306, If the token for not holding target hard disk executes S303.

Software-SAS-HBA driving layer judges whether the calculate node holds the token of target hard disk.

S303 sends token application request to the SAS switch where target hard disk, so that the SAS where target hard disk Expander returns to the current token depth of target hard disk.

Software-SAS-HBA drives layer, by SAS-HBA card and SAS switch etc., to the SAS extension where target hard disk Device sends token application request.SAS expander is after receiving token application request, to the calculating section for sending token application request Point returns to the current token depth of target hard disk.

S304 judges the size of target hard disk current token depth and depth threshold, if the token that target hard disk is current Depth is less than depth threshold and executes S305, otherwise returns to S301 and continues to execute.

After the software-SAS-HBA driving layer of the calculate node gets the current token depth of target hard disk, compare mesh The size of hard disk current token depth and depth threshold is marked, the setting of depth threshold will guarantee to meet at least two calculating Node accesses a hard disk simultaneously.If the current token depth of target hard disk is greater than or equal to depth threshold, data are not executed and are asked It asks instruction to be directed to the read-write operation of target hard disk, returns and execute S301, i.e., in next period, reacquire request of data and refer to It enables.

S305 obtains the token success of target hard disk, returns to token to the SAS expander where target hard disk and obtain successfully Instruction, so that SAS expander obtains the token depth that successfully instruction increases target hard disk according to token.

When the current token depth of target hard disk is less than depth threshold, determine that the calculate node obtains the order of target hard disk Board success, software-SAS-HBA drive layer by SAS-HBA card and SAS switch etc. to the SAS expander where target hard disk Transmission token, which obtains, successfully to be instructed, wherein token obtains the token success that successfully instruction characterization obtains target hard disk.SAS extension Device increases rule according to predetermined depth, increases the token depth of target hard disk, example after receiving token and obtaining successfully instruction Such as, the token depth of target hard disk is increased by 1.

S306 sends read write command to target hard disk, to be written and read.

Software-SAS-HBA driving layer is issued to target hard disk for carrying out by SAS-HBA card and SAS switch etc. The read write command of read-write operation, to complete the read-write operation to target hard disk, which can be data requesting instructions, It can be the instruction for being different from data requesting instructions.

S307, judges whether the calculate node meets default token release rule, holds if meeting default token release rule Row S308.

Judge whether the calculate node meets default token release rule, is executed if meeting default token release rule S308 is returned if being unsatisfactory for default token release rule and is executed S301.Default token release rule can according to actual needs into Row setting, for example, when the calculate node is completed to the read-write operation of target hard disk or the calculate node holds target hard disk When the time of token reaches preset time threshold, determine that the calculate node meets default token release rule.

S308 discharges the token of target hard disk, and sends token to the SAS expander where target hard disk and release order, So that the SAS expander where target hard disk releases order according to token, the token depth of target hard disk is reduced.

When calculate node meets default token release rule, the token of target hard disk is discharged, even the calculate node is not Hold the token of target hard disk again.Software-SAS-HBA drives layer by SAS-HBA card and SAS switch etc. to target hard disk institute SAS expander send token release order, wherein token release order characterization release target hard disk token.SAS extension Device reduces rule after receiving token and releasing order, according to predetermined depth, reduces the token depth of target hard disk, for example, will The token depth minus 1 of target hard disk.

In embodiments of the present invention, in the token by distributing hard disk for calculate node, multiple calculate nodes may be implemented A hard disk is accessed simultaneously, can be improved the working efficiency of calculate node, to improve the operational efficiency of network entirety.

The embodiment of the invention also provides a kind of disk read-write control devices, and referring to fig. 4, which includes:

Hard disk determining module 401, for determining to the target hard disk where operation data;

State determination module 402, for judging that request operates the above-mentioned calculate node to operation data for above-mentioned target The mode of operation of hard disk;

Depth obtains module 403, if being non-permitted for the mode of operation that above-mentioned calculate node is directed to above-mentioned target hard disk State obtains the token depth of above-mentioned target hard disk, wherein the token depth of above-mentioned target hard disk is hard for characterizing above-mentioned target Occupied read-write resource in disk;

Threshold-discrimination module 404, for judging the token depth of above-mentioned target hard disk and the size relation of depth threshold;

State demarcating module 405, if the token depth for above-mentioned target hard disk is less than above-mentioned depth threshold, by above-mentioned meter Operator node is changed to permission state for the mode of operation of above-mentioned target hard disk, and regular according to predetermined depth increase, in increase State the token depth of target hard disk.

In embodiments of the present invention, determine whether target hard disk can also allow to calculate according to the token depth of target hard disk The access of node allows calculate node to execute target hard disk corresponding when the token depth of target hard disk is less than depth threshold Read-write operation, may be implemented multiple calculate nodes and meanwhile access a hard disk, can be improved the working efficiency of calculate node, from And improve the operational efficiency of network entirety.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Operation allows module, if being permission state for the mode of operation that above-mentioned calculate node is directed to above-mentioned target hard disk, It is completed by above-mentioned calculate node to the read-write operation in above-mentioned target hard disk to operation data.

In embodiments of the present invention, when calculate node is in the permission mode of operation of target hard disk, pass through calculate node Target hard disk is written and read according to data requesting instructions, multiple calculate nodes may be implemented while accessing a hard disk, It can be improved the working efficiency of calculate node, to improve the operational efficiency of network entirety.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Depth release module is used for when above-mentioned calculate node meets default token release rule, by above-mentioned calculate node It is changed to non-permitted state for the mode of operation of above-mentioned target hard disk, and reduces rule according to predetermined depth, reduces above-mentioned mesh Mark the token depth of hard disk.

Optionally, in the disk read-write control device of the embodiment of the present invention, above-mentioned depth release module is specifically used for:

After above-mentioned calculate node is completed to the read-write operation of above-mentioned target hard disk or above-mentioned calculate node is directed to above-mentioned mesh The mode of operation of mark hard disk is that when the time of permission state reaching preset time threshold, above-mentioned calculate node is directed to above-mentioned target The mode of operation of hard disk is changed to non-permitted state, and reduces rule according to predetermined depth, reduces the token of above-mentioned target hard disk Depth.

In embodiments of the present invention, when calculate node meets default token release rule, calculate node is directed to target The mode of operation of hard disk is changed to non-permitted state, and reduces rule according to predetermined depth, reduces the token depth of target hard disk, It ensure that the release of hard disk token, to guarantee that new calculate node has an opportunity to be written and read target hard disk.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Attendant exclusion module is forbidden above-mentioned if the token depth for above-mentioned target hard disk is not less than above-mentioned depth threshold Calculate node is written and read above-mentioned target hard disk.

In embodiments of the present invention, it is not less than depth threshold in the token depth of target hard disk, forbids calculate node to mesh Mark hard disk is written and read, and ensure that the bandwidth for the calculate node being written and read to target hard disk.

Optionally, the disk read-write control device of the embodiment of the present invention further include:

Resource determination module, for determine above-mentioned calculate node to above-mentioned when operation data is written and read, it is shared The read-write resource of above-mentioned target hard disk, as read-write resource to be used;

Threshold determination module, for removing above-mentioned read-write resource to be used in total read-write resource of above-mentioned target hard disk, Obtain above-mentioned depth threshold.

In the present invention is implemented, it according to operation data, determines depth threshold, can make full use of the read-write money of hard disk Source.

The embodiment of the invention also provides a kind of electronic equipment, referring to Fig. 5, including processor 501 and memory 502;

Above-mentioned memory 502, for storing computer program;

Above-mentioned processor 501 when for executing the program stored on above-mentioned memory 502, realizes following steps:

It determines to the target hard disk where operation data;

Judgement request operates the mode of operation that the above-mentioned calculate node to operation data is directed to above-mentioned target hard disk;

If above-mentioned calculate node is non-permitted state for the mode of operation of above-mentioned target hard disk, above-mentioned target hard disk is obtained Token depth, wherein the token depth of above-mentioned target hard disk is for characterizing occupied read-write resource in above-mentioned target hard disk;

Judge the token depth of above-mentioned target hard disk and the size relation of depth threshold;

It is if the token depth of above-mentioned target hard disk is less than above-mentioned depth threshold, above-mentioned calculate node is hard for above-mentioned target The mode of operation of disk is changed to permission state, and increases rule according to predetermined depth, increases the token depth of above-mentioned target hard disk.

In embodiments of the present invention, determine whether target hard disk can also allow to calculate according to the token depth of target hard disk The access of node allows calculate node to execute target hard disk corresponding when the token depth of target hard disk is less than depth threshold Read-write operation, may be implemented multiple calculate nodes and meanwhile access a hard disk, can be improved the working efficiency of calculate node, from And improve the operational efficiency of network entirety.

Optionally, the electronic equipment of the embodiment of the present invention further include: communication interface and communication bus, wherein processor 501, communication interface, memory 502 completes mutual communication by communication bus.

Optionally, above-mentioned processor 501, when for executing the program stored on above-mentioned memory 502, additionally it is possible to realize Any of the above-described disk read-write control method.

The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.

Communication interface is for the communication between above-mentioned electronic equipment and other equipment.

Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.

Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.

The embodiment of the invention also provides a kind of computer readable storage medium, stored in the computer readable storage medium There is computer program, upper computer program realizes following steps when being executed by processor:

It determines to the target hard disk where operation data;

Judgement request operates the mode of operation that the above-mentioned calculate node to operation data is directed to above-mentioned target hard disk;

If above-mentioned calculate node is non-permitted state for the mode of operation of above-mentioned target hard disk, above-mentioned target hard disk is obtained Token depth, wherein the token depth of above-mentioned target hard disk is for characterizing occupied read-write resource in above-mentioned target hard disk;

Judge the token depth of above-mentioned target hard disk and the size relation of depth threshold;

It is if the token depth of above-mentioned target hard disk is less than above-mentioned depth threshold, above-mentioned calculate node is hard for above-mentioned target The mode of operation of disk is changed to permission state, and increases rule according to predetermined depth, increases the token depth of above-mentioned target hard disk.

In embodiments of the present invention, determine whether target hard disk can also allow to calculate according to the token depth of target hard disk The access of node allows calculate node to execute target hard disk corresponding when the token depth of target hard disk is less than depth threshold Read-write operation, may be implemented multiple calculate nodes and meanwhile access a hard disk, can be improved the working efficiency of calculate node, from And improve the operational efficiency of network entirety.

Optionally, being stored in above-mentioned computer readable storage medium can also be real when computer program is executed by processor Existing any of the above-described disk read-write control method.

It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.

Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.

The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据存储系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类