Virtualization reading method and device of disk array, electronic equipment and storage medium

CN116540929BActive Publication Date: 2026-08-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310370761.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2026-08-18
Estimated Expiration
2043-04-07

AI Technical Summary

Technical Problem

[0003]本发明提供一种磁盘阵列的虚拟化读取方法、装置、电子设备及存储介质,用以解决现有技术中虚拟机读取磁盘数据的过程较为复杂,读取速度较慢的缺陷,实现虚拟机模拟读取RAID卡的方式以提升读取效率

Benefits of technology

[0032] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the virtualization reading method or the virtualization method of the disk array as described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116540929B_ABST
    Figure CN116540929B_ABST
Patent Text Reader

Abstract

The application provides a virtualization reading method and device of a disk array, electronic equipment and a storage medium, and the method comprises the following steps: receiving a first instruction sent by a virtual operating system simulator; in the case that it is determined that a user selects to use a disk array, performing retrieval matching on the first instruction based on a configuration library, wherein the configuration library comprises configuration information of virtualized disk arrays of respective virtual machines; in the case that there is matched configuration information of a virtualized disk array in the configuration library, modifying the first instruction based on the configuration information to obtain a second instruction, and executing the second instruction to call the virtualized disk array from a resource pool of the virtual machine to read or write hard disk data. Through virtualization of the disk array, the virtual machine can read disk data in a simulated manner of reading the disk array, and the reading speed and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of server technology, and in particular to a virtualization reading method, apparatus, electronic device, and storage medium for a disk array. Background Technology

[0002] Currently, server virtualization technology based on QEMU-KVM is widely used. Virtualization redefines and partitions IT resources using software methods, enabling dynamic allocation, flexible scheduling, and cross-domain sharing of IT resources. This improves IT resource utilization and allows IT resources to truly become social infrastructure, serving the flexible and ever-changing application needs of various industries. In virtualization technology, the software representation of hardware is fundamental. Virtualization of hardware such as CPUs and network cards can be logically partitioned within virtualization software; however, virtualization of RAID cards has limitations. Therefore, the process of virtual machines reading disk data is relatively complex and slow. Summary of the Invention

[0003] This invention provides a virtualized reading method, apparatus, electronic device, and storage medium for disk arrays, which solves the shortcomings of the existing technology where the process of virtual machine reading disk data is relatively complex and the reading speed is slow, and realizes the virtual machine to simulate reading RAID card to improve reading efficiency.

[0004] This invention provides a virtualized reading method for a disk array, comprising:

[0005] The system receives a first instruction sent by a virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0006] If it is determined that the user has chosen to use a disk array, the first instruction is retrieved and matched based on the configuration library, which includes the configuration information of the virtualized disk arrays of each virtual machine;

[0007] If a matching configuration information for a virtualized disk array exists in the configuration library, the first instruction is modified based on the configuration information to obtain a second instruction. The second instruction is then executed to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0008] According to a virtualized disk array reading method provided by the present invention, the step of modifying the first instruction based on the configuration information to obtain a second instruction, and executing the second instruction to call the virtualized disk array from the resource pool of the virtual machine for reading or writing hard disk data includes:

[0009] Based on the configuration information, determine the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array;

[0010] Based on the virtual machine information corresponding to the virtualized disk array, the cache quota and priority execution information of the disk array, the second instruction is obtained and executed to call the virtualized disk array to read or write hard disk data based on the cache quota and priority execution information of the disk array.

[0011] According to a virtualization reading method for a disk array provided by the present invention, before performing a retrieval and matching of the first instruction based on the configuration library when it is determined that the user has selected to use the disk array, the method further includes:

[0012] The first instruction is parsed to obtain the first virtual machine information corresponding to the first instruction.

[0013] According to a virtualization reading method for a disk array provided by the present invention, the step of searching and matching the first instruction based on the configuration library includes:

[0014] Based on the first instruction, determine whether there is configuration information for a virtualized disk array in the configuration library that matches the first virtual machine information.

[0015] According to a virtualization reading method for a disk array provided by the present invention, after searching and matching the first instruction based on the configuration library, the method further includes:

[0016] If no matching configuration information for the virtualized disk array is found in the configuration library, the first instruction is executed.

[0017] The virtualization reading method for a disk array provided by the present invention further includes:

[0018] If it is determined that the disk array or any virtual machine information in the configuration library has changed, the configuration information is updated.

[0019] This invention also provides a disk array virtualization method applied to a virtual operating system simulator, comprising:

[0020] Receive disk read / write commands sent by the client;

[0021] Based on binary instruction translation technology, the disk read / write instructions are translated into intermediate code of the target format, and the intermediate code is translated into type instructions executable by the disk array to generate the first instruction;

[0022] Send the first instruction to the virtual machine.

[0023] The disk array virtualization method provided by the present invention further includes:

[0024] The configuration information of the virtualized disk array is determined, including the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array;

[0025] The configuration information is stored in the configuration library, and the virtualized disk array is stored in the resource pool of the corresponding virtual machine, so that the corresponding virtual machine can call it according to business needs.

[0026] The present invention also provides a virtualization reading device for a disk array, comprising:

[0027] The receiving module is used to receive a first instruction sent by the virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0028] The matching module is used to search and match the first instruction based on the configuration library when it is determined that the user has selected to use a disk array. The configuration library includes the configuration information of the virtualized disk arrays of each virtual machine.

[0029] The modification module is used to modify the first instruction based on the configuration information when a matching virtualized disk array configuration information exists in the configuration library, to obtain a second instruction, and execute the second instruction to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0030] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a virtualized read method for a disk array or a virtualization method for a disk array as described above.

[0031] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the virtualization reading method of the disk array or the virtualization method of the disk array as described above.

[0032] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the virtualization reading method or the virtualization method of the disk array as described above.

[0033] The present invention provides a virtualized disk array reading method, apparatus, electronic device, and storage medium. Upon receiving a first instruction from a virtual operating system emulator and determining that the user has selected to use a disk array, the first instruction is searched and matched against a configuration library. If a match is successful and the configuration information for the disk array exists in the library, the first instruction is modified to obtain a second instruction, which is then executed to read the virtualized disk array. By virtualizing the disk array, the present invention enables a virtual machine to read disk data by simulating the reading of the disk array, thereby improving reading speed and efficiency. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0035] Figure 1 This is a technical schematic diagram of existing server virtualization technology based on QEMU-kvm.

[0036] Figure 2 This is one of the flowcharts illustrating the virtualization reading method for disk arrays provided by the present invention;

[0037] Figure 3 This is the second flowchart illustrating the virtualization reading method for disk arrays provided by this invention;

[0038] Figure 4 This is a flowchart illustrating the disk array virtualization method provided by the present invention;

[0039] Figure 5 This is a schematic diagram of the structure of the virtualization reading device for the disk array provided by the present invention;

[0040] Figure 6 This is a schematic diagram of the structure of the disk array virtualization device provided by the present invention;

[0041] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0043] It should be noted that all uses of "first" and "second" in the embodiments of the present invention are for the purpose of distinguishing two different entities or different parameters with the same name. Therefore, "first" and "second" are merely for convenience of expression and should not be construed as limiting the embodiments of the present invention. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as other steps or units inherent in a process, method, system, product, or device that includes a series of steps or units.

[0044] First, the technical terms involved in this invention will be explained:

[0045] QEMU (Quick Emulator) is a purely software-based virtualization system. Its code includes a complete set of virtual machine implementations, including CPU virtualization, memory virtualization, and the simulation of other virtual devices such as network cards, graphics cards, and hard drives. QEMU acts as a virtual machine monitor (VMM) for the host machine, simulating the CPU through dynamic binary translation and providing a series of hardware models. This makes the virtual machine operating system believe it is interacting with hardware, when in fact it is interacting with the hardware simulated by QEMU. QEMU then translates these instructions to the actual hardware for operation.

[0046] KVM: Kernel-based Virtual Machine, is an open-source virtualization solution based on the Linux kernel. KVM is a full virtualization solution that relies on hardware-assisted virtualization technology. Its basic idea is to add a virtual machine management module to the Linux kernel, reusing well-established and mature mechanisms and modules in the Linux kernel, such as process scheduling, memory management, and I / O management, making it a hypervisor capable of running virtual machines. KVM only provides virtualization for CPU and memory management.

[0047] Reference Figure 1 , Figure 1This is a technical diagram illustrating the principles of server virtualization technology based on QEMU-kvm. Virtualization uses software methods to redefine and partition IT resources, enabling dynamic allocation, flexible scheduling, and cross-domain sharing of IT resources. This improves IT resource utilization and allows IT resources to truly become social infrastructure, serving the flexible and ever-changing application needs of various industries.

[0048] It should be noted that the execution subject of the disk array virtualization reading method provided by this invention can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. For example, a mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc., while a non-mobile electronic device can be a server, network attached storage (NAS), or personal computer (PC), etc. This invention does not impose specific limitations. The following describes the steps of this invention in detail by using a computer to execute the disk array virtualization reading method provided by this invention.

[0049] Reference Figure 2 The virtualization reading method for disk arrays provided by this invention includes the following steps:

[0050] Step 210: Receive a first instruction sent by the virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0051] Step 220: If it is determined that the user has selected to use a disk array, the first instruction is searched and matched based on the configuration library, which includes the configuration information of the virtualized disk arrays of each virtual machine.

[0052] Step 230: If a matching configuration information for a virtualized disk array exists in the configuration library, modify the first instruction based on the configuration information to obtain a second instruction, and execute the second instruction to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0053] In step 210 above, the first instruction is obtained through instruction virtualization using the QEMU virtual operating system emulator based on binary instruction translation technology. Specifically, this process involves extracting the client's code instructions, translating them into TCG (Tiny Code Generator) intermediate code, and finally translating the intermediate code into code specific to the physical machine's architecture, thereby achieving hardware virtualization simulation. The first instruction is the type of disk array executable instruction obtained by the QEMU virtual operating system emulator translating disk read / write instructions using binary instruction translation technology. In other words, the virtualization process of the disk sequence RAID card is the process by which QEMU translates the disk read instructions sent by the client into RAID executable instructions.

[0054] RAID, or Redundant Array of Independent Disks, is a technology that combines multiple independent hard drives (physical hard drives) in different ways to form a hard drive group (logical hard drive), thereby providing higher storage performance and data backup capabilities than a single hard drive. A RAID card is a card used to implement RAID functionality, typically consisting of an I / O processor, hard drive controller, hard drive connectors, and cache, among other components. Generally, a RAID card consists of the following parts:

[0055] SCSI controller: Connects to SCSI physical disks at the back end;

[0056] PCI bus controller: Its front end is connected to the host's PCI bus to maintain PCI bus arbitration, data transmission and reception and other functions;

[0057] ROM: Contains the code necessary to initialize the RAID card and the code required to implement RAID functionality;

[0058] RAM serves two main purposes: firstly, as a data cache (data that the OS needs to write to the hard drive and data that the OS needs to read from the hard drive), improving performance; secondly, as the memory space required by the CPU on the RAID card to perform RAID operations.

[0059] XOR chip: Used for calculating parity data in parity-type RAID such as RAID3, 5, and 6.

[0060] It should be noted that the virtualization of the RAID card is all performed in user space.

[0061] In step 220 above, if it is determined that the user has selected to use a disk array, the first instruction is searched and matched based on the configuration library. That is, when the user intends to use a RAID card (the virtual machine needs to read the disk array), the first instruction needs to be searched according to the configuration library, that is, to determine whether the configuration information of the RAID card corresponding to the first instruction exists in the configuration library.

[0062] If the RAID card configuration information exists in the configuration library, the match is successful. In this case, the first command needs to be modified to further confirm the RAID card corresponding to the configuration information. If the RAID card configuration information does not exist in the configuration library, the match fails. In this case, the RAID card cannot be read, so the first command can be executed directly.

[0063] In step 230 above, the first instruction is modified based on the configuration information according to the successful matching result, and a second instruction is obtained and executed to enable the virtual machine to read the virtualized disk array.

[0064] It should be noted that, according to the modified second instruction, the usage quota of the disk array card cache and the execution priority of data instructions can be obtained during the reading process. That is, the virtual machine reads the RAID card first, which means that the RAID card cache is used, thereby improving performance.

[0065] The virtualized disk array reading method provided by this invention receives a first instruction sent by the QEMU virtual operating system emulator. If the user selects to use a disk array, the method searches and matches the first instruction against a configuration library. If a match is found and disk array configuration information exists in the library, the first instruction is modified to obtain a second instruction, which is then executed to read the virtualized disk array. This invention, by virtualizing the disk array, allows the virtual machine to read disk data by simulating the disk array, thus improving read speed and efficiency.

[0066] In some optional embodiments, modifying the first instruction based on the configuration information to obtain a second instruction, and executing the second instruction to call the virtualized disk array from the virtual machine's resource pool for reading or writing hard disk data, includes:

[0067] Based on the configuration information, determine the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array;

[0068] Based on the virtual machine information corresponding to the virtualized disk array, the cache quota and priority execution information of the disk array, the second instruction is obtained and executed to call the virtualized disk array to read or write hard disk data based on the cache quota and priority execution information of the disk array.

[0069] Specifically, in this embodiment, a first instruction that is successfully matched indicates that there is a corresponding RAID card configuration information in the configuration library. Therefore, the first instruction needs to be modified according to the specific configuration information to obtain the modified second instruction.

[0070] The specific modification method is to determine the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the disk array, based on the configuration information of the disk array that successfully matches the first instruction, so as to obtain the modified second instruction.

[0071] Based on the modified second instruction, the disk array card cache usage quota and data instruction execution priority can be obtained during the reading process. Then, the modified target instruction is executed to enable the virtual machine to read or write disk data.

[0072] In some optional embodiments, before retrieving and matching the first instruction based on the configuration library when it is determined that the user has selected to use a disk array, the method further includes:

[0073] The first instruction is parsed to obtain the first virtual machine information corresponding to the first instruction;

[0074] Accordingly, the step of searching and matching the first instruction based on the configuration library includes:

[0075] Based on the first instruction, determine whether there is configuration information for a virtualized disk array in the configuration library that matches the first virtual machine information.

[0076] Specifically, this embodiment describes the parsing and matching process of the first instruction. It should be noted that the execution process of this embodiment can be completed by multiple units, including a configuration library, a receiver, a parser, and a modifier.

[0077] Configuration Library: This section stores the configuration information of each virtual machine's RAID card. The information in the configuration library is updated whenever the virtual machine's RAID card configuration changes. Receiver: Receives QEMU-translated instructions and sends them to the parser. Parser: Responsible for parsing the QEMU-translated instructions, obtaining virtual machine-related information, and sending the instructions and parsed information to the modifier. Modifier: After receiving the instruction parsing information, the modifier searches the configuration library for virtual machine RAID card configuration information based on the parsed virtual machine information. If no RAID card configuration information is found, the instructions are executed directly without modification. If a RAID card configuration is found, the instructions are modified according to the specific configuration information to obtain the RAID card cache quota and execution priority, and then the modified instructions are executed.

[0078] Before matching, the first instruction needs to be parsed by the parser to obtain the virtual machine information corresponding to the first instruction. Then, the parsed first instruction and virtual machine information are sent to the modifier for matching and modification.

[0079] The modifier searches the configuration library for disk array configuration information based on the parsed first instruction and virtual machine information to obtain the matching result.

[0080] If the configuration information of the RAID card exists in the configuration library, it means that the match is successful and the first matching result is obtained. At this time, the first command needs to be modified in order to further confirm the RAID card corresponding to the configuration information.

[0081] Optionally, after performing the retrieval and matching of the first instruction based on the configuration library, the method further includes:

[0082] If no matching configuration information for the virtualized disk array is found in the configuration library, the first instruction is executed.

[0083] If the RAID card configuration information is not found in the configuration library, the matching fails, and a second matching result is obtained. At this time, the RAID card cannot be read, so the first command can be executed directly.

[0084] In some optional embodiments, the method further includes: determining that the disk array or any virtual machine information in the configuration library has changed, and updating the configuration information.

[0085] It is understandable that the configuration information in the configuration library is updated each time the virtual machine information or disk array changes, so that the first instruction can be retrieved and matched according to the updated configuration library, thereby improving the retrieval accuracy of the first instruction.

[0086] Reference Figure 3 The virtualization reading method for disk arrays provided by this invention includes the following steps:

[0087] First, QEMU instructions are sent; the receiver receives the QEMU-translated instructions; the parser parses the instructions; the modifier receives the parsed instructions; the configuration library is searched to see if there is a match; if so, the modifier modifies the instructions and then executes them; otherwise, the instructions are executed directly.

[0088] Reference Figure 4 The present invention also provides a method for virtualizing a disk array, comprising the following steps:

[0089] Step 410: Receive disk read / write commands sent by the client;

[0090] Step 420: Based on binary instruction translation technology, translate the disk read / write instructions into intermediate code of the target format, and translate the intermediate code into type instructions executable by the disk array to generate the first instruction;

[0091] Step 430: Send the first instruction to the virtual machine.

[0092] Furthermore, the method also includes;

[0093] The configuration information of the virtualized disk array is determined, including the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array;

[0094] The configuration information is stored in the configuration library, and the virtualized disk array is stored in the resource pool of the corresponding virtual machine, so that the corresponding virtual machine can call it according to business needs.

[0095] This embodiment receives disk read / write commands sent by the client, then virtualizes these commands to make them executable by the disk array. The commands are then sent to the virtual machine, enabling the virtual machine to read or write to the disk according to the commands.

[0096] In addition, this embodiment also needs to virtualize the disk array to obtain the configuration information of the virtualized disk array, and store the configuration information in the resource pool so that user virtual machines can add and use it according to business needs.

[0097] Specifically, this embodiment describes the RAID card virtualization process. QEMU software implements virtualization using binary instruction translation technology. This primarily involves extracting the client's code instructions, translating them into TCG (Tiny Code Generator) intermediate code, and finally translating the intermediate code into code specific to the physical machine's architecture. This achieves hardware virtualization simulation. The RAID card virtualization process is essentially QEMU translating the disk read instructions sent by the client into instructions that RAID can execute. After RAID virtualization, it can be added to the virtual machine resource pool, allowing user virtual machines to add and use it according to business needs.

[0098] When a user virtual machine with a virtual RAID card is added, it will receive a corresponding disk I / O performance boost during daily use, based on the RAID card's cache quota and priority configuration. This means that the disk data that the virtual machine needs to write or read will preferentially use the RAID card cache, and the system will prioritize processing this data, thereby speeding up the virtual machine's read and write speeds and achieving the goal of improving performance.

[0099] The virtual machine running process based on QEMU-kvm is as follows:

[0100] (1) QEMU-kvm running in user space operates the / dev / kvm character device through the ioctl system call to create VM (virtual machine) and vCPU (virtual CPU).

[0101] (2) The KVM kernel module is responsible for creating and initializing the relevant data structures, and then returns to user space.

[0102] (3) QEMU-kvm runs vCPUs by calling ioctl (request code), that is, it schedules the corresponding virtual machines to run.

[0103] (4) After the KVM kernel performs the relevant processing, it executes the VMLAUNCH instruction and enters the virtual machine operating system through VM-Entry. The virtual machine operating system runs in non-root mode.

[0104] (5) The virtual machine operating system executes the corresponding virtual machine code, and authorized instructions can run directly on the physical CPU.

[0105] (6) When the virtual machine operating system encounters an unauthorized instruction, an external interrupt, or an internal exception, the operation of the virtual machine operating system is suspended. A VM-Exit will be generated to exit the non-root mode for exception handling, and the relevant information will be recorded in the VMCS structure.

[0106] (7) VM-Exit causes the CPU to return to root mode, and the KVM kernel reads the VMCS virtual machine control structure to determine the reason for VM-Exit.

[0107] (8) If it is an I / O operation or other peripheral instruction, return to user mode QEMU-kvm, and QEMU-kvm will simulate the relevant instruction.

[0108] (9) If not, KVM will handle it automatically.

[0109] (10) After processing is complete, re-enter VM-Entry into the virtual machine operating system to run.

[0110] During virtual machine operation, disk read I / O instructions in the virtual machine code return to user space. QEMU reads and translates these instructions. After translation, the virtual machine can successfully read disk data through the RAID card, and the virtual machine starts. After the virtual machine starts, any subsequent disk read I / O instructions are also translated by QEMU to simulate the RAID card and complete communication with the disk.

[0111] The virtualization apparatus for a disk array provided by the present invention will be described below. The virtualization apparatus for a disk array described below and the virtualization reading method for a disk array described above can be referred to in correspondence with each other.

[0112] Reference Figure 5 The virtualization reading device for disk arrays provided by the present invention includes the following modules:

[0113] The receiving module 510 is used to receive a first instruction sent by the virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0114] The matching module 520 is used to search and match the first instruction based on the configuration library when it is determined that the user has selected to use a disk array. The configuration library includes the configuration information of the virtualized disk arrays of each virtual machine.

[0115] The modification module 530 is used to modify the first instruction based on the configuration information when a matching virtualized disk array configuration information exists in the configuration library, to obtain a second instruction, and execute the second instruction to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0116] In the aforementioned receiving module, the first instruction is obtained through instruction virtualization using the QEMU virtual operating system emulator based on binary instruction translation technology. Specifically, this process involves extracting the client's code instructions, translating them into TCG (Tiny Code Generator) intermediate code, and finally translating the intermediate code into code specific to the physical machine's architecture. This achieves hardware virtualization simulation. In other words, the disk serial RAID card virtualization process is essentially QEMU translating the disk read instructions sent by the client into RAID-executable instructions.

[0117] RAID, or Redundant Array of Independent Disks, is a technology that combines multiple independent hard drives (physical hard drives) in different ways to form a hard drive group (logical hard drive), thereby providing higher storage performance and data backup capabilities than a single hard drive. A RAID card is a card used to implement RAID functionality, typically consisting of an I / O processor, hard drive controller, hard drive connectors, and cache, among other components. Generally, a RAID card consists of the following parts:

[0118] SCSI controller: Connects to SCSI physical disks at the back end;

[0119] PCI bus controller: Its front end is connected to the host's PCI bus to maintain PCI bus arbitration, data transmission and reception and other functions;

[0120] ROM: Contains the code necessary to initialize the RAID card and the code required to implement RAID functionality;

[0121] RAM serves two main purposes: firstly, as a data cache (data that the OS needs to write to the hard drive and data that the OS needs to read from the hard drive), improving performance; secondly, as the memory space required by the CPU on the RAID card to perform RAID operations.

[0122] XOR chip: Used for calculating parity data in parity-type RAID such as RAID3, 5, and 6.

[0123] It should be noted that the virtualization of the RAID card is all performed in user space.

[0124] In the aforementioned matching module 520, if it is determined that the user selects to use a disk array, the first instruction is searched and matched based on the configuration library. In other words, when the user intends to use a RAID card (the virtual machine needs to read the disk array), the first instruction needs to be searched according to the configuration library, that is, to determine whether the configuration information of the RAID card corresponding to the first instruction exists in the configuration library.

[0125] If the RAID card configuration information exists in the configuration library, the match is successful. In this case, the first command needs to be modified to further confirm the RAID card corresponding to the configuration information. If the RAID card configuration information does not exist in the configuration library, the match fails. In this case, the RAID card cannot be read, so the first command can be executed directly.

[0126] In the above-mentioned modification module 530, the first instruction is modified based on the configuration information according to the successful matching result, and a second instruction is obtained and executed to enable the virtual machine to read the virtualized disk array.

[0127] It should be noted that, according to the modified second instruction, the usage quota of the disk array card cache and the execution priority of data instructions can be obtained during the reading process. That is, the virtual machine reads the RAID card first, which means that the RAID card cache is used, thereby improving performance.

[0128] The disk array virtualization reading device provided by this invention receives a first instruction sent by the QEMU virtual operating system emulator. If the user selects to use a disk array, the device searches and matches the first instruction against a configuration library. If a match is found and disk array configuration information exists in the library, the first instruction is modified to obtain a second instruction, which is then executed to read the virtualized disk array. This invention, by virtualizing the disk array, allows a virtual machine to read disk data by simulating the disk array, thus improving read speed and efficiency.

[0129] In some optional embodiments, modifying the first instruction based on the configuration information to obtain a second instruction, and executing the second instruction to call the virtualized disk array from the virtual machine's resource pool for reading or writing hard disk data, includes:

[0130] Based on the configuration information, determine the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array;

[0131] Based on the virtual machine information corresponding to the virtualized disk array, the cache quota and priority execution information of the disk array, the second instruction is obtained and executed to call the virtualized disk array to read or write hard disk data based on the cache quota and priority execution information of the disk array.

[0132] Specifically, in this embodiment, a first instruction that is successfully matched indicates that there is a corresponding RAID card configuration information in the configuration library. Therefore, the first instruction needs to be modified according to the specific configuration information to obtain the modified second instruction.

[0133] The specific modification method is to determine the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the disk array, based on the configuration information of the disk array that successfully matches the first instruction, so as to obtain the modified second instruction.

[0134] Based on the modified second instruction, the disk array card cache usage quota and data instruction execution priority can be obtained during the reading process. Then, the modified target instruction is executed to enable the virtual machine to read or write disk data.

[0135] In some optional embodiments, before retrieving and matching the first instruction based on the configuration library when it is determined that the user has selected to use a disk array, the method further includes:

[0136] The first instruction is parsed to obtain the first virtual machine information corresponding to the first instruction;

[0137] The step of searching and matching the first instruction based on the configuration library includes:

[0138] Based on the first instruction, determine whether there is configuration information for a virtualized disk array in the configuration library that matches the first virtual machine information.

[0139] Specifically, this embodiment describes the parsing and matching process of the first instruction. It should be noted that the execution process of this embodiment can be completed by multiple units, including a configuration library, a receiver, a parser, and a modifier.

[0140] Configuration Library: This section stores the configuration information of each virtual machine's RAID card. The information in the configuration library is updated whenever the virtual machine's RAID card configuration changes. Receiver: Receives QEMU-translated instructions and sends them to the parser. Parser: Responsible for parsing the QEMU-translated instructions, obtaining virtual machine-related information, and sending the instructions and parsed information to the modifier. Modifier: After receiving the instruction parsing information, the modifier searches the configuration library for virtual machine RAID card configuration information based on the parsed virtual machine information. If no RAID card configuration information is found, the instructions are executed directly without modification. If a RAID card configuration is found, the instructions are modified according to the specific configuration information to obtain the RAID card cache quota and execution priority, and then the modified instructions are executed.

[0141] Before matching, the first instruction needs to be parsed by the parser to obtain the virtual machine information corresponding to the first instruction. Then, the parsed first instruction and virtual machine information are sent to the modifier for matching and modification.

[0142] The modifier searches the configuration library for disk array configuration information based on the parsed first instruction and virtual machine information to obtain the matching result.

[0143] If the configuration information of the RAID card exists in the configuration library, it means that the match is successful and the first matching result is obtained. At this time, the first command needs to be modified in order to further confirm the RAID card corresponding to the configuration information.

[0144] Optionally, after performing the retrieval and matching of the first instruction based on the configuration library, the method further includes:

[0145] If no matching configuration information for the virtualized disk array is found in the configuration library, the first instruction is executed.

[0146] If the RAID card configuration information is not found in the configuration library, the matching fails, and a second matching result is obtained. At this time, the RAID card cannot be read, so the first command can be executed directly.

[0147] In some optional embodiments, the method further includes: determining that the disk array or any virtual machine information in the configuration library has changed, and updating the configuration information.

[0148] It is understandable that the configuration information in the configuration library is updated each time the virtual machine information or disk array changes, so that the first instruction can be retrieved and matched according to the updated configuration library, thereby improving the retrieval accuracy of the first instruction.

[0149] Reference Figure 6 The present invention also provides a disk array virtualization device, comprising the following modules:

[0150] The read / write module 610 is used to receive disk read / write commands sent by the client;

[0151] The translation module 620 is used to translate the disk read / write instructions into intermediate code of the target format based on binary instruction translation technology, and to translate the intermediate code into type instructions executable by the disk array to generate the first instruction;

[0152] The sending module 630 is used to send the first instruction to the virtual machine.

[0153] Furthermore, the device also includes a configuration module, which is specifically used for:

[0154] The configuration information of the virtualized disk array is determined, including the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array;

[0155] The configuration information is stored in the configuration library, and the virtualized disk array is stored in the resource pool of the corresponding virtual machine, so that the corresponding virtual machine can call it according to business needs.

[0156] This embodiment receives disk read / write commands sent by the client, then virtualizes these commands to make them executable by the disk array. The commands are then sent to the virtual machine, enabling the virtual machine to read or write to the disk according to the commands.

[0157] Furthermore, this embodiment also requires virtualizing the disk array to obtain the configuration information of the virtualized disk array. This configuration information is then stored in a resource pool for user virtual machines to add and use according to business needs. Specifically, this embodiment describes the RAID card virtualization process. The QEMU software implements virtualization using binary instruction translation technology. This primarily involves extracting the client's code instructions, translating them into TCG (Tiny Code Generator) intermediate code, and finally translating the intermediate code into code specific to the physical machine's architecture, thereby achieving hardware virtualization simulation. The RAID card virtualization process is essentially QEMU translating the disk read instructions sent by the client into RAID executable instructions. After RAID virtualization, it can be added to the virtual machine resource pool, where user virtual machines can add and use it according to business needs.

[0158] When a user virtual machine with a virtual RAID card is added, it will receive a corresponding disk I / O performance boost during daily use, based on the RAID card's cache quota and priority configuration. This means that the disk data that the virtual machine needs to write or read will preferentially use the RAID card cache, and the system will prioritize processing this data, thereby speeding up the virtual machine's read and write speeds and achieving the goal of improving performance.

[0159] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a virtualized read method of the disk array, the method including:

[0160] The system receives a first instruction sent by a virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0161] If it is determined that the user has chosen to use a disk array, the first instruction is retrieved and matched based on the configuration library, which includes the configuration information of the virtualized disk arrays of each virtual machine;

[0162] If a matching configuration information for a virtualized disk array exists in the configuration library, the first instruction is modified based on the configuration information to obtain a second instruction. The second instruction is then executed to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0163] Alternatively, a virtualization method for a disk array may be implemented, the method comprising:

[0164] Receive disk read / write commands sent by the client;

[0165] Based on binary instruction translation technology, the disk read / write instructions are translated into intermediate code of the target format, and the intermediate code is translated into type instructions executable by the disk array to generate the first instruction;

[0166] Send the first instruction to the virtual machine.

[0167] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0168] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the virtualization reading method of the disk array provided by the above methods, the method comprising:

[0169] The system receives a first instruction sent by a virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0170] If it is determined that the user has chosen to use a disk array, the first instruction is retrieved and matched based on the configuration library, which includes the configuration information of the virtualized disk arrays of each virtual machine;

[0171] If a matching configuration information for a virtualized disk array exists in the configuration library, the first instruction is modified based on the configuration information to obtain a second instruction. The second instruction is then executed to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0172] Alternatively, a virtualization method for a disk array may be implemented, the method comprising:

[0173] Receive disk read / write commands sent by the client;

[0174] Based on binary instruction translation technology, the disk read / write instructions are translated into intermediate code of the target format, and the intermediate code is translated into type instructions executable by the disk array to generate the first instruction;

[0175] Send the first instruction to the virtual machine.

[0176] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the virtualized read method of the disk array provided by the methods described above, the method comprising:

[0177] The system receives a first instruction sent by a virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology.

[0178] If it is determined that the user has chosen to use a disk array, the first instruction is retrieved and matched based on the configuration library, which includes the configuration information of the virtualized disk arrays of each virtual machine;

[0179] If a matching configuration information for a virtualized disk array exists in the configuration library, the first instruction is modified based on the configuration information to obtain a second instruction. The second instruction is then executed to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

[0180] Alternatively, a virtualization method for a disk array may be implemented, the method comprising:

[0181] Receive disk read / write commands sent by the client;

[0182] Based on binary instruction translation technology, the disk read / write instructions are translated into intermediate code of the target format, and the intermediate code is translated into type instructions executable by the disk array to generate the first instruction;

[0183] Send the first instruction to the virtual machine.

[0184] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0185] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A virtualized reading method for a disk array, characterized in that, Applied to virtual machines, including: The system receives a first instruction sent by a virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology. If it is determined that the user has chosen to use a disk array, the first instruction is retrieved and matched based on the configuration library, which includes the configuration information of the virtualized disk arrays of each virtual machine; If a matching configuration information for a virtualized disk array exists in the configuration library, the first instruction is modified based on the configuration information to obtain a second instruction. The second instruction is then executed to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

2. The virtualization reading method for a disk array according to claim 1, characterized in that, The step of modifying the first instruction based on the configuration information to obtain a second instruction, and executing the second instruction to call the virtualized disk array from the virtual machine's resource pool for reading or writing hard disk data, includes: Based on the configuration information, determine the virtual machine information corresponding to the virtualized disk array, as well as the cache quota and priority execution information of the virtualized disk array; Based on the virtual machine information corresponding to the virtualized disk array, the cache quota and priority execution information of the disk array, the second instruction is obtained and executed to call the virtualized disk array to read or write hard disk data based on the cache quota and priority execution information of the disk array.

3. The virtualization reading method for a disk array according to claim 1, characterized in that, Before performing a search and matching of the first instruction based on the configuration library when it is determined that the user has selected to use a disk array, the method further includes: The first instruction is parsed to obtain the first virtual machine information corresponding to the first instruction.

4. The virtualization reading method for a disk array according to claim 3, characterized in that, The step of searching and matching the first instruction based on the configuration library includes: Based on the first instruction, determine whether there is configuration information for a virtualized disk array in the configuration library that matches the first virtual machine information.

5. The virtualization reading method for a disk array according to claim 1, characterized in that, After performing a search and matching of the first instruction based on the configuration library, the method further includes: If no matching configuration information for the virtualized disk array is found in the configuration library, the first instruction is executed.

6. The virtualization reading method for a disk array according to any one of claims 1-5, characterized in that, Also includes: If it is determined that the disk array or any virtual machine information in the configuration library has changed, the configuration information is updated.

7. A virtualization method for a disk array, characterized in that, Applications to virtual operating system emulators include: Receive disk read / write commands sent by the client; Based on binary instruction translation technology, the disk read / write instructions are translated into intermediate code of the target format, and the intermediate code is translated into type instructions executable by the disk array to generate the first instruction; Send the first instruction to the virtual machine.

8. A virtualization reading device for a disk array, characterized in that, include: The receiving module is used to receive a first instruction sent by the virtual operating system simulator. The first instruction is a disk array executable instruction obtained by the virtual operating system simulator after translating disk read / write instructions based on binary instruction translation technology. The matching module is used to search and match the first instruction based on the configuration library when it is determined that the user has selected to use a disk array. The configuration library includes the configuration information of the virtualized disk arrays of each virtual machine. The modification module is used to modify the first instruction based on the configuration information when a matching virtualized disk array configuration information exists in the configuration library, to obtain a second instruction, and execute the second instruction to call the virtualized disk array from the virtual machine's resource pool to read or write hard disk data.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the virtualization reading method of the disk array as described in any one of claims 1 to 6, or the virtualization method of the disk array as described in claim 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the virtualization reading method of the disk array as described in any one of claims 1 to 6, or the virtualization method of the disk array as described in claim 7.

Citation Information

Patent Citations

  • Processing method and device for shared write cache of redundant arrays of independent disks (RAIDs)

    CN106569728A

  • Cross-platform transplanting method and device for disk array configuration software

    CN111552512A