[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2019223445A1 - Hard disk read-write control method and apparatus, electronic device and storage medium - Google Patents

Hard disk read-write control method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2019223445A1
WO2019223445A1 PCT/CN2019/082262 CN2019082262W WO2019223445A1 WO 2019223445 A1 WO2019223445 A1 WO 2019223445A1 CN 2019082262 W CN2019082262 W CN 2019082262W WO 2019223445 A1 WO2019223445 A1 WO 2019223445A1
Authority
WO
WIPO (PCT)
Prior art keywords
hard disk
target hard
depth
computing node
token
Prior art date
Application number
PCT/CN2019/082262
Other languages
French (fr)
Chinese (zh)
Inventor
张宏海
余高峰
吴海波
严杰
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2019223445A1 publication Critical patent/WO2019223445A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Definitions

  • the present application relates to the technical field of data reading and writing, and in particular, to a hard disk reading and writing control method, device, electronic device, and storage medium.
  • SAN Storage Area Network
  • SCSI Serial Computer System Interface
  • SAS Serial Attached SCSI, Serial Attached SCSI
  • SCSI Serial Attached SCSI
  • each hard disk allows only one I / O (Input / Output) operation of a computing node at the same time.
  • I / O Input / Output
  • the hard disk allows only one computing node's IO operations at the same time, causing a large number of computing nodes to queue up, which seriously affects the computing node's working efficiency and the overall network operation efficiency is low.
  • the present application provides a hard disk read-write control method, device, electronic device, and storage medium, so as to achieve low overall operating efficiency.
  • the specific technical solutions are as follows:
  • an embodiment of the present application provides a hard disk read-write control method.
  • the method includes:
  • the method further includes:
  • the hard disk read-write control method in the embodiment of the present application further includes:
  • the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk.
  • the steps of determining whether the computing node satisfies a preset token release rule are as follows:
  • the method further includes:
  • the computing node is prohibited from performing read and write operations on the target hard disk.
  • the method further includes:
  • the read and write resources to be used are removed from the total read and write resources of the target hard disk to obtain the depth threshold.
  • an embodiment of the present application provides a hard disk read-write control device, where the device includes:
  • a hard disk determining module for determining a target hard disk where the data to be operated is located
  • a state determination module configured to determine an operation state of a computing node requesting operation of the data to be operated on the target hard disk
  • a depth acquisition module configured to obtain a token depth of the target hard disk if the operation status of the computing node for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to characterize the target; Read and write resources occupied on the hard disk;
  • a threshold determination module configured to determine a magnitude relationship between a token depth of the target hard disk and a depth threshold
  • a state calibration module configured to change the operation state of the computing node for the target hard disk to an allowed state if the token depth of the target hard disk is less than the depth threshold, and add the preset depth increase rule to increase the The token depth of the target hard disk.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • An operation permission module is configured to complete the reading and writing of data to be operated on the target hard disk by the computing node if the operation status of the computing node for the target hard disk is allowed.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • a deep release module is configured to change an operation state of the computing node for the target hard disk to a non-permitted state when the computing node meets a preset token release rule, and reduce the rule according to a preset depth reduction rule to reduce the The token depth of the target hard disk.
  • the deep release module is specifically configured to:
  • the computing node After the computing node completes the read and write operations on the target hard disk, or when the time when the operation status of the computing node for the target hard disk is allowed to reach a preset time threshold, the computing node is The operating state of the target hard disk is changed to a non-permitted state, and the token depth of the target hard disk is reduced according to a preset depth reduction rule.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • An operation prohibition module is configured to prohibit the computing node from performing read and write operations on the target hard disk if the token depth of the target hard disk is not less than the depth threshold.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • a resource determining module configured to determine the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the data to be operated, as the read and write resources to be used;
  • a threshold determination module is configured to remove the read-write resources to be used from the total read-write resources of the target hard disk to obtain the depth threshold.
  • an embodiment of the present application provides an electronic device, including a processor and a memory;
  • the memory is used to store a computer program
  • the processor is configured to implement the hard disk read-write control method according to any one of the first aspects when executing a program stored in the memory.
  • an embodiment of the present application provides a storage medium.
  • the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the hard disk read or write according to any one of the first aspects is implemented. Control Method.
  • the hard disk read-write control method, device, electronic device and storage medium determine the target hard disk where the data to be operated is located; determine the operation status of the computing node requesting the operation of the data to be operated against the target hard disk; The operating status of the hard disk is non-permitted, and the token depth of the target hard disk is obtained.
  • the token depth of the target hard disk is used to represent the read and write resources occupied by the target hard disk.
  • the token depth and the depth threshold of the target hard disk are determined. Relationship; if the token depth of the target hard disk is less than the depth threshold, the operation state of the computing node for the target hard disk is changed to an allowed state, and the token depth of the target hard disk is increased according to a preset depth increase rule.
  • the token depth of the target hard disk determine whether the target hard disk can still allow access to the computing node.
  • the token depth of the target hard disk is less than the depth threshold, allow the computing node to perform corresponding read and write operations on the target hard disk, which can implement multiple computing nodes. Accessing a hard disk at the same time can improve the working efficiency of the computing node, thereby improving the overall operating efficiency of the network.
  • the implementation of any product or method of this application does not necessarily need to achieve all the above advantages at the same time.
  • FIG. 1 is a schematic flowchart of a hard disk read-write control method according to an embodiment of the present application
  • FIG. 2a is a schematic diagram of a data storage system according to an embodiment of the present application.
  • FIG. 2b is another schematic diagram of a data storage system according to an embodiment of the present application.
  • FIG. 3 is another schematic flowchart of a hard disk read-write control method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a hard disk read-write control device according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • each hard disk allows only one computing node's IO operations at the same time, and other computing nodes that need to read and write the hard disk need to wait in line.
  • the bandwidth of hard disks has increased greatly.
  • the number of computing nodes in the SAN network has also increased significantly.
  • a hard disk allows only one compute node to perform IO operations at the same time, which reduces the utilization efficiency of hard disks and seriously affects SAN The overall speed of the network.
  • an embodiment of the present application provides a hard disk read-write control method. Referring to FIG. 1, the method includes:
  • the hard disk read-write control method in the embodiment of the present application can be implemented by a control system, and the control system is any system capable of realizing the hard disk read-write control method in the embodiment of the present application.
  • the control system is any system capable of realizing the hard disk read-write control method in the embodiment of the present application.
  • the control system may be a kind of equipment, including: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected through a bus and complete communication with each other; the memory stores executable program code; and the processor reads the memory by The executable program code stored in the program is used to run a program corresponding to the executable program code, and is used to execute the hard disk read-write control method in the embodiment of the present application.
  • the control system may also be an application program for executing the hard disk read-write control method in the embodiment of the present application at runtime.
  • the control system may also be a storage medium for storing executable code, and the executable code is used to execute the hard disk read-write control method in the embodiment of the present application.
  • the control system may determine the target hard disk where the data to be operated is located according to the acquired data request instruction, wherein the data request instruction includes an identifier of the data to be operated.
  • the data request instruction may further include an identification of a computing node requesting operation of the data to be operated.
  • the control system determines the operating state of the computing node with respect to the target hard disk, and the operating state of the computing node with respect to the target hard disk is an allowed state or an unallowed state. For example, the control system establishes an operation status table of the hard disk and the computing node, and for each hard disk in the operating status table, records each computing node whose operating status is allowed for the hard disk; or for each computing node in the operating status table To record which hard disks' operation status is allowed for this compute node.
  • the control system is a computing node, and the operation state table of the control system includes an identification of each hard disk targeted by the computing node for an operating state that is allowed.
  • the control system can also determine whether the computing node is in the allowed operating state of the target hard disk by judging whether the computing node holds the token of the target hard disk. If the computing node holds the token of the target hard disk, determine the operating status of the computing node for the target hard disk. It is an allowed state; if the computing node does not hold the token of the target hard disk, it is determined that the operating state of the computing node for the target hard disk is a non-permitted state.
  • the token depth of the target hard disk may also be stored in the local storage of the control system, for example, the control system obtains the token depth of the target hard disk in the local storage.
  • the token depth of the target hard disk can also be saved on the storage management node of the target hard disk.
  • the control system can obtain the token depth of the target hard disk through the storage management node of the target hard disk.
  • the control system sends an access request to the storage management node of the target hard disk, and the storage management node of the target hard disk returns to the target after receiving the access request.
  • the token depth of the hard disk is used to characterize the read and write resources occupied in the hard disk.
  • the token depth of the target hard disk can be the bandwidth occupied by the target hard disk, or the token depth of the target hard disk can also be the number of computing nodes that are performing read and write operations on the target hard disk.
  • the depth threshold can be set in advance.
  • the depth threshold must be set to ensure that at least two computing nodes can simultaneously access a hard disk.
  • the depth threshold can be set to 2, 3, 4, or 5 and so on.
  • the depth threshold can also be calculated based on resources such as the bandwidth of the target hard disk.
  • the hard disk read-write control method in the embodiment of the present application further includes:
  • Step 1 Determine the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the to-be-operated data, as the read and write resources to be used.
  • the control system determines that when the computing node performs read and write operations of the data to be operated on the target hard disk, it needs to use the read and write resources of the target hard disk, that is, the read and write resources to be used.
  • Step 2 Remove the to-be-used read and write resources from the total read and write resources of the target hard disk to obtain the depth threshold.
  • the depth threshold is determined according to the data to be operated, and the read and write resources of the hard disk can be fully utilized.
  • the operation status of the computing node for the target hard disk is changed from a non-permitted state to an allowed state, for example, the computing node holds the target hard disk token; at the same time, a rule is added according to a preset depth To increase the token depth of the target hard disk.
  • the computing node whose operation status is allowed for the target hard disk can perform read and write operations on the target hard disk.
  • the preset depth increase rule may be: In a computing node whose operation status for the target hard disk is in a non-permitted state, each computing node changes the operation status of the target hard disk for the target hard disk to the allowed status, and the current token depth of the target hard disk
  • the token depth occupied by the compute node is increased on the basis of. For example, when the token depth of the target hard disk is the number of compute nodes that are performing read and write operations on the target hard disk, it can be set as follows: for each compute node whose operation status for the target hard disk is not allowed, each When the node changes the permitted state of the operation status of the target hard disk, the node adds 1 to the current token depth of the target hard disk.
  • the token depth when the token depth is the bandwidth occupied by the target hard disk, it can be set: in a computing node whose operating status for the target hard disk is not allowed, each computing node changes the permitted status for the operating status of the target hard disk.
  • the bandwidth occupied by the computing node is increased based on the current token depth of the target hard disk.
  • the target hard disk it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk.
  • the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
  • the method further includes:
  • the operation state of the computing node with respect to the target hard disk is an allowable state
  • the read and write operations of the data to be operated on the target hard disk are completed by the computing node.
  • the computing node If the operation status of the computing node for the target hard disk is allowed, for example, the computing node holds the token of the target hard disk, the computing node is allowed to perform read and write operations on the target hard disk.
  • the computing node when the computing node is in the allowed operating state of the target hard disk, the computing node performs read and write operations on the target hard disk according to the data request instruction, so that multiple computing nodes can simultaneously access one hard disk, which can improve the computing node's performance. Work efficiency, thereby improving the overall operating efficiency of the network.
  • the hard disk read-write control method in the embodiment of the present application further includes:
  • the operating state of the computing node for the target hard disk is changed to a non-permitted state, and the token depth of the target hard disk is reduced according to a preset depth reduction rule.
  • the preset token release rules can be set according to actual needs.
  • the steps to determine whether the computing nodes meet the preset token release rules are as follows:
  • the computing node After the computing node completes the read and write operations on the target hard disk, or when the time when the computing node's operating state for the target hard disk is allowed to reach a preset time threshold, it is determined that the computing node satisfies a preset token release rule.
  • the preset time threshold can be set according to the actual situation, for example, it is set to 1 second, 5 seconds, or 10 seconds.
  • the preset depth reduction rule is a rule that arbitrarily reduces the token depth of the target hard disk. It can be set as follows: In a computing node whose operation status is allowed for the target hard disk, each computing node's operation status for the target hard disk is changed to In the non-permitted state, the token depth released by the compute node is subtracted from the current token depth of the target hard disk. For example, when the token depth of the target hard disk is the number of compute nodes that are performing read and write operations on the target hard disk, it can be set that: each of the compute nodes is When the operating status of the target hard disk is changed to a non-permitted state, it is reduced by 1 based on the current token depth of the target hard disk.
  • the token depth is the bandwidth occupied by the target hard disk
  • the control system can directly modify the token depth of the target hard disk in the local storage, thereby reducing the token depth of the target hard disk.
  • the control system sends a token depth reduction instruction of the target hard disk to the storage management node of the target hard disk, so that the storage management node of the target hard disk follows the token depth. Reduce instructions to reduce the token depth of the target hard disk.
  • the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk.
  • the release of the hard disk token is guaranteed, thereby ensuring that new computing nodes have the opportunity to read and write to the target hard disk.
  • the method further includes:
  • the computing node is prohibited from performing read and write operations on the target hard disk.
  • the read / write operation of the target hard disk by the computing node is prohibited, thereby ensuring the bandwidth of the computing node which is performing read / write operations on the target hard disk.
  • the hard disk read-write control method in the embodiment of the present application can be implemented by a data storage system.
  • the data storage system is a cluster distributed storage system, each computing resource of the computing nodes is distributed, and the data storage resources of the storage nodes are hard disks. It is also distributed. Through a single or multiple SAS switch network routes, each computing node can see each other, and each computing node can see each hard disk.
  • Compute nodes include: software-business application layer, software-IO flow management layer, software-SAS-HBA driver layer, hardware motherboard, and SAS-HBA card.
  • Software-business application layer used to implement various computer application software, initiate data storage read and write requests, and initiate or respond to data communication requests.
  • Software-IO flow management layer It is used to aggregate or split data from the software-business application layer, and send it to the software-SAS-HBA (Host Bus Adapter) driver layer after grouping, and the software- The data packet returned by the SAS-HBA driver is passed back to the software-business application layer.
  • SAS-HBA Hyper Bus Adapter
  • Software-SAS-HBA driver layer used as the initiator to send IO streams to the hard disk, or send the IO streams to the computing node of the destination; when acting as the destination, respond to the IO stream request sent by the computing node of the initiator, via The software-IO flow management layer of this computing node is passed to the software-business application layer of this computing node.
  • Hardware motherboard and SAS-HBA card Specific hardware resources used to carry computing nodes, including hardware motherboard, processor, and SAS-HBA card.
  • SAS switch It is a hardware device responsible for SASIO routing. Its software program records the SAS address routing table of all SAS devices in the data storage system of the embodiment of this application, which can implement SASIO switching.
  • SAS expander It is a hardware device of a storage node and can be connected to multiple hard disks.
  • the software program of the SAS expander records the SAS address routing table of all SAS devices in the data storage system in the embodiment of this application, and can control SASIO exchange.
  • the data storage system in the embodiment of the present application can not only realize data transmission between a computing node and a hard disk, but also data transmission between computing nodes, thereby realizing cluster communication.
  • Distributed management is adopted for computing nodes. When some computing nodes are lost due to crashes and other reasons, other computing nodes do not need to switch data storage. They only need to take over the hard disk data storage resources managed by the lost nodes on average and use it to trigger the average. The amount of information that is taken over is small. Distributed management of hard disks.
  • redundancy For example, computing nodes based on RAID (Redundant Arrays of Independent Disks) data redundancy backup Principle, reconstruct lost hard disk data to other hard disks, and enhance disaster recovery capabilities.
  • RAID Redundant Arrays of Independent Disks
  • a plurality of computing nodes form a ring network. Adjacent computing nodes in the ring network communicate through a SAS switching unit, and the SAS switching unit of the computing node is connected to a SAS expander. Each computing node can see each other, and each computing node can see each hard disk.
  • Compute nodes include software-business application layer, software-IO flow management layer, software-SAS-HBA driver layer, hardware motherboard and SAS-HBA card, SAS switching unit; storage nodes include SAS expanders and hard disks.
  • Software-business application layer used to implement various computer application software, initiate data storage read and write requests, and initiate or respond to data communication requests.
  • Software-IO flow management layer It is used to aggregate or split data from the software-business application layer, send it to the software-SAS-HBA driver layer after grouping, and send the data packets returned by the software-SAS-HBA driver. Back to the software-business application layer.
  • Software-SAS-HBA driver layer used as the initiator to send IO streams to the hard disk, or send the IO streams to the computing node of the destination; when acting as the destination, respond to the IO stream request sent by the computing node of the initiator, via The software-IO flow management layer of this computing node is passed to the software-business application layer of this computing node.
  • Hardware motherboard and SAS-HBA card Specific hardware resources used to carry computing nodes, including hardware motherboard, processor, and SAS-HBA card.
  • SAS switching unit is a module responsible for SASIO routing. Its software program records the SAS address routing table of all SAS devices in the data storage system in the embodiment of this application, which can implement SASIO switching.
  • SAS expander It is a hardware device of a storage node and can be connected to multiple hard disks.
  • the software program of the SAS expander records the SAS address routing table of all SAS devices in the data storage system in the embodiment of this application, and can control SASIO exchange.
  • a hard disk read-write control method includes:
  • the software-SAS-HBA driver layer of the compute node periodically queries the HBA queue. For example, the software-SAS-HBA driver layer polls the HBA queue every 10 milliseconds, and obtains from the HBA queue to be sent to Data request instruction for the target hard disk.
  • S302 Determine whether the computing node holds the token of the target hard disk. If the token of the target hard disk is held, execute S306; if the token of the target hard disk is not held, execute S303.
  • the software-SAS-HBA driver layer determines whether the compute node holds the token of the target hard disk.
  • the software-SAS-HBA driver layer sends a token application request to the SAS expander where the target hard disk is located through a SAS-HBA card and a SAS switch. After receiving the token application request, the SAS expander returns the current token depth of the target hard disk to the computing node that sent the token application request.
  • S304 Determine the size of the current token depth and depth threshold of the target hard disk. If the current token depth of the target hard disk is less than the depth threshold, perform S305; otherwise, return to S301 to continue execution.
  • the software-SAS-HBA driver layer of the compute node After the software-SAS-HBA driver layer of the compute node obtains the current token depth of the target hard disk, compare the current token depth of the target hard disk with the depth threshold.
  • the depth threshold must be set to ensure that it can meet at least two calculations. Nodes access a hard disk at the same time. If the current token depth of the target hard disk is greater than or equal to the depth threshold, the data request instruction is not executed to read or write the target hard disk, and S301 is executed, that is, the data request instruction is reacquired in the next cycle.
  • the software-SAS-HBA driver layer sends the SAS expander where the target hard disk is located through the SAS-HBA card and SAS switch.
  • the token acquisition success instruction wherein the token acquisition success instruction signifies that the token acquisition of the target hard disk is successful.
  • the SAS expander increases the token depth of the target hard disk according to a preset depth increase rule, for example, increases the token depth of the target hard disk by one.
  • S306 Send a read / write instruction to the target hard disk to perform a read / write operation.
  • Software-SAS-HBA driver layer through the SAS-HBA card and SAS switch, etc., sends read and write instructions to the target hard disk for read and write operations to complete the read and write operations on the target hard disk.
  • the read and write instructions can be
  • the data request instruction may be an instruction different from the data request instruction.
  • S307 Determine whether the computing node satisfies a preset token release rule, and if the preset token release rule is satisfied, execute S308.
  • the preset token release rule can be set according to actual needs, for example, when the computing node completes reading and writing to the target hard disk, or when the computing node holds the token of the target hard disk for a preset time threshold, It is determined that the computing node satisfies a preset token release rule.
  • S308 Release the token of the target hard disk, and send a token release instruction to the SAS expander where the target hard disk is located, so that the SAS expander where the target hard disk is located can reduce the token depth of the target hard disk according to the token release instruction.
  • the token of the target hard disk is released, so that the computing node no longer holds the token of the target hard disk.
  • the software-SAS-HBA driver layer sends a token release instruction to the SAS expander where the target hard disk is located through a SAS-HBA card, a SAS switch, etc., where the token release instruction represents a token for releasing the target hard disk.
  • the SAS expander reduces the token depth of the target hard disk according to a preset depth reduction rule, for example, reduces the token depth of the target hard disk by one.
  • An embodiment of the present application further provides a hard disk read-write control device.
  • the device includes:
  • a hard disk determining module 401 configured to determine a target hard disk where the data to be operated is located;
  • a state determination module 402 configured to determine an operation state of the computing node requesting the operation of the data to be operated on the target hard disk;
  • the depth obtaining module 403 is configured to obtain the token depth of the target hard disk if the operation status of the computing node for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to characterize that the target hard disk is occupied. Read and write resources;
  • a threshold determination module 404 configured to determine the magnitude relationship between the token depth of the target hard disk and the depth threshold
  • the state calibration module 405 is configured to change the operation state of the computing node for the target hard disk to an allowed state if the token depth of the target hard disk is less than the depth threshold, and add a command for the target hard disk according to a preset depth increase rule. Card depth.
  • the target hard disk it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk.
  • the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • the operation permitting module is configured to complete the read / write operation of the data to be operated on the target hard disk by the computing node if the operation status of the computing node with respect to the target hard disk is allowed.
  • the computing node when the computing node is in the allowed operating state of the target hard disk, the computing node performs read and write operations on the target hard disk according to the data request instruction, so that multiple computing nodes can simultaneously access one hard disk, which can improve the computing node's performance. Work efficiency, thereby improving the overall operating efficiency of the network.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • the deep release module is used to change the operation status of the computing node for the target hard disk to a non-permitted state when the computing node meets the preset token release rule, and reduce the order of the target hard disk according to the preset depth reduction rule. Card depth.
  • the above-mentioned depth release module is specifically configured to:
  • the operation status of the computing node for the target hard disk is changed The state is not allowed, and the depth of the token of the target hard disk is reduced according to the preset depth reduction rule.
  • the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk.
  • the release of the hard disk token is guaranteed, thereby ensuring that new computing nodes have the opportunity to read and write to the target hard disk.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • An operation prohibition module is configured to prohibit the computing node from performing read and write operations on the target hard disk if the token depth of the target hard disk is not less than the depth threshold.
  • the read / write operation of the target hard disk by the computing node is prohibited, thereby ensuring the bandwidth of the computing node which is performing read / write operations on the target hard disk.
  • the hard disk read-write control device in the embodiment of the present application further includes:
  • a resource determining module configured to determine the read and write resources of the target hard disk occupied by the computing node when the read and write operations are performed on the data to be operated, as the read and write resources to be used;
  • the threshold determination module is configured to remove the read-write resources to be used from the total read-write resources of the target hard disk to obtain the depth threshold.
  • the depth threshold is determined according to the data to be operated, and the read and write resources of the hard disk can be fully utilized.
  • An embodiment of the present application further provides an electronic device.
  • the electronic device includes a processor 501 and a memory 502.
  • the memory 502 is configured to store a computer program
  • the processor 501 is configured to execute the following steps when executing a program stored in the memory 502:
  • the operation state of the computing node for the target hard disk is changed to an allowed state, and the token depth of the target hard disk is increased according to a preset depth increase rule.
  • the target hard disk it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk.
  • the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
  • the electronic device in the embodiment of the present application further includes a communication interface and a communication bus, where the processor 501, the communication interface, and the memory 502 complete communication with each other through the communication bus.
  • processor 501 when configured to execute a program stored in the memory 502, it can also implement any of the hard disk read-write control methods described above.
  • the communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, the figure only uses a thick line, but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used for communication between the aforementioned electronic device and other devices.
  • the memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • NVM non-Volatile Memory
  • the memory may also be at least one storage device located far from the foregoing processor.
  • the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc .; it may also be a digital signal processor (Digital Signal Processing, DSP), special integration Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP network processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • An embodiment of the present application further provides a computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the following steps are implemented:
  • the operation state of the computing node for the target hard disk is changed to an allowed state, and the token depth of the target hard disk is increased according to a preset depth increase rule.
  • the target hard disk it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk.
  • the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
  • any of the hard disk read-write control methods described above can also be implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

Disclosed are a hard disk read-write control method and apparatus, an electronic device and a storage medium. The method comprises: if the operating state of a computing node regarding a target hard disk is a disallowed state, acquiring a token depth of the target hard disk (S103); determining a magnitude relationship between the token depth of the target hard disk and a depth threshold value (S104); and if the token depth of the target hard disk is less than the depth threshold value, changing the operating state of the computing node regarding the target hard disk to an allowed state, and increasing the token depth of the target hard disk according to a pre-set depth increase rule (S105). According to the hard disk read-write control method, whether a computing node is still allowed to access a target hard disk is determined according to a token depth of the target hard disk, and when the token depth of the target hard disk is less than a depth threshold value, the computing node is allowed to carry out corresponding read-write operations on the target hard disk, so that a plurality of computing nodes can simultaneously access one hard disk, and the working efficiency of the computing nodes can be improved, thereby improving the overall running efficiency of a network.

Description

硬盘读写控制方法、装置、电子设备及存储介质Hard disk read-write control method, device, electronic equipment and storage medium
本申请要求于2018年05月22日提交中国专利局、申请号为201810496764.2申请名称为“硬盘读写控制方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 22, 2018, with application number 201810496764.2 and entitled "Hard Disk Read / Write Control Method, Device, Electronic Equipment, and Storage Medium", the entire contents of which are hereby incorporated by reference. Incorporated in this application.
技术领域Technical field
本申请涉及数据读写技术领域,特别是涉及硬盘读写控制方法、装置、电子设备及存储介质。The present application relates to the technical field of data reading and writing, and in particular, to a hard disk reading and writing control method, device, electronic device, and storage medium.
背景技术Background technique
SAN(Storage Area Network,存储局域网络)是一种将存储设备、连接设备和接口集成在一起的存储网络,承担了数据存储任务。在SAN中通过SCSI(Small Computer System Interface,小型计算机系统接口)完成数据传输。SAS(Serial Attached SCSI,串行连接SCSI)是新一代的SCSI技术,通过采用串行技术以获得更高的传输速度,并且通过缩短连接线以改善内部空间等。SAN (Storage Area Network) is a storage network that integrates storage devices, connected devices, and interfaces, and assumes data storage tasks. Data transmission is completed in a SAN via SCSI (Small Computer System Interface). SAS (Serial Attached SCSI, Serial Attached SCSI) is a new generation of SCSI technology. It adopts serial technology to achieve higher transmission speed, and shortens the connection line to improve internal space.
相关SAN网络中,每个硬盘同一时间仅允许一个计算节点的I/O(Input/Output,输入/输出)操作,但是随着SAS技术的兴起,SAN网络中计算节点的数量大量增加,每个硬盘同一时间仅允许一个计算节点的IO操作,造成大量计算节点排队等待的现象,严重影响了计算节点的工作效率,网络整体运行效率低。In a related SAN network, each hard disk allows only one I / O (Input / Output) operation of a computing node at the same time. However, with the rise of SAS technology, the number of computing nodes in a SAN network has increased significantly. The hard disk allows only one computing node's IO operations at the same time, causing a large number of computing nodes to queue up, which seriously affects the computing node's working efficiency and the overall network operation efficiency is low.
发明内容Summary of the Invention
本申请提供了一种硬盘读写控制方法、装置、电子设备及存储介质,以实现提高网络整体运行效率低。具体技术方案如下:The present application provides a hard disk read-write control method, device, electronic device, and storage medium, so as to achieve low overall operating efficiency. The specific technical solutions are as follows:
第一方面,本申请实施例提供了一种硬盘读写控制方法,所述方法包括:In a first aspect, an embodiment of the present application provides a hard disk read-write control method. The method includes:
确定待操作数据所在的目标硬盘;Determine the target hard disk where the data to be operated is located;
判断请求操作所述待操作数据的计算节点针对所述目标硬盘的操作状态;Determine an operation state of a computing node requesting operation of the data to be operated with respect to the target hard disk;
若所述计算节点针对所述目标硬盘的操作状态为非允许状态,获取所述目标硬盘的令牌深度,其中,所述目标硬盘的令牌深度用于表征所述目标硬盘中被占用的读写资源;Obtaining the token depth of the target hard disk if the operation status of the target hard disk for the target hard disk is a non-permitted state, wherein the token depth of the target hard disk is used to represent an occupied read in the target hard disk; Write resources
判断所述目标硬盘的令牌深度与深度阈值的大小关系;Determining a magnitude relationship between a token depth of the target hard disk and a depth threshold;
若所述目标硬盘的令牌深度小于所述深度阈值,将所述计算节点针对所述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加所述目标硬盘的令牌深度。If the token depth of the target hard disk is less than the depth threshold, change the operation state of the computing node for the target hard disk to an allowed state, and increase the token depth of the target hard disk according to a preset depth increase rule. .
可选的,在所述判断请求操作所述待操作数据的计算节点针对所述目标硬盘的操作状态之后,所述方法还包括:Optionally, after the judging the operating status of the computing node requesting the data to be operated on the target hard disk, the method further includes:
若所述计算节点针对所述目标硬盘的操作状态为允许状态,通过所述计算节点完成对所述目标硬盘中待操作数据的读写操作。If the operation state of the computing node with respect to the target hard disk is an allowed state, reading and writing operations to be performed on the target hard disk by the computing node are completed.
可选的,本申请实施例的硬盘读写控制方法还包括:Optionally, the hard disk read-write control method in the embodiment of the present application further includes:
在所述计算节点满足预设令牌释放规则时,将所述计算节点针对所述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少所述目标硬盘的令牌深度。When the computing node satisfies a preset token release rule, the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk. .
可选的,在本申请实施例的硬盘读写控制方法中,判断所述计算节点是否满足预设令牌释放规则的步骤如下:Optionally, in the hard disk read-write control method in the embodiment of the present application, the steps of determining whether the computing node satisfies a preset token release rule are as follows:
在所述计算节点完成对所述目标硬盘的读写操作后,或所述计算节点针对所述目标硬盘的操作状态为允许状态的时间达到预设时间阈值时,判定所述计算节点满足预设令牌释放规则。Determining that the computing node satisfies a preset after the computing node completes a read-write operation on the target hard disk, or when the time when the operating state of the computing node for the target hard disk is in an allowed state reaches a preset time threshold Token release rules.
可选的,在所述判断所述目标硬盘的令牌深度与深度阈值的大小关系之后,所述方法还包括:Optionally, after determining the magnitude relationship between the token depth and the depth threshold of the target hard disk, the method further includes:
若所述目标硬盘的令牌深度不小于所述深度阈值,禁止所述计算节点对所述目标硬盘进行读写操作。If the token depth of the target hard disk is not less than the depth threshold, the computing node is prohibited from performing read and write operations on the target hard disk.
可选的,在所述判断所述目标硬盘的令牌深度与深度阈值的大小关系之前,所述方法还包括:Optionally, before the judging the relationship between the token depth of the target hard disk and the depth threshold, the method further includes:
确定所述计算节点对所述待操作数据进行读写操作时,所占用的所述目标硬盘的读写资源,作为待使用读写资源;Determining that the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the data to be operated are used as read and write resources to be used;
在所述目标硬盘的总读写资源中去除所述待使用读写资源,得到所述深度阈值。The read and write resources to be used are removed from the total read and write resources of the target hard disk to obtain the depth threshold.
第二方面,本申请实施例提供了一种硬盘读写控制装置,所述装置包括:In a second aspect, an embodiment of the present application provides a hard disk read-write control device, where the device includes:
硬盘确定模块,用于确定待操作数据所在的目标硬盘;A hard disk determining module for determining a target hard disk where the data to be operated is located;
状态判定模块,用于判断请求操作所述待操作数据的计算节点针对所述目标硬盘的操作状态;A state determination module, configured to determine an operation state of a computing node requesting operation of the data to be operated on the target hard disk;
深度获取模块,用于若所述计算节点针对所述目标硬盘的操作状态为非允许状态,获取所述目标硬盘的令牌深度,其中,所述目标硬盘的令牌深度用于表征所述目标硬盘中被占用的读写资源;A depth acquisition module, configured to obtain a token depth of the target hard disk if the operation status of the computing node for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to characterize the target; Read and write resources occupied on the hard disk;
阈值判定模块,用于判断所述目标硬盘的令牌深度与深度阈值的大小关系;A threshold determination module, configured to determine a magnitude relationship between a token depth of the target hard disk and a depth threshold;
状态标定模块,用于若所述目标硬盘的令牌深度小于所述深度阈值,将所述计算节点针对所述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加所述目标硬盘的令牌深度。A state calibration module, configured to change the operation state of the computing node for the target hard disk to an allowed state if the token depth of the target hard disk is less than the depth threshold, and add the preset depth increase rule to increase the The token depth of the target hard disk.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
操作允许模块,用于若所述计算节点针对所述目标硬盘的操作状态为允许状态,通过所述计算节点完成对所述目标硬盘中待操作数据的读写操作。An operation permission module is configured to complete the reading and writing of data to be operated on the target hard disk by the computing node if the operation status of the computing node for the target hard disk is allowed.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
深度释放模块,用于在所述计算节点满足预设令牌释放规则时,将所述计算节点针对所述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少所述目标硬盘的令牌深度。A deep release module is configured to change an operation state of the computing node for the target hard disk to a non-permitted state when the computing node meets a preset token release rule, and reduce the rule according to a preset depth reduction rule to reduce the The token depth of the target hard disk.
可选的,所述深度释放模块,具体用于:Optionally, the deep release module is specifically configured to:
在所述计算节点完成对所述目标硬盘的读写操作后,或所述计算节点针对所述目标硬盘的操作状态为允许状态的时间达到预设时间阈值时,将所述计算节点针对所述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少所述目标硬盘的令牌深度。After the computing node completes the read and write operations on the target hard disk, or when the time when the operation status of the computing node for the target hard disk is allowed to reach a preset time threshold, the computing node is The operating state of the target hard disk is changed to a non-permitted state, and the token depth of the target hard disk is reduced according to a preset depth reduction rule.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
操作禁止模块,用于若所述目标硬盘的令牌深度不小于所述深度阈值,禁止所述计算节点对所述目标硬盘进行读写操作。An operation prohibition module is configured to prohibit the computing node from performing read and write operations on the target hard disk if the token depth of the target hard disk is not less than the depth threshold.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
资源确定模块,用于确定所述计算节点对所述待操作数据进行读写操作时,所占用的所述目标硬盘的读写资源,作为待使用读写资源;A resource determining module, configured to determine the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the data to be operated, as the read and write resources to be used;
阈值确定模块,用于在所述目标硬盘的总读写资源中去除所述待使用读写资源,得到所述深度阈值。A threshold determination module is configured to remove the read-write resources to be used from the total read-write resources of the target hard disk to obtain the depth threshold.
第三方面,本申请实施例提供了一种电子设备,包括处理器及存储器;In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
所述存储器,用于存放计算机程序;The memory is used to store a computer program;
所述处理器,用于执行所述存储器上所存放的程序时,实现上述第一方面任一所述的硬盘读写控制方法。The processor is configured to implement the hard disk read-write control method according to any one of the first aspects when executing a program stored in the memory.
第四方面,本申请实施例提供了一种存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面任一所述的硬盘读写控制方法。According to a fourth aspect, an embodiment of the present application provides a storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the hard disk read or write according to any one of the first aspects is implemented. Control Method.
本申请实施例提供的硬盘读写控制方法、装置、电子设备及存储介质,确定待操作数据所在的目标硬盘;判断请求操作待操作数据的计算节点针对目标硬盘的操作状态;若计算节点针对目标硬盘的操作状态为非允许状态,获取目标硬盘的令牌深度,其中,目标硬盘的令牌深度用于表征目标硬盘中被占用的读写资源;判断目标硬盘的令牌深度与深度阈值的大小关系;若目标硬盘的令牌深度小于深度阈值,将计算节点针对目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加目标硬盘的令牌深度。根据目标硬盘的令牌深度判定目标硬盘是否还能够允许计算节点的访问,在目标硬 盘的令牌深度小于深度阈值时,允许计算节点对目标硬盘进行相应的读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。当然,实施本申请的任一产品或方法并不一定需要同时达到以上的所有优点。The hard disk read-write control method, device, electronic device and storage medium provided in the embodiments of the present application determine the target hard disk where the data to be operated is located; determine the operation status of the computing node requesting the operation of the data to be operated against the target hard disk; The operating status of the hard disk is non-permitted, and the token depth of the target hard disk is obtained. The token depth of the target hard disk is used to represent the read and write resources occupied by the target hard disk. The token depth and the depth threshold of the target hard disk are determined. Relationship; if the token depth of the target hard disk is less than the depth threshold, the operation state of the computing node for the target hard disk is changed to an allowed state, and the token depth of the target hard disk is increased according to a preset depth increase rule. According to the token depth of the target hard disk, determine whether the target hard disk can still allow access to the computing node. When the token depth of the target hard disk is less than the depth threshold, allow the computing node to perform corresponding read and write operations on the target hard disk, which can implement multiple computing nodes. Accessing a hard disk at the same time can improve the working efficiency of the computing node, thereby improving the overall operating efficiency of the network. Of course, the implementation of any product or method of this application does not necessarily need to achieve all the above advantages at the same time.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application and the technical solutions of the prior art, the following briefly introduces the embodiments and the drawings needed in the prior art. Obviously, the drawings in the following description are only the present invention. Some embodiments of the application, for those of ordinary skill in the art, can obtain other drawings according to these drawings without paying creative labor.
图1为本申请实施例的硬盘读写控制方法的一种流程示意图;1 is a schematic flowchart of a hard disk read-write control method according to an embodiment of the present application;
图2a为本申请实施例的数据存储系统的一种示意图;2a is a schematic diagram of a data storage system according to an embodiment of the present application;
图2b为本申请实施例的数据存储系统的另一种示意图;2b is another schematic diagram of a data storage system according to an embodiment of the present application;
图3为本申请实施例的硬盘读写控制方法的另一种流程示意图;FIG. 3 is another schematic flowchart of a hard disk read-write control method according to an embodiment of the present application; FIG.
图4为本申请实施例的硬盘读写控制装置的一种示意图;4 is a schematic diagram of a hard disk read-write control device according to an embodiment of the present application;
图5为本申请实施例的电子设备的示意图。FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution, and advantages of the present application clearer, the following further describes the present application in detail with reference to the accompanying drawings and examples. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
相关SAN网络中,为了保证硬盘带宽,每个硬盘同一时间仅允许一个计算节点的IO操作,其他需要读写该硬盘的计算节点需要排队等待。但是随着 SAS等技术的发展,硬盘带宽大大增加,同时SAN网络中计算节点的数量也大幅增长,一个硬盘同一时间仅允许一个计算节点进行IO操作,降低了硬盘的利用效率低,严重影响SAN网络整体运行速度。In related SAN networks, in order to ensure the bandwidth of hard disks, each hard disk allows only one computing node's IO operations at the same time, and other computing nodes that need to read and write the hard disk need to wait in line. However, with the development of SAS and other technologies, the bandwidth of hard disks has increased greatly. At the same time, the number of computing nodes in the SAN network has also increased significantly. A hard disk allows only one compute node to perform IO operations at the same time, which reduces the utilization efficiency of hard disks and seriously affects SAN The overall speed of the network.
有鉴于此,本申请实施例提供了一种硬盘读写控制方法,参见图1,该方法包括:In view of this, an embodiment of the present application provides a hard disk read-write control method. Referring to FIG. 1, the method includes:
S101,确定待操作数据所在的目标硬盘。S101. Determine a target hard disk where the data to be operated is located.
本申请实施例中的硬盘读写控制方法可以通过控制系统实现,控制系统为任意能够实现本申请实施例的硬盘读写控制方法的系统。例如:The hard disk read-write control method in the embodiment of the present application can be implemented by a control system, and the control system is any system capable of realizing the hard disk read-write control method in the embodiment of the present application. E.g:
控制系统可以为一种设备,包括:处理器、存储器、通信接口和总线;处理器、存储器和通信接口通过总线连接并完成相互间的通信;存储器存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行本申请实施例的硬盘读写控制方法。The control system may be a kind of equipment, including: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected through a bus and complete communication with each other; the memory stores executable program code; and the processor reads the memory by The executable program code stored in the program is used to run a program corresponding to the executable program code, and is used to execute the hard disk read-write control method in the embodiment of the present application.
控制系统还可以为一种应用程序,用于在运行时执行本申请实施例的硬盘读写控制方法。The control system may also be an application program for executing the hard disk read-write control method in the embodiment of the present application at runtime.
控制系统还可以为一种存储介质,用于存储可执行代码,可执行代码用于执行本申请实施例的硬盘读写控制方法。The control system may also be a storage medium for storing executable code, and the executable code is used to execute the hard disk read-write control method in the embodiment of the present application.
控制系统可以根据获取的数据请求指令,确定待操作数据所在的目标硬盘,其中,数据请求指令中包含待操作数据的标识。可选的,数据请求指令中还可以包括请求操作待操作数据的计算节点的标识。The control system may determine the target hard disk where the data to be operated is located according to the acquired data request instruction, wherein the data request instruction includes an identifier of the data to be operated. Optionally, the data request instruction may further include an identification of a computing node requesting operation of the data to be operated.
S102,判断请求操作上述待操作数据的计算节点针对上述目标硬盘的操作状态。S102. Determine an operation state of the computing node requesting to operate the data to be operated on the target hard disk.
控制系统判断计算节点针对目标硬盘的操作状态,计算节点针对目标硬盘的操作状态为允许状态或非允许状态。例如,控制系统建立硬盘与计算节点的操作状态表,在操作状态表中针对每个硬盘,记录针对该硬盘的操作状态为允许状态的各计算节点;或在操作状态表中针对每个计算节点,记录该计算节点针对哪些硬盘的操作状态为允许状态。可选的,控制系统为计算节点,控制系统的操作状态表中包括该计算节点针对的操作状态为允许状态的 各硬盘的标识。The control system determines the operating state of the computing node with respect to the target hard disk, and the operating state of the computing node with respect to the target hard disk is an allowed state or an unallowed state. For example, the control system establishes an operation status table of the hard disk and the computing node, and for each hard disk in the operating status table, records each computing node whose operating status is allowed for the hard disk; or for each computing node in the operating status table To record which hard disks' operation status is allowed for this compute node. Optionally, the control system is a computing node, and the operation state table of the control system includes an identification of each hard disk targeted by the computing node for an operating state that is allowed.
控制系统还可以通过判断计算节点是否持有目标硬盘的令牌来确定计算节点是否处于目标硬盘的允许操作状态,若计算节点持有目标硬盘的令牌,则判定计算节点针对目标硬盘的操作状态为允许状态;若计算节点未持有目标硬盘的令牌,判定计算节点针对目标硬盘的操作状态为非允许状态。The control system can also determine whether the computing node is in the allowed operating state of the target hard disk by judging whether the computing node holds the token of the target hard disk. If the computing node holds the token of the target hard disk, determine the operating status of the computing node for the target hard disk. It is an allowed state; if the computing node does not hold the token of the target hard disk, it is determined that the operating state of the computing node for the target hard disk is a non-permitted state.
S103,若上述计算节点针对上述目标硬盘的操作状态为非允许状态,获取上述目标硬盘的令牌深度,其中,上述目标硬盘的令牌深度用于表征上述目标硬盘中被占用的读写资源。S103: If the computing node's operation status for the target hard disk is not allowed, obtain the token depth of the target hard disk, where the token depth of the target hard disk is used to represent the read and write resources occupied by the target hard disk.
目标硬盘的令牌深度还可以保存在控制系统的本地存储中,例如,控制系统在本地存储中获取目标硬盘的令牌深度。目标硬盘的令牌深度也可保存在目标硬盘的存储管理节点上。例如,控制系统可以通过目标硬盘的存储管理节点获取目标硬盘的令牌深度,具体的,控制系统向目标硬盘的存储管理节点发送访问请求,目标硬盘的存储管理节点在接收到访问请求后返回目标硬盘的令牌深度。令牌深度用于表征硬盘中被占用的读写资源。例如:目标硬盘的令牌深度可以为目标硬盘被占用的带宽,或目标硬盘的令牌深度还可以为正在对目标硬盘进行读写操作的计算节点的数量。The token depth of the target hard disk may also be stored in the local storage of the control system, for example, the control system obtains the token depth of the target hard disk in the local storage. The token depth of the target hard disk can also be saved on the storage management node of the target hard disk. For example, the control system can obtain the token depth of the target hard disk through the storage management node of the target hard disk. Specifically, the control system sends an access request to the storage management node of the target hard disk, and the storage management node of the target hard disk returns to the target after receiving the access request. The token depth of the hard disk. The token depth is used to characterize the read and write resources occupied in the hard disk. For example, the token depth of the target hard disk can be the bandwidth occupied by the target hard disk, or the token depth of the target hard disk can also be the number of computing nodes that are performing read and write operations on the target hard disk.
S104,判断上述目标硬盘的令牌深度与深度阈值的大小关系。S104. Determine the magnitude relationship between the token depth of the target hard disk and the depth threshold.
在目标硬盘的令牌深度为正在对目标硬盘进行读写操作的计算节点的数量时,深度阈值可以为提前设定的,深度阈值的设定要保证能够满足至少两个计算节点同时访问一个硬盘,例如,深度阈值可以设定为2、3、4或5等。When the token depth of the target hard disk is the number of computing nodes that are performing read and write operations on the target hard disk, the depth threshold can be set in advance. The depth threshold must be set to ensure that at least two computing nodes can simultaneously access a hard disk. For example, the depth threshold can be set to 2, 3, 4, or 5 and so on.
深度阈值还可以根据目标硬盘的带宽等资源计算得到。可选的,在上述判断上述目标硬盘的令牌深度与深度阈值的大小关系之前,本申请实施例的硬盘读写控制方法还包括:The depth threshold can also be calculated based on resources such as the bandwidth of the target hard disk. Optionally, before judging the magnitude relationship between the token depth and the depth threshold of the target hard disk, the hard disk read-write control method in the embodiment of the present application further includes:
步骤一,确定上述计算节点对上述待操作数据进行读写操作时,所占用的上述目标硬盘的读写资源,作为待使用读写资源。Step 1: Determine the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the to-be-operated data, as the read and write resources to be used.
控制系统确定计算节点针对目标硬盘执行待操作数据的读写操作时,需要使用的目标硬盘的读写资源,即待使用读写资源。The control system determines that when the computing node performs read and write operations of the data to be operated on the target hard disk, it needs to use the read and write resources of the target hard disk, that is, the read and write resources to be used.
步骤二,在上述目标硬盘的总读写资源中去除上述待使用读写资源,得到上述深度阈值。Step 2: Remove the to-be-used read and write resources from the total read and write resources of the target hard disk to obtain the depth threshold.
控制系统在目标硬盘总读写资源的基础上,去除上述待使用读写资源,将剩余的资源作为深度阈值。例如,目标硬盘的总带宽为100MB(MByte/兆字节)/秒,计算节点执行数据请求指令的读写操作所需的硬盘带宽为20MB/秒,则深度阈值为100-20=80MB/秒。The control system removes the read-write resources to be used based on the total read-write resources of the target hard disk, and uses the remaining resources as the depth threshold. For example, if the total bandwidth of the target hard disk is 100MB (MByte / Megabyte) / second, and the hard disk bandwidth required by the compute node to perform the read and write operations of the data request instruction is 20MB / second, then the depth threshold is 100-20 = 80MB / second .
在本申请实施中,根据待操作数据,确定深度阈值,能够充分利用硬盘的读写资源。In the implementation of this application, the depth threshold is determined according to the data to be operated, and the read and write resources of the hard disk can be fully utilized.
S105,若上述目标硬盘的令牌深度小于上述深度阈值,将上述计算节点针对上述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加上述目标硬盘的令牌深度。S105: If the token depth of the target hard disk is smaller than the depth threshold, change the operation state of the computing node for the target hard disk to an allowed state, and increase the token depth of the target hard disk according to a preset depth increase rule.
在目标硬盘的令牌深度小于深度阈值时,将计算节点针对目标硬盘的操作状态由非允许状态变更为允许状态,例如,令计算节点持有目标硬盘的令牌;同时按照预设深度增加规则,增加目标硬盘的令牌深度。针对目标硬盘的操作状态为允许状态的计算节点能够对目标硬盘进行读写操作。When the token depth of the target hard disk is less than the depth threshold, the operation status of the computing node for the target hard disk is changed from a non-permitted state to an allowed state, for example, the computing node holds the target hard disk token; at the same time, a rule is added according to a preset depth To increase the token depth of the target hard disk. The computing node whose operation status is allowed for the target hard disk can perform read and write operations on the target hard disk.
预设深度增加规则可以为:在针对目标硬盘的操作状态为非允许状态的计算节点中,每有一个计算节点针对该目标硬盘的操作状态变更为允许状态时,在目标硬盘的当前令牌深度的基础上增加该计算节点占用的令牌深度。例如,在目标硬盘的令牌深度为正在对目标硬盘进行读写操作的计算节点的数量时,可以设定为:在针对目标硬盘的操作状态为非允许状态的计算节点中,每有一个计算节点针对该目标硬盘的操作状态变更允许状态时,在目标硬盘的当前令牌深度的基础上增加1。例如,在令牌深度为目标硬盘被占用的带宽时,可以设定:在针对目标硬盘的操作状态为非允许状态的计算节点中,每有一个计算节点针对该目标硬盘的操作状态变更允许状态时,在目标硬盘的当前令牌深度的基础上增加该计算节点占用的带宽等。The preset depth increase rule may be: In a computing node whose operation status for the target hard disk is in a non-permitted state, each computing node changes the operation status of the target hard disk for the target hard disk to the allowed status, and the current token depth of the target hard disk The token depth occupied by the compute node is increased on the basis of. For example, when the token depth of the target hard disk is the number of compute nodes that are performing read and write operations on the target hard disk, it can be set as follows: for each compute node whose operation status for the target hard disk is not allowed, each When the node changes the permitted state of the operation status of the target hard disk, the node adds 1 to the current token depth of the target hard disk. For example, when the token depth is the bandwidth occupied by the target hard disk, it can be set: in a computing node whose operating status for the target hard disk is not allowed, each computing node changes the permitted status for the operating status of the target hard disk. In addition, the bandwidth occupied by the computing node is increased based on the current token depth of the target hard disk.
在本申请实施例中,根据目标硬盘的令牌深度判定目标硬盘是否还能够允许计算节点的访问,在目标硬盘的令牌深度小于深度阈值时,允许计算节点对目标硬盘执行相应的读写操作,可以实现多个计算节点同时访问一个硬 盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk. When the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
可选的,在上述判断请求操作上述待操作数据的计算节点针对上述目标硬盘的操作状态之后,上述方法还包括:Optionally, after the judging the operation status of the computing node that requested the operation of the data to be operated on the target hard disk, the method further includes:
若上述计算节点针对上述目标硬盘的操作状态为允许状态,通过上述计算节点完成对上述目标硬盘中待操作数据的读写操作。If the operation state of the computing node with respect to the target hard disk is an allowable state, the read and write operations of the data to be operated on the target hard disk are completed by the computing node.
若计算节点针对上述目标硬盘的操作状态为允许状态,例如,计算节点持有目标硬盘的令牌,则允许计算节点对目标硬盘进行读写操作。If the operation status of the computing node for the target hard disk is allowed, for example, the computing node holds the token of the target hard disk, the computing node is allowed to perform read and write operations on the target hard disk.
在本申请实施例中,在计算节点处于目标硬盘的允许操作状态时,通过计算节点按照数据请求指令对目标硬盘进行读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, when the computing node is in the allowed operating state of the target hard disk, the computing node performs read and write operations on the target hard disk according to the data request instruction, so that multiple computing nodes can simultaneously access one hard disk, which can improve the computing node's performance. Work efficiency, thereby improving the overall operating efficiency of the network.
为了减少计算节点对硬盘的无用占用,需要减少硬盘的令牌深度。可选的,本申请实施例的硬盘读写控制方法还包括:In order to reduce the unnecessary use of hard disks by computing nodes, the token depth of hard disks needs to be reduced. Optionally, the hard disk read-write control method in the embodiment of the present application further includes:
在上述计算节点满足预设令牌释放规则时,将上述计算节点针对上述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少上述目标硬盘的令牌深度。When the computing node satisfies a preset token release rule, the operating state of the computing node for the target hard disk is changed to a non-permitted state, and the token depth of the target hard disk is reduced according to a preset depth reduction rule.
预设令牌释放规则可以根据实际需求进行设定,可选的,判断上述计算节点是否满足预设令牌释放规则的步骤如下:The preset token release rules can be set according to actual needs. Optionally, the steps to determine whether the computing nodes meet the preset token release rules are as follows:
在上述计算节点完成对上述目标硬盘的读写操作后,或上述计算节点针对上述目标硬盘的操作状态为允许状态的时间达到预设时间阈值时,判定上述计算节点满足预设令牌释放规则。After the computing node completes the read and write operations on the target hard disk, or when the time when the computing node's operating state for the target hard disk is allowed to reach a preset time threshold, it is determined that the computing node satisfies a preset token release rule.
预设时间阈值可以根据实际情况进行设定,例如,设定为1秒、5秒或10秒等。在计算节点满足预设令牌释放规则时,将该计算节点针对目标硬盘的操作状态变更为非允许状态,并释放该计算节点占用的目标硬盘的令牌深度。The preset time threshold can be set according to the actual situation, for example, it is set to 1 second, 5 seconds, or 10 seconds. When the computing node satisfies a preset token release rule, the operating state of the computing node for the target hard disk is changed to a non-permitted state, and the token depth of the target hard disk occupied by the computing node is released.
预设深度减少规则为任意减少目标硬盘的令牌深度的规则,可以设定为:在针对目标硬盘的操作状态为允许状态的计算节点中,每有一个计算节点针 对目标硬盘的操作状态变更为非允许状态时,在目标硬盘的当前令牌深度的基础上减去该计算节点释放的令牌深度。例如,在目标硬盘的令牌深度为正在对目标硬盘进行读写操作的计算节点的数量时,可以设定:在针对目标硬盘的操作状态为允许状态的计算节点中,每有一个计算节点针对目标硬盘的操作状态变更为非允许状态时,在目标硬盘的当前令牌深度的基础上减1。例如,在令牌深度为目标硬盘被占用的带宽,可以设定:在针对目标硬盘的操作状态为允许状态的计算节点中,每有一个计算节点针对目标硬盘的操作状态变更为非允许状态时,在目标硬盘的当前令牌深度的基础上减去该计算节点占用的带宽等。The preset depth reduction rule is a rule that arbitrarily reduces the token depth of the target hard disk. It can be set as follows: In a computing node whose operation status is allowed for the target hard disk, each computing node's operation status for the target hard disk is changed to In the non-permitted state, the token depth released by the compute node is subtracted from the current token depth of the target hard disk. For example, when the token depth of the target hard disk is the number of compute nodes that are performing read and write operations on the target hard disk, it can be set that: each of the compute nodes is When the operating status of the target hard disk is changed to a non-permitted state, it is reduced by 1 based on the current token depth of the target hard disk. For example, when the token depth is the bandwidth occupied by the target hard disk, you can set: In a computing node whose operating status for the target hard disk is allowed, each computing node's operating status for the target hard disk is changed to a non-allowed status. , Subtract the bandwidth occupied by the compute node from the current token depth of the target hard disk.
在目标硬盘的令牌深度存储在控制系统的本地存储中时,控制系统可以直接对本地存储中目标硬盘的令牌深度进行修改,从而减少上述目标硬盘的令牌深度。在目标硬盘的令牌深度保存在目标硬盘的存储管理节点上时,控制系统向目标硬盘的存储管理节点发送目标硬盘的令牌深度减少指令,以使目标硬盘的存储管理节点按照该令牌深度减少指令,减少目标硬盘的令牌深度。When the token depth of the target hard disk is stored in the local storage of the control system, the control system can directly modify the token depth of the target hard disk in the local storage, thereby reducing the token depth of the target hard disk. When the token depth of the target hard disk is stored on the storage management node of the target hard disk, the control system sends a token depth reduction instruction of the target hard disk to the storage management node of the target hard disk, so that the storage management node of the target hard disk follows the token depth. Reduce instructions to reduce the token depth of the target hard disk.
在本申请实施例中,在计算节点满足预设令牌释放规则时,将计算节点针对目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少目标硬盘的令牌深度,保证了硬盘令牌的释放,从而保证新的计算节点有机会对目标硬盘进行读写操作。In the embodiment of the present application, when the computing node satisfies a preset token release rule, the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk. The release of the hard disk token is guaranteed, thereby ensuring that new computing nodes have the opportunity to read and write to the target hard disk.
可选的,在上述判断上述目标硬盘的令牌深度与深度阈值的大小关系之后,上述方法还包括:Optionally, after determining the magnitude relationship between the token depth of the target hard disk and the depth threshold, the method further includes:
若上述目标硬盘的令牌深度不小于上述深度阈值,禁止上述计算节点对上述目标硬盘进行读写操作。If the token depth of the target hard disk is not less than the depth threshold, the computing node is prohibited from performing read and write operations on the target hard disk.
在本申请实施例中,在目标硬盘的令牌深度不小于深度阈值,禁止计算节点对目标硬盘进行读写操作,保证了正在对目标硬盘进行读写操作的计算节点的带宽。In the embodiment of the present application, when the token depth of the target hard disk is not less than the depth threshold, the read / write operation of the target hard disk by the computing node is prohibited, thereby ensuring the bandwidth of the computing node which is performing read / write operations on the target hard disk.
本申请实施例的硬盘读写控制方法可以通过数据存储系统实现,参见图2a,上述数据存储系统为集群分布式存储系统,计算节点的各计算资源是分 布式的,存储节点的数据存储资源硬盘也是分布式的,通过单个或多个SAS交换机网络路由,各计算节点间相互可见,各计算节点也可以看到各硬盘。The hard disk read-write control method in the embodiment of the present application can be implemented by a data storage system. Referring to FIG. 2a, the data storage system is a cluster distributed storage system, each computing resource of the computing nodes is distributed, and the data storage resources of the storage nodes are hard disks. It is also distributed. Through a single or multiple SAS switch network routes, each computing node can see each other, and each computing node can see each hard disk.
计算节点包括:软件-业务应用层、软件-IO流管理层、软件-SAS-HBA驱动层、硬件主板和SAS-HBA卡等。Compute nodes include: software-business application layer, software-IO flow management layer, software-SAS-HBA driver layer, hardware motherboard, and SAS-HBA card.
软件-业务应用层:用于实现各种计算机应用软件,发起数据存储的读写请求,发起或响应数据通讯的请求。Software-business application layer: used to implement various computer application software, initiate data storage read and write requests, and initiate or respond to data communication requests.
软件-IO流管理层:用于将来自软件-业务应用层的数据进行聚合或拆分,组包后发送给软件-SAS-HBA(Host Bus Adapter,主机总线适配器)驱动层,并将软件-SAS-HBA驱动反馈回来的数据包回传给软件-业务应用层。Software-IO flow management layer: It is used to aggregate or split data from the software-business application layer, and send it to the software-SAS-HBA (Host Bus Adapter) driver layer after grouping, and the software- The data packet returned by the SAS-HBA driver is passed back to the software-business application layer.
软件-SAS-HBA驱动层:用于作为发起端时,将IO流发送给硬盘,或将IO流发送给目的端的计算节点;作为目的端时,响应发起端计算节点发送的IO流请求,经本计算节点的软件-IO流管理层传递给本计算节点的软件-业务应用层。Software-SAS-HBA driver layer: used as the initiator to send IO streams to the hard disk, or send the IO streams to the computing node of the destination; when acting as the destination, respond to the IO stream request sent by the computing node of the initiator, via The software-IO flow management layer of this computing node is passed to the software-business application layer of this computing node.
硬件主板和SAS-HBA卡:是用于承载计算节点的具体硬件资源,包括硬件主板,处理器及SAS-HBA卡等。Hardware motherboard and SAS-HBA card: Specific hardware resources used to carry computing nodes, including hardware motherboard, processor, and SAS-HBA card.
SAS交换机:是负责SAS IO路由的硬件设备,其软件程序记录了本申请实施例的数据存储系统中所有SAS设备的SAS地址路由表,可以实现SAS IO交换。SAS switch: It is a hardware device responsible for SASIO routing. Its software program records the SAS address routing table of all SAS devices in the data storage system of the embodiment of this application, which can implement SASIO switching.
SAS扩展器:是存储节点的硬件设备,可以扩展连接多块硬盘,SAS扩展器的软件程序记录了本申请实施例的数据存储系统中所有SAS设备的SAS地址路由表,可以控制SAS IO交换。SAS expander: It is a hardware device of a storage node and can be connected to multiple hard disks. The software program of the SAS expander records the SAS address routing table of all SAS devices in the data storage system in the embodiment of this application, and can control SASIO exchange.
本申请实施例的数据存储系统,既可以实现计算节点与硬盘的数据传输,也可以实现各计算节点之间的数据传输,从而实现集群通讯。对计算节点采用分布式管理,当部分计算节点因死机等原因丢失时,其它计算节点,不需要做存储数据的切换,仅需要平均接管丢失节点上面管理的硬盘数据存储资源,并且用于触发平均接管的信息的通讯量很小。对硬盘进行分布式管理,当硬盘因掉电等原因导致该硬盘的资源丢失时,在满足冗余的情况下,例如,计算节点基于RAID(Redundant Arrays of Independent Disks,磁盘阵列)数据 冗余备份原理,重构丢失的硬盘的数据到其它硬盘中,增强容灾能力。The data storage system in the embodiment of the present application can not only realize data transmission between a computing node and a hard disk, but also data transmission between computing nodes, thereby realizing cluster communication. Distributed management is adopted for computing nodes. When some computing nodes are lost due to crashes and other reasons, other computing nodes do not need to switch data storage. They only need to take over the hard disk data storage resources managed by the lost nodes on average and use it to trigger the average. The amount of information that is taken over is small. Distributed management of hard disks. When the hard disk's resources are lost due to power failure and other reasons, in the case of redundancy, for example, computing nodes based on RAID (Redundant Arrays of Independent Disks) data redundancy backup Principle, reconstruct lost hard disk data to other hard disks, and enhance disaster recovery capabilities.
上述数据存储系统还可以如图2b所示,多个计算节点组成环形网络,环形网络中相邻计算节点通过SAS交换单元进行通信,计算节点的SAS交换单元与SAS扩展器连接。各计算节点间相互可见,各计算节点也可以看到各硬盘。The above data storage system may also be shown in FIG. 2b. A plurality of computing nodes form a ring network. Adjacent computing nodes in the ring network communicate through a SAS switching unit, and the SAS switching unit of the computing node is connected to a SAS expander. Each computing node can see each other, and each computing node can see each hard disk.
计算节点包括软件-业务应用层、软件-IO流管理层、软件-SAS-HBA驱动层、硬件主板和SAS-HBA卡、SAS交换单元;存储节点包括SAS扩展器及硬盘。Compute nodes include software-business application layer, software-IO flow management layer, software-SAS-HBA driver layer, hardware motherboard and SAS-HBA card, SAS switching unit; storage nodes include SAS expanders and hard disks.
软件-业务应用层:用于实现各种计算机应用软件,发起数据存储的读写请求,发起或响应数据通讯的请求。Software-business application layer: used to implement various computer application software, initiate data storage read and write requests, and initiate or respond to data communication requests.
软件-IO流管理层:用于将来自软件-业务应用层的数据进行聚合或拆分,组包后发送给软件-SAS-HBA驱动层,并将软件-SAS-HBA驱动反馈回来的数据包回传给软件-业务应用层。Software-IO flow management layer: It is used to aggregate or split data from the software-business application layer, send it to the software-SAS-HBA driver layer after grouping, and send the data packets returned by the software-SAS-HBA driver. Back to the software-business application layer.
软件-SAS-HBA驱动层:用于作为发起端时,将IO流发送给硬盘,或将IO流发送给目的端的计算节点;作为目的端时,响应发起端计算节点发送的IO流请求,经本计算节点的软件-IO流管理层传递给本计算节点的软件-业务应用层。Software-SAS-HBA driver layer: used as the initiator to send IO streams to the hard disk, or send the IO streams to the computing node of the destination; when acting as the destination, respond to the IO stream request sent by the computing node of the initiator, via The software-IO flow management layer of this computing node is passed to the software-business application layer of this computing node.
硬件主板和SAS-HBA卡:是用于承载计算节点的具体硬件资源,包括硬件主板,处理器及SAS-HBA卡等。Hardware motherboard and SAS-HBA card: Specific hardware resources used to carry computing nodes, including hardware motherboard, processor, and SAS-HBA card.
SAS交换单元:是负责SAS IO路由的模块,其软件程序记录了本申请实施例的数据存储系统中所有SAS设备的SAS地址路由表,可以实现SAS IO交换。SAS switching unit: is a module responsible for SASIO routing. Its software program records the SAS address routing table of all SAS devices in the data storage system in the embodiment of this application, which can implement SASIO switching.
SAS扩展器:是存储节点的硬件设备,可以扩展连接多块硬盘,SAS扩展器的软件程序记录了本申请实施例的数据存储系统中所有SAS设备的SAS地址路由表,可以控制SAS IO交换。SAS expander: It is a hardware device of a storage node and can be connected to multiple hard disks. The software program of the SAS expander records the SAS address routing table of all SAS devices in the data storage system in the embodiment of this application, and can control SASIO exchange.
基于上述数据存储系统,参见图3,本申请实施例的硬盘读写控制方法包括:Based on the above data storage system, referring to FIG. 3, a hard disk read-write control method according to an embodiment of the present application includes:
S301,周期性获取数据请求指令。S301. Obtain a data request instruction periodically.
针对每个计算节点,该计算节点的软件-SAS-HBA驱动层周期性查询HBA队列,例如,软件-SAS-HBA驱动层每隔10毫秒轮询一次HBA队列,从HBA队列中获取待发送给目标硬盘的数据请求指令。For each compute node, the software-SAS-HBA driver layer of the compute node periodically queries the HBA queue. For example, the software-SAS-HBA driver layer polls the HBA queue every 10 milliseconds, and obtains from the HBA queue to be sent to Data request instruction for the target hard disk.
S302,判断计算节点是否持有目标硬盘的令牌,若持有目标硬盘的令牌执行S306,若未持有目标硬盘的令牌执行S303。S302: Determine whether the computing node holds the token of the target hard disk. If the token of the target hard disk is held, execute S306; if the token of the target hard disk is not held, execute S303.
软件-SAS-HBA驱动层判断该计算节点是否持有目标硬盘的令牌。The software-SAS-HBA driver layer determines whether the compute node holds the token of the target hard disk.
S303,向目标硬盘所在的SAS交换机发送令牌申请请求,以使目标硬盘所在的SAS扩展器返回目标硬盘当前的令牌深度。S303. Send a token application request to the SAS switch where the target hard disk is located, so that the SAS expander where the target hard disk is located returns the current token depth of the target hard disk.
软件-SAS-HBA驱动层,通过SAS-HBA卡及SAS交换机等,向目标硬盘所在的SAS扩展器发送令牌申请请求。SAS扩展器在接收到令牌申请请求后,向发送令牌申请请求的计算节点返回目标硬盘当前的令牌深度。The software-SAS-HBA driver layer sends a token application request to the SAS expander where the target hard disk is located through a SAS-HBA card and a SAS switch. After receiving the token application request, the SAS expander returns the current token depth of the target hard disk to the computing node that sent the token application request.
S304,判断目标硬盘当前的令牌深度与深度阈值的大小,若目标硬盘当前的令牌深度小于深度阈值执行S305,否则返回S301继续执行。S304. Determine the size of the current token depth and depth threshold of the target hard disk. If the current token depth of the target hard disk is less than the depth threshold, perform S305; otherwise, return to S301 to continue execution.
在该计算节点的软件-SAS-HBA驱动层获取到目标硬盘当前的令牌深度后,比较目标硬盘当前的令牌深度与深度阈值的大小,深度阈值的设定要保证能够满足至少两个计算节点同时访问一个硬盘。若目标硬盘当前的令牌深度大于或等于深度阈值,不执行数据请求指令针对目标硬盘的读写操作,返回执行S301,即在下一周期中,重新获取数据请求指令。After the software-SAS-HBA driver layer of the compute node obtains the current token depth of the target hard disk, compare the current token depth of the target hard disk with the depth threshold. The depth threshold must be set to ensure that it can meet at least two calculations. Nodes access a hard disk at the same time. If the current token depth of the target hard disk is greater than or equal to the depth threshold, the data request instruction is not executed to read or write the target hard disk, and S301 is executed, that is, the data request instruction is reacquired in the next cycle.
S305,获取目标硬盘的令牌成功,向目标硬盘所在的SAS扩展器返回令牌获取成功指令,以使SAS扩展器根据令牌获取成功指令增加目标硬盘的令牌深度。S305. The token acquisition of the target hard disk is successful, and a token acquisition success instruction is returned to the SAS expander where the target hard disk is located, so that the SAS expander increases the token depth of the target hard disk according to the token acquisition success instruction.
在目标硬盘当前的令牌深度小于深度阈值时,判定该计算节点获取目标硬盘的令牌成功,软件-SAS-HBA驱动层通过SAS-HBA卡及SAS交换机等向目标硬盘所在的SAS扩展器发送令牌获取成功指令,其中,令牌获取成功指令表征获取目标硬盘的令牌成功。SAS扩展器在接收到令牌获取成功指令后,按照预设深度增加规则,增加目标硬盘的令牌深度,例如,将目标硬盘 的令牌深度增加1。When the current token depth of the target hard disk is less than the depth threshold, it is determined that the compute node successfully obtained the token of the target hard disk. The software-SAS-HBA driver layer sends the SAS expander where the target hard disk is located through the SAS-HBA card and SAS switch. The token acquisition success instruction, wherein the token acquisition success instruction signifies that the token acquisition of the target hard disk is successful. After receiving the token acquisition success instruction, the SAS expander increases the token depth of the target hard disk according to a preset depth increase rule, for example, increases the token depth of the target hard disk by one.
S306,向目标硬盘发送读写指令,以进行读写操作。S306: Send a read / write instruction to the target hard disk to perform a read / write operation.
软件-SAS-HBA驱动层,通过SAS-HBA卡及SAS交换机等,向目标硬盘下发用于进行读写操作的读写指令,以完成对目标硬盘的读写操作,该读写指令可以为数据请求指令,也可以为区别于数据请求指令的指令。Software-SAS-HBA driver layer, through the SAS-HBA card and SAS switch, etc., sends read and write instructions to the target hard disk for read and write operations to complete the read and write operations on the target hard disk. The read and write instructions can be The data request instruction may be an instruction different from the data request instruction.
S307,判断该计算节点是否满足预设令牌释放规则,若满足预设令牌释放规则执行S308。S307: Determine whether the computing node satisfies a preset token release rule, and if the preset token release rule is satisfied, execute S308.
判断该计算节点是否满足预设令牌释放规则,若满足预设令牌释放规则执行S308,若不满足预设令牌释放规则,返回执行S301。预设令牌释放规则可以根据实际需求进行设定,例如,在该计算节点完成对目标硬盘的读写操作时,或该计算节点持有目标硬盘的令牌的时间达到预设时间阈值时,判定该计算节点满足预设令牌释放规则。It is determined whether the computing node satisfies a preset token release rule. If the preset token release rule is satisfied, S308 is performed, and if the preset token release rule is not satisfied, the process returns to S301. The preset token release rule can be set according to actual needs, for example, when the computing node completes reading and writing to the target hard disk, or when the computing node holds the token of the target hard disk for a preset time threshold, It is determined that the computing node satisfies a preset token release rule.
S308,释放目标硬盘的令牌,并向目标硬盘所在的SAS扩展器发送令牌释放指令,以使目标硬盘所在的SAS扩展器按照令牌释放指令,减少目标硬盘的令牌深度。S308: Release the token of the target hard disk, and send a token release instruction to the SAS expander where the target hard disk is located, so that the SAS expander where the target hard disk is located can reduce the token depth of the target hard disk according to the token release instruction.
在计算节点满足预设令牌释放规则时,释放目标硬盘的令牌,即令该计算节点不再持有目标硬盘的令牌。软件-SAS-HBA驱动层通过SAS-HBA卡及SAS交换机等向目标硬盘所在的SAS扩展器发送令牌释放指令,其中,令牌释放指令表征释放目标硬盘的令牌。SAS扩展器在接收到令牌释放指令后,按照预设深度减少规则,减少目标硬盘的令牌深度,例如,将目标硬盘的令牌深度减1。When the computing node meets the preset token release rules, the token of the target hard disk is released, so that the computing node no longer holds the token of the target hard disk. The software-SAS-HBA driver layer sends a token release instruction to the SAS expander where the target hard disk is located through a SAS-HBA card, a SAS switch, etc., where the token release instruction represents a token for releasing the target hard disk. After receiving the token release instruction, the SAS expander reduces the token depth of the target hard disk according to a preset depth reduction rule, for example, reduces the token depth of the target hard disk by one.
在本申请实施例中,在通过为计算节点分配硬盘的令牌,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, by allocating a hard disk token to a computing node, multiple computing nodes can access a hard disk at the same time, which can improve the working efficiency of the computing node, thereby improving the overall operating efficiency of the network.
本申请实施例还提供了一种硬盘读写控制装置,参见图4,该装置包括:An embodiment of the present application further provides a hard disk read-write control device. Referring to FIG. 4, the device includes:
硬盘确定模块401,用于确定待操作数据所在的目标硬盘;A hard disk determining module 401, configured to determine a target hard disk where the data to be operated is located;
状态判定模块402,用于判断请求操作上述待操作数据的计算节点针对上 述目标硬盘的操作状态;A state determination module 402, configured to determine an operation state of the computing node requesting the operation of the data to be operated on the target hard disk;
深度获取模块403,用于若上述计算节点针对上述目标硬盘的操作状态为非允许状态,获取上述目标硬盘的令牌深度,其中,上述目标硬盘的令牌深度用于表征上述目标硬盘中被占用的读写资源;The depth obtaining module 403 is configured to obtain the token depth of the target hard disk if the operation status of the computing node for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to characterize that the target hard disk is occupied. Read and write resources;
阈值判定模块404,用于判断上述目标硬盘的令牌深度与深度阈值的大小关系;A threshold determination module 404, configured to determine the magnitude relationship between the token depth of the target hard disk and the depth threshold;
状态标定模块405,用于若上述目标硬盘的令牌深度小于上述深度阈值,将上述计算节点针对上述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加上述目标硬盘的令牌深度。The state calibration module 405 is configured to change the operation state of the computing node for the target hard disk to an allowed state if the token depth of the target hard disk is less than the depth threshold, and add a command for the target hard disk according to a preset depth increase rule. Card depth.
在本申请实施例中,根据目标硬盘的令牌深度判定目标硬盘是否还能够允许计算节点的访问,在目标硬盘的令牌深度小于深度阈值时,允许计算节点对目标硬盘执行相应的读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk. When the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
操作允许模块,用于若上述计算节点针对上述目标硬盘的操作状态为允许状态,通过上述计算节点完成对上述目标硬盘中待操作数据的读写操作。The operation permitting module is configured to complete the read / write operation of the data to be operated on the target hard disk by the computing node if the operation status of the computing node with respect to the target hard disk is allowed.
在本申请实施例中,在计算节点处于目标硬盘的允许操作状态时,通过计算节点按照数据请求指令对目标硬盘进行读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, when the computing node is in the allowed operating state of the target hard disk, the computing node performs read and write operations on the target hard disk according to the data request instruction, so that multiple computing nodes can simultaneously access one hard disk, which can improve the computing node's performance. Work efficiency, thereby improving the overall operating efficiency of the network.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
深度释放模块,用于在上述计算节点满足预设令牌释放规则时,将上述计算节点针对上述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少上述目标硬盘的令牌深度。The deep release module is used to change the operation status of the computing node for the target hard disk to a non-permitted state when the computing node meets the preset token release rule, and reduce the order of the target hard disk according to the preset depth reduction rule. Card depth.
可选的,在本申请实施例的硬盘读写控制装置中,上述深度释放模块,具体用于:Optionally, in the hard disk read-write control device in the embodiment of the present application, the above-mentioned depth release module is specifically configured to:
在上述计算节点完成对上述目标硬盘的读写操作后,或上述计算节点针 对上述目标硬盘的操作状态为允许状态的时间达到预设时间阈值时,将上述计算节点针对上述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少上述目标硬盘的令牌深度。After the computing node completes the read and write operations on the target hard disk, or when the time when the operation status of the computing node for the target hard disk is allowed to reach a preset time threshold, the operation status of the computing node for the target hard disk is changed The state is not allowed, and the depth of the token of the target hard disk is reduced according to the preset depth reduction rule.
在本申请实施例中,在计算节点满足预设令牌释放规则时,将计算节点针对目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少目标硬盘的令牌深度,保证了硬盘令牌的释放,从而保证新的计算节点有机会对目标硬盘进行读写操作。In the embodiment of the present application, when the computing node satisfies a preset token release rule, the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk. The release of the hard disk token is guaranteed, thereby ensuring that new computing nodes have the opportunity to read and write to the target hard disk.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
操作禁止模块,用于若上述目标硬盘的令牌深度不小于上述深度阈值,禁止上述计算节点对上述目标硬盘进行读写操作。An operation prohibition module is configured to prohibit the computing node from performing read and write operations on the target hard disk if the token depth of the target hard disk is not less than the depth threshold.
在本申请实施例中,在目标硬盘的令牌深度不小于深度阈值,禁止计算节点对目标硬盘进行读写操作,保证了正在对目标硬盘进行读写操作的计算节点的带宽。In the embodiment of the present application, when the token depth of the target hard disk is not less than the depth threshold, the read / write operation of the target hard disk by the computing node is prohibited, thereby ensuring the bandwidth of the computing node which is performing read / write operations on the target hard disk.
可选的,本申请实施例的硬盘读写控制装置还包括:Optionally, the hard disk read-write control device in the embodiment of the present application further includes:
资源确定模块,用于确定上述计算节点对上述待操作数据进行读写操作时,所占用的上述目标硬盘的读写资源,作为待使用读写资源;A resource determining module, configured to determine the read and write resources of the target hard disk occupied by the computing node when the read and write operations are performed on the data to be operated, as the read and write resources to be used;
阈值确定模块,用于在上述目标硬盘的总读写资源中去除上述待使用读写资源,得到上述深度阈值。The threshold determination module is configured to remove the read-write resources to be used from the total read-write resources of the target hard disk to obtain the depth threshold.
在本申请实施中,根据待操作数据,确定深度阈值,能够充分利用硬盘的读写资源。In the implementation of this application, the depth threshold is determined according to the data to be operated, and the read and write resources of the hard disk can be fully utilized.
本申请实施例还提供了一种电子设备,参见图5,包括处理器501及存储器502;An embodiment of the present application further provides an electronic device. Referring to FIG. 5, the electronic device includes a processor 501 and a memory 502.
上述存储器502,用于存放计算机程序;The memory 502 is configured to store a computer program;
上述处理器501,用于执行上述存储器502上所存放的程序时,实现如下步骤:The processor 501 is configured to execute the following steps when executing a program stored in the memory 502:
确定待操作数据所在的目标硬盘;Determine the target hard disk where the data to be operated is located;
判断请求操作上述待操作数据的计算节点针对上述目标硬盘的操作状态;Determine the operation status of the computing node requesting the operation of the data to be operated on the target hard disk;
若上述计算节点针对上述目标硬盘的操作状态为非允许状态,获取上述目标硬盘的令牌深度,其中,上述目标硬盘的令牌深度用于表征上述目标硬盘中被占用的读写资源;Obtaining the token depth of the target hard disk if the operation status of the target hard disk for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to represent the read and write resources occupied by the target hard disk;
判断上述目标硬盘的令牌深度与深度阈值的大小关系;Judging the relationship between the token depth of the target hard disk and the depth threshold;
若上述目标硬盘的令牌深度小于上述深度阈值,将上述计算节点针对上述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加上述目标硬盘的令牌深度。If the token depth of the target hard disk is smaller than the depth threshold, the operation state of the computing node for the target hard disk is changed to an allowed state, and the token depth of the target hard disk is increased according to a preset depth increase rule.
在本申请实施例中,根据目标硬盘的令牌深度判定目标硬盘是否还能够允许计算节点的访问,在目标硬盘的令牌深度小于深度阈值时,允许计算节点对目标硬盘执行相应的读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk. When the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
可选的,本申请实施例的电子设备还包括:通信接口和通信总线,其中,处理器501,通信接口,存储器502通过通信总线完成相互间的通信。Optionally, the electronic device in the embodiment of the present application further includes a communication interface and a communication bus, where the processor 501, the communication interface, and the memory 502 complete communication with each other through the communication bus.
可选的,上述处理器501,用于执行上述存储器502上所存放的程序时,还能够实现上述任一硬盘读写控制方法。Optionally, when the processor 501 is configured to execute a program stored in the memory 502, it can also implement any of the hard disk read-write control methods described above.
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, the figure only uses a thick line, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the aforementioned electronic device and other devices.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the foregoing processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing  Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc .; it may also be a digital signal processor (Digital Signal Processing, DSP), special integration Circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,上计算机程序被处理器执行时实现如下步骤:An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the following steps are implemented:
确定待操作数据所在的目标硬盘;Determine the target hard disk where the data to be operated is located;
判断请求操作上述待操作数据的计算节点针对上述目标硬盘的操作状态;Determine the operation status of the computing node requesting the operation of the data to be operated on the target hard disk;
若上述计算节点针对上述目标硬盘的操作状态为非允许状态,获取上述目标硬盘的令牌深度,其中,上述目标硬盘的令牌深度用于表征上述目标硬盘中被占用的读写资源;Obtaining the token depth of the target hard disk if the operation status of the target hard disk for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to represent the read and write resources occupied by the target hard disk;
判断上述目标硬盘的令牌深度与深度阈值的大小关系;Judging the relationship between the token depth of the target hard disk and the depth threshold;
若上述目标硬盘的令牌深度小于上述深度阈值,将上述计算节点针对上述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加上述目标硬盘的令牌深度。If the token depth of the target hard disk is smaller than the depth threshold, the operation state of the computing node for the target hard disk is changed to an allowed state, and the token depth of the target hard disk is increased according to a preset depth increase rule.
在本申请实施例中,根据目标硬盘的令牌深度判定目标硬盘是否还能够允许计算节点的访问,在目标硬盘的令牌深度小于深度阈值时,允许计算节点对目标硬盘执行相应的读写操作,可以实现多个计算节点同时访问一个硬盘,能够提高计算节点的工作效率,从而提高网络整体的运行效率。In the embodiment of the present application, it is determined whether the target hard disk can still allow access to the computing node according to the token depth of the target hard disk. When the token depth of the target hard disk is less than the depth threshold, the computing node is allowed to perform corresponding read and write operations on the target hard disk. It can realize that multiple computing nodes access one hard disk at the same time, which can improve the working efficiency of the computing nodes, thereby improving the overall operating efficiency of the network.
可选的,上述计算机可读存储介质内存储有计算机程序被处理器执行时还能够实现上述任一硬盘读写控制方法。Optionally, when the computer program stored in the computer-readable storage medium is executed by a processor, any of the hard disk read-write control methods described above can also be implemented.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要 素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is any such actual relationship or order among them. Moreover, the terms "including", "comprising", or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also those that are not explicitly listed Or other elements inherent to such a process, method, article, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article, or equipment that includes the elements.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, refer to the description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。The above are only preferred embodiments of this application, and are not intended to limit this application. Any modification, equivalent replacement, or improvement made within the spirit and principle of this application shall be included in this application Within the scope of protection.

Claims (14)

  1. 一种硬盘读写控制方法,其特征在于,所述方法包括:A hard disk read-write control method, characterized in that the method includes:
    确定待操作数据所在的目标硬盘;Determine the target hard disk where the data to be operated is located;
    判断请求操作所述待操作数据的计算节点针对所述目标硬盘的操作状态;Determine an operation state of a computing node requesting operation of the data to be operated with respect to the target hard disk;
    若所述计算节点针对所述目标硬盘的操作状态为非允许状态,获取所述目标硬盘的令牌深度,其中,所述目标硬盘的令牌深度用于表征所述目标硬盘中被占用的读写资源;Obtaining the token depth of the target hard disk if the operation status of the target hard disk for the target hard disk is a non-permitted state, wherein the token depth of the target hard disk is used to represent an occupied read in the target hard disk; Write resources
    判断所述目标硬盘的令牌深度与深度阈值的大小关系;Determining a magnitude relationship between a token depth of the target hard disk and a depth threshold;
    若所述目标硬盘的令牌深度小于所述深度阈值,将所述计算节点针对所述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加所述目标硬盘的令牌深度。If the token depth of the target hard disk is less than the depth threshold, change the operation state of the computing node for the target hard disk to an allowed state, and increase the token depth of the target hard disk according to a preset depth increase rule. .
  2. 根据权利要求1所述的方法,其特征在于,在所述判断请求操作所述待操作数据的计算节点针对所述目标硬盘的操作状态之后,所述方法还包括:The method according to claim 1, wherein after the judging an operation state of the computing node that requested to operate the data to be operated on the target hard disk, the method further comprises:
    若所述计算节点针对所述目标硬盘的操作状态为允许状态,通过所述计算节点完成对所述目标硬盘中待操作数据的读写操作。If the operation state of the computing node with respect to the target hard disk is an allowed state, reading and writing operations to be performed on the target hard disk by the computing node are completed.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, further comprising:
    在所述计算节点满足预设令牌释放规则时,将所述计算节点针对所述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少所述目标硬盘的令牌深度。When the computing node satisfies a preset token release rule, the operation state of the computing node for the target hard disk is changed to a non-permitted state, and the preset depth reduction rule is used to reduce the token depth of the target hard disk. .
  4. 根据权利要求3所述的方法,其特征在于,判断所述计算节点是否满足预设令牌释放规则的步骤如下:The method according to claim 3, wherein the step of determining whether the computing node satisfies a preset token release rule is as follows:
    在所述计算节点完成对所述目标硬盘的读写操作后,或所述计算节点针对所述目标硬盘的操作状态为允许状态的时间达到预设时间阈值时,判定所述计算节点满足预设令牌释放规则。Determining that the computing node satisfies a preset after the computing node completes a read-write operation on the target hard disk, or when the time when the operating state of the computing node for the target hard disk is in an allowed state reaches a preset time threshold Token release rules.
  5. 根据权利要求1所述的方法,其特征在于,在所述判断所述目标硬盘的 令牌深度与深度阈值的大小关系之后,所述方法还包括:The method according to claim 1, wherein after determining a magnitude relationship between a token depth and a depth threshold of the target hard disk, the method further comprises:
    若所述目标硬盘的令牌深度不小于所述深度阈值,禁止所述计算节点对所述目标硬盘进行读写操作。If the token depth of the target hard disk is not less than the depth threshold, the computing node is prohibited from performing read and write operations on the target hard disk.
  6. 根据权利要求1所述的方法,其特征在于,在所述判断所述目标硬盘的令牌深度与深度阈值的大小关系之前,所述方法还包括:The method according to claim 1, wherein before the determining a magnitude relationship between a token depth and a depth threshold of the target hard disk, the method further comprises:
    确定所述计算节点对所述待操作数据进行读写操作时,所占用的所述目标硬盘的读写资源,作为待使用读写资源;Determining that the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the data to be operated are used as read and write resources to be used;
    在所述目标硬盘的总读写资源中去除所述待使用读写资源,得到所述深度阈值。The read and write resources to be used are removed from the total read and write resources of the target hard disk to obtain the depth threshold.
  7. 一种硬盘读写控制装置,其特征在于,所述装置包括:A hard disk read-write control device is characterized in that the device includes:
    硬盘确定模块,用于确定待操作数据所在的目标硬盘;A hard disk determining module for determining a target hard disk where the data to be operated is located;
    状态判定模块,用于判断请求操作所述待操作数据的计算节点针对所述目标硬盘的操作状态;A state determination module, configured to determine an operation state of a computing node requesting operation of the data to be operated on the target hard disk;
    深度获取模块,用于若所述计算节点针对所述目标硬盘的操作状态为非允许状态,获取所述目标硬盘的令牌深度,其中,所述目标硬盘的令牌深度用于表征所述目标硬盘中被占用的读写资源;A depth acquisition module, configured to obtain a token depth of the target hard disk if the operation status of the computing node for the target hard disk is not allowed, wherein the token depth of the target hard disk is used to characterize the target; Read and write resources occupied on the hard disk;
    阈值判定模块,用于判断所述目标硬盘的令牌深度与深度阈值的大小关系;A threshold determination module, configured to determine a magnitude relationship between a token depth of the target hard disk and a depth threshold;
    状态标定模块,用于若所述目标硬盘的令牌深度小于所述深度阈值,将所述计算节点针对所述目标硬盘的操作状态变更为允许状态,并按照预设深度增加规则,增加所述目标硬盘的令牌深度。A state calibration module, configured to change the operation state of the computing node for the target hard disk to an allowed state if the token depth of the target hard disk is less than the depth threshold, and add the preset depth increase rule to increase the The token depth of the target hard disk.
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The apparatus according to claim 7, further comprising:
    操作允许模块,用于若所述计算节点针对所述目标硬盘的操作状态为允许状态,通过所述计算节点完成对所述目标硬盘中待操作数据的读写操作。An operation permission module is configured to complete the reading and writing of data to be operated on the target hard disk by the computing node if the operation status of the computing node for the target hard disk is allowed.
  9. 根据权利要求7或8所述的装置,其特征在于,所述装置还包括:The device according to claim 7 or 8, wherein the device further comprises:
    深度释放模块,用于在所述计算节点满足预设令牌释放规则时,将所述 计算节点针对所述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少所述目标硬盘的令牌深度。A deep release module is configured to change an operation state of the computing node for the target hard disk to a non-permitted state when the computing node meets a preset token release rule, and reduce the rule according to a preset depth reduction rule to reduce the The token depth of the target hard disk.
  10. 根据权利要求9所述的装置,其特征在于,所述深度释放模块,具体用于:The device according to claim 9, wherein the depth release module is specifically configured to:
    在所述计算节点完成对所述目标硬盘的读写操作后,或所述计算节点针对所述目标硬盘的操作状态为允许状态的时间达到预设时间阈值时,将所述计算节点针对所述目标硬盘的操作状态变更为非允许状态,并按照预设深度减少规则,减少所述目标硬盘的令牌深度。After the computing node completes the read and write operations on the target hard disk, or when the time when the operation status of the computing node for the target hard disk is allowed to reach a preset time threshold, the computing node is The operating state of the target hard disk is changed to a non-permitted state, and the token depth of the target hard disk is reduced according to a preset depth reduction rule.
  11. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The apparatus according to claim 7, further comprising:
    操作禁止模块,用于若所述目标硬盘的令牌深度不小于所述深度阈值,禁止所述计算节点对所述目标硬盘进行读写操作。An operation prohibition module is configured to prohibit the computing node from performing read and write operations on the target hard disk if the token depth of the target hard disk is not less than the depth threshold.
  12. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The apparatus according to claim 7, further comprising:
    资源确定模块,用于确定所述计算节点对所述待操作数据进行读写操作时,所占用的所述目标硬盘的读写资源,作为待使用读写资源;A resource determining module, configured to determine the read and write resources of the target hard disk occupied by the computing node when performing read and write operations on the data to be operated, as the read and write resources to be used;
    阈值确定模块,用于在所述目标硬盘的总读写资源中去除所述待使用读写资源,得到所述深度阈值。A threshold determination module is configured to remove the read-write resources to be used from the total read-write resources of the target hard disk to obtain the depth threshold.
  13. 一种电子设备,其特征在于,包括处理器及存储器;An electronic device, comprising a processor and a memory;
    所述存储器,用于存放计算机程序;The memory is used to store a computer program;
    所述处理器,用于执行所述存储器上所存放的程序时,实现权利要求1-6任一所述的方法步骤。The processor is configured to implement the method steps according to any one of claims 1-6 when executing a program stored in the memory.
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-6任一所述的方法步骤。A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps according to any one of claims 1-6 are implemented.
PCT/CN2019/082262 2018-05-22 2019-04-11 Hard disk read-write control method and apparatus, electronic device and storage medium WO2019223445A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810496764.2A CN110515535B (en) 2018-05-22 2018-05-22 Hard disk read-write control method and device, electronic equipment and storage medium
CN201810496764.2 2018-05-22

Publications (1)

Publication Number Publication Date
WO2019223445A1 true WO2019223445A1 (en) 2019-11-28

Family

ID=68617361

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/082262 WO2019223445A1 (en) 2018-05-22 2019-04-11 Hard disk read-write control method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN110515535B (en)
WO (1) WO2019223445A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148222B (en) * 2020-09-21 2023-08-25 浙江大华技术股份有限公司 Configuration method and device of database hard disk, storage medium and electronic device
CN112838991B (en) * 2021-02-09 2023-03-24 芯河半导体科技(无锡)有限公司 Method for adaptively adjusting token value of small-bandwidth scheduler

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101419828A (en) * 2008-11-20 2009-04-29 杭州海康威视数字技术股份有限公司 Hard disc video recording and retrieval method for analog magnetic tape serial schema
CN101803330A (en) * 2007-09-14 2010-08-11 国际商业机器公司 Method, system and computer program for balancing the access to shared resources with credit-based tokens
CN102663310A (en) * 2012-03-23 2012-09-12 华为技术有限公司 Method and device for protecting storage system
CN107276827A (en) * 2017-07-25 2017-10-20 郑州云海信息技术有限公司 Qos implementation method and device in a kind of distributed memory system

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100396065C (en) * 2005-01-14 2008-06-18 清华大学 A method for implementing iSCSI memory system
CN101566933B (en) * 2009-06-11 2012-07-04 成都市华为赛门铁克科技有限公司 Method and device for configurating cache and electronic equipment and data read-write equipment
CN102012794A (en) * 2010-11-19 2011-04-13 北京兆易创新科技有限公司 Solid state disk and access control method thereof, and solid state disk controller
CN102215268A (en) * 2011-07-14 2011-10-12 北京飞杰信息技术有限公司 Method and device for transferring file data
CN103870202B (en) * 2012-12-10 2018-08-21 上海优刻得信息科技有限公司 A kind of distributed storage method and system of block device
CN103513938B (en) * 2013-09-16 2016-06-29 华为技术有限公司 A kind of RAID RAID system expansion method and device
CN104734985A (en) * 2013-12-23 2015-06-24 腾讯数码(天津)有限公司 Data receiving flow control method and system
JP6382454B2 (en) * 2014-11-06 2018-08-29 華為技術有限公司Huawei Technologies Co.,Ltd. Distributed storage and replication system and method
CN105138276B (en) * 2015-07-14 2018-05-18 苏州科达科技股份有限公司 Data storage method and data storage system
CN105630416B (en) * 2015-12-24 2018-10-26 创新科存储技术(深圳)有限公司 Disk method and device is kicked in a kind of cloud storage system
CN105978987B (en) * 2016-06-16 2019-04-26 上海天玑科技股份有限公司 A kind of virtual method for Exadata memory node
CN106354436A (en) * 2016-09-20 2017-01-25 郑州云海信息技术有限公司 Storage system based on distributed IPSAN
CN106775456B (en) * 2016-11-22 2019-11-26 华为技术有限公司 A kind of data processing method, apparatus and system
CN107145384A (en) * 2017-04-17 2017-09-08 广州孩教圈信息科技股份有限公司 Method for allocating tasks and system
CN107423111B (en) * 2017-06-23 2020-06-26 浪潮云信息技术有限公司 Openstack environment computing node back-end storage management method
CN107402721A (en) * 2017-06-30 2017-11-28 郑州云海信息技术有限公司 A kind of control method of hard disk, device and server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101803330A (en) * 2007-09-14 2010-08-11 国际商业机器公司 Method, system and computer program for balancing the access to shared resources with credit-based tokens
CN101419828A (en) * 2008-11-20 2009-04-29 杭州海康威视数字技术股份有限公司 Hard disc video recording and retrieval method for analog magnetic tape serial schema
CN102663310A (en) * 2012-03-23 2012-09-12 华为技术有限公司 Method and device for protecting storage system
CN107276827A (en) * 2017-07-25 2017-10-20 郑州云海信息技术有限公司 Qos implementation method and device in a kind of distributed memory system

Also Published As

Publication number Publication date
CN110515535B (en) 2021-01-01
CN110515535A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US9864517B2 (en) Actively responding to data storage traffic
CN113918101B (en) Method, system, equipment and storage medium for writing data cache
US11726701B2 (en) Memory expander, heterogeneous computing device using memory expander, and operation method of heterogenous computing
CN103890729A (en) Collaborative management of shared resources
CN112988066B (en) Data processing method and device
KR102646619B1 (en) Method and system providing file system for an electronic device comprising a composite memory device
JP2017211984A (en) METHOD, SYSTEM AND APPARATUS FOR QoS-AWARE INPUT/OUTPUT MANAGEMENT FOR PCIe STORAGE SYSTEM WITH RECONFIGURABLE MULTI-PORTS
US11556391B2 (en) CPU utilization for service level I/O scheduling
US10860223B1 (en) Method and system for enhancing a distributed storage system by decoupling computation and network tasks
WO2014206078A1 (en) Memory access method, device and system
CN110119304A (en) A kind of interruption processing method, device and server
CN114546902A (en) System, apparatus and method for multi-protocol based access to memory
US10846094B2 (en) Method and system for managing data access in storage system
WO2019223445A1 (en) Hard disk read-write control method and apparatus, electronic device and storage medium
US9069621B2 (en) Submitting operations to a shared resource based on busy-to-success ratios
JP5893028B2 (en) System and method for efficient sequential logging on a storage device that supports caching
WO2015078193A1 (en) Management method for storage space and storage management device
KR20220082563A (en) Storate device and operating method of the same
JP2015088071A (en) Information processor, storage device control circuit, and control method for storage device
CN114550773A (en) Memory controller, memory system, and data processing method
CN110515536B (en) Data storage system
KR20240063438A (en) Method and device to reconfigure memory region of memory device dynamically
KR102365261B1 (en) A electronic system and operating method of memory device
US11055218B2 (en) Apparatus and methods for accelerating tasks during storage caching/tiering in a computing environment
CN112291292B (en) Data storage method, device, equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19808267

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19808267

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19808267

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01.06.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19808267

Country of ref document: EP

Kind code of ref document: A1