WO2017215249A1 - Internet protocol (ip) disk assignment method and device - Google Patents

Internet protocol (ip) disk assignment method and device Download PDF

Info

Publication number
WO2017215249A1
WO2017215249A1 PCT/CN2016/113682 CN2016113682W WO2017215249A1 WO 2017215249 A1 WO2017215249 A1 WO 2017215249A1 CN 2016113682 W CN2016113682 W CN 2016113682W WO 2017215249 A1 WO2017215249 A1 WO 2017215249A1
Authority
WO
WIPO (PCT)
Prior art keywords
disk
data read
write
average time
currently selected
Prior art date
Application number
PCT/CN2016/113682
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 WO2017215249A1 publication Critical patent/WO2017215249A1/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/0604Improving or facilitating administration, e.g. storage management
    • 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
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • 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/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Definitions

  • the present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for allocating an internet protocol IP disk.
  • IP Internet Protocol, Internet Protocol, also known as Internet Protocol
  • the disk can spontaneously read and write data by key-value read and write without communicating with the host and without being controlled by the host.
  • each IP disk is equivalent to one server, and multiple IP disks can form a server set in a symmetric manner.
  • each server in the collection has an equivalent status, and can provide services separately without additional server assistance.
  • the management server acts as a load balancer, and uniformly distributes the requests sent by the client to the servers in the server set through a specific load balancing policy.
  • the server that receives the request responds to the client independently.
  • the management server needs to obtain real-time data of the IP disk, including CPU (Central Processing Unit) processing capacity, disk capacity, and I/O (Input/Output) pressure.
  • CPU Central Processing Unit
  • disk capacity disk capacity
  • I/O Input/Output
  • the IP disk cannot provide real-time data to the management server due to limited processing capacity, so it is impossible to formulate a reasonable load balancing policy. Eventually, the load balancing of the management server loses its practical significance.
  • the purpose of the embodiments of the present application is to provide a method and an apparatus for allocating an internet protocol IP disk.
  • IP disk of the related technology cannot provide real-time information to the management server due to limited processing capability, it is impossible to formulate a reasonable load balancing policy, and ultimately the management server has poor load balancing effect.
  • the embodiment of the present application provides a method for allocating an Internet Protocol IP disk, including: receiving a data read/write request sent by a client; and calculating a current selected IP disk to perform the last N data read and write operations.
  • An average time wherein N is a positive integer; determining whether the average time is less than a reference time, wherein the reference time is a time consumed by a predetermined disk to perform a data read/write operation; and determining that the average time is less than the reference time
  • the above data read and write request is allocated to the currently selected IP disk.
  • the method further includes: determining whether the read/write state of the IP disk is an idle state; determining that the read/write state of the IP disk is an idle state.
  • the data read and write request is allocated to the currently selected IP disk.
  • the method further includes: clearing the IP disk to execute the latest N. A record of the above average time consumed by the secondary data read and write operations.
  • the method further includes: selecting a next IP disk; and calculating the selected next IP disk to perform the last N data read and write operations. The average time consumed; determining whether the average time is less than the reference time; and determining that the average time is less than the reference time, assigning the data read/write request to the selected next IP disk.
  • the method before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes: determining that the IP disk is the Mth allocated data read/write request; determining whether the M is greater than N, where M is a positive integer, and in the case where it is judged that M is greater than N, the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
  • the method further includes: directly allocating the data read/write request to the currently selected IP disk.
  • the embodiment of the present application further provides an apparatus for allocating an Internet Protocol IP disk, including: a receiving unit, configured to receive a data read/write request sent by a client; and a first calculating unit, configured to calculate the currently selected The average time consumed by the IP disk to perform the most recent data read and write operations, wherein N is a positive integer; the first determining unit is configured to determine whether the average time is less than the reference time, wherein the reference time is a preset disk execution data. The time consumed by the read/write operation; the first allocation unit is configured to allocate the data read/write request to the currently selected IP disk when it is determined that the average time is less than the reference time.
  • the device further includes: a second determining unit, configured to determine, when the average time is not less than the reference time, whether the read/write state of the IP disk is an idle state; When it is determined that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
  • a second determining unit configured to determine, when the average time is not less than the reference time, whether the read/write state of the IP disk is an idle state; When it is determined that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
  • the device further includes: a clearing unit, configured to: after determining that the read/write status of the IP disk is in an idle state, and allocating the data read/write request to the currently selected IP disk, clearing the foregoing The IP disk performs a correlation record of the above average time consumed by the last N data read and write operations.
  • a clearing unit configured to: after determining that the read/write status of the IP disk is in an idle state, and allocating the data read/write request to the currently selected IP disk, clearing the foregoing The IP disk performs a correlation record of the above average time consumed by the last N data read and write operations.
  • the foregoing apparatus further includes: a selecting unit, when determining that the read/write state of the IP disk is not in an idle state, selecting a next IP disk; and the second calculating unit is configured to calculate the selected the next IP The average time consumed by the disk to perform the most recent data read and write operations; the third determining unit is configured to determine whether the average time is less than the reference time; and the third allocating unit is configured to determine that the average time is less than the reference time In the case, the above data read and write request is allocated to the selected next IP disk.
  • the foregoing apparatus further includes: a determining unit, configured to determine that the IP disk is the Mth allocated data read/write request before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations a fourth determining unit, configured to determine whether M is greater than N, and M is a positive integer, wherein the first calculating unit is further configured to perform calculation for the currently selected IP disk to perform the last N times, if it is determined that M is greater than N The step of the average time consumed by data read and write operations.
  • the foregoing apparatus further includes: a fourth allocating unit, configured to directly allocate the data read/write request to the currently selected IP disk if it is determined that M is not greater than N.
  • a fourth allocating unit configured to directly allocate the data read/write request to the currently selected IP disk if it is determined that M is not greater than N.
  • an embodiment of the present application further provides an electronic device, including:
  • processor a memory, a communication interface, and a bus
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable code
  • the processor by reading the executable code stored in the memory, runs a program corresponding to the executable code for performing any of the methods for allocating an Internet Protocol IP disk provided by the embodiments of the present application.
  • the embodiment of the present application further provides a storage medium for storing executable code, and the executable code is used to execute any method for allocating an Internet Protocol IP disk provided by the embodiments of the present application.
  • the embodiment of the present application further provides an executable code for performing any method for allocating an Internet Protocol IP disk provided by the embodiment of the present application.
  • the method for comparing the average time consumed by the IP disk to perform the most recent data read and write operations and the reference time is adopted, and the data read and write request sent by the client is received; and the currently selected IP disk is calculated.
  • the average time consumed by the last N data read and write operations where N is a positive integer; determining whether the average time is less than the reference time, wherein the reference time is the time consumed by the predetermined disk to perform data read and write operations;
  • the management server actively calculates the IP disk to perform the latest N data reading.
  • the average time consumed by the write operation is to allocate the data read and write request to the IP disk when the processing speed of the IP disk is determined to be fast enough, thereby realizing the technical effect of improving the load balancing effect of the management server, thereby solving the problem.
  • the IP disk cannot provide the management server due to limited processing capacity. Real-time information, and therefore can not work out a reasonable load balancing strategy, eventually leading to technical problems of poor management server load balancing effect.
  • FIG. 1 is a schematic diagram of a load balancing system for an IP disk provided by the related art
  • FIG. 2 is a flowchart of an optional method for allocating an internet protocol IP disk according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of an optional round-assigned IP disk provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an optional apparatus for allocating an internet protocol IP disk according to an embodiment of the present application.
  • IP disk refers to a disk that uses the IP protocol (interconnect protocol between networks) interface instead of the traditional SCSI (Small Computer System Interface) standard protocol interface, and the traditional disk requires a small computer system.
  • the interface communicates with the host to complete data read and write operations. It is a self-contained disk that can communicate with the host. Under the control of the host, the simpler and more general IP protocol and Ethernet technology are used to transfer data to and from the host, so that data read and write operations are performed spontaneously by key-value reading and writing.
  • SAS Serial Attached SCSI
  • SATA Serial Advanced Technology Attachment
  • the interconnection is simpler, almost independent of distance, so there is no performance bottleneck, and the scalability of its storage system is greatly enhanced.
  • IP disks users no longer need to maintain a separate storage connection network, only need to maintain an IP network, which undoubtedly reduces the cost of the user.
  • the management server also known as the metadata server, is primarily used to organize and manage spatial information.
  • the object server also known as the object storage server, is mainly used to manage the online and offline tasks of the IP disk and some computing tasks.
  • a load balancer is a collection of servers in a symmetric manner by multiple servers. Each server has an equivalent status and can provide services separately without the assistance of other servers.
  • the load balancer distributes externally sent requests evenly to a server in a symmetric structure through a load sharing technology, and the server receiving the request can independently request the corresponding client.
  • the balanced loader is able to evenly distribute requests to the server set, thus providing a service that quickly acquires important data, and solves the problem of requesting a large number of concurrent accesses to the same server.
  • the embodiment of the present application provides a method for allocating an internet protocol IP disk. It should be noted that the steps shown in the flowchart of the drawing may be performed in a computer system such as a set of computer executable instructions, and although The logical order is shown in the flowchart, but in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 2 is a flowchart of an optional method for allocating an internet protocol IP disk according to an embodiment of the present application.
  • the method can be, but is not limited to, applied to a management server. As shown in FIG. 2, the method includes the following steps:
  • Step S202 receiving a data read/write request sent by the client
  • Step S204 calculating an average time consumed by the currently selected (including but not limited to using a disk picking pointer to select) the IP disk to perform the most recent N data read and write operations, where N is a positive integer;
  • Step S206 determining whether the average time is less than the reference time, wherein the reference time is a time consumed by the preset disk to perform data read and write operations;
  • Step S208 in the case that it is determined that the average time is less than the reference time, the data read/write request is allocated to the currently selected IP disk (including but not limited to the disk picking pointer currently referred to).
  • the embodiment of the present application proposes a method for obtaining the pressure of the IP disk.
  • the fixed size of the I/O data in the data read and write operation may be set in advance, and the read/write operation of the fixed-size I/O data is performed each time repeatedly by the preset disk.
  • the elapsed time based on these times, calculates the average time taken by the preset disk to perform the operation of the fixed-size I/O data once, and uses the calculation result as the reference time.
  • the I/O data size is 1 MB in the data read/write operation in advance, and the average time consumed by the IP disk when processing 1 MB of I/O data is obtained through a large number of tests, and this time is used as the reference time. .
  • the management server records the start time and end time of the IP disk performing I/O data processing each time, and calculates the time taken to perform each I/O data processing. In order to avoid the contingency affecting the estimated IP disk pressure, the management server will further calculate the average time taken by the IP disk to perform the data read and write operations for the last N times (such as 5 times, which can be adjusted according to actual needs).
  • the management server allocates a corresponding IP disk for the data read/write request. Specifically, after receiving the data read/write request sent by the client, the management server first checks the disk selection pointer. The currently referred IP disk calculates the average time it takes to perform the most recent N data read and write operations. For example, for the IP disk, if this is the sixth allocation request, the last 5 times of consumption can be calculated. The average time is compared with the reference time. If the average time is less than the reference time, it indicates that the current processing capacity of the IP disk is strong, so data read and write requests can be allocated to the IP disk for processing.
  • all IP disks in the load balancing system need to be sorted according to the order of the disk capacity, and a circular sort list of the IP disks is obtained, based on the The circular sorting list can achieve the purpose of distributing IP disks in turn.
  • the disk picking pointer can be pointed to the linked list header, and each time an IP disk is selected, the pointer will be sequentially moved in the order of the IP disk's circular sorting list until it is returned to the linked list header. After a round of distribution, this cycle reciprocates to realize the rotation of the IP disk. purpose.
  • the method of comparing the average time consumed by the IP disk to perform the most recent N data read and write operations and the reference time is achieved, and the management server is obtained when the IP disk cannot provide real-time information to the management server.
  • the IP disk since the IP disk has limited processing capability and cannot provide real-time information to the management server, it is impossible to formulate a reasonable load balancing policy, which ultimately leads to a technical problem that the load balancing effect of the management server is not good.
  • the foregoing method further includes:
  • the S2 is implemented by the following process to determine whether the number of times the data read/write request is allocated is 0. When the number of data read/write requests allocated to the IP disk is 0, the IP disk is idle, and the data of the IP disk is read. When the number of write request allocations is not 0, the read and write status of the IP disk is not idle, that is, it is busy.
  • the data read/write request is allocated to the currently selected (including but not limited to the disk selection pointer currently referred to ) of the IP disk.
  • the average time is not less than the reference time, it indicates that the current processing capability of the IP disk is not very strong, and the IP disk may have the ability to respond to data read and write requests, or may not be able to respond to data read and write requests.
  • the management server adds 1 to the allocation count of the IP disk each time the IP disk is allocated, and the IP disk reads and writes the IP disk every time the IP disk completes the data read and write operations.
  • the corresponding allocation count is decremented by 1, so when the allocation count corresponding to an IP disk is 0, the number of data read/write requests allocated to the IP disk will be 0; otherwise, the IP disk The number of data read and write requests will not be 0.
  • the management server may also determine whether the current state of the IP disk is idle or available by other means such as data traffic through the read/write interface.
  • the above methods also include:
  • S6 Clear the related record of the average time consumed by the IP disk to perform the last N data read and write operations.
  • the data read/write processing capability of the IP disk whose number of data read/write requests is 0 can actually satisfy the current data read and write request.
  • the IP disk is allocated according to the actual situation.
  • the upper is the number of data read and write requests allocated by the IP disk, not the average time it takes to perform the most recent N data read and write operations. That is, at this time, the IP disk can be allocated according to the former to obtain a better load balancing effect. Therefore, before the data read/write request is allocated to the IP disk currently pointed by the disk selection pointer, the IP disk is cleared for the last N times (for example, 5 times).
  • the average time consumed by data read and write operations can prevent the management server from using the average time in the subsequent load balancing process, thus affecting the load balancing effect.
  • the method further includes:
  • S8 select (including but not limited to, make the disk pick pointer point to the next IP disk to select) the next IP disk;
  • the data read/write request is allocated to the selected IP disk (including but not limited to the disk picking pointer).
  • the number of data read/write requests allocated by the IP disk is not 0, it indicates that it is in a busy working state, and its current data processing capability is difficult to respond to data read and write requests sent by the client, and thus
  • the data read and write request can be assigned to the IP disk currently referred to by the disk pick pointer. In this case, it is necessary to have the disk pick pointer point to the next IP disk and execute S10, S12, S14.
  • S10, S12, and S14 are the same as steps S204, S206, and S208, and are not described here.
  • the next IP disk in the above step may be the next IP disk in the IP disk sequence table stored in the database, and the ordering may be pre-arranged, or may be calculated according to a preset rule or algorithm in step S8. of.
  • the method before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
  • S18 Determine whether M is greater than N, where M is a positive integer, and if it is determined that M is greater than N, perform the step of calculating an average time consumed by the currently selected IP disk to perform the last N data read and write operations.
  • the foregoing method further includes:
  • the IP disk is currently the first time to be allocated data read and write requests, for example, if the load balancing policy requires calculation of the average time of the last 5 times, The IP disk is currently assigned a data read/write request any one of the 1-4 times, and the data read/write request can be directly allocated to the IP disk. Otherwise, the disk selection policy in the above embodiment is required to allocate the corresponding disk. , will not repeat them here.
  • the embodiment of the present application provides an apparatus for allocating an internet protocol IP disk.
  • FIG. 4 is a schematic diagram of an apparatus for allocating an Internet Protocol IP disk according to an embodiment of the present disclosure.
  • the apparatus includes: a receiving unit 402, configured to receive a data read/write request sent by a client;
  • the first calculating unit 404 is configured to calculate an average time taken by the currently selected IP disk to perform the most recent data read and write operations, where N is a positive integer, and the first determining unit 406 is configured to determine whether the average time is less than the reference time.
  • the reference time is a time taken by the preset disk to perform a data read/write operation;
  • the first allocating unit 408 is configured to determine that the average time is less than the reference time In the case of a data read and write request, the currently selected IP disk is allocated.
  • the embodiment of the present application proposes a method for obtaining the pressure of the IP disk.
  • the fixed size of the I/O data in the data read and write operation may be set in advance, and the read/write operation of the fixed-size I/O data is performed each time repeatedly by the preset disk.
  • the elapsed time based on these times, calculates the average time taken by the preset disk to perform the operation of the fixed-size I/O data once, and uses the calculation result as the reference time.
  • the I/O data size is 1 MB in the data read/write operation in advance, and the average time consumed by the IP disk when processing 1 MB of I/O data is obtained through a large number of tests, and this time is used as the reference time. .
  • the management server records the start time and end time of the IP disk performing I/O data processing each time, and calculates the time taken to perform each I/O data processing. In order to avoid the contingency affecting the estimated IP disk pressure, the management server will further calculate the average time taken by the IP disk to perform the data read and write operations for the last N times (such as 5 times, which can be adjusted according to actual needs).
  • the management server allocates a corresponding IP disk for the data read/write request. Specifically, after receiving the data read/write request sent by the client, the management server first checks the disk selection pointer. The currently referred IP disk calculates the average time it takes to perform the most recent N data read and write operations. For example, for the IP disk, if this is the sixth allocation request, the last 5 times of consumption can be calculated. The average time is compared with the reference time. If the average time is less than the reference time, it indicates that the current processing capacity of the IP disk is strong, so data read and write requests can be allocated to the IP disk for processing.
  • the method of comparing the average time consumed by the IP disk to perform the most recent N data read and write operations and the reference time is achieved, and the management server is obtained when the IP disk cannot provide real-time information to the management server.
  • the IP disk since the IP disk has limited processing capability and cannot provide real-time information to the management server, it is impossible to formulate a reasonable load balancing policy, which ultimately leads to a technical problem that the load balancing effect of the management server is not good.
  • the device further includes: a second determining unit, configured to determine that the average time is not small In the case of the reference time, it is determined whether the read/write status of the IP disk is in an idle state.
  • a second determining unit configured to determine that the average time is not small In the case of the reference time, it is determined whether the read/write status of the IP disk is in an idle state.
  • the second determining unit is configured to determine, when the average time is not less than the reference time, whether the number of times the data read/write request is allocated is 0, wherein when the number of data read/write requests allocated to the IP disk is 0, The IP disk is in an idle state. When the number of data read/write requests allocated to the IP disk is not 0, the IP disk is in a busy state; and the second allocation unit is configured to determine that the read and write status of the IP disk is idle (for example, When the number of data read/write requests is 0), the data read/write request is assigned to the currently selected IP disk.
  • the foregoing apparatus further includes: a clearing unit, configured to: when it is determined that the read/write state of the IP disk is an idle state (for example, the number of times the data read/write request is allocated is 0), and the data read/write request is allocated to Before the currently selected IP disk, clear the related record of the average time taken by the IP disk to perform the most recent N data read and write operations.
  • a clearing unit configured to: when it is determined that the read/write state of the IP disk is an idle state (for example, the number of times the data read/write request is allocated is 0), and the data read/write request is allocated to Before the currently selected IP disk, clear the related record of the average time taken by the IP disk to perform the most recent N data read and write operations.
  • the foregoing apparatus further includes: a selecting unit, when determining that the read/write status of the IP disk is not in an idle state (for example, the number of times the data read/write request allocation is not 0), selecting the next IP disk; the second calculation a unit, configured to calculate an average time consumed by the selected next IP disk to perform the last N data read and write operations; a third determining unit, configured to determine whether the average time is less than a reference time; and a third allocation unit, configured to determine When the average time is less than the reference time, the data read and write request is allocated to the selected next IP disk.
  • a selecting unit when determining that the read/write status of the IP disk is not in an idle state (for example, the number of times the data read/write request allocation is not 0), selecting the next IP disk
  • the second calculation a unit configured to calculate an average time consumed by the selected next IP disk to perform the last N data read and write operations
  • a third determining unit configured to determine whether the average time is less than a reference time
  • the foregoing apparatus further includes: a determining unit, configured to determine that the IP disk is the Mth allocated data read/write request before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations;
  • the fourth determining unit is configured to determine whether M is greater than N, and M is a positive integer.
  • the first calculating unit is further configured to perform calculation of the currently selected IP disk to perform the last N data readings when it is determined that M is greater than N. The step of the average time consumed by the write operation.
  • the foregoing apparatus further includes: a fourth allocating unit, configured to directly allocate the data read/write request to the currently selected IP disk, if it is determined that M is not greater than N.
  • a fourth allocating unit configured to directly allocate the data read/write request to the currently selected IP disk, if it is determined that M is not greater than N.
  • the embodiment of the present application further provides an electronic device, which may include: a processor, a memory, a communication interface, and a bus;
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable code
  • the processor by reading the executable code stored in the memory, to run a program corresponding to the executable code, for performing the method for distributing an Internet Protocol IP disk provided by the embodiment of the present application;
  • the method for allocating an internet protocol IP disk provided by the application embodiment may include:
  • the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
  • the data read/write request is allocated to the currently selected IP disk.
  • the method further includes:
  • the data read/write request is allocated to the currently selected IP disk.
  • the method further includes: before determining that the read/write state of the IP disk is in an idle state, and before the data read/write request is allocated to the currently selected IP disk, the method further includes:
  • the method further includes:
  • the data read and write request is determined if it is determined that the average time is less than the reference time Assigned to the selected next IP disk.
  • the method further includes: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
  • M is a positive integer.
  • the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
  • the method further includes:
  • the data read/write request is directly allocated to the currently selected IP disk.
  • the embodiment of the present application further provides a storage medium for storing executable code, where the executable code is used to execute the method for allocating an Internet Protocol IP disk provided by the embodiment of the present application;
  • the provided method of allocating an internet protocol IP disk may include:
  • the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
  • the data read/write request is allocated to the currently selected IP disk.
  • the method further includes:
  • the data read/write request is allocated to the currently selected IP disk.
  • the method further includes: before determining that the read/write state of the IP disk is in an idle state, and before the data read/write request is allocated to the currently selected IP disk, the method further includes:
  • the method further includes:
  • the data read/write request is allocated to the selected next IP disk.
  • the method further includes: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
  • M is a positive integer.
  • the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
  • the method further includes:
  • the data read/write request is directly allocated to the currently selected IP disk.
  • the embodiment of the present application further provides an executable code for performing the method for allocating an Internet Protocol IP disk provided by the embodiment of the present application.
  • the method for allocating an Internet Protocol IP disk provided by the embodiment of the present application may be include:
  • the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
  • the data read/write request is allocated to the currently selected IP disk.
  • the method further includes:
  • the data read/write request is allocated to the currently selected IP disk.
  • the method further includes: before determining that the read/write state of the IP disk is in an idle state, and before the data read/write request is allocated to the currently selected IP disk, the method further includes:
  • the method further includes:
  • the data read/write request is allocated to the selected next IP disk.
  • the method further includes: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
  • M is a positive integer.
  • the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
  • the method further includes:
  • the data read/write request is directly allocated to the currently selected IP disk.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are only schematic.
  • the division of the unit may be a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Abstract

Provided are a method and device for assigning an Internet Protocol (IP) disk. The method comprises: receiving a data reading and writing request sent by a client (S202); calculating an average time consumed by a currently selected IP disk when performing the last N data reading and writing operations, wherein N is a positive integer (S204); determining whether or not the average time is less than a reference time, wherein the reference time is a preset time consumed by a disk when performing the data reading and writing operation (S206); and when it is determined that the average time is less than the reference time, assigning the data reading and writing request to the currently selected IP disk (S208). The method solves the technical problem that an IP disk in the related technology cannot provide a reasonable load balancing strategy, which finally leads to the poor load balancing effect of the management server, because it cannot provide real-time information to the management server due to limited processing capacity.

Description

分配网际协议IP磁盘的方法及装置Method and device for allocating internet protocol IP disk
本申请要求于2016年6月12日提交中国专利局、申请号为201610411513.0发明名称为“分配网际协议IP磁盘的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201610411513.0, entitled "Method and Apparatus for Assigning Internet Protocol IP Disks", to the Chinese Patent Office, which is incorporated herein by reference. in.
技术领域Technical field
本申请涉及数据存储技术领域,特别涉及一种分配网际协议IP磁盘的方法及装置。The present application relates to the field of data storage technologies, and in particular, to a method and an apparatus for allocating an internet protocol IP disk.
背景技术Background technique
IP(Internet Protocol,互联网协议,又称网际协议)磁盘,即采用IP协议接口的磁盘,与传统磁盘需要借助小型计算机系统接口与主机进行通信以完成数据读写操作不同,它是一种自包含磁盘,可以在不与主机通信、不受主机控制的情况下,自发地以key-value的读写方式完成数据读写操作。IP (Internet Protocol, Internet Protocol, also known as Internet Protocol) disk, that is, the disk using the IP protocol interface, and the traditional disk needs to communicate with the host through the small computer system interface to complete the data read and write operations, it is a self-contained The disk can spontaneously read and write data by key-value read and write without communicating with the host and without being controlled by the host.
如图1所示,每个IP磁盘相当于一台服务器,多个IP磁盘可以以对称方式组成一个服务器集合。其中,该集合中每台服务器都具有等价的地位,都可以单独对外提供服务而无须其他服务器辅助。实施时,为了避免大量请求并发访问服务器集合中的同一台服务器,管理服务器会充当负载均衡器,通过特定负载均衡策略,将客户端发送的请求均匀地分配到服务器集合中的服务器上,进而由接到请求的服务器独立响应客户端。为了制定出较为合理的负载均衡策略,管理服务器需要获取IP磁盘的实时数据,包括CPU(Central Processing Unit,中央处理器)处理能力、磁盘容量、I/O(Input/Output,输入/输出)压力及处理能力、网络带宽等。然而,与传统磁盘可以实时上报信息不同,IP磁盘由于处理能力有限,无法给管理服务器提供实时数据,因而无法制定出合理的负载均衡策略,最终导致管理服务器的负载均衡失去了实际意义。As shown in Figure 1, each IP disk is equivalent to one server, and multiple IP disks can form a server set in a symmetric manner. Among them, each server in the collection has an equivalent status, and can provide services separately without additional server assistance. In implementation, in order to avoid a large number of requests for concurrent access to the same server in the server collection, the management server acts as a load balancer, and uniformly distributes the requests sent by the client to the servers in the server set through a specific load balancing policy. The server that receives the request responds to the client independently. In order to develop a more reasonable load balancing strategy, the management server needs to obtain real-time data of the IP disk, including CPU (Central Processing Unit) processing capacity, disk capacity, and I/O (Input/Output) pressure. And processing power, network bandwidth, and so on. However, unlike the traditional disk that can report information in real time, the IP disk cannot provide real-time data to the management server due to limited processing capacity, so it is impossible to formulate a reasonable load balancing policy. Eventually, the load balancing of the management server loses its practical significance.
针对上述问题,目前尚未提出有效的解决方案。In response to the above problems, no effective solution has been proposed yet.
发明内容Summary of the invention
本申请实施例的目的在于提供一种分配网际协议IP磁盘的方法及装置, 以至少解决相关技术中IP磁盘由于处理能力有限,无法给管理服务器提供实时信息,因而无法制定出合理的负载均衡策略,最终导致管理服务器的负载均衡效果不佳的技术问题。The purpose of the embodiments of the present application is to provide a method and an apparatus for allocating an internet protocol IP disk. In order to solve at least the technical problem that the IP disk of the related technology cannot provide real-time information to the management server due to limited processing capability, it is impossible to formulate a reasonable load balancing policy, and ultimately the management server has poor load balancing effect.
为达到上述目的,本申请实施例提供了一种分配网际协议IP磁盘的方法,包括:接收客户端发送的数据读写请求;计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;判断上述平均时间是否小于基准时间,其中,上述基准时间为预设磁盘执行数据读写操作所消耗的时间;在判断出上述平均时间小于上述基准时间的情况下,将上述数据读写请求分配给当前选中的上述IP磁盘。To achieve the above objective, the embodiment of the present application provides a method for allocating an Internet Protocol IP disk, including: receiving a data read/write request sent by a client; and calculating a current selected IP disk to perform the last N data read and write operations. An average time, wherein N is a positive integer; determining whether the average time is less than a reference time, wherein the reference time is a time consumed by a predetermined disk to perform a data read/write operation; and determining that the average time is less than the reference time Next, the above data read and write request is allocated to the currently selected IP disk.
可选的,在判断出上述平均时间不小于上述基准时间的情况下,上述方法还包括:判断上述IP磁盘的读写状态是否为空闲状态;在判断出上述IP磁盘的读写状态为空闲状态的情况下,将上述数据读写请求分配给当前选中的上述IP磁盘。Optionally, in the case that it is determined that the average time is not less than the reference time, the method further includes: determining whether the read/write state of the IP disk is an idle state; determining that the read/write state of the IP disk is an idle state. In the case of the above, the data read and write request is allocated to the currently selected IP disk.
可选的,在判断出上述IP磁盘的读写状态为空闲状态的情况下,且将上述数据读写请求分配给当前选中的上述IP磁盘之前,上述方法还包括:清除上述IP磁盘执行最近N次数据读写操作所消耗的上述平均时间的相关记录。Optionally, in the case that the read/write state of the IP disk is determined to be in an idle state, and the data read/write request is allocated to the currently selected IP disk, the method further includes: clearing the IP disk to execute the latest N. A record of the above average time consumed by the secondary data read and write operations.
可选的,在判断出上述IP磁盘的读写状态不为空闲状态的情况下,上述方法还包括:选中下一个IP磁盘;计算选中的上述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间;判断该平均时间是否小于上述基准时间;在判断出该平均时间小于上述基准时间的情况下,将上述数据读写请求分配给选中的上述下一个IP磁盘。Optionally, in the case that it is determined that the read/write state of the IP disk is not in an idle state, the method further includes: selecting a next IP disk; and calculating the selected next IP disk to perform the last N data read and write operations. The average time consumed; determining whether the average time is less than the reference time; and determining that the average time is less than the reference time, assigning the data read/write request to the selected next IP disk.
可选的,在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,上述方法还包括:确定上述IP磁盘是第M次被分配数据读写请求;判断M是否大于N,其中,M为正整数,在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Optionally, before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes: determining that the IP disk is the Mth allocated data read/write request; determining whether the M is greater than N, where M is a positive integer, and in the case where it is judged that M is greater than N, the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
可选的,在判断出M不大于N的情况下,上述方法还包括:直接将上述数据读写请求分配给当前选中的上述IP磁盘。 Optionally, in the case that it is determined that M is not greater than N, the method further includes: directly allocating the data read/write request to the currently selected IP disk.
为达到上述目的,本申请实施例还提供了一种分配网际协议IP磁盘的装置,包括:接收单元,用于接收客户端发送的数据读写请求;第一计算单元,用于计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;第一判断单元,用于判断上述平均时间是否小于基准时间,其中,上述基准时间为预设磁盘执行数据读写操作所消耗的时间;第一分配单元,用于在判断出上述平均时间小于上述基准时间的情况下,将上述数据读写请求分配给当前选中的上述IP磁盘。To achieve the above objective, the embodiment of the present application further provides an apparatus for allocating an Internet Protocol IP disk, including: a receiving unit, configured to receive a data read/write request sent by a client; and a first calculating unit, configured to calculate the currently selected The average time consumed by the IP disk to perform the most recent data read and write operations, wherein N is a positive integer; the first determining unit is configured to determine whether the average time is less than the reference time, wherein the reference time is a preset disk execution data. The time consumed by the read/write operation; the first allocation unit is configured to allocate the data read/write request to the currently selected IP disk when it is determined that the average time is less than the reference time.
可选的,上述装置还包括:第二判断单元,用于在判断出上述平均时间不小于上述基准时间的情况下,判断上述IP磁盘的读写状态是否为空闲状态;第二分配单元,用于在判断出上述IP磁盘的读写状态为空闲状态的情况下,将上述数据读写请求分配给当前选中的上述IP磁盘。Optionally, the device further includes: a second determining unit, configured to determine, when the average time is not less than the reference time, whether the read/write state of the IP disk is an idle state; When it is determined that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
可选的,上述装置还包括:清除单元,用于在判断出上述IP磁盘的读写状态为空闲状态的情况下,且将上述数据读写请求分配给当前选中的上述IP磁盘之前,清除上述IP磁盘执行最近N次数据读写操作所消耗的上述平均时间的相关记录。Optionally, the device further includes: a clearing unit, configured to: after determining that the read/write status of the IP disk is in an idle state, and allocating the data read/write request to the currently selected IP disk, clearing the foregoing The IP disk performs a correlation record of the above average time consumed by the last N data read and write operations.
可选的,上述装置还包括:选择单元,在判断出上述IP磁盘的读写状态不为空闲状态的情况下,选中下一个IP磁盘;第二计算单元,用于计算选中的上述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间;第三判断单元,用于判断该平均时间是否小于上述基准时间;第三分配单元,用于在判断出该平均时间小于上述基准时间的情况下,将上述数据读写请求分配给选中的上述下一个IP磁盘。Optionally, the foregoing apparatus further includes: a selecting unit, when determining that the read/write state of the IP disk is not in an idle state, selecting a next IP disk; and the second calculating unit is configured to calculate the selected the next IP The average time consumed by the disk to perform the most recent data read and write operations; the third determining unit is configured to determine whether the average time is less than the reference time; and the third allocating unit is configured to determine that the average time is less than the reference time In the case, the above data read and write request is allocated to the selected next IP disk.
可选的,上述装置还包括:确定单元,用于在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,确定上述IP磁盘是第M次被分配数据读写请求;第四判断单元,用于判断M是否大于N,M为正整数,其中,上述第一计算单元还用于在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Optionally, the foregoing apparatus further includes: a determining unit, configured to determine that the IP disk is the Mth allocated data read/write request before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations a fourth determining unit, configured to determine whether M is greater than N, and M is a positive integer, wherein the first calculating unit is further configured to perform calculation for the currently selected IP disk to perform the last N times, if it is determined that M is greater than N The step of the average time consumed by data read and write operations.
可选的,上述装置还包括:第四分配单元,用于在判断出M不大于N的情况下,直接将上述数据读写请求分配给当前选中的上述IP磁盘。 Optionally, the foregoing apparatus further includes: a fourth allocating unit, configured to directly allocate the data read/write request to the currently selected IP disk if it is determined that M is not greater than N.
为达到上述目的,本申请实施例还提供了一种电子设备,包括:To achieve the above objective, an embodiment of the present application further provides an electronic device, including:
处理器、存储器、通信接口和总线;a processor, a memory, a communication interface, and a bus;
所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;The processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
所述存储器存储可执行代码;The memory stores executable code;
所述处理器通过读取所述存储器中存储的可执行代码来运行与所述可执行代码对应的程序,以用于执行本申请实施例所提供的任意一种分配网际协议IP磁盘的方法。The processor, by reading the executable code stored in the memory, runs a program corresponding to the executable code for performing any of the methods for allocating an Internet Protocol IP disk provided by the embodiments of the present application.
为达到上述目的,本申请实施例还提供了一种存储介质,用于存储可执行代码,所述可执行代码用于执行本申请实施例所提供的任意一种分配网际协议IP磁盘的方法。To achieve the above objective, the embodiment of the present application further provides a storage medium for storing executable code, and the executable code is used to execute any method for allocating an Internet Protocol IP disk provided by the embodiments of the present application.
为达到上述目的,本申请实施例还提供了一种可执行代码,用于执行本申请实施例所提供的任意一种分配网际协议IP磁盘的方法。To achieve the above objective, the embodiment of the present application further provides an executable code for performing any method for allocating an Internet Protocol IP disk provided by the embodiment of the present application.
在本申请实施例中,采用比较IP磁盘执行最近N次数据读写操作所消耗的平均时间与基准时间的大小的方式,通过接收客户端发送的数据读写请求;计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;判断平均时间是否小于基准时间,其中,基准时间为预设磁盘执行数据读写操作所消耗的时间;在判断出平均时间小于基准时间的情况下,将数据读写请求分配给当前选中的IP磁盘,达到了在IP磁盘无法给管理服务器提供实时信息的情况下,由管理服务器主动计算IP磁盘执行最近N次数据读写操作所消耗的平均时间,在确定IP磁盘的处理速度足够快时,才将数据读写请求分配给该IP磁盘的目的,从而实现了改善导致管理服务器的负载均衡效果的技术效果,进而解决了相关技术中IP磁盘由于处理能力有限,无法给管理服务器提供实时信息,因而无法制定出合理的负载均衡策略,最终导致管理服务器的负载均衡效果不佳的技术问题。In the embodiment of the present application, the method for comparing the average time consumed by the IP disk to perform the most recent data read and write operations and the reference time is adopted, and the data read and write request sent by the client is received; and the currently selected IP disk is calculated. The average time consumed by the last N data read and write operations, where N is a positive integer; determining whether the average time is less than the reference time, wherein the reference time is the time consumed by the predetermined disk to perform data read and write operations; When the time is less than the reference time, the data read and write request is allocated to the currently selected IP disk, and when the IP disk cannot provide real-time information to the management server, the management server actively calculates the IP disk to perform the latest N data reading. The average time consumed by the write operation is to allocate the data read and write request to the IP disk when the processing speed of the IP disk is determined to be fast enough, thereby realizing the technical effect of improving the load balancing effect of the management server, thereby solving the problem. In the related art, the IP disk cannot provide the management server due to limited processing capacity. Real-time information, and therefore can not work out a reasonable load balancing strategy, eventually leading to technical problems of poor management server load balancing effect.
附图说明DRAWINGS
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例 和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application and the technical solutions of the prior art, the following embodiments BRIEF DESCRIPTION OF THE DRAWINGS The drawings, which are used in the prior art, are briefly described. It is obvious that the drawings in the following description are only some embodiments of the present application, and those skilled in the art will not make any creative work. Further drawings can also be obtained from these figures.
图1是相关技术提供的一种用于IP磁盘的负载均衡系统的示意图;1 is a schematic diagram of a load balancing system for an IP disk provided by the related art;
图2是本申请实施例提供的一种可选的分配网际协议IP磁盘的方法的流程图;2 is a flowchart of an optional method for allocating an internet protocol IP disk according to an embodiment of the present application;
图3是本申请实施例提供的一种可选的轮转分配IP磁盘的示意图;3 is a schematic diagram of an optional round-assigned IP disk provided by an embodiment of the present application;
图4是本申请实施例提供的一种可选的分配网际协议IP磁盘的装置的示意图。FIG. 4 is a schematic diagram of an optional apparatus for allocating an internet protocol IP disk according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or order. It is to be understood that the data so used may be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "comprises" and "comprises" and "the" and "the" are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to Those steps or units may include other steps or units not explicitly listed or inherent to such processes, methods, products or devices.
以下对本申请涉及到的相关术语简单解释如下:The following briefly explains the related terms involved in this application as follows:
IP磁盘,顾名思义,它是指采用IP协议(网络之间的互连协议)接口代替传统的SCSI(Small Computer System Interface,小型计算机系统接口)标准协议接口的磁盘,与传统磁盘需要借助小型计算机系统接口与主机进行通信以完成数据读写操作不同,它是一种自包含磁盘,可以在不与主机通信、 不受主机控制的情况下,采用更简单通用的IP协议以及以太网技术,与主机之间传递数据,从而自发地以key-value的读写方式完成数据读写操作。与传统SAS(Serial Attached SCSI,串行连接SCSI接口)/SATA(Serial Advanced Technology Attachment,串行高级技术附件)接口容易产生的性能瓶颈相比,IP磁盘由于采用IP接口,因而与主机之间的互联更加简单,几乎不受距离限制,因此不会产生性能瓶颈,并且其存储系统的扩展性也大大增强了。同时,使用IP磁盘,用户无需再维护单独的存储连接网络,只需要维护一张IP网络,这无疑降低了用户的成本投入。IP disk, as its name suggests, refers to a disk that uses the IP protocol (interconnect protocol between networks) interface instead of the traditional SCSI (Small Computer System Interface) standard protocol interface, and the traditional disk requires a small computer system. The interface communicates with the host to complete data read and write operations. It is a self-contained disk that can communicate with the host. Under the control of the host, the simpler and more general IP protocol and Ethernet technology are used to transfer data to and from the host, so that data read and write operations are performed spontaneously by key-value reading and writing. Compared with the performance bottleneck that is easily caused by the traditional SAS (Serial Attached SCSI)/SATA (Serial Advanced Technology Attachment) interface, the IP disk is connected to the host computer due to the IP interface. The interconnection is simpler, almost independent of distance, so there is no performance bottleneck, and the scalability of its storage system is greatly enhanced. At the same time, using IP disks, users no longer need to maintain a separate storage connection network, only need to maintain an IP network, which undoubtedly reduces the cost of the user.
管理服务器,又称为元数据服务器,主要用于组织和管理空间信息。The management server, also known as the metadata server, is primarily used to organize and manage spatial information.
对象服务器,又称为对象存储服务器,主要用于管理IP磁盘的上下线任务及部分计算任务。The object server, also known as the object storage server, is mainly used to manage the online and offline tasks of the IP disk and some computing tasks.
负载均衡器,是由多台服务器以对称的方式组成一个服务器集合,每台服务器都具有等价的地位,都可以单独对外提供服务而无须其他服务器的辅助。负载均衡器通过某种负载分担技术,将外部发送来的请求均匀分配到对称结构中的某一台服务器上,而接收到请求的服务器能够独立相应客户端的请求。均衡负载器能够平均分配请求到服务器集合中,因而能够提供快速获取重要数据的服务,解决了请求大量并发访问同一服务器的问题。A load balancer is a collection of servers in a symmetric manner by multiple servers. Each server has an equivalent status and can provide services separately without the assistance of other servers. The load balancer distributes externally sent requests evenly to a server in a symmetric structure through a load sharing technology, and the server receiving the request can independently request the corresponding client. The balanced loader is able to evenly distribute requests to the server set, thus providing a service that quickly acquires important data, and solves the problem of requesting a large number of concurrent accesses to the same server.
实施例1Example 1
本申请实施例提供了一种分配网际协议IP磁盘的方法,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The embodiment of the present application provides a method for allocating an internet protocol IP disk. It should be noted that the steps shown in the flowchart of the drawing may be performed in a computer system such as a set of computer executable instructions, and although The logical order is shown in the flowchart, but in some cases the steps shown or described may be performed in a different order than the ones described herein.
图2是本申请实施例提供的一种可选的分配网际协议IP磁盘的方法的流程图。该方法可以但不限于应用于管理服务器。如图2所示,该方法包括如下步骤:FIG. 2 is a flowchart of an optional method for allocating an internet protocol IP disk according to an embodiment of the present application. The method can be, but is not limited to, applied to a management server. As shown in FIG. 2, the method includes the following steps:
步骤S202,接收客户端发送的数据读写请求;Step S202, receiving a data read/write request sent by the client;
步骤S204,计算当前选中的(包括但不限于使用磁盘挑选指针来选择)IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数; Step S204, calculating an average time consumed by the currently selected (including but not limited to using a disk picking pointer to select) the IP disk to perform the most recent N data read and write operations, where N is a positive integer;
步骤S206,判断平均时间是否小于基准时间,其中,基准时间为预设磁盘执行数据读写操作所消耗的时间;Step S206, determining whether the average time is less than the reference time, wherein the reference time is a time consumed by the preset disk to perform data read and write operations;
步骤S208,在判断出平均时间小于基准时间的情况下,将数据读写请求分配给当前选中的(包括但不限于磁盘挑选指针当前所指的)IP磁盘。Step S208, in the case that it is determined that the average time is less than the reference time, the data read/write request is allocated to the currently selected IP disk (including but not limited to the disk picking pointer currently referred to).
为了解决IP磁盘无法提供实时信息的问题,本申请实施例提出了一种获取IP磁盘的压力的方法。具体地,实施步骤S202之前,可以预先设定1次数据读写操作中I/O数据的固定大小,多次反复测试预设磁盘每次执行上述固定大小的I/O数据的读写操作所消耗的时间,基于这些时间计算该预设磁盘执行1次固定大小的I/O数据的操作所消耗的平均时间,并将计算结果作为基准时间。例如,预先设定1次数据读写操作中I/O数据大小为1MB,通过大量测试,得出处理1MB大小的I/O数据时IP磁盘所消耗的平均时间,并将此时间作为基准时间。另外,针对每个IP磁盘,管理服务器每次都会记录IP磁盘执行I/O数据处理时的起始时间和结束时间,并计算执行每次I/O数据处理所消耗的时间。为了避免偶然性对估算IP磁盘压力情况造成影响,管理服务器会进一步计算IP磁盘执行最近N次(如5次,该次数可以根据实际需要调整)数据读写操作所消耗的平均时间。In order to solve the problem that the IP disk cannot provide real-time information, the embodiment of the present application proposes a method for obtaining the pressure of the IP disk. Specifically, before the step S202 is performed, the fixed size of the I/O data in the data read and write operation may be set in advance, and the read/write operation of the fixed-size I/O data is performed each time repeatedly by the preset disk. The elapsed time, based on these times, calculates the average time taken by the preset disk to perform the operation of the fixed-size I/O data once, and uses the calculation result as the reference time. For example, the I/O data size is 1 MB in the data read/write operation in advance, and the average time consumed by the IP disk when processing 1 MB of I/O data is obtained through a large number of tests, and this time is used as the reference time. . In addition, for each IP disk, the management server records the start time and end time of the IP disk performing I/O data processing each time, and calculates the time taken to perform each I/O data processing. In order to avoid the contingency affecting the estimated IP disk pressure, the management server will further calculate the average time taken by the IP disk to perform the data read and write operations for the last N times (such as 5 times, which can be adjusted according to actual needs).
例如,当客户端发出数据读写请求,管理服务器会为该数据读写请求分配对应的IP磁盘,具体地,在接收到客户端发送的数据读写请求后,管理服务器首先会查看磁盘挑选指针当前所指的IP磁盘,计算其执行最近N次数据读写操作所消耗的平均时间,比如,对该IP磁盘而言,如果此次是第6次分配请求,则可以计算最近5次所消耗的平均时间,并将该平均时间与基准时间比较,如果平均时间小于基准时间,则表明该IP磁盘当前的处理能力较强,因而可以将数据读写请求分配给这个IP磁盘处理。For example, when the client sends a data read/write request, the management server allocates a corresponding IP disk for the data read/write request. Specifically, after receiving the data read/write request sent by the client, the management server first checks the disk selection pointer. The currently referred IP disk calculates the average time it takes to perform the most recent N data read and write operations. For example, for the IP disk, if this is the sixth allocation request, the last 5 times of consumption can be calculated. The average time is compared with the reference time. If the average time is less than the reference time, it indicates that the current processing capacity of the IP disk is strong, so data read and write requests can be allocated to the IP disk for processing.
在本申请的一个实施例中,为了便于分配IP磁盘,需要按照磁盘容量由大到小的顺序,将负载均衡系统中的所有IP磁盘进行排序,得到一个关于IP磁盘的循环排序链表,基于该循环排序链表,可以实现轮转分配IP磁盘的目的。如图3所示,例如,起始时,可以使磁盘挑选指针指向链表头,后续每挑选一次IP磁盘,指针都会按照IP磁盘的循环排序链表依次顺序后移,直到又回到链表头开启下一轮分配为止,如此循环往复,实现轮转分配IP磁盘的 目的。In an embodiment of the present application, in order to facilitate the allocation of IP disks, all IP disks in the load balancing system need to be sorted according to the order of the disk capacity, and a circular sort list of the IP disks is obtained, based on the The circular sorting list can achieve the purpose of distributing IP disks in turn. As shown in FIG. 3, for example, at the beginning, the disk picking pointer can be pointed to the linked list header, and each time an IP disk is selected, the pointer will be sequentially moved in the order of the IP disk's circular sorting list until it is returned to the linked list header. After a round of distribution, this cycle reciprocates to realize the rotation of the IP disk. purpose.
通过本申请实施例,采用比较IP磁盘执行最近N次数据读写操作所消耗的平均时间与基准时间的大小的方式,达到了在IP磁盘无法给管理服务器提供实时信息的情况下,由管理服务器主动计算IP磁盘执行最近N次数据读写操作所消耗的平均时间以确定是否将数据读写请求分配给该IP磁盘的目的,从而实现了改善导致管理服务器的负载均衡效果的技术效果,进而解决了相关技术中IP磁盘由于处理能力有限,无法给管理服务器提供实时信息,因而无法制定出合理的负载均衡策略,最终导致管理服务器的负载均衡效果不佳的技术问题。With the embodiment of the present application, the method of comparing the average time consumed by the IP disk to perform the most recent N data read and write operations and the reference time is achieved, and the management server is obtained when the IP disk cannot provide real-time information to the management server. Actively calculate the average time taken by the IP disk to perform the last N data read and write operations to determine whether to allocate data read and write requests to the IP disk, thereby achieving the technical effect of improving the load balancing effect of the management server, thereby solving In the related art, since the IP disk has limited processing capability and cannot provide real-time information to the management server, it is impossible to formulate a reasonable load balancing policy, which ultimately leads to a technical problem that the load balancing effect of the management server is not good.
可选地,在判断出平均时间不小于基准时间的情况下,上述方法还包括:Optionally, in the case that it is determined that the average time is not less than the reference time, the foregoing method further includes:
S2,判断IP磁盘的读写状态是否为空闲状态。S2: Determine whether the read/write status of the IP disk is idle.
可选地,通过下述过程实现S2,判断数据读写请求分配次数是否为0,其中,当IP磁盘的数据读写请求分配次数为0时,IP磁盘为空闲状态,当IP磁盘的数据读写请求分配次数不为0时,IP磁盘的读写状态不为空闲状态,即为忙碌状态。Optionally, the S2 is implemented by the following process to determine whether the number of times the data read/write request is allocated is 0. When the number of data read/write requests allocated to the IP disk is 0, the IP disk is idle, and the data of the IP disk is read. When the number of write request allocations is not 0, the read and write status of the IP disk is not idle, that is, it is busy.
S4,在判断出IP磁盘的读写状态为空闲状态(如,数据读写请求分配次数为0)的情况下,将数据读写请求分配给当前选中(包括但不限于磁盘挑选指针当前所指的)的IP磁盘。S4. When it is determined that the read/write status of the IP disk is in an idle state (for example, the number of data read/write requests is 0), the data read/write request is allocated to the currently selected (including but not limited to the disk selection pointer currently referred to ) of the IP disk.
也即,如果平均时间不小于基准时间,则表明该IP磁盘当前的处理能力不是很强,此时该IP磁盘可能有能力响应数据读写请求,也可能没能力响应数据读写请求。为了确认其是否有能力响应数据读写请求,以制定更加合理的负载均衡策略,此时还需要进一步判断磁盘挑选指针当前所指的IP磁盘的数据读写请求分配次数,如判断该次数是否为0,若为0,则表明该IP磁盘当前空闲,可以响应数据读写请求,此时可以将数据读写请求分配给该IP磁盘。That is, if the average time is not less than the reference time, it indicates that the current processing capability of the IP disk is not very strong, and the IP disk may have the ability to respond to data read and write requests, or may not be able to respond to data read and write requests. In order to confirm whether it has the ability to respond to data read and write requests, in order to develop a more reasonable load balancing strategy, it is necessary to further determine the number of data read/write requests allocated by the disk selection pointer currently pointed to by the disk selection pointer. 0. If it is 0, it indicates that the IP disk is currently idle and can respond to data read and write requests. At this time, data read and write requests can be allocated to the IP disk.
需要说明的是,管理服务器为了监控各IP磁盘的状态,每次分配IP磁盘都会将该IP磁盘对应的分配计数加1,而IP磁盘每完成一次数据读写操作都会使管理服务器将该IP磁盘对应的分配计数减1,因而当某IP磁盘对应的分配计数为0时,该IP磁盘的数据读写请求分配次数就会为0;否则,IP磁盘 的数据读写请求分配次数就会不为0。It should be noted that, in order to monitor the status of each IP disk, the management server adds 1 to the allocation count of the IP disk each time the IP disk is allocated, and the IP disk reads and writes the IP disk every time the IP disk completes the data read and write operations. The corresponding allocation count is decremented by 1, so when the allocation count corresponding to an IP disk is 0, the number of data read/write requests allocated to the IP disk will be 0; otherwise, the IP disk The number of data read and write requests will not be 0.
在本申请的其它实施例中,管理服务器也可以用通过读写接口的数据流量等其它方式确定IP磁盘的当前状态是否是空闲或者可用。In other embodiments of the present application, the management server may also determine whether the current state of the IP disk is idle or available by other means such as data traffic through the read/write interface.
可选地,在判断出IP磁盘的数据读写请求分配次数为0的情况下,且将数据读写请求分配给当前选中的(包括但不限于磁盘挑选指针当前所指的)IP磁盘之前,上述方法还包括:Optionally, in the case that it is determined that the number of data read/write requests allocated by the IP disk is 0, and the data read/write request is allocated to the currently selected IP disk (including but not limited to the disk picking pointer currently referred to), The above methods also include:
S6,清除IP磁盘执行最近N次数据读写操作所消耗的平均时间的相关记录。S6: Clear the related record of the average time consumed by the IP disk to perform the last N data read and write operations.
基于上述实施方式可知,对于数据读写请求分配次数为0的IP磁盘而言,其数据读写处理能力实际上可以满足当前的数据读写请求,在这种情况下,分配IP磁盘的依据实际上是IP磁盘的数据读写请求分配次数,而不是其执行最近N次数据读写操作所消耗的平均时间。也即,此时依据前者分配IP磁盘可以获得更好的负载均衡效果,因而将数据读写请求分配给磁盘挑选指针当前所指的IP磁盘之前,清除IP磁盘执行最近N次(如5次)数据读写操作所消耗的平均时间,可以防止管理服务器在后续负载均衡过程中再此使用该平均时间,从而影响负载均衡效果。Based on the above embodiments, the data read/write processing capability of the IP disk whose number of data read/write requests is 0 can actually satisfy the current data read and write request. In this case, the IP disk is allocated according to the actual situation. The upper is the number of data read and write requests allocated by the IP disk, not the average time it takes to perform the most recent N data read and write operations. That is, at this time, the IP disk can be allocated according to the former to obtain a better load balancing effect. Therefore, before the data read/write request is allocated to the IP disk currently pointed by the disk selection pointer, the IP disk is cleared for the last N times (for example, 5 times). The average time consumed by data read and write operations can prevent the management server from using the average time in the subsequent load balancing process, thus affecting the load balancing effect.
可选地,在判断出IP磁盘的读写状态不为空闲状态(如,数据读写请求分配次数不为0)的情况下,上述方法还包括:Optionally, in the case that it is determined that the read/write status of the IP disk is not in an idle state (for example, the number of times the data read/write request is not allocated is 0), the method further includes:
S8,选中(包括但不限于使磁盘挑选指针指向下一个IP磁盘来选择)下一个IP磁盘;S8, select (including but not limited to, make the disk pick pointer point to the next IP disk to select) the next IP disk;
S10,计算选中的(包括但不限于磁盘挑选指针指向的)下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间;S10. Calculate an average time taken by the selected IP disk (including but not limited to the disk picking pointer) to perform the last N data read and write operations;
S12,判断该平均时间是否小于基准时间;S12, determining whether the average time is less than a reference time;
S14,在判断出该平均时间小于基准时间的情况下,将数据读写请求分配给选中的(包括但不限于磁盘挑选指针指向的)下一个IP磁盘。S14. If it is determined that the average time is less than the reference time, the data read/write request is allocated to the selected IP disk (including but not limited to the disk picking pointer).
由于IP磁盘的数据读写请求分配次数不为0时,表明其处于忙碌的工作状态,其当前的数据处理能力难以响应客户端发送的数据读写请求,因而不 能将该数据读写请求分配给磁盘挑选指针当前所指的IP磁盘。在这种情况下,需要使磁盘挑选指针指向下一IP磁盘,并执行S10、S12、S14。其中,S10、S12、S14分别同步骤S204、步骤S206、步骤S208,在此不再赘述。Since the number of data read/write requests allocated by the IP disk is not 0, it indicates that it is in a busy working state, and its current data processing capability is difficult to respond to data read and write requests sent by the client, and thus The data read and write request can be assigned to the IP disk currently referred to by the disk pick pointer. In this case, it is necessary to have the disk pick pointer point to the next IP disk and execute S10, S12, S14. S10, S12, and S14 are the same as steps S204, S206, and S208, and are not described here.
上述步骤中的下一个IP磁盘,可以是数据库中存储的IP磁盘顺序表中的下一个IP磁盘,其排序可以是预先排列的,也可以是在S8步骤中按照预设的规则或者算法计算选择的。The next IP disk in the above step may be the next IP disk in the IP disk sequence table stored in the database, and the ordering may be pre-arranged, or may be calculated according to a preset rule or algorithm in step S8. of.
可选地,在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,上述方法还包括:Optionally, before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
S16,确定IP磁盘是第M次被分配数据读写请求;S16, determining that the IP disk is the Mth allocated data read/write request;
S18,判断M是否大于N,其中,M为正整数,在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。S18: Determine whether M is greater than N, where M is a positive integer, and if it is determined that M is greater than N, perform the step of calculating an average time consumed by the currently selected IP disk to perform the last N data read and write operations.
可选地,在判断出M不大于N的情况下,上述方法还包括:Optionally, in the case that it is determined that M is not greater than N, the foregoing method further includes:
S20,直接将所述数据读写请求分配给当前选中的所述IP磁盘。S20. Directly allocate the data read/write request to the currently selected IP disk.
为了提高工作效率,防止计算平均时间时出错,在计算平均时间之前,可以先确定IP磁盘当前是第几次被分配数据读写请求,例如,若负载均衡策略要求计算最近5次的平均时间,而IP磁盘当前是第1-4次中的任意一次被分配数据读写请求,则可以直接将数据读写请求分配给该IP磁盘,否则,需要上述实施例中的磁盘挑选策略分配对应的磁盘,在此不再赘述。In order to improve work efficiency and prevent errors in calculating the average time, before calculating the average time, it can be determined that the IP disk is currently the first time to be allocated data read and write requests, for example, if the load balancing policy requires calculation of the average time of the last 5 times, The IP disk is currently assigned a data read/write request any one of the 1-4 times, and the data read/write request can be directly allocated to the IP disk. Otherwise, the disk selection policy in the above embodiment is required to allocate the corresponding disk. , will not repeat them here.
实施例2Example 2
本申请实施例提供了一种分配网际协议IP磁盘的装置。The embodiment of the present application provides an apparatus for allocating an internet protocol IP disk.
图4是本申请实施例提供的一种可选的分配网际协议IP磁盘的装置的示意图,如图4所示,该装置包括:接收单元402,用于接收客户端发送的数据读写请求;第一计算单元404,用于计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;第一判断单元406,用于判断平均时间是否小于基准时间,其中,基准时间为预设磁盘执行数据读写操作所消耗的时间;第一分配单元408,用于在判断出平均时间小于基准时间 的情况下,将数据读写请求分配给当前选中的IP磁盘。FIG. 4 is a schematic diagram of an apparatus for allocating an Internet Protocol IP disk according to an embodiment of the present disclosure. As shown in FIG. 4, the apparatus includes: a receiving unit 402, configured to receive a data read/write request sent by a client; The first calculating unit 404 is configured to calculate an average time taken by the currently selected IP disk to perform the most recent data read and write operations, where N is a positive integer, and the first determining unit 406 is configured to determine whether the average time is less than the reference time. The reference time is a time taken by the preset disk to perform a data read/write operation; the first allocating unit 408 is configured to determine that the average time is less than the reference time In the case of a data read and write request, the currently selected IP disk is allocated.
为了解决IP磁盘无法提供实时信息的问题,本申请实施例提出了一种获取IP磁盘的压力的方法。具体地,实施步骤S202之前,可以预先设定1次数据读写操作中I/O数据的固定大小,多次反复测试预设磁盘每次执行上述固定大小的I/O数据的读写操作所消耗的时间,基于这些时间计算该预设磁盘执行1次固定大小的I/O数据的操作所消耗的平均时间,并将计算结果作为基准时间。例如,预先设定1次数据读写操作中I/O数据大小为1MB,通过大量测试,得出处理1MB大小的I/O数据时IP磁盘所消耗的平均时间,并将此时间作为基准时间。另外,针对每个IP磁盘,管理服务器每次都会记录IP磁盘执行I/O数据处理时的起始时间和结束时间,并计算执行每次I/O数据处理所消耗的时间。为了避免偶然性对估算IP磁盘压力情况造成影响,管理服务器会进一步计算IP磁盘执行最近N次(如5次,该次数可以根据实际需要调整)数据读写操作所消耗的平均时间。In order to solve the problem that the IP disk cannot provide real-time information, the embodiment of the present application proposes a method for obtaining the pressure of the IP disk. Specifically, before the step S202 is performed, the fixed size of the I/O data in the data read and write operation may be set in advance, and the read/write operation of the fixed-size I/O data is performed each time repeatedly by the preset disk. The elapsed time, based on these times, calculates the average time taken by the preset disk to perform the operation of the fixed-size I/O data once, and uses the calculation result as the reference time. For example, the I/O data size is 1 MB in the data read/write operation in advance, and the average time consumed by the IP disk when processing 1 MB of I/O data is obtained through a large number of tests, and this time is used as the reference time. . In addition, for each IP disk, the management server records the start time and end time of the IP disk performing I/O data processing each time, and calculates the time taken to perform each I/O data processing. In order to avoid the contingency affecting the estimated IP disk pressure, the management server will further calculate the average time taken by the IP disk to perform the data read and write operations for the last N times (such as 5 times, which can be adjusted according to actual needs).
例如,当客户端发出数据读写请求,管理服务器会为该数据读写请求分配对应的IP磁盘,具体地,在接收到客户端发送的数据读写请求后,管理服务器首先会查看磁盘挑选指针当前所指的IP磁盘,计算其执行最近N次数据读写操作所消耗的平均时间,比如,对该IP磁盘而言,如果此次是第6次分配请求,则可以计算最近5次所消耗的平均时间,并将该平均时间与基准时间比较,如果平均时间小于基准时间,则表明该IP磁盘当前的处理能力较强,因而可以将数据读写请求分配给这个IP磁盘处理。For example, when the client sends a data read/write request, the management server allocates a corresponding IP disk for the data read/write request. Specifically, after receiving the data read/write request sent by the client, the management server first checks the disk selection pointer. The currently referred IP disk calculates the average time it takes to perform the most recent N data read and write operations. For example, for the IP disk, if this is the sixth allocation request, the last 5 times of consumption can be calculated. The average time is compared with the reference time. If the average time is less than the reference time, it indicates that the current processing capacity of the IP disk is strong, so data read and write requests can be allocated to the IP disk for processing.
通过本申请实施例,采用比较IP磁盘执行最近N次数据读写操作所消耗的平均时间与基准时间的大小的方式,达到了在IP磁盘无法给管理服务器提供实时信息的情况下,由管理服务器主动计算IP磁盘执行最近N次数据读写操作所消耗的平均时间以确定是否将数据读写请求分配给该IP磁盘的目的,从而实现了改善导致管理服务器的负载均衡效果的技术效果,进而解决了相关技术中IP磁盘由于处理能力有限,无法给管理服务器提供实时信息,因而无法制定出合理的负载均衡策略,最终导致管理服务器的负载均衡效果不佳的技术问题。With the embodiment of the present application, the method of comparing the average time consumed by the IP disk to perform the most recent N data read and write operations and the reference time is achieved, and the management server is obtained when the IP disk cannot provide real-time information to the management server. Actively calculate the average time taken by the IP disk to perform the last N data read and write operations to determine whether to allocate data read and write requests to the IP disk, thereby achieving the technical effect of improving the load balancing effect of the management server, thereby solving In the related art, since the IP disk has limited processing capability and cannot provide real-time information to the management server, it is impossible to formulate a reasonable load balancing policy, which ultimately leads to a technical problem that the load balancing effect of the management server is not good.
可选地,上述装置还包括:第二判断单元,用于在判断出平均时间不小 于基准时间的情况下,判断IP磁盘的读写状态是否为空闲状态。Optionally, the device further includes: a second determining unit, configured to determine that the average time is not small In the case of the reference time, it is determined whether the read/write status of the IP disk is in an idle state.
可选地,第二判断单元,用于在判断出平均时间不小于基准时间的情况下,判断数据读写请求分配次数是否为0,其中,当IP磁盘的数据读写请求分配次数为0时,IP磁盘为空闲状态,当IP磁盘的数据读写请求分配次数不为0时,IP磁盘为忙碌状态;第二分配单元,用于在判断出IP磁盘的读写状态是空闲状态(如,数据读写请求分配次数为0)的情况下,将数据读写请求分配给当前选中的IP磁盘。Optionally, the second determining unit is configured to determine, when the average time is not less than the reference time, whether the number of times the data read/write request is allocated is 0, wherein when the number of data read/write requests allocated to the IP disk is 0, The IP disk is in an idle state. When the number of data read/write requests allocated to the IP disk is not 0, the IP disk is in a busy state; and the second allocation unit is configured to determine that the read and write status of the IP disk is idle (for example, When the number of data read/write requests is 0), the data read/write request is assigned to the currently selected IP disk.
可选地,上述装置还包括:清除单元,用于在判断出IP磁盘的读写状态是空闲状态(如,数据读写请求分配次数为0)的情况下,且将数据读写请求分配给当前选中的IP磁盘之前,清除IP磁盘执行最近N次数据读写操作所消耗的平均时间的相关记录。Optionally, the foregoing apparatus further includes: a clearing unit, configured to: when it is determined that the read/write state of the IP disk is an idle state (for example, the number of times the data read/write request is allocated is 0), and the data read/write request is allocated to Before the currently selected IP disk, clear the related record of the average time taken by the IP disk to perform the most recent N data read and write operations.
可选地,上述装置还包括:选择单元,在判断出IP磁盘的读写状态不是空闲状态(如,数据读写请求分配次数不为0)的情况下,选中下一个IP磁盘;第二计算单元,用于计算选中的下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间;第三判断单元,用于判断该平均时间是否小于基准时间;第三分配单元,用于在判断出该平均时间小于基准时间的情况下,将数据读写请求分配给选中的下一个IP磁盘。Optionally, the foregoing apparatus further includes: a selecting unit, when determining that the read/write status of the IP disk is not in an idle state (for example, the number of times the data read/write request allocation is not 0), selecting the next IP disk; the second calculation a unit, configured to calculate an average time consumed by the selected next IP disk to perform the last N data read and write operations; a third determining unit, configured to determine whether the average time is less than a reference time; and a third allocation unit, configured to determine When the average time is less than the reference time, the data read and write request is allocated to the selected next IP disk.
可选地,上述装置还包括:确定单元,用于在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,确定IP磁盘是第M次被分配数据读写请求;第四判断单元,用于判断M是否大于N,M为正整数,其中,第一计算单元还用于在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Optionally, the foregoing apparatus further includes: a determining unit, configured to determine that the IP disk is the Mth allocated data read/write request before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations; The fourth determining unit is configured to determine whether M is greater than N, and M is a positive integer. The first calculating unit is further configured to perform calculation of the currently selected IP disk to perform the last N data readings when it is determined that M is greater than N. The step of the average time consumed by the write operation.
可选地,上述装置还包括:第四分配单元,用于在判断出M不大于N的情况下,直接将数据读写请求分配给当前选中的IP磁盘。Optionally, the foregoing apparatus further includes: a fourth allocating unit, configured to directly allocate the data read/write request to the currently selected IP disk, if it is determined that M is not greater than N.
另外,本申请实施例还提供了一种电子设备,可以包括:处理器、存储器、通信接口和总线;In addition, the embodiment of the present application further provides an electronic device, which may include: a processor, a memory, a communication interface, and a bus;
所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信; The processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
所述存储器存储可执行代码;The memory stores executable code;
所述处理器通过读取所述存储器中存储的可执行代码来运行与所述可执行代码对应的程序,以用于执行本申请实施例所提供的分配网际协议IP磁盘的方法;其中,本申请实施例所提供的分配网际协议IP磁盘的方法可以包括:The processor, by reading the executable code stored in the memory, to run a program corresponding to the executable code, for performing the method for distributing an Internet Protocol IP disk provided by the embodiment of the present application; The method for allocating an internet protocol IP disk provided by the application embodiment may include:
接收客户端发送的数据读写请求;Receiving data read and write requests sent by the client;
计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;Calculate the average time taken by the currently selected IP disk to perform the last N data read and write operations, where N is a positive integer;
判断所述平均时间是否小于基准时间,其中,所述基准时间为预设磁盘执行数据读写操作所消耗的时间;Determining whether the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
在判断出所述平均时间小于所述基准时间的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。When it is determined that the average time is less than the reference time, the data read/write request is allocated to the currently selected IP disk.
其中,在判断出所述平均时间不小于所述基准时间的情况下,所述方法还包括:Wherein, in the case that it is determined that the average time is not less than the reference time, the method further includes:
判断所述IP磁盘的读写状态是否为空闲状态;以及在判断出所述IP磁盘的读写状态为空闲状态的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。Determining whether the read/write state of the IP disk is an idle state; and determining that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
其中,在判断出所述IP磁盘的读写状态为空闲状态的情况下,且将所述数据读写请求分配给当前选中的所述IP磁盘之前,所述方法还包括:The method further includes: before determining that the read/write state of the IP disk is in an idle state, and before the data read/write request is allocated to the currently selected IP disk, the method further includes:
清除所述IP磁盘执行最近N次数据读写操作所消耗的所述平均时间的相关记录。Clearing the associated record of the average time consumed by the IP disk to perform the most recent N data read and write operations.
其中,在判断出所述IP磁盘的读写状态不为空闲状态的情况下,所述方法还包括:In the case that it is determined that the read/write state of the IP disk is not in an idle state, the method further includes:
选中下一个IP磁盘;Select the next IP disk;
计算选中的所述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间,并判断该平均时间是否小于所述基准时间;Calculating an average time taken by the selected next IP disk to perform the last N data read and write operations, and determining whether the average time is less than the reference time;
在判断出该平均时间小于所述基准时间的情况下,将所述数据读写请求 分配给选中的所述下一个IP磁盘。The data read and write request is determined if it is determined that the average time is less than the reference time Assigned to the selected next IP disk.
其中,在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,所述方法还包括:The method further includes: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
确定所述IP磁盘是第M次被分配数据读写请求;Determining that the IP disk is the Mth allocated data read and write request;
判断M是否大于N,Determine if M is greater than N,
其中,M为正整数,在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Wherein, M is a positive integer. When it is determined that M is greater than N, the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
其中,在判断出M不大于N的情况下,所述方法还包括:Wherein, in the case that it is determined that M is not greater than N, the method further includes:
直接将所述数据读写请求分配给当前选中的所述IP磁盘。The data read/write request is directly allocated to the currently selected IP disk.
另外,本申请实施例还提供了一种存储介质,用于存储可执行代码,所述可执行代码用于执行本申请实施例所提供的分配网际协议IP磁盘的方法;其中,本申请实施例所提供的分配网际协议IP磁盘的方法可以包括:In addition, the embodiment of the present application further provides a storage medium for storing executable code, where the executable code is used to execute the method for allocating an Internet Protocol IP disk provided by the embodiment of the present application; The provided method of allocating an internet protocol IP disk may include:
接收客户端发送的数据读写请求;Receiving data read and write requests sent by the client;
计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;Calculate the average time taken by the currently selected IP disk to perform the last N data read and write operations, where N is a positive integer;
判断所述平均时间是否小于基准时间,其中,所述基准时间为预设磁盘执行数据读写操作所消耗的时间;Determining whether the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
在判断出所述平均时间小于所述基准时间的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。When it is determined that the average time is less than the reference time, the data read/write request is allocated to the currently selected IP disk.
其中,在判断出所述平均时间不小于所述基准时间的情况下,所述方法还包括:Wherein, in the case that it is determined that the average time is not less than the reference time, the method further includes:
判断所述IP磁盘的读写状态是否为空闲状态;以及在判断出所述IP磁盘的读写状态为空闲状态的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。Determining whether the read/write state of the IP disk is an idle state; and determining that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
其中,在判断出所述IP磁盘的读写状态为空闲状态的情况下,且将所述数据读写请求分配给当前选中的所述IP磁盘之前,所述方法还包括: The method further includes: before determining that the read/write state of the IP disk is in an idle state, and before the data read/write request is allocated to the currently selected IP disk, the method further includes:
清除所述IP磁盘执行最近N次数据读写操作所消耗的所述平均时间的相关记录。Clearing the associated record of the average time consumed by the IP disk to perform the most recent N data read and write operations.
其中,在判断出所述IP磁盘的读写状态不为空闲状态的情况下,所述方法还包括:In the case that it is determined that the read/write state of the IP disk is not in an idle state, the method further includes:
选中下一个IP磁盘;Select the next IP disk;
计算选中的所述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间,并判断该平均时间是否小于所述基准时间;Calculating an average time taken by the selected next IP disk to perform the last N data read and write operations, and determining whether the average time is less than the reference time;
在判断出该平均时间小于所述基准时间的情况下,将所述数据读写请求分配给选中的所述下一个IP磁盘。When it is determined that the average time is less than the reference time, the data read/write request is allocated to the selected next IP disk.
其中,在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,所述方法还包括:The method further includes: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
确定所述IP磁盘是第M次被分配数据读写请求;Determining that the IP disk is the Mth allocated data read and write request;
判断M是否大于N,Determine if M is greater than N,
其中,M为正整数,在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Wherein, M is a positive integer. When it is determined that M is greater than N, the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
其中,在判断出M不大于N的情况下,所述方法还包括:Wherein, in the case that it is determined that M is not greater than N, the method further includes:
直接将所述数据读写请求分配给当前选中的所述IP磁盘。The data read/write request is directly allocated to the currently selected IP disk.
另外,本申请实施例还提供了一种可执行代码,用于执行本申请实施例所提供的分配网际协议IP磁盘的方法;其中,本申请实施例所提供的分配网际协议IP磁盘的方法可以包括:In addition, the embodiment of the present application further provides an executable code for performing the method for allocating an Internet Protocol IP disk provided by the embodiment of the present application. The method for allocating an Internet Protocol IP disk provided by the embodiment of the present application may be include:
接收客户端发送的数据读写请求;Receiving data read and write requests sent by the client;
计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;Calculate the average time taken by the currently selected IP disk to perform the last N data read and write operations, where N is a positive integer;
判断所述平均时间是否小于基准时间,其中,所述基准时间为预设磁盘执行数据读写操作所消耗的时间; Determining whether the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
在判断出所述平均时间小于所述基准时间的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。When it is determined that the average time is less than the reference time, the data read/write request is allocated to the currently selected IP disk.
其中,在判断出所述平均时间不小于所述基准时间的情况下,所述方法还包括:Wherein, in the case that it is determined that the average time is not less than the reference time, the method further includes:
判断所述IP磁盘的读写状态是否为空闲状态;以及在判断出所述IP磁盘的读写状态为空闲状态的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。Determining whether the read/write state of the IP disk is an idle state; and determining that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
其中,在判断出所述IP磁盘的读写状态为空闲状态的情况下,且将所述数据读写请求分配给当前选中的所述IP磁盘之前,所述方法还包括:The method further includes: before determining that the read/write state of the IP disk is in an idle state, and before the data read/write request is allocated to the currently selected IP disk, the method further includes:
清除所述IP磁盘执行最近N次数据读写操作所消耗的所述平均时间的相关记录。Clearing the associated record of the average time consumed by the IP disk to perform the most recent N data read and write operations.
其中,在判断出所述IP磁盘的读写状态不为空闲状态的情况下,所述方法还包括:In the case that it is determined that the read/write state of the IP disk is not in an idle state, the method further includes:
选中下一个IP磁盘;Select the next IP disk;
计算选中的所述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间,并判断该平均时间是否小于所述基准时间;Calculating an average time taken by the selected next IP disk to perform the last N data read and write operations, and determining whether the average time is less than the reference time;
在判断出该平均时间小于所述基准时间的情况下,将所述数据读写请求分配给选中的所述下一个IP磁盘。When it is determined that the average time is less than the reference time, the data read/write request is allocated to the selected next IP disk.
其中,在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,所述方法还包括:The method further includes: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further includes:
确定所述IP磁盘是第M次被分配数据读写请求;Determining that the IP disk is the Mth allocated data read and write request;
判断M是否大于N,Determine if M is greater than N,
其中,M为正整数,在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Wherein, M is a positive integer. When it is determined that M is greater than N, the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
其中,在判断出M不大于N的情况下,所述方法还包括:Wherein, in the case that it is determined that M is not greater than N, the method further includes:
直接将所述数据读写请求分配给当前选中的所述IP磁盘。 The data read/write request is directly allocated to the currently selected IP disk.
需要说明的是,装置部分各实施方式中的单元/模块所实现的功能分别与方法部分对应实施方式中的对应步骤相同或类似;装置部分各实施方式达到的技术效果也分别与方法部分各对应实施方式达到的技术效果相同或类似,在此不再赘述。It should be noted that the functions implemented by the units/modules in the embodiments of the device part are respectively the same as or similar to the corresponding steps in the corresponding embodiments of the method part; the technical effects achieved by the implementations of the device parts are also respectively corresponding to the method parts. The technical effects achieved by the embodiments are the same or similar, and are not described herein again.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the descriptions of the various embodiments are different, and the parts that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed technical contents may be implemented in other manners. The device embodiments described above are only schematic. For example, the division of the unit may be a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。 而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。 The above description is only a preferred embodiment of the present application, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present application. It should be considered as the scope of protection of this application.

Claims (15)

  1. 一种分配网际协议IP磁盘的方法,其特征在于,包括:A method for allocating an internet protocol IP disk, comprising:
    接收客户端发送的数据读写请求;Receiving data read and write requests sent by the client;
    计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;Calculate the average time taken by the currently selected IP disk to perform the last N data read and write operations, where N is a positive integer;
    判断所述平均时间是否小于基准时间,其中,所述基准时间为预设磁盘执行数据读写操作所消耗的时间;Determining whether the average time is less than a reference time, wherein the reference time is a time consumed by a preset disk to perform a data read/write operation;
    在判断出所述平均时间小于所述基准时间的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。When it is determined that the average time is less than the reference time, the data read/write request is allocated to the currently selected IP disk.
  2. 根据权利要求1所述的方法,其特征在于,在判断出所述平均时间不小于所述基准时间的情况下,所述方法还包括:The method according to claim 1, wherein, in the case that it is determined that the average time is not less than the reference time, the method further comprises:
    判断所述IP磁盘的读写状态是否为空闲状态;以及在判断出所述IP磁盘的读写状态为空闲状态的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。Determining whether the read/write state of the IP disk is an idle state; and determining that the read/write state of the IP disk is in an idle state, the data read/write request is allocated to the currently selected IP disk.
  3. 根据权利要求2所述的方法,其特征在于,在判断出所述IP磁盘的读写状态为空闲状态的情况下,且将所述数据读写请求分配给当前选中的所述IP磁盘之前,所述方法还包括:The method according to claim 2, wherein, in the case that it is determined that the read/write state of the IP disk is in an idle state, and the data read/write request is allocated to the currently selected IP disk, The method further includes:
    清除所述IP磁盘执行最近N次数据读写操作所消耗的所述平均时间的相关记录。Clearing the associated record of the average time consumed by the IP disk to perform the most recent N data read and write operations.
  4. 根据权利要求2所述的方法,其特征在于,在判断出所述IP磁盘的读写状态不为空闲状态的情况下,所述方法还包括:The method according to claim 2, wherein, in the case that it is determined that the read/write state of the IP disk is not in an idle state, the method further includes:
    选中下一个IP磁盘;Select the next IP disk;
    计算选中的所述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间,并判断该平均时间是否小于所述基准时间;Calculating an average time taken by the selected next IP disk to perform the last N data read and write operations, and determining whether the average time is less than the reference time;
    在判断出该平均时间小于所述基准时间的情况下,将所述数据读写请求分配给选中的所述下一个IP磁盘。 When it is determined that the average time is less than the reference time, the data read/write request is allocated to the selected next IP disk.
  5. 根据权利要求1所述的方法,其特征在于,在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, the method further comprising:
    确定所述IP磁盘是第M次被分配数据读写请求;Determining that the IP disk is the Mth allocated data read and write request;
    判断M是否大于N,Determine if M is greater than N,
    其中,M为正整数,在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。Wherein, M is a positive integer. When it is determined that M is greater than N, the step of calculating the average time taken by the currently selected IP disk to perform the most recent N data read and write operations is performed.
  6. 根据权利要求5所述的方法,其特征在于,在判断出M不大于N的情况下,所述方法还包括:The method according to claim 5, wherein in the case that it is determined that M is not greater than N, the method further comprises:
    直接将所述数据读写请求分配给当前选中的所述IP磁盘。The data read/write request is directly allocated to the currently selected IP disk.
  7. 一种分配网际协议IP磁盘的装置,其特征在于,包括:An apparatus for allocating an internet protocol IP disk, comprising:
    接收单元,用于接收客户端发送的数据读写请求;a receiving unit, configured to receive a data read/write request sent by the client;
    第一计算单元,用于计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间,其中,N为正整数;a first calculating unit, configured to calculate an average time consumed by the currently selected IP disk to perform the last N data read and write operations, where N is a positive integer;
    第一判断单元,用于判断所述平均时间是否小于基准时间,其中,所述基准时间为预设磁盘执行数据读写操作所消耗的时间;a first determining unit, configured to determine whether the average time is less than a reference time, where the reference time is a time consumed by a preset disk to perform a data read/write operation;
    第一分配单元,用于在判断出所述平均时间小于所述基准时间的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。And a first allocation unit, configured to allocate the data read/write request to the currently selected IP disk if it is determined that the average time is less than the reference time.
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The device according to claim 7, wherein the device further comprises:
    第二判断单元,用于在判断出所述平均时间不小于所述基准时间的情况下,判断所述IP磁盘的读写状态是否为空闲状态;a second determining unit, configured to determine whether the read/write state of the IP disk is an idle state, if it is determined that the average time is not less than the reference time;
    第二分配单元,用于在判断出所述IP磁盘的读写状态为空闲状态的情况下,将所述数据读写请求分配给当前选中的所述IP磁盘。And a second allocation unit, configured to allocate the data read/write request to the currently selected IP disk if it is determined that the read/write state of the IP disk is an idle state.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    清除单元,用于在判断出所述IP磁盘的读写状态为空闲状态的情况下,且将所述数据读写请求分配给当前选中的所述IP磁盘之前,清除所述IP磁盘 执行最近N次数据读写操作所消耗的所述平均时间的相关记录。a clearing unit, configured to: after determining that the read/write status of the IP disk is in an idle state, and allocating the data read/write request to the currently selected IP disk, clearing the IP disk A correlation record of the average time consumed by the most recent N data read and write operations.
  10. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    选择单元,在判断出所述IP磁盘的读写状态不为空闲状态的情况下,选中下一个IP磁盘;Selecting a unit, in the case that it is determined that the read/write state of the IP disk is not in an idle state, the next IP disk is selected;
    第二计算单元,用于计算选中的所述下一个IP磁盘执行最近N次数据读写操作所消耗的平均时间;a second calculating unit, configured to calculate an average time taken by the selected next IP disk to perform the last N data read and write operations;
    第三判断单元,用于判断该平均时间是否小于所述基准时间;a third determining unit, configured to determine whether the average time is less than the reference time;
    第三分配单元,用于在判断出该平均时间小于所述基准时间的情况下,将所述数据读写请求分配给选中的所述下一个IP磁盘。And a third allocation unit, configured to allocate the data read/write request to the selected next IP disk if it is determined that the average time is less than the reference time.
  11. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The device according to claim 7, wherein the device further comprises:
    确定单元,用于在计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间之前,确定所述IP磁盘是第M次被分配数据读写请求;a determining unit, configured to determine that the IP disk is the Mth allocated data read/write request before calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations;
    第四判断单元,用于判断M是否大于N,M为正整数,The fourth determining unit is configured to determine whether M is greater than N, and M is a positive integer.
    其中,所述第一计算单元还用于在判断出M大于N的情况下,执行计算当前选中的IP磁盘执行最近N次数据读写操作所消耗的平均时间的步骤。The first calculating unit is further configured to perform the step of calculating an average time taken by the currently selected IP disk to perform the last N data read and write operations, when it is determined that M is greater than N.
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:The device according to claim 11, wherein the device further comprises:
    第四分配单元,用于在判断出M不大于N的情况下,直接将所述数据读写请求分配给当前选中的所述IP磁盘。And a fourth allocation unit, configured to directly allocate the data read/write request to the currently selected IP disk if it is determined that M is not greater than N.
  13. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    处理器、存储器、通信接口和总线;a processor, a memory, a communication interface, and a bus;
    所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;The processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
    所述存储器存储可执行代码;The memory stores executable code;
    所述处理器通过读取所述存储器中存储的可执行代码来运行与所述可执行代码对应的程序,以用于执行权利要求1-6任意一项所述的分配网际协议 IP磁盘的方法。The processor runs a program corresponding to the executable code by reading executable code stored in the memory for performing the distribution internet protocol of any one of claims 1-6 The method of the IP disk.
  14. 一种存储介质,其特征在于,用于存储可执行代码,所述可执行代码用于执行权利要求1-6任意一项所述的分配网际协议IP磁盘的方法。A storage medium for storing executable code for performing the method of allocating an Internet Protocol IP disk according to any one of claims 1-6.
  15. 一种可执行代码,其特征在于,用于执行权利要求1-6任意一项所述的分配网际协议IP磁盘的方法。 An executable code, characterized by a method for performing the allocation of an internet protocol IP disk according to any of claims 1-6.
PCT/CN2016/113682 2016-06-12 2016-12-30 Internet protocol (ip) disk assignment method and device WO2017215249A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610411513.0 2016-06-12
CN201610411513.0A CN107491265B (en) 2016-06-12 2016-06-12 Method and device for distributing internet protocol IP disk

Publications (1)

Publication Number Publication Date
WO2017215249A1 true WO2017215249A1 (en) 2017-12-21

Family

ID=60643276

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113682 WO2017215249A1 (en) 2016-06-12 2016-12-30 Internet protocol (ip) disk assignment method and device

Country Status (2)

Country Link
CN (1) CN107491265B (en)
WO (1) WO2017215249A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061431A (en) * 2019-11-28 2020-04-24 曙光信息产业股份有限公司 Distributed storage method, server and client

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995745A (en) * 2014-05-22 2014-08-20 华为技术有限公司 IP hard disk task execution method and IP hard disk
CN104023081A (en) * 2014-06-19 2014-09-03 华为技术有限公司 Data processing method for network association IP hard disk and IP hard disk
CN104461378A (en) * 2014-10-30 2015-03-25 华为技术有限公司 Method, device and system for writing data object in IP hard disk
CN105471955A (en) * 2014-09-11 2016-04-06 北京金山云网络技术有限公司 Writing method of distributed file system, client device and distributed file system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8468318B2 (en) * 2010-09-15 2013-06-18 Pure Storage Inc. Scheduling of I/O writes in a storage environment
CN102073546B (en) * 2010-12-13 2013-07-10 北京航空航天大学 Task-dynamic dispatching method under distributed computation mode in cloud computing environment
CN103414761B (en) * 2013-07-23 2017-02-08 北京工业大学 Mobile terminal cloud resource scheduling method based on Hadoop framework
CN104049916B (en) * 2014-06-24 2017-08-04 东南大学 A kind of self-organization distribution storage system and its method based on node role's handover mechanism

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995745A (en) * 2014-05-22 2014-08-20 华为技术有限公司 IP hard disk task execution method and IP hard disk
CN104023081A (en) * 2014-06-19 2014-09-03 华为技术有限公司 Data processing method for network association IP hard disk and IP hard disk
CN105471955A (en) * 2014-09-11 2016-04-06 北京金山云网络技术有限公司 Writing method of distributed file system, client device and distributed file system
CN104461378A (en) * 2014-10-30 2015-03-25 华为技术有限公司 Method, device and system for writing data object in IP hard disk

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061431A (en) * 2019-11-28 2020-04-24 曙光信息产业股份有限公司 Distributed storage method, server and client
CN111061431B (en) * 2019-11-28 2023-06-23 曙光信息产业股份有限公司 Distributed storage method, server and client

Also Published As

Publication number Publication date
CN107491265B (en) 2021-05-25
CN107491265A (en) 2017-12-19

Similar Documents

Publication Publication Date Title
US11340672B2 (en) Persistent reservations for virtual disk using multiple targets
US20200364608A1 (en) Communicating in a federated learning environment
US10798016B2 (en) Policy-based scaling of network resources
US20190034084A1 (en) Selecting controllers based on affinity between access devices and storage segments
US20180081562A1 (en) Cloud storage system
CN103999031B (en) The virtual privately owned storage array service of Cloud Server
US9864749B2 (en) Methods for provisioning workloads in a storage system using machine learning and devices thereof
US20200042364A1 (en) Movement of services across clusters
US10366110B2 (en) Load balancing for multi-tiered querying
US11307802B2 (en) NVMe queue management multi-tier storage systems
US10616134B1 (en) Prioritizing resource hosts for resource placement
US11297067B2 (en) Resource appropriation in a multi-tenant environment using risk and value modeling systems and methods
CN108933829A (en) A kind of load-balancing method and device
CN109085999A (en) data processing method and processing system
CN107749887A (en) A kind of CDN resource allocations, localization method and device and CDN system
US20050021511A1 (en) System and method for load balancing in database queries
Gill et al. Dynamic cost-aware re-replication and rebalancing strategy in cloud system
CN107395708B (en) Method and device for processing download request
Manikandan et al. Virtualized load balancer for hybrid cloud using genetic algorithm
CN107276914B (en) Self-service resource allocation scheduling method based on CMDB
CN107797758B (en) Date storage method, data access method and device
WO2017215249A1 (en) Internet protocol (ip) disk assignment method and device
US11080092B1 (en) Correlated volume placement in a distributed block storage service
Kim et al. Virtual machines placement for network isolation in clouds
US20230137673A1 (en) Systems and methods for dynamically scaling remote resources

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: 16905356

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: 16905356

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16905356

Country of ref document: EP

Kind code of ref document: A1