A distributed storage method, device, electronic device and storage medium

By associating the iSCSI target process with the virtual machine's logical unit number as a visitor object, a single point of failure caused by the iSCSI target process failure is solved, and the stability of the virtual machine accessing the distributed storage system is improved.

CN114003342BActive Publication Date: 2024-12-13BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111282906.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-01
Publication Date
2024-12-13
Estimated Expiration
2041-11-01

AI Technical Summary

Technical Problem

When multiple virtual machines provide distributed storage services, failure of iSCSI target processes will lead to a single point of failure, affecting the stability of distributed storage services.

Method used

By associating an iSCSI target process with a logical block device with a logical unit number corresponding to a virtual machine as a visitor object, the coupling between the iSCSI target process and the logical unit number is reduced, so that the iSCSI target process only provides services to one virtual machine. This improves the stability of virtual machine accessing distributed storage systems in hyperconverged systems.

Benefits of technology

It effectively reduces the impact of single point of failure, ensures high availability and stability of virtual machines in distributed storage systems, and avoids other virtual machines being affected by single point of failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114003342B_ABST
    Figure CN114003342B_ABST
Patent Text Reader

Abstract

The present application provides a distributed storage method, device, electronic device and storage medium, which are used to improve the problem that a single point failure has a significant impact on the stability of a distributed storage service. The method includes: receiving an iSCSI data packet sent by a virtual machine; parsing the iSCSI data packet into a SCSI command through an iSCSI target process of an accessor object, and storing the SCSI command in a circular queue of the accessor object, wherein the SCSI command is a command for operating a logical block device of a logical unit number corresponding to the virtual machine; reading and processing the SCSI command from the circular queue through a scheduler process of the accessor object to obtain a SCSI processing command; and sending the SCSI processing command to a distributed storage system so that the distributed storage system returns an operation result corresponding to the SCSI processing command.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical fields of big data, cloud computing and distributed storage, and more specifically, to a distributed storage method, device, electronic device and storage medium. Background Art

[0002] Small Computer System Interface (SCSI) is a processor-independent standard for system-level interfaces between computers and their peripheral devices (hard disks, floppy drives, optical drives, printers, scanners, etc.). The SCSI standard defines commands, communication protocols, and electrical characteristics of entities. The largest application is on storage devices (such as hard disks and tape drives). In addition, SCSI can connect devices including scanners, optical devices (such as CDs and DVDs), printers, etc.

[0003] Internet Small Computer System Interface (iSCSI), also known as Internet Protocol-Storage Area Network (IP-SAN), is a storage technology based on Transmission Control Protocol / Internet Protocol (TCP / IP) and SCSI-3 protocol. It was proposed by the Internet Engineering Task Force and became a formal standard. iSCSI specifically adopts the client-server architecture. The client is called iSCSI Initiator and the server is called iSCSI Target.

[0004] At present, the idea of ​​providing distributed storage services for multiple virtual machines is to use one iSCSI target process (i.e., iSCSI Target process) to provide services for multiple virtual machines, that is, it is necessary to operate the logical block devices of the logical unit numbers (LUNs) of the respective virtual machines on behalf of the multiple virtual machines. However, in the actual practice, it is found that when this iSCSI target process fails, it cannot provide services for multiple virtual machines. At this time, the iSCSI target process becomes a single point of failure for all virtual machine storage, and this single point of failure has a great impact on the stability of the distributed storage service. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a distributed storage method, device, electronic device and storage medium, which are used to improve the problem that single point failure has a significant impact on the stability of distributed storage services.

[0006] The embodiment of the present application provides a distributed storage method, including: receiving an iSCSI data packet sent by a virtual machine; parsing the iSCSI data packet into a SCSI command through the iSCSI target process of the visitor object, and storing the SCSI command in the circular queue of the visitor object, wherein the SCSI command is a command for operating the logical block device of the logical unit number corresponding to the virtual machine; reading and processing the SCSI command from the circular queue through the scheduler process of the visitor object to obtain the SCSI processing command; sending the SCSI processing command to the distributed storage system so that the distributed storage system returns the operation result corresponding to the SCSI processing command. In the above implementation process, by associating an iSCSI target process with the logical block device of the logical unit number corresponding to a virtual machine as a visitor object, that is, an iSCSI target process only operates the logical block device of the logical unit number corresponding to a virtual machine on behalf of a virtual machine, thereby reducing the coupling between the iSCSI target process and the logical block device of the logical unit number, effectively reducing the impact of single point failures, and thus improving the stability of virtual machines accessing distributed storage systems in hyper-converged systems.

[0007] Optionally, in an embodiment of the present application, after sending a SCSI processing command to a distributed storage system, it also includes: receiving an operation result corresponding to the SCSI processing command sent by the distributed storage system; encapsulating the operation result into a SCSI command through the dispatcher process of the accessor object, and storing the SCSI command in a circular queue; reading the SCSI command from the circular queue through the iSCSI target process of the accessor object, and encapsulating the SCSI command into an iSCSI data packet; and sending an iSCSI data packet to the virtual machine. In the above implementation process, when the iSCSI Target process provides services for the virtual machine, the iSCSI target process accessed by the virtual machine through the iSCSI Initiator is 1:1. When an exception occurs in the iSCSI Target process or the Dispatcher process, the impact range is controlled within the same Accessor object, and the virtual machines do not share the same Accessor object, so the normal use of other virtual machines will not be affected.

[0008] Optionally, in an embodiment of the present application, receiving an iSCSI data packet sent by a virtual machine includes: obtaining an accessor object from a pre-created object pool; receiving a data request sent by the virtual machine through the iSCSI target process of the accessor object, and decapsulating the data request into an iSCSI data packet. In the above implementation process, the accessor object pool is separated from the complex operation logic of creating the object, and services are provided to multiple virtual machines in the form of an object pool (the iSCSI target process in one accessor object only provides services to one virtual machine), so that the accessor object does not need to be repeatedly created and destroyed every time it is needed, thereby effectively reducing the impact of single point failures and improving the stability of virtual machines accessing distributed storage systems in hyper-converged systems.

[0009] Optionally, in an embodiment of the present application, the above-mentioned ring queue is a queue with data persistence.

[0010] The embodiment of the present application also provides a distributed storage device, including: an iSCSI data receiving module, used to receive an iSCSI data packet sent by a virtual machine; an iSCSI data parsing module, used to parse the iSCSI data packet into a SCSI command through the iSCSI target process of the visitor object, and store the SCSI command in a circular queue of the visitor object, wherein the SCSI command is a command for operating a logical block device of a logical unit number corresponding to the virtual machine; a SCSI command obtaining module, used to read and process the SCSI command from the circular queue through the scheduler process of the visitor object, and obtain a SCSI processing command; and a SCSI command sending module, used to send the SCSI processing command to the distributed storage system, so that the distributed storage system returns the operation result corresponding to the SCSI processing command.

[0011] Optionally, in an embodiment of the present application, the distributed storage device also includes: an operation result sending module, which is used to receive the operation result corresponding to the SCSI processing command sent by the distributed storage system; a SCSI command storage module, which is used to encapsulate the operation result into a SCSI command through the scheduler process of the visitor object, and store the SCSI command in a circular queue; an iSCSI data encapsulation module, which is used to read the SCSI command from the circular queue through the iSCSI target process of the visitor object, and encapsulate the SCSI command into an iSCSI data packet; and an iSCSI data sending module, which is used to send an iSCSI data packet to the virtual machine.

[0012] Optionally, in an embodiment of the present application, the iSCSI data receiving module includes: an accessor object acquisition module, used to obtain an accessor object from a pre-created object pool; an iSCSI data decapsulation module, used to receive a data request sent by a virtual machine through the iSCSI target process of the accessor object, and decapsulate the data request into an iSCSI data packet.

[0013] Optionally, in an embodiment of the present application, the ring queue is a queue in which data can be persisted.

[0014] An embodiment of the present application further provides an electronic device, including: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method described above is performed.

[0015] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described above is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A schematic diagram of the architecture of a hyper-convergence system provided by an embodiment of the present application is shown;

[0018] Figure 2 A schematic diagram of the process of the distributed storage method provided by an embodiment of the present application is shown;

[0019] Figure 3 A schematic diagram of a process of feeding back an operation result to a virtual machine provided in an embodiment of the present application is shown;

[0020] Figure 4 A schematic diagram of the structure of a distributed storage device provided in an embodiment of the present application is shown;

[0021] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the embodiments of the present application claimed for protection, but merely represents the selected embodiments of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the embodiments of the present application.

[0023] Before introducing the distributed storage method provided in the embodiment of the present application, some concepts involved in the embodiment of the present application are first introduced:

[0024] A virtual machine (VM) is a special software in computer science. A virtual machine can create an environment between a computer platform and an end user. The end user operates the software based on the environment created by the virtual machine. A virtual machine can run computer software programs like a real machine.

[0025] Hyper-Converged Infrastructure (HCI) is an information infrastructure framework that integrates storage devices and virtual computing. In such an architecture environment, hardware units such as servers and storage from the same manufacturer are integrated into a chassis with virtualization software.

[0026] A hyper-converged system is a system that uses a hyper-converged infrastructure (HCI) to manage storage-related software and hardware, and is usually applied to virtual storage devices. A hyper-converged system uses a virtual machine (VM)-centric strategy to integrate storage management, data protection, and networking into one box, thereby providing users with virtual machine-related services.

[0027] Software Defined Network (SDN) is a new type of network architecture. SDN uses the OpenFlow protocol to separate the control plane of the router from the data plane and implements it in software, so that the control planes scattered on various network devices can be centrally managed. This architecture allows network administrators to re-plan the network with programs in a centrally controlled manner without changing the hardware equipment, providing a new solution for controlling network traffic and a good platform for core network and application innovation.

[0028] Logical Unit Number (LUN) refers to the device identification number of a logical storage device, that is, the storage device identification number used according to logical space requirements. It can refer to a storage space resource divided from a distributed storage system. LUN can usually be divided according to capacity space.

[0029] It should be noted that the distributed storage method provided in the embodiment of the present application can be executed by an electronic device, where the electronic device refers to a device terminal or server with the function of executing a computer program, such as a smart phone, a personal computer, a tablet computer, a personal digital assistant, or a mobile Internet device. A server refers to a device that provides computing services through a network. Compared with a virtual machine running on a server, the server is also called a physical server. A physical server can be an x86 server or a non-x86 server. Non-x86 servers include mainframes, minicomputers, and UNIX servers.

[0030] The following introduces application scenarios where the distributed storage method is applicable. The application scenarios here include but are not limited to: using the distributed storage method to enhance the functions of cloud computing related products. The cloud computing related products here include: hyper-converged systems, desktop clouds, and enterprise clouds, etc.; among which, the hyper-converged system refers to the software-defined infrastructure of the data center. The software-defined infrastructure here includes software-defined disks, software-defined networks (SDN), etc.

[0031] See also Figure 1 The schematic diagram of the architecture of the hyper-convergence system provided by the embodiment of the present application is shown; before introducing the distributed storage method, the hyper-convergence system to which the distributed storage method can be applied is first introduced, and the hyper-convergence system may include multiple servers; at least one accessor object (Accessor) runs on each server, and an accessor object only includes one iSCSI target process (Target Process), one ring queue (Ring Queue) and one dispatcher (Dispatcher) process. Among them, the iSCSI target process and the dispatcher process communicate with each other through the ring queue (receive and send SCSI commands), and the iSCSI target process only operates on a logical block device of a logical unit number (LUN) (for example, increase or decrease the space of the logical block device).

[0032] The above-mentioned hyper-converged system may also include at least one virtual machine, which may run on the server above (for example, to provide users with virtual machine services or cloud desktop services in the virtual machine, etc.), or may not run on the server above, but directly run on the user's terminal device. When the virtual machine runs directly on the user's terminal device, the server can directly provide services for the virtual machine running on the user's terminal device, that is, the virtual machine on the terminal device can directly use the iSCSI protocol to communicate with the visitor object on the server through the Internet, that is, the terminal device can directly send iSCSI data packets to the server through the virtual machine. When the virtual machine runs on the server, the virtual machine on the server can directly use the iSCSI protocol to communicate with the visitor object on the server through the kernel protocol stack.

[0033] The iSCSI client (i.e., iSCSI Initiator) can be run in the above virtual machine, and the user can create a virtual disk (e.g., a virtual SCSI device) by operating the iSCSI Initiator. At the same time, the above iSCSI target process (Target Process) is the server of iSCSI, so the iSCSI Initiator and the iSCSI target process (Target Process) of the visitor object can communicate with each other through the iSCSI protocol.

[0034] The above-mentioned hyper-converged system may also include a distributed storage system, which is a system that manages multiple dispersed storage devices (such as multiple disks) as a virtual elastic and scalable whole. In other words, the disks directly connected to the above servers may be managed by the distributed storage system or not. When the disks directly connected to the server are managed by the distributed storage system, the visitor object and the distributed storage system communicate with each other using the TCP / IP protocol. When the disks directly connected to the server are not managed by the distributed storage system, the server and the disk communicate directly with each other through the SCSI protocol.

[0035] See also Figure 2 The flow chart of the distributed storage method provided by the embodiment of the present application is shown; the main idea of ​​the distributed storage method is to associate an iSCSI target process with a logical block device of a logical unit number corresponding to a virtual machine as an accessor object, that is, an iSCSI target process only operates the logical block device of the logical unit number corresponding to a virtual machine on behalf of a virtual machine, thereby reducing the coupling between the iSCSI target process and the logical block device of the logical unit number, effectively reducing the impact of single point failures, thereby improving the stability of virtual machines accessing distributed storage systems in hyper-converged systems. The above-mentioned distributed storage method may include:

[0036] Step S110: the electronic device receives the iSCSI data packet sent by the virtual machine.

[0037] There are many implementation methods of the above step S110, including but not limited to the following:

[0038] The first implementation method is to directly receive through the accessor object in the object pool. This implementation method may include: obtaining the accessor object from a pre-created object pool. The data request sent by the virtual machine is received through the iSCSI target process of the accessor object, and the data request is decapsulated as an iSCSI data packet. The accessor object pool is separated from the complex operation logic of creating the object, and services are provided to multiple virtual machines in the form of an object pool (the iSCSI target process in one accessor object only provides services to one virtual machine), so that the accessor object does not need to be repeatedly created and destroyed every time it is needed, thereby effectively reducing the impact of single point failures and improving the stability of virtual machines accessing distributed storage systems in hyper-converged systems.

[0039] The second implementation method is to create a visitor object and then use the created visitor object to receive. This implementation method may include: first creating the required resources for the visitor object (for example: creating an iSCSI target process and a scheduler process, and applying to the system for allocation of a circular queue and a logical block device of a LUN), then building a visitor object based on the process ID of the iSCSI target process, the process ID of the scheduler process, the address information of the circular queue and the LUN, and then using the created visitor object to receive the data request sent by the virtual machine through the iSCSI protocol, and decapsulating the data request into an iSCSI data packet.

[0040] It is understandable that when the iSCSI Target process provides services for the virtual machine, the iSCSI target process accessed by the virtual machine through the iSCSI Initiator is 1:1. When an exception occurs in the iSCSI Target process or the Dispatcher process, the impact is controlled within the same Accessor object. The virtual machines do not share the same accessor object, so the normal use of other virtual machines will not be affected.

[0041] After step S110, step S120 is executed: the electronic device parses the iSCSI data packet into a SCSI command through the iSCSI target process of the visitor object, and stores the SCSI command in the circular queue of the visitor object.

[0042] The iSCSI target process is a process in the accessor object that is used to parse iSCSI packets into SCSI commands. The iSCSI target process here can also be used to manage the connection with the iSCSI Initiator, create or delete the logical block device and ring queue of LUN, etc.

[0043] The implementation method of the above-mentioned step S120 is, for example: the electronic device parses the iSCSI data packet into a SCSI command for operating the logical block device of the target LUN through the iSCSI target process of the visitor object, and stores the SCSI command in the ring queue of the visitor object; for example: the logical block device of the target LUN here can be understood as a virtual disk that the user needs to operate, so when the user operates the virtual disk (for example, increase or decrease the disk space), it needs to be translated into a SCSI command such as adding a hardware disk to the virtual disk, or deleting a hardware disk from the virtual disk, etc. The SCSI command refers to a command for operating the logical block device of the logical unit number corresponding to the virtual machine. The above-mentioned ring queue (Ring Queue) can be a queue that can persist data, and specifically, an ultra-high-speed storage device (such as Intel Optane or Samsung Z-SSD) can be used to implement data persistence of the ring queue.

[0044] After step S120, step S130 is executed: the electronic device reads and processes the SCSI command from the circular queue through the scheduler process of the visitor object to obtain the SCSI processing command.

[0045] An implementation example of the above step S130 is: the electronic device reads and parses the SCSI command from the circular queue through the scheduler process of the visitor object, and can also perform a series of processing operations on the SCSI command, such as: Input / Output Operations Per Second (IOPS) limit, network independent hard disk redundant array (RAID), erasure code characteristics and cache characteristics and other related processing operations. After the parsed SCSI command undergoes these processing operations, the processed SCSI processing command is obtained.

[0046] After step S130, step S140 is executed: the electronic device sends a SCSI processing command to the distributed storage system, so that the distributed storage system returns an operation result corresponding to the SCSI processing command.

[0047] An implementation example of the above step S140 is as follows: the electronic device sends a SCSI processing command to the distributed storage system through the TCP / IP protocol. After receiving the SCSI processing command, the distributed storage system operates the storage device (e.g., multiple managed disks) according to the SCSI processing command to obtain an operation result; then, the distributed storage system sends the operation result corresponding to the SCSI processing command to the electronic device.

[0048] In the above implementation process, an iSCSI target process is associated with a logical block device of a logical unit number corresponding to a virtual machine as an accessor object, that is, an iSCSI target process only operates the logical block device of a logical unit number corresponding to a virtual machine on behalf of a virtual machine, thereby reducing the coupling between the iSCSI target process and the logical block device of the logical unit number, effectively reducing the impact of single point failures, thereby improving the stability of virtual machines accessing distributed storage systems in hyper-converged systems.

[0049] See also Figure 3 The flowchart of feeding back the operation result to the virtual machine provided by the embodiment of the present application is shown; optionally, after the electronic device sends the SCSI processing command to the distributed storage system, the operation result can also be fed back to the virtual machine, and of course the virtual machine can also be allowed to actively query the operation result. Here, the active feeding back of the operation result to the virtual machine is used as an example for explanation, which may include:

[0050] Step S210: the electronic device receives the operation result corresponding to the SCSI processing command sent by the distributed storage system.

[0051] Step S220: The electronic device encapsulates the operation result into a SCSI command through the scheduler process of the visitor object, and stores the SCSI command in a circular queue.

[0052] The implementation method of the above steps S210 to S220 is, for example: after the distributed storage system sends the operation result corresponding to the SCSI processing command to the electronic device, the electronic device can receive the operation result corresponding to the SCSI processing command sent by the distributed storage system through the TCP / IP protocol, and encapsulate the operation result into a SCSI command through the scheduler process of the visitor object, and write the SCSI command into (i.e., store it in) a circular queue (Ring). The circular queue (Ring) is used to temporarily store SCSI commands, and the circular queue (Ring) can adopt a persistent or non-persistent circular queue. Of course, the circular queue (Ring) can be implemented in addition to the non-persistent Ring of shared memory, and can also be implemented by the data persistence Ring of ultra-high-speed storage devices (such as Intel Optane, Samsung Z-SSD). The persistent circular queue can effectively improve abnormal downtime, resulting in a small amount of data loss and the problem that the virtual machine file system needs to be repaired.

[0053] Step S230: The electronic device reads the SCSI command from the circular queue through the iSCSI target process of the accessor object, and encapsulates the SCSI command into an iSCSI data packet.

[0054] Step S240: The electronic device sends an iSCSI data packet to the virtual machine.

[0055] The implementation method of the above steps S230 to S240 is, for example: the electronic device reads the SCSI command from the circular queue through the iSCSI target process of the visitor object, and encapsulates the SCSI command into an iSCSI data packet of data response, and then the electronic device sends the iSCSI data packet of data response to the virtual machine through the TCP / IP protocol. It can be understood that the iSCSI data packet of data response here corresponds to the data request sent by the above virtual machine, that is, the electronic device sends a data response corresponding to the data request to the virtual machine.

[0056] In the above implementation process, the dispatcher process of the accessor object encapsulates the operation result into a SCSI command and stores the SCSI command in a circular queue; then, the iSCSI target process of the accessor object reads the SCSI command from the circular queue and encapsulates the SCSI command into an iSCSI data packet. When the iSCSI Target process provides services for the virtual machine, the iSCSI target process accessed by the virtual machine through the iSCSI Initiator is 1:1. When an exception occurs in the iSCSI Target process or the Dispatcher process, the impact range is controlled within the same Accessor object. The virtual machines do not share the same Accessor object, so the normal use of other virtual machines will not be affected.

[0057] See also Figure 4 The structural diagram of the distributed storage device provided in the embodiment of the present application is shown; the embodiment of the present application provides a distributed storage device 300, including:

[0058] The iSCSI data receiving module 310 is used to receive an iSCSI data packet sent by a virtual machine.

[0059] The iSCSI data parsing module 320 is used to parse the iSCSI data packets into SCSI commands through the iSCSI target process of the visitor object, and store the SCSI commands in the circular queue of the visitor object. The SCSI commands are commands for operating the logical block device of the logical unit number corresponding to the virtual machine.

[0060] The SCSI command obtaining module 330 is used to read and process SCSI commands from the circular queue through the scheduler process of the visitor object to obtain SCSI processing commands.

[0061] The SCSI command sending module 340 is used to send a SCSI processing command to the distributed storage system, so that the distributed storage system returns an operation result corresponding to the SCSI processing command.

[0062] Optionally, in the embodiment of the present application, the distributed storage device further includes:

[0063] The operation result sending module is used to receive the operation result corresponding to the SCSI processing command sent by the distributed storage system.

[0064] The SCSI command storage module is used to encapsulate the operation result into a SCSI command through the scheduler process of the visitor object, and store the SCSI command in a circular queue.

[0065] The iSCSI data encapsulation module is used to read SCSI commands from the circular queue through the iSCSI target process of the visitor object and encapsulate the SCSI commands into iSCSI data packets.

[0066] The iSCSI data sending module is used to send iSCSI data packets to the virtual machine.

[0067] Optionally, in an embodiment of the present application, the iSCSI data receiving module includes:

[0068] The visitor object acquisition module is used to obtain the visitor object from the pre-created object pool.

[0069] The iSCSI data decapsulation module is used to receive a data request sent by the virtual machine through the iSCSI target process of the visitor object, and decapsulate the data request into an iSCSI data packet.

[0070] Optionally, in an embodiment of the present application, the above-mentioned ring queue may also be a queue capable of data persistence.

[0071] It should be understood that the device corresponds to the above-mentioned distributed storage method embodiment and can execute the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in the memory in the form of software or firmware or solidified in the operating system (OS) of the device.

[0072] See also Figure 5 An electronic device 400 provided in an embodiment of the present application includes: a processor 410 and a memory 420, wherein the memory 420 stores machine-readable instructions executable by the processor 410, and when the machine-readable instructions are executed by the processor 410, the above method is executed.

[0073] The embodiment of the present application further provides a computer-readable storage medium 430 , on which a computer program is stored. When the computer program is executed by the processor 410 , the above method is executed.

[0074] Among them, the computer-readable storage medium 430 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0075] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed device and method can also be implemented in other ways. The device embodiments described above are only schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, a program segment or a code, and a part of a module, a program segment or a code includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also be different from the order of occurrence marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is mainly determined by the functions involved.

[0076] In addition, the functional modules of the various embodiments in the embodiments of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0077] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0078] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.

Claims

1. A distributed storage method, characterized in that: include: Receive iSCSI data packets sent by the virtual machine; Parsing the iSCSI data packet into a SCSI command through the iSCSI target process of the visitor object, and storing the SCSI command in a circular queue of the visitor object, wherein the SCSI command is a command for operating a logical block device corresponding to the virtual machine; Reading and processing the SCSI command from the circular queue through the scheduler process of the visitor object to obtain a SCSI processing command; Sending the SCSI processing command to the distributed storage system so that the distributed storage system returns an operation result corresponding to the SCSI processing command; Wherein, the visitor object includes an iSCSI target process, a circular queue and a scheduler process; the iSCSI target process and the scheduler process communicate with each other through the circular queue, the circular queue is used to temporarily store the SCSI commands, and the iSCSI target process operates on the logical block device of a logical unit number; the virtual machine is used to communicate with the visitor object running on the server when running on the server, or, when running on the terminal device, send iSCSI data packets to each other through the virtual machine and the visitor object running on the server; the distributed storage system is used to communicate with the visitor object using the TCP / IP protocol when being managed by the server, or, when not being managed, the server and the disk directly connected to the server communicate with each other through the SCSI protocol; the iSCSI target process is a process in the visitor object used to parse the iSCSI data packets into the SCSI commands.

2. The method according to claim 1, characterized in that After sending the SCSI processing command to the distributed storage system, the method further comprises: Receiving an operation result corresponding to the SCSI processing command sent by the distributed storage system; Encapsulating the operation result into a SCSI command through the scheduler process of the visitor object, and storing the SCSI command in the ring queue; Reading the SCSI command from the circular queue through the iSCSI target process of the visitor object, and encapsulating the SCSI command into an iSCSI data packet; The iSCSI data packet is sent to the virtual machine.

3. The method according to claim 1, characterized in that The receiving of the iSCSI data packet sent by the virtual machine includes: Obtain the visitor object from a pre-created object pool; The data request sent by the virtual machine is received through the iSCSI target process of the visitor object, and the data request is decapsulated into the iSCSI data packet.

4. The method according to any one of claims 1 to 3, characterized in that: The circular queue is a queue capable of data persistence.

5. A distributed storage device, characterized in that: include: An iSCSI data receiving module is used to receive iSCSI data packets sent by the virtual machine; An iSCSI data parsing module, used for parsing the iSCSI data packet into a SCSI command through the iSCSI target process of the visitor object, and storing the SCSI command in a circular queue of the visitor object, wherein the SCSI command is a command for operating a logical block device corresponding to the virtual machine; A SCSI command acquisition module, used for reading and processing the SCSI command from the circular queue through the scheduler process of the visitor object to obtain a SCSI processing command; A SCSI command sending module, used for sending the SCSI processing command to the distributed storage system, so that the distributed storage system returns the operation result corresponding to the SCSI processing command; Wherein, the visitor object includes an iSCSI target process, a circular queue and a scheduler process; the iSCSI target process and the scheduler process communicate with each other through the circular queue, the circular queue is used to temporarily store the SCSI commands, and the iSCSI target process operates on the logical block device of a logical unit number; the virtual machine is used to communicate with the visitor object running on the server when running on the server, or, when running on the terminal device, send iSCSI data packets to each other through the virtual machine and the visitor object running on the server; the distributed storage system is used to communicate with the visitor object using the TCP / IP protocol when being managed by the server, or, when not being managed, the server and the disk directly connected to the server communicate with each other through the SCSI protocol; the iSCSI target process is a process in the visitor object used to parse the iSCSI data packets into the SCSI commands.

6. The device according to claim 5, characterized in that The distributed storage device further includes: An operation result sending module, used for receiving the operation result corresponding to the SCSI processing command sent by the distributed storage system; A SCSI command storage module, used for encapsulating the operation result into a SCSI command through the scheduler process of the visitor object, and storing the SCSI command in the ring queue; An iSCSI data encapsulation module, used for reading the SCSI command from the circular queue through the iSCSI target process of the visitor object, and encapsulating the SCSI command into an iSCSI data packet; The iSCSI data sending module is used to send the iSCSI data packet to the virtual machine.

7. The device according to claim 5, characterized in that The iSCSI data receiving module comprises: A visitor object acquisition module, used to acquire the visitor object from a pre-created object pool; The iSCSI data decapsulation module is used to receive the data request sent by the virtual machine through the iSCSI target process of the visitor object, and decapsulate the data request into the iSCSI data packet.

8. The device according to any one of claims 5 to 7, characterized in that: The circular queue is a queue capable of data persistence.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 4 is performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is executed.