Hard disk read-write method and device, equipment, medium and program product

By using artificial intelligence accelerator cards to assist in the completion of hard disk reading and writing operations in an artificial intelligence server, the problem that NVME solid-state drives cannot use the RAID mechanism to improve performance is solved, and the hard disk performance is significantly improved and cost reduction is achieved.

CN118885124APending Publication Date: 2024-11-01CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411088437.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

A large number of NVME protocol solid-state drives cannot use the commonly used RAID mechanism to further improve the performance of data reading and writing, resulting in the performance of the entire machine of the artificial intelligence server being unable to perform ideally.

Method used

By obtaining the virtual hard disk storage address of the target file, mapping processing is performed to obtain the physical hard disk storage address, and dividing the request into multiple sub-requests. The artificial intelligence acceleration card is used to assist in reading and writing operations, and supporting all types including NVME solid-state drives The hard disk uses the commonly used RAID mechanism for read and write optimization to reduce the use of CPU processing resources.

Benefits of technology

It significantly improves the read and write performance of the hard disk, reduces the dependence on traditional hardware RAID cards, and reduces the cost of artificial intelligence servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885124A_ABST
    Figure CN118885124A_ABST
Patent Text Reader

Abstract

The invention provides a hard disk read-write method and device, equipment, a medium and a program product, relates to the technical field of storage, and aims to solve the problem that an NVME solid state disk cannot utilize a common RAID mechanism. The method comprises the steps that a virtual hard disk storage address of a target file is obtained based on a first request, and the first request is used for requesting to read or write the target file; mapping the virtual hard disk storage address to obtain a physical hard disk storage address; according to a plurality of strips in the physical hard disk storage address, the first request is divided into a plurality of sub-requests, and the plurality of strips are located in different physical hard disks; and executing the sub-request corresponding to the first strip based on a first artificial intelligence acceleration card in a first logic group to which a first physical hard disk where the first strip is located belongs, the first logic group comprising the first physical hard disk and the first artificial intelligence acceleration card, and the first strip being any one of the plurality of strips. According to the method and the device, all types of hard disks including the NVME solid state disk can be supported to perform read-write optimization by utilizing a common RAID mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a hard disk reading and writing method, device, equipment, medium and program product. Background Art

[0002] With the rapid advancement of artificial intelligence technology and the increasing popularity of its applications, society's demand for artificial intelligence servers is growing rapidly. Compared with traditional general-purpose servers, artificial intelligence servers are standardly equipped with one or more artificial intelligence acceleration cards, such as graphics processing units (GPUs) or artificial intelligence accelerators (AIaccelerators).

[0003] Currently, a small number of small-capacity SATA / SAS hard disks are configured in artificial intelligence servers for installing operating systems. These SATA / SAS hard disks are connected to the server motherboard through traditional hardware host bus adapter (HBA) cards. The hardware HBA card has relatively simple functions and can only realize the Redundant Array of Independent Disks (RAID) 0 / RAID 1 functions, which has limited improvement in the hard disk read and write speed. In addition, artificial intelligence servers are configured with a large number of NVME protocol (Peripheral Component Interconnect Express, PCIe) interface) solid-state hard disks as large-capacity high-speed data disks. However, these large numbers of NVME protocol solid-state hard disks cannot use the commonly used RAID mechanism to further improve the performance of data reading and writing. Summary of the invention

[0004] The embodiments of the present application provide a hard disk reading and writing method, device, equipment, medium and program product to solve the problem in the related art that a large number of NVME protocol solid-state hard disks cannot use the commonly used RAID mechanism to further improve the performance of data reading and writing.

[0005] To solve the above technical problems, this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a hard disk reading and writing method, comprising:

[0007] Based on a first request, obtaining a virtual hard disk storage address of a target file, wherein the first request is used to request to read or write the target file;

[0008] Mapping the virtual hard disk storage address to obtain a physical hard disk storage address;

[0009] According to a plurality of strips in the physical hard disk storage address, the first request is divided into a plurality of sub-requests, the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks;

[0010] Based on a first artificial intelligence accelerator card in a first logical group to which a first physical hard disk where a first strip is located belongs, a sub-request corresponding to the first strip is executed, where the first logical group includes the first physical hard disk and the first artificial intelligence accelerator card, and the first strip is any one of the multiple strips.

[0011] Optionally, in a case where the first request is used to request to read the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including:

[0012] When target data corresponding to the first strip is stored in the video memory of the first artificial intelligence acceleration card, the target data is returned to the server operating system kernel based on the first artificial intelligence acceleration card.

[0013] Optionally, in a case where the first request is used to request to read the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including:

[0014] If the target data corresponding to the first strip is not stored in the video memory of the first artificial intelligence accelerator card, reading the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card;

[0015] Based on the first artificial intelligence acceleration card, the target data in the video memory is returned to the server operating system kernel.

[0016] Optionally, reading the target data in the first physical hard disk into a video memory based on the first artificial intelligence acceleration card includes:

[0017] In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs;

[0018] Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

[0019] Optionally, in a case where the first request is used to request writing of the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including:

[0020] Writing the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card;

[0021] Based on the first artificial intelligence acceleration card, the target data in the video memory is written into the first strip in the first physical hard disk.

[0022] Optionally, when the back-end RAID group is in RAID5 mode, the method further includes:

[0023] Based on at least one third artificial intelligence acceleration card, data in a third strip of at least one third physical hard disk is read into the video memory, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the third physical hard disk belongs;

[0024] Performing an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is the physical hard disk where the verification strip is located;

[0025] Based on the fourth artificial intelligence acceleration card, the verification data is written into a verification strip of the fourth physical hard disk.

[0026] In a second aspect, an embodiment of the present application provides a hard disk read-write device, comprising:

[0027] An acquisition module, configured to acquire a virtual hard disk storage address of a target file based on a first request, wherein the first request is used to request to read or write the target file;

[0028] A processing module, used for mapping the virtual hard disk storage address to obtain a physical hard disk storage address;

[0029] a division module, configured to divide the first request into a plurality of sub-requests according to a plurality of strips in the storage address of the physical hard disk, wherein the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks;

[0030] An execution module is used to execute a sub-request corresponding to a first strip based on a first artificial intelligence acceleration card in a first logical group to which a first physical hard disk where the first strip is located belongs, wherein the first logical group includes the first physical hard disk and the first artificial intelligence acceleration card, and the first strip is any one of the multiple strips.

[0031] Optionally, when the first request is used to request to read the target file, the execution module includes:

[0032] The first returning unit is configured to return the target data to the server operating system kernel based on the first artificial intelligence accelerator card when the target data corresponding to the first strip is stored in the video memory of the first artificial intelligence accelerator card.

[0033] Optionally, when the first request is used to request to read the target file, the execution module includes:

[0034] a first reading unit, configured to read the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card when the video memory of the first artificial intelligence accelerator card does not store the target data corresponding to the first strip;

[0035] The second returning unit is used to return the target data in the video memory to the server operating system kernel based on the first artificial intelligence acceleration card.

[0036] Optionally, the reading unit is specifically used for:

[0037] In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs;

[0038] Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

[0039] Optionally, when the first request is used to request writing the target file, the execution module includes:

[0040] A first writing unit, configured to write target data corresponding to the first strip into a video memory of the first artificial intelligence accelerator card;

[0041] The second writing unit is used to write the target data in the video memory into the first strip in the first physical hard disk based on the first artificial intelligence acceleration card.

[0042] Optionally, when the back-end RAID group is in RAID5 mode, the execution module further includes:

[0043] A second reading unit is used to read data in a third strip of at least one third physical hard disk into a video memory based on at least one third artificial intelligence acceleration card, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in a logical group to which the third physical hard disk belongs;

[0044] a computing unit, configured to perform an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in a logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is a physical hard disk where the verification strip is located;

[0045] The third writing unit is used to write the verification data into the verification strip of the fourth physical hard disk based on the fourth artificial intelligence acceleration card.

[0046] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, wherein the processor is configured to:

[0047] Based on a first request, obtaining a virtual hard disk storage address of a target file, wherein the first request is used to request to read or write the target file;

[0048] Mapping the virtual hard disk storage address to obtain a physical hard disk storage address;

[0049] According to a plurality of strips in the physical hard disk storage address, the first request is divided into a plurality of sub-requests, the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks;

[0050] Based on a first artificial intelligence accelerator card in a first logical group to which a first physical hard disk where a first strip is located belongs, a sub-request corresponding to the first strip is executed, where the first logical group includes the first physical hard disk and the first artificial intelligence accelerator card, and the first strip is any one of the multiple strips.

[0051] Optionally, when the first request is used to request to read the target file, the processor is specifically configured to:

[0052] When target data corresponding to the first strip is stored in the video memory of the first artificial intelligence acceleration card, the target data is returned to the server operating system kernel based on the first artificial intelligence acceleration card.

[0053] Optionally, when the first request is used to request to read the target file, the processor is specifically configured to:

[0054] If the target data corresponding to the first strip is not stored in the video memory of the first artificial intelligence accelerator card, reading the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card;

[0055] Based on the first artificial intelligence acceleration card, the target data in the video memory is returned to the server operating system kernel.

[0056] Optionally, the processor is specifically configured to:

[0057] In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs;

[0058] Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

[0059] Optionally, when the first request is used to request writing the target file, the processor is specifically configured to:

[0060] Writing the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card;

[0061] Based on the first artificial intelligence acceleration card, the target data in the video memory is written into the first strip in the first physical hard disk.

[0062] Optionally, when the back-end RAID group is in RAID5 mode, the processor is further configured to:

[0063] Based on at least one third artificial intelligence acceleration card, data in a third strip of at least one third physical hard disk is read into the video memory, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the third physical hard disk belongs;

[0064] Performing an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is the physical hard disk where the verification strip is located;

[0065] Based on the fourth artificial intelligence acceleration card, the verification data is written into a verification strip of the fourth physical hard disk.

[0066] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the hard disk reading and writing method described in the first aspect are implemented.

[0067] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the hard disk reading and writing method described in the first aspect above are implemented.

[0068] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the hard disk reading and writing method as described in the first aspect above.

[0069] In an embodiment of the present application, the hard disk reading and writing method can obtain a virtual hard disk storage address of a target file based on a first request, wherein the first request is used to request to read or write the target file, and the virtual hard disk storage address is mapped to obtain a physical hard disk storage address. According to multiple strips in the physical hard disk storage address, the first request is divided into multiple sub-requests, and the sub-requests are used to request to read or write corresponding target data in the target file, and the multiple strips are located on different physical hard disks. Based on the first artificial intelligence acceleration card in the first logical group to which the first physical hard disk where the first strip is located belongs, the sub-request corresponding to the first strip is executed, and the first logical group includes the first physical hard disk and the first artificial intelligence acceleration card, and the first strip is any one of the multiple strips, so that the read and write access request for the physical hard disk can be assisted by the artificial intelligence acceleration card in the logical group to which it belongs, and the hard disk is no longer dependent on the traditional hardware RAID card to implement the hard disk, and can support all types of hard disks including NVME solid-state hard disks to use the common RAID mechanism for read and write optimization, significantly reducing the occupation and consumption of CPU processing resources, thereby significantly improving the read and write performance of the hard disk, and reducing the dependence on the traditional hardware RAID card, The cost of the artificial intelligence server can be significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0071] Figure 1 is a flow chart of a hard disk reading and writing method provided in an embodiment of the present application;

[0072] Figure 2 It is a schematic diagram of the structure of a RAID0 mode provided in an embodiment of the present application;

[0073] Figure 3 It is a schematic diagram of the structure of a RAID1 mode provided in an embodiment of the present application;

[0074] Figure 4 It is a schematic diagram of the structure of a RAID5 mode provided in an embodiment of the present application;

[0075] Figure 5 This is one of the flowcharts of a hard disk reading data provided by an embodiment of the present application;

[0076] Figure 6is a schematic diagram of a traditional data transmission path provided in an embodiment of the present application;

[0077] Figure 7 It is a schematic diagram of a transmission path of AICardDirectStorage provided in an embodiment of the present application;

[0078] Figure 8 This is the second schematic diagram of a process of hard disk reading data provided by an embodiment of the present application;

[0079] Fig. 9 This is one of the flowcharts of a hard disk writing data provided by an embodiment of the present application;

[0080] Fig.10 This is the second schematic diagram of a process of writing data to a hard disk provided in an embodiment of the present application;

[0081] Fig.11 It is a structural schematic diagram of a hard disk reading and writing device provided in an embodiment of the present application;

[0082] Fig.12 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0083] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0084] For ease of understanding, some contents involved in the embodiments of the present application are described below:

[0085] At present, a large number of NVME protocol solid-state drives cannot use the commonly used RAID mechanism to further improve the performance of data reading and writing. On the one hand, even if there is pure software RAID implementation support for NVME solid-state drives, this method requires a large amount of CPU processing resources, and increases the copy latency between the CPU and the host memory. It cannot ideally play the read and write performance of NVME protocol solid-state drives, thus affecting the overall performance of the artificial intelligence server. On the other hand, the artificial intelligence server is equipped with several artificial intelligence acceleration cards. These artificial intelligence acceleration cards have strong parallel computing capabilities and are equipped with hundreds of GB of cache. They have the innate conditions to realize the functions of traditional hardware RAID cards, and are not limited to hard drives of various interface types, including SATA / SAS HDD, and PCIe (NVME) SSD, etc., so that the goal of optimizing and improving the read and write performance of various hard drives can be achieved at a lower cost.

[0086] Currently, the most commonly used RAID modes include RAID0, RAID1, and RAID5. The following is an introduction to the three modes respectively.

[0087] RAID0 mode: several physical hard disks in the hard disk group are divided into strips of the same block size. Each physical hard disk is divided into several strips. It does not support data verification and mirroring. Strips with the same index number of all physical hard disks constitute a logical stripe. The host completes read and write operations based on the stripe. In theory, the throughput rate of RAID0 data reading and writing, that is, the throughput rate of the entire RAID group is N times the throughput rate of a single member disk (N is the number of member disks in the RAID group). On the other hand, the actual storage space of RAID0 is the sum of the capacity of all physical hard disks in the hard disk group, but it does not provide data redundancy protection.

[0088] RAID1 mode: For several hard disks in a physical hard disk group, the blocks in each hard disk are mirror images of each other. In theory, the data read and write throughput of RAID1 is similar to that of RAID0, and it provides better data redundancy protection, but the actual storage space is only the size of one physical hard disk.

[0089] RAID5 mode: several hard disks in a physical hard disk group are divided into strips of the same block size. Each physical hard disk is divided into several strips, and the strips with the same index number of all hard disks constitute a stripe. In each stripe, a strip is included to save the verification data. In theory, the data read and write throughput of RAID5 is N-1 times the throughput of a single member disk (N is the number of member disks in the RAID group). It also provides data redundancy protection, allowing the damage or loss of data on a disk, but the actual storage space is reduced by the capacity of a physical hard disk.

[0090] In the embodiments of the present application, a hard disk reading and writing method, device, equipment, medium and program product are proposed to solve the problem in the related art that a large number of NVME protocol solid-state hard disks cannot use the commonly used RAID mechanism to further improve the performance of data reading and writing.

[0091] See also Figure 1 , Figure 1 is a flowchart of a hard disk reading and writing method provided by an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0092] Step 101: Based on a first request, obtain a virtual hard disk storage address of a target file, where the first request is used to request to read or write the target file.

[0093] Specifically, the first request may be a request sent by an upper-layer application of an artificial intelligence server to an operating system kernel when the upper-layer application needs to read or write data from a physical hard disk. The target file may be data that the upper-layer application needs to read or write. The target file may include multiple data. When the first request is used to request to read the target file, the multiple data may be stored in multiple physical hard disks respectively; when the first request is used to request to write the target file, the multiple data may be written to multiple physical hard disks respectively. The virtual hard disk storage address may be the storage path of the target file in the virtual hard disk.

[0094] Step 102: Map the virtual hard disk storage address to obtain a physical hard disk storage address.

[0095] Specifically, the physical hard disk storage address can be the storage address of the target file in the underlying physical hard disk. Exemplarily, the physical hard disk storage address can be RAID StripeID+physical hard disk ExtentID+StripID+DataBlockID, which means first locating the stripe in the RAID group, then locating the hard disk in the stripe, then locating the strip in the hard disk, and finally locating the Datablock in the stripe. The mapping process of the virtual hard disk storage address can be specifically processed according to the mode of the backend RAID group.

[0096] Step 103: Divide the first request into multiple sub-requests according to multiple strips in the physical hard disk storage address, wherein the sub-requests are used to request to read or write corresponding target data in the target file, and the multiple strips are located in different physical hard disks.

[0097] Specifically, the physical hard disk storage address may include storage addresses corresponding to multiple strips, and the multiple strips are located in different physical hard disks, that is, multiple target data in the target file are stored in multiple strips, or are to be stored in multiple strips. The physical hard disk may be all types of hard disks including NVME solid-state drives.

[0098] It should be noted that the sub-request may correspond to one or more strips, and the sub-request may also correspond to one or more target data. When the first request is used to request to read the target file, the sub-request is used to request to read the corresponding target data; when the first request is used to request to write the target file, the sub-request is used to request to write the corresponding target data.

[0099] Step 104: Execute a sub-request corresponding to a first strip based on a first artificial intelligence accelerator card in a first logical group to which a first physical hard disk to which the first strip belongs, where the first logical group includes the first physical hard disk and the first artificial intelligence accelerator card, and the first strip is any one of the multiple strips.

[0100] Specifically, the above-mentioned execution of the sub-request corresponding to the first strip, that is, the first artificial intelligence accelerator card will complete the operation of reading or writing the corresponding target data. The above-mentioned first logical group may include at least one physical hard disk and a first artificial intelligence accelerator card, and the at least one physical hard disk includes the first physical hard disk. The above-mentioned first logical group (LogicGroup) can be obtained by combining several physical hard disks and an artificial intelligence accelerator card according to the number of artificial intelligence accelerator cards configured in the artificial intelligence server, the number of physical hard disks, the adjacent distance between the accelerator card and the physical hard disk on the bus, the minimum number of routing hops and other strategies.

[0101] It should be noted that modern server operating systems all support the creation of soft RAID, such as the open source MD module of the open source Linux operating system. The embodiment of the present application is implemented on the basis of customized development and implementation of the open source software RAID module of the open source modern operating system. The customized module can be called OpenAiAcceMD.

[0102] When the user of the artificial intelligence server creates a soft RAID through OpenAiAcceMD (usually, a soft RAID is created for a data disk), on the one hand, information about the RAID group will be saved in the system disk of the artificial intelligence server, and on the other hand, the RAID configuration information will be written to the member hard disks of the RAID group. According to relevant standards, the configuration information of the target RAID is written in the last block of each member physical disk, that is, DDF. After the soft RAID is created, the RAID group presents a virtual disk (Virtual Disk) with a continuous address to the upper-layer application of the operating system. OpenAiAcceMD can form a logical group with several physical hard disks and an artificial intelligence accelerator card based on the number of artificial intelligence accelerator cards configured in the artificial intelligence server, the number of physical hard disks, the adjacent distance between the accelerator card and the physical hard disk on the bus, the minimum number of routing hops, and other strategies.

[0103] For example, Figure 2 is a schematic diagram of the structure of a RAID0 mode provided in an embodiment of the present application, such as Figure 2 As shown, a logical group may include two physical hard disks and an AI accelerator card, or may include a physical hard disk and an AI accelerator card. Each physical hard disk is divided into several strips, each strip includes multiple DataBlocks, and the strips with the same index number of all physical hard disks constitute a logical stripe.

[0104] Figure 3 is a schematic diagram of the structure of a RAID1 mode provided in an embodiment of the present application, such as Figure 3 As shown, the logical group may include a physical hard disk and an artificial intelligence accelerator card, wherein the blocks in the two physical hard disks are mirror images of each other.

[0105] Figure 4 is a schematic diagram of the structure of a RAID5 mode provided in an embodiment of the present application, such as Figure 4 As shown, a logical group may include two physical hard disks and an AI accelerator card, or may include a physical hard disk and an AI accelerator card. Each physical hard disk is divided into several strips, and the strips with the same index number of all physical hard disks constitute a logical stripe. And in each stripe, there is a strip for storing verification data.

[0106] In an embodiment of the present application, the hard disk reading and writing method can obtain a virtual hard disk storage address of a target file based on a first request, wherein the first request is used to request to read or write the target file, and the virtual hard disk storage address is mapped to obtain a physical hard disk storage address. According to multiple strips in the physical hard disk storage address, the first request is divided into multiple sub-requests, and the sub-requests are used to request to read or write corresponding target data in the target file, and the multiple strips are located on different physical hard disks. Based on the first artificial intelligence acceleration card in the first logical group to which the first physical hard disk where the first strip is located belongs, the sub-request corresponding to the first strip is executed, and the first logical group includes the first physical hard disk and the first artificial intelligence acceleration card, and the first strip is any one of the multiple strips, so that the read and write access request for the physical hard disk can be assisted by the artificial intelligence acceleration card in the logical group to which it belongs, and the hard disk is no longer dependent on the traditional hardware RAID card to implement the hard disk, and can support all types of hard disks including NVME solid-state hard disks to use the common RAID mechanism for read and write optimization, significantly reducing the occupation and consumption of CPU processing resources, thereby significantly improving the read and write performance of the hard disk, and reducing the dependence on the traditional hardware RAID card, The cost of the artificial intelligence server can be significantly reduced.

[0107] Optionally, in a case where the first request is used to request to read the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including:

[0108] When target data corresponding to the first strip is stored in the video memory of the first artificial intelligence acceleration card, the target data is returned to the server operating system kernel based on the first artificial intelligence acceleration card.

[0109] Specifically, when the first request is used to request to read the target file, the sub-request is used to request to read the corresponding target data. The above-mentioned returning the target data to the server operating system kernel based on the first artificial intelligence acceleration card can be that the first artificial intelligence acceleration card returns the target data in the video memory to the server operating system kernel through the (device Device's "video memory" -> host Host's "memory") operation.

[0110] It should be noted that each AI accelerator card can allocate a certain amount of space (for example, 2GB / 4GB / 8GB) from its own video memory for use as a cache for reading and writing the physical hard disk within its logical group.

[0111] For example, Figure 5This is one of the flowcharts of a hard disk reading data provided by the embodiment of the present application, such as Figure 5 As shown:

[0112] The operating system kernel of the artificial intelligence server divides each "read data operation" into several "sub (read) operations" according to the strips located in different physical hard disk Extents in the physical hard disk storage address involved in the read operation. Each "sub (read) operation" is completed by the artificial intelligence acceleration card (LeaderAICard) of the logical group (LogicGroup) to which the corresponding target physical hard disk where the target strip belongs. Among them, the "read data operation" can be understood as the above-mentioned first request, and the "sub (read) operation" can be understood as the above-mentioned sub-request. The target strip is the strip corresponding to the "sub (read) operation", and the target physical hard disk is the physical hard disk where the target strip is located. The operating system kernel transfers each "sub (read) operation" to the corresponding artificial intelligence acceleration card through heterogeneous computing.

[0113] If the AI ​​accelerator card's own cache (i.e., video memory) already has the data of the target Datablock in the target strip of the target physical hard disk, that is, a cache hit, the AI ​​accelerator card returns the data in the cache to the server operating system kernel through the (device Device's "video memory" -> host Host's "memory") operation.

[0114] In this embodiment, the above-mentioned hard disk reading and writing method can return the target data corresponding to the first strip to the server operating system kernel based on the first artificial intelligence acceleration card when the target data corresponding to the first strip is stored in the video memory of the first artificial intelligence acceleration card, so that the cache of the first artificial intelligence acceleration card in the first logical group can be used as a large-capacity high-speed cache by the physical hard disk of the first logical group, thereby improving the speed of reading data.

[0115] Optionally, in a case where the first request is used to request to read the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including:

[0116] If the target data corresponding to the first strip is not stored in the video memory of the first artificial intelligence accelerator card, reading the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card;

[0117] Based on the first artificial intelligence acceleration card, the target data in the video memory is returned to the server operating system kernel.

[0118] Specifically, when the first request is used to request to read the target file, the sub-request is used to request to read the corresponding target data. The above-mentioned reading of the target data in the first physical hard disk into the video memory based on the first artificial intelligence acceleration card can be transmitted through a data transmission channel established between the artificial intelligence acceleration card and the physical hard disk.

[0119] For example, Figure 5 As shown, the operating system transfers each "sub (read) operation" to the corresponding artificial intelligence accelerator card (LeaderAICard) through heterogeneous computing. If the cache (i.e., video memory) of the artificial intelligence accelerator card does not hit, the artificial intelligence accelerator card reads the data in the target Datablock of the target strip of the target physical hard disk and puts it into its own video memory. Through the artificial intelligence card direct storage (AICardDirectStorage) mechanism, the target data in the physical hard disk is directly read to the video memory of the artificial intelligence accelerator card, i.e., the host host "hard disk" -> Device "video memory", and then returns the target data to the server operating system kernel, i.e., the device Device "video memory" -> host Host "memory".

[0120] It should be noted that the above-mentioned AICardDirectStorage mechanism is similar to the NVIDIA GPU Direct Storage (NVIDIA GPUDirectStorage) mechanism. The AI ​​accelerator card can establish a direct data transmission channel with the storage device without having to detour through the CPU and host memory, thereby improving efficiency, reducing CPU load, improving CPU utilization, and reducing latency.

[0121] For example, Figure 6 is a schematic diagram of a traditional data transmission path provided in an embodiment of the present application, such as Figure 6 As shown, the data transmission path is A / A': NVME SSD / SATA (SAS) HDD to PCIe switch (Switch); B: PCIe Switch to CPU; C: CPU to system memory (System Memory); D: System memory to CPU; E: CPU to PCIe Switch; F: PCIe Switch to AI accelerator (Accelerator).

[0122] Figure 7 is a schematic diagram of a transmission path of AICardDirectStorage provided in an embodiment of the present application, such as Figure 7As shown in the figure, in the AI ​​Card Direct Storage mechanism, the data transmission path is A / A': NVME SSD / SATA (SAS) HDD to PCIe Switch; B: PCIe Switch to AI Accelerator.

[0123] It can be seen that in the AICardDirectStorage mechanism, the AI ​​accelerator card can establish a direct data transmission channel with the storage device without having to detour through the CPU and host memory.

[0124] In this embodiment, the above-mentioned hard disk reading and writing method can read the target data in the first physical hard disk into the video memory based on the first artificial intelligence acceleration card when the target data corresponding to the first strip is not stored in the video memory of the first artificial intelligence acceleration card, and return the target data in the video memory to the server operating system kernel based on the first artificial intelligence acceleration card, so that the first artificial intelligence acceleration card can be used to read the target data in the physical hard disk and store it in its video memory for reading again, thereby reducing the occupancy and consumption of CPU processing resources, thereby improving the reading performance of the hard disk.

[0125] Optionally, reading the target data in the first physical hard disk into a video memory based on the first artificial intelligence acceleration card includes:

[0126] In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs;

[0127] Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

[0128] Specifically, the second strip is a strip other than the first strip in the logical stripe where the target data is located, including a strip where the verification data is located. The XOR operation on the data in the second strip based on the first artificial intelligence acceleration card may be that the at least one second artificial intelligence acceleration card aggregates the data in its respective video memory to the first artificial intelligence acceleration card, and the first artificial intelligence acceleration card calls the XOR (exclusive OR) operation of the data bits to obtain the target data, and returns the target data to the server operating system kernel.

[0129] It should be noted that, when the first physical hard disk is damaged and the back-end disk array RAID group is in other RAID modes other than RAID5 mode, such as RAID0 and RAID1 mode, the upper layer application is directly notified of the failure to read the data. When the RAID group is in RAID5 mode, after obtaining the target data, the server operating system kernel can issue a hard disk failure alarm, prompting the user to solve the hard disk failure, and then perform RAID5 reconstruction.

[0130] For example, Figure 8 This is a second schematic diagram of a process of hard disk reading data provided by an embodiment of the present application, such as Figure 8 As shown:

[0131] If the AI ​​accelerator card encounters a target data corruption in the target strip of the target physical hard disk, causing the AICardDirectStorage operation to fail, the AI ​​accelerator card will respond to the server operating system kernel with the result of the hard disk read failure. After the server kernel receives the result, for other RAID modes other than RAID5, it will directly notify the upper-layer application of the data read failure; for the RAID5 mode, it will continue to use heterogeneous computing methods to allow the AI ​​accelerator card to recover the read target data by verifying the data. The specific method is as follows: the data of other physical hard disk strips (including the physical hard disk strip where the verification data is located) in the RAID stripe involved in this data read operation, except for the physical hard disk strip with damaged data, is sent to the AI ​​accelerator card to which it belongs through the AICardDirectStorage mechanism to perform the 'host host "hard disk" -> Device "video memory"' operation. After that, the above-mentioned AI accelerator card uses the full name message passing interface (Message The MPI_gather operation of the Multi-Purpose Drive (MPI) gathers the strip data to the AI ​​accelerator card responsible for the "sub-read operation". The latter calls the XOR operation of the data bit to generate the target physical hard disk strip information of the "sub-read operation" (this is the "cache hit"), and returns the data to the server operating system kernel (the "video memory" of the device Device -> the "memory" of the host Host). After that, the server operating system kernel issues a hard disk failure alarm, prompting the user to solve the hard disk failure, and then performs RAID5 reconstruction. The reconstruction process is similar to the above operation.

[0132] In this embodiment, the above-mentioned hard disk reading and writing method can read the data in the second strip of at least one second physical hard disk into the video memory based on at least one second artificial intelligence acceleration card when the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode. The second physical hard disk is the physical hard disk where the strips other than the first strip are located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is the artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs. Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data, so that when the physical hard disk where the target data is located is damaged, the first artificial intelligence acceleration card can be used to restore the target data, thereby achieving data fault tolerance, thereby improving system stability.

[0133] Optionally, in a case where the first request is used to request writing of the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including:

[0134] Writing the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card;

[0135] Based on the first artificial intelligence acceleration card, the target data in the video memory is written into the first strip in the first physical hard disk.

[0136] Specifically, when the first request is used to request writing the target file, the sub-request is used to request writing the corresponding target data. After writing the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card, writing to the hard disk can be delayed for a certain period of time, and the first artificial intelligence accelerator card can write all the target data in the video memory into the first physical hard disk in batches.

[0137] For example, Fig. 9 This is one of the flowcharts of a hard disk writing data provided by the embodiment of the present application, such as Fig. 9 As shown:

[0138] The operating system kernel of the artificial intelligence server divides each "write data operation" into several "sub (write) operations" according to the different strips in the physical hard disk storage address involved in the write operation. Each "sub (write) operation" is completed by the artificial intelligence acceleration card (LeaderAICard) to which the target physical hard disk where the target strip belongs belongs. Among them, the "write data operation" can be understood as the above-mentioned first request, and the "sub (write) operation" can be understood as the above-mentioned sub-request. The target strip is the strip corresponding to the "sub (write) operation", and the target physical hard disk is the physical hard disk where the target strip is located. The operating system transfers each "sub (write) operation" to the corresponding artificial intelligence acceleration card through heterogeneous computing.

[0139] The AI ​​accelerator card writes the data in the server memory into the accelerator card's own video memory through the operation (host "memory" -> device "video memory"), and then immediately returns a "successful write" response to the operating system kernel; after that, the AI ​​accelerator card actually writes the data to be written to the hard disk in the video memory into the target block of the target strip of the target physical hard disk in batches (through the AICardDirectStorage mechanism, i.e. Device "video memory" -> host "hard disk").

[0140] In this implementation, the hard disk reading and writing method can write the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card, and write the target data in the video memory into the first strip in the first physical hard disk based on the first artificial intelligence accelerator card, so that hard disk data writing can be implemented based on the first artificial intelligence accelerator card, thereby reducing the occupancy and consumption of CPU processing resources, thereby improving the writing performance of the hard disk.

[0141] Optionally, when the back-end RAID group is in RAID5 mode, the method further includes:

[0142] Based on at least one third artificial intelligence acceleration card, data in a third strip of at least one third physical hard disk is read into the video memory, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the third physical hard disk belongs;

[0143] Performing an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is the physical hard disk where the verification strip is located;

[0144] Based on the fourth artificial intelligence acceleration card, the verification data is written into a verification strip of the fourth physical hard disk.

[0145] Specifically, the third strip may be a strip in the stripe where the target data is located except the first strip and the check strip. The check strip is a strip in the stripe where the target data is located for storing check data. The check data is the check data updated according to the writing of the target data. The fourth artificial intelligence acceleration card based on the XOR operation of the target data and the data in the third strip to obtain the check data may be that the first artificial intelligence acceleration card and the at least one third artificial intelligence acceleration card respectively aggregate the data in their respective video memories to the fourth artificial intelligence acceleration card, and the fourth artificial intelligence acceleration card calls the XOR (exclusive OR) operation of the data bits to generate the latest check data bits.

[0146] For example, Fig.10 This is a second schematic diagram of a process of writing data to a hard disk provided in an embodiment of the present application. Fig.10 As shown:

[0147] For RAID0 or RAID1 mode, the update of the check data is not involved, but for RAID5 mode, the check data needs to be updated after the target poem is stored. The operating system kernel of the artificial intelligence server uses the heterogeneous computing mode to first pass the physical hard disk strips of other unupdated data contained in the stripe in the RAID group involved in this write operation to their respective artificial intelligence accelerator cards. The artificial intelligence accelerator card uses the AICardDirectStorage mechanism to perform the 'host host "hard disk" -> Device "video memory"' operation to read the corresponding data to the video memory of the artificial intelligence accelerator card. After that, the artificial intelligence accelerator card respectively aggregates the data in the above-mentioned respective video memories and the target data of this "sub (write) operation" through the MPI (Message Processing Interface) MPI_gather operation to the artificial intelligence accelerator card (LeaderAICard) of the physical hard disk of the check data strip in this Stripe. The latter calls the XOR (exclusive OR) operation of the data bit, generates the latest check data bit, and writes the check data bit to the target block of the target strip of the corresponding physical hard disk (through the AICardDirectStorage mechanism, that is, Device "video memory" -> host host "hard disk").

[0148] In this embodiment, the hard disk reading and writing method can read the data in the third strip of at least one third physical hard disk into the video memory based on at least one third artificial intelligence acceleration card, the third physical hard disk is the physical hard disk where the strips of the target data are located except the first strip and the check strip are located, the third artificial intelligence acceleration card is the artificial intelligence acceleration card in the logical group to which the third physical hard disk belongs, based on the fourth artificial intelligence acceleration card, the target data and the data in the third strip are XORed to obtain the check data, the fourth artificial intelligence acceleration card is the artificial intelligence acceleration card in the logical group to which the fourth physical hard disk belongs, the fourth physical hard disk is the physical hard disk where the check strip is located, and the check data is written into the check strip of the fourth physical hard disk based on the fourth artificial intelligence acceleration card, so that after the new data is written based on the first artificial intelligence acceleration card, the check data is updated in time, and the updated check data is written, thereby improving the reliability of the data and improving the stability of the system.

[0149] See also Fig.11 , Fig.11 is a structural diagram of a hard disk read-write device provided in an embodiment of the present application, such as Fig.11 As shown, the hard disk read-write device 1100 includes:

[0150] An acquisition module 1101 is configured to acquire a virtual hard disk storage address of a target file based on a first request, wherein the first request is used to request to read or write the target file;

[0151] The processing module 1102 is used to map the virtual hard disk storage address to obtain the physical hard disk storage address;

[0152] A division module 1103 is used to divide the first request into multiple sub-requests according to multiple strips in the physical hard disk storage address, wherein the sub-requests are used to request to read or write corresponding target data in the target file, and the multiple strips are located in different physical hard disks;

[0153] The execution module 1104 is used to execute a sub-request corresponding to the first strip based on the first artificial intelligence acceleration card in the first logical group to which the first physical hard disk where the first strip is located belongs, wherein the first logical group includes the first physical hard disk and the first artificial intelligence acceleration card, and the first strip is any one of the multiple strips.

[0154] Optionally, when the first request is used to request to read the target file, the execution module includes:

[0155] The first returning unit is configured to return the target data to the server operating system kernel based on the first artificial intelligence accelerator card when the target data corresponding to the first strip is stored in the video memory of the first artificial intelligence accelerator card.

[0156] Optionally, when the first request is used to request to read the target file, the execution module includes:

[0157] a first reading unit, configured to read the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card when the video memory of the first artificial intelligence accelerator card does not store the target data corresponding to the first strip;

[0158] The second returning unit is used to return the target data in the video memory to the server operating system kernel based on the first artificial intelligence acceleration card.

[0159] Optionally, the reading unit is specifically used for:

[0160] In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs;

[0161] Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

[0162] Optionally, when the first request is used to request writing the target file, the execution module includes:

[0163] A first writing unit, configured to write target data corresponding to the first strip into a video memory of the first artificial intelligence accelerator card;

[0164] The second writing unit is used to write the target data in the video memory into the first strip in the first physical hard disk based on the first artificial intelligence acceleration card.

[0165] Optionally, when the back-end RAID group is in RAID5 mode, the execution module further includes:

[0166] A second reading unit is used to read data in a third strip of at least one third physical hard disk into a video memory based on at least one third artificial intelligence acceleration card, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in a logical group to which the third physical hard disk belongs;

[0167] a computing unit, configured to perform an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in a logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is a physical hard disk where the verification strip is located;

[0168] The third writing unit is used to write the verification data into the verification strip of the fourth physical hard disk based on the fourth artificial intelligence acceleration card.

[0169] It should be noted that the hard disk read / write device provided in the embodiment of the present application is a device capable of executing the hard disk read / write method described above, and all implementation methods in the embodiment of the hard disk read / write method described above are applicable to the device and can achieve the same or similar beneficial effects. To avoid repeated description, this embodiment will not be described in detail.

[0170] For details, see Fig.12 As shown, an embodiment of the present application further provides an electronic device, including a bus 1201 , a transceiver 1202 , an antenna 1203 , a bus interface 1204 , a processor 1205 and a memory 1206 .

[0171] Further, the processor 1205 is configured to:

[0172] Based on a first request, obtaining a virtual hard disk storage address of a target file, wherein the first request is used to request to read or write the target file;

[0173] Mapping the virtual hard disk storage address to obtain a physical hard disk storage address;

[0174] According to a plurality of strips in the physical hard disk storage address, the first request is divided into a plurality of sub-requests, the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks;

[0175] Based on a first artificial intelligence accelerator card in a first logical group to which a first physical hard disk where a first strip is located belongs, a sub-request corresponding to the first strip is executed, where the first logical group includes the first physical hard disk and the first artificial intelligence accelerator card, and the first strip is any one of the multiple strips.

[0176] exist Fig.12 In the embodiment, the bus architecture (represented by bus 1201) may include any number of interconnected buses and bridges, and bus 1201 links various circuits including one or more processors represented by processor 1205 and memory represented by memory 1206. Bus 1201 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1204 provides an interface between bus 1201 and transceiver 1202. Transceiver 1202 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 1205 is transmitted on a wireless medium via antenna 1203, and further, antenna 1203 also receives data and transmits the data to processor 1205.

[0177] The processor 1205 is responsible for managing the bus 1201 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 1206 can be used to store data used by the processor 1205 when performing operations.

[0178] Optionally, the processor 1205 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a complex programmable logic device (CPLD).

[0179] Optionally, when the first request is used to request to read the target file, the processor 1205 is specifically configured to:

[0180] When target data corresponding to the first strip is stored in the video memory of the first artificial intelligence acceleration card, the target data is returned to the server operating system kernel based on the first artificial intelligence acceleration card.

[0181] Optionally, when the first request is used to request to read the target file, the processor 1205 is specifically configured to:

[0182] If the target data corresponding to the first strip is not stored in the video memory of the first artificial intelligence accelerator card, reading the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card;

[0183] Based on the first artificial intelligence acceleration card, the target data in the video memory is returned to the server operating system kernel.

[0184] Optionally, the processor 1205 is specifically configured to:

[0185] In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs;

[0186] Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

[0187] Optionally, when the first request is used to request writing the target file, the processor 1205 is specifically configured to:

[0188] Writing the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card;

[0189] Based on the first artificial intelligence acceleration card, the target data in the video memory is written into the first strip in the first physical hard disk.

[0190] Optionally, when the back-end RAID group is in RAID5 mode, the processor 1205 is further configured to:

[0191] Based on at least one third artificial intelligence acceleration card, data in a third strip of at least one third physical hard disk is read into the video memory, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the third physical hard disk belongs;

[0192] Performing an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is the physical hard disk where the verification strip is located;

[0193] Based on the fourth artificial intelligence acceleration card, the verification data is written into a verification strip of the fourth physical hard disk.

[0194] It should be noted that the electronic device provided in the embodiment of the present application is a device capable of executing the hard disk reading and writing method, and all implementation methods in the embodiment of the hard disk reading and writing method are applicable to the electronic device and can achieve the same or similar beneficial effects. To avoid repeated description, this embodiment will not be repeated.

[0195] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, the various processes of the above-mentioned hard disk reading and writing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0196] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned hard disk reading and writing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0197] The embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the various processes of the above-mentioned hard disk reading and writing embodiments and can achieve the same technical effect. To avoid repetition, they are not repeated here.

[0198] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0199] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0200] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A hard disk reading and writing method, characterized in that: include: Based on a first request, obtaining a virtual hard disk storage address of a target file, wherein the first request is used to request to read or write the target file; Mapping the virtual hard disk storage address to obtain a physical hard disk storage address; According to a plurality of strips in the physical hard disk storage address, the first request is divided into a plurality of sub-requests, the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks; Based on a first artificial intelligence accelerator card in a first logical group to which a first physical hard disk where a first strip is located belongs, a sub-request corresponding to the first strip is executed, where the first logical group includes the first physical hard disk and the first artificial intelligence accelerator card, and the first strip is any one of the multiple strips.

2. The method according to claim 1, characterized in that In a case where the first request is used to request to read the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including: When target data corresponding to the first strip is stored in the video memory of the first artificial intelligence acceleration card, the target data is returned to the server operating system kernel based on the first artificial intelligence acceleration card.

3. The method according to claim 1, characterized in that In a case where the first request is used to request to read the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including: If the target data corresponding to the first strip is not stored in the video memory of the first artificial intelligence accelerator card, reading the target data in the first physical hard disk into the video memory based on the first artificial intelligence accelerator card; Based on the first artificial intelligence acceleration card, the target data in the video memory is returned to the server operating system kernel.

4. The method according to claim 3, characterized in that The step of reading the target data in the first physical hard disk into the video memory based on the first artificial intelligence acceleration card includes: In the case where the first physical hard disk is damaged and the back-end disk array RAID group is in RAID5 mode, data in a second strip of at least one second physical hard disk is read into the video memory based on at least one second artificial intelligence acceleration card, where the second physical hard disk is a physical hard disk where a strip other than the first strip is located in the logical stripe where the target data is located, and the second artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the second physical hard disk belongs; Based on the first artificial intelligence acceleration card, an XOR operation is performed on the data in the second strip to obtain the target data.

5. The method according to claim 1, characterized in that In the case where the first request is used to request writing of the target file, the first artificial intelligence accelerator card in the first logical group to which the first physical hard disk where the first strip is located belongs executes the sub-request corresponding to the first strip, including: Writing the target data corresponding to the first strip into the video memory of the first artificial intelligence accelerator card; Based on the first artificial intelligence acceleration card, the target data in the video memory is written into the first strip in the first physical hard disk.

6. The method according to claim 5, characterized in that When the back-end RAID group is in RAID5 mode, the method further includes: Based on at least one third artificial intelligence acceleration card, data in a third strip of at least one third physical hard disk is read into the video memory, wherein the third physical hard disk is a physical hard disk where a strip other than the first strip and the check strip in the strip where the target data is located is located, and the third artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which the third physical hard disk belongs; Performing an XOR operation on the target data and the data in the third strip based on a fourth artificial intelligence acceleration card to obtain verification data, wherein the fourth artificial intelligence acceleration card is an artificial intelligence acceleration card in the logical group to which a fourth physical hard disk belongs, and the fourth physical hard disk is the physical hard disk where the verification strip is located; Based on the fourth artificial intelligence acceleration card, the verification data is written into a verification strip of the fourth physical hard disk.

7. A hard disk read-write device, characterized in that: include: An acquisition module, configured to acquire a virtual hard disk storage address of a target file based on a first request, wherein the first request is used to request to read or write the target file; A processing module, used for mapping the virtual hard disk storage address to obtain a physical hard disk storage address; a division module, configured to divide the first request into a plurality of sub-requests according to a plurality of strips in the storage address of the physical hard disk, wherein the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks; An execution module is used to execute a sub-request corresponding to a first strip based on a first artificial intelligence acceleration card in a first logical group to which a first physical hard disk where the first strip is located belongs, wherein the first logical group includes the first physical hard disk and the first artificial intelligence acceleration card, and the first strip is any one of the multiple strips.

8. An electronic device, characterized in that: comprising a processor configured to: Based on a first request, obtaining a virtual hard disk storage address of a target file, wherein the first request is used to request to read or write the target file; Mapping the virtual hard disk storage address to obtain a physical hard disk storage address; According to a plurality of strips in the physical hard disk storage address, the first request is divided into a plurality of sub-requests, the sub-requests are used to request to read or write corresponding target data in the target file, and the plurality of strips are located in different physical hard disks; Based on a first artificial intelligence accelerator card in a first logical group to which a first physical hard disk where a first strip is located belongs, a sub-request corresponding to the first strip is executed, where the first logical group includes the first physical hard disk and the first artificial intelligence accelerator card, and the first strip is any one of the multiple strips.

9. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the hard disk reading and writing method as claimed in any one of claims 1 to 6.

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 steps of the hard disk reading and writing method according to any one of claims 1 to 6 are implemented.

11. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the steps of the hard disk reading and writing method as described in any one of claims 1 to 6.