Disclosure of Invention
The invention provides a self-adaptive storage system and a self-adaptive storage method, and aims to solve the problem that three types of hard disks, namely SAS, SATA, NVME hard disks, cannot be compatible at the same time in the traditional technical scheme, and the compatibility is poor.
In a first aspect, there is provided an adaptive storage system comprising:
The device comprises a CPU module, a self-adaptive storage management control module, an FPGA module, a hard disk port switching module, a program burner, a program storage unit and an adaptive storage protocol program compiling module;
The hard disk port switching module is used for converting a hard disk protocol inserted into a hard disk into a universal protocol;
The self-adaptive storage management control module is used for acquiring first hard disk information of the hard disk through the hard disk port switching module, judging whether the current hard disk protocol of the FPGA module and the current hard disk drive of the CPU module are adaptive to the hard disk, and when the current hard disk protocol of the FPGA module is not adaptive to the hard disk and/or the current hard disk drive of the CPU module is not adaptive to the hard disk, determining a new hard disk protocol of the adaptive hard disk and/or an adaptive program corresponding to the new hard disk drive according to the first hard disk information and sending an adaptive program compiling instruction of the adaptive program to the adaptive storage protocol program compiling module;
The adaptation storage protocol program compiling module is used for compiling a program according to the adaptation program compiling instruction to obtain an adaptation program and storing the adaptation program into the program storage unit;
the self-adaptive storage management control module is also used for sending an adaptive program burning instruction to the program burner after the IIC bus is used for identifying that the adaptive program is successfully stored;
The program burner is used for scanning the program storage unit according to the adaptive program burning instruction, respectively updating and burning the scanned adaptive program to the FPGA module and/or the CPU module, so that a new hard disk protocol of the FPGA module and/or a new hard disk drive of the CPU module are adapted to the hard disk.
Further, the self-adaptive storage system further comprises:
the PCIE SWITCH unit module establishes a PCIE expansion link with the FPGA module;
The self-adaptive storage management control module is also used for calculating data transmission bandwidth requirements according to the first hard disk information and sending PCIE resource dynamic allocation instructions to the PCIE SWITCH unit module according to the data transmission bandwidth requirements;
And PCIE SWITCH unit module, configured to allocate link resources of the PCIE expansion link according to the PCIE resource dynamic allocation instruction.
Further, the self-adaptive storage management control module includes:
the hard disk protocol judging unit is connected with the FPGA module through a protocol checking bus;
The hard disk protocol judging unit is used for acquiring the current hard disk protocol of the I/O port of the FPGA module through the protocol checking bus and judging whether the current hard disk protocol is suitable for the hard disk.
Further, the self-adaptive storage management control module further includes:
The hard disk protocol burning control unit is used for determining an adaptation program of a new hard disk protocol of the adaptation hard disk according to the first hard disk information when the current hard disk protocol is not adapted to the hard disk, and sending an adaptation program compiling instruction of the adaptation program of the new hard disk protocol to the adaptation storage protocol compiling module;
The adaptation storage protocol program compiling module is specifically used for compiling a program according to an adaptation program compiling instruction to obtain an adaptation program of a new hard disk protocol, and storing the adaptation program into the program storage unit;
the hard disk protocol burning control unit is also used for sending an adaptation program burning instruction to the program burner after the successful storage of the adaptation program of the new hard disk protocol is identified through the IIC bus;
and the program writer is used for scanning the program storage unit according to the adaptive program writing instruction and writing the adaptive program update of the new hard disk protocol obtained by scanning to the FPGA module.
Further, the CPU module includes:
the system comprises a CPU module, a data processor, a BIOS system module and a BIOS hard disk drive module;
the BIOS system module is used for storing all drivers of the normal operation of the CPU module;
the BIOS hard disk drive module is used for storing the current hard disk drive;
the data processor is used for storing all the drivers of the BIOS system module, refreshing and calling the hard disk driver of the BIOS hard disk driver module in real time, and fusing the drivers of the BIOS system module and the BIOS hard disk driver module;
And the CPU module is used for obtaining the current hard disk drive through the data processor when the hard disk protocol is adapted to the hard disk, identifying and scanning the hard disk by utilizing the current hard disk drive to obtain second hard disk information, and sending the second hard disk information to the self-adaptive storage management control module.
Further, the self-adaptive storage management control module further includes:
The hard disk drive judging unit is used for acquiring second hard disk information fed back by the CPU module, judging whether the second hard disk information is consistent with the first hard disk information, if so, determining that the current hard disk drive is suitable for the hard disk, and if not, determining that the current hard disk drive is not suitable for the hard disk.
Further, the self-adaptive storage management control module further includes:
The hard disk drive burning control unit is used for determining an adaptation program of a new hard disk drive of the adaptation hard disk according to the first hard disk information when the current hard disk drive is not adapted to the hard disk, and sending an adaptation program compiling instruction of the adaptation program of the new hard disk drive to the adaptation storage protocol program compiling module;
The adaptive storage protocol program compiling module is specifically used for compiling a program according to an adaptive program compiling instruction to obtain an adaptive program of a new hard disk drive, and storing the adaptive program into the program storage unit;
the hard disk drive burning control unit is also used for sending an adaptation program burning instruction to the program burner after the successful storage of the adaptation program of the new hard disk drive is identified through the IIC bus;
The program writer is used for scanning the program storage unit according to the adaptive program writing instruction and writing the adaptive program update of the new hard disk drive obtained by scanning to the BIOS hard disk drive module;
the data processor is also used for calling a new hard disk drive of the BIOS hard disk drive module and fusing the drive of the BIOS system module and the new hard disk drive;
and the CPU module is used for obtaining a new hard disk drive through the data processor.
Further, the self-adaptive storage management control module further includes:
And the dormancy control unit is used for controlling and keeping the PCIE SWITCH unit module, the FPGA module and the hard disk port switching module in a working state when the current hard disk drive is matched with the hard disk, and controlling the program burner, the program storage unit and the adaptive storage protocol program compiling module in a dormancy state.
Further, the types of hard disks include one or more of SAS hard disks, SATA hard disks, or NVME hard disks.
In a second aspect, there is provided an adaptive storage method applied to the adaptive storage system of the first aspect, the adaptive storage method including:
the self-adaptive storage management control module acquires first hard disk information of a hard disk through the hard disk port switching module and judges whether the current hard disk protocol of the FPGA module and the current hard disk drive of the CPU module are adaptive to the hard disk or not;
When the current hard disk protocol of the FPGA module is not matched with the hard disk and/or the current hard disk drive of the CPU module is not matched with the hard disk, determining a new hard disk protocol of the matched hard disk and/or an matched program corresponding to the new hard disk drive according to the first hard disk information, and sending an matched program compiling instruction of the matched program to the matched storage protocol program compiling module;
The adaptation storage protocol program compiling module is used for compiling a program according to the adaptation program compiling instruction to obtain an adaptation program, and storing the adaptation program into the program storage unit;
The self-adaptive storage management control module recognizes that the adaptive program is successfully stored through the IIC bus, and then sends an adaptive program burning instruction to the program burner;
the program burner scans the program storage unit according to the burning instruction of the adapting program, updates and burns the scanned adapting program to the FPGA module and/or the CPU module respectively, so that the new hard disk protocol of the FPGA module and/or the new hard disk drive of the CPU module adapt to the hard disk.
The invention has the beneficial effects that:
The self-adaptive storage system comprises a CPU module, a self-adaptive storage management control module, an FPGA module, a hard disk port switching module, a program burner, a program storage unit and an adaptive storage protocol program compiling module, wherein the hard disk port switching module is used for converting a hard disk protocol inserted into a universal protocol, the self-adaptive storage management control module is used for acquiring first hard disk information of a hard disk through the hard disk port switching module and judging whether the current hard disk protocol of the FPGA module and the current hard disk drive of the CPU module are matched with the hard disk, the self-adaptive storage management control module is also used for determining a new hard disk protocol of the adaptive hard disk and/or an adaptive program corresponding to the new hard disk drive according to the first hard disk information when the current hard disk protocol of the FPGA module is not matched with the hard disk, the adaptive storage protocol compiling module is used for compiling the adaptive program according to the adaptive storage protocol, and storing the adaptive program to the program storage unit, and the self-adaptive storage management control module is also used for reading and writing the adaptive program compiling instruction into the adaptive hard disk drive by the adaptive storage protocol module when the current hard disk protocol of the FPGA module is not matched with the hard disk, and/is/are scanned by the CPU module to obtain the adaptive program compiling instruction. The self-adaptive storage management control module can acquire first hard disk information of the inserted hard disk through the hard disk port switching module, and compile adaptive programs of different types of hard disks with the aid of the adaptive storage protocol program compiling module, so that the problem that the traditional technical scheme cannot be compatible with multiple types of hard disks is solved;
the self-adaptive storage management control module can calculate the data transmission bandwidth requirement according to the hard disk information, dynamically allocate PCIE resources according to the requirement, save usable resources of the system and improve the data processing efficiency;
The problem of data loss caused by restarting and refreshing hard disk information by closing the system every time a new hard disk is inserted in the prior art is solved, the inserted new hard disk information can be dynamically updated without restarting the system, and the user experience is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, based on the examples herein, which are within the scope of the invention as defined by the claims, will be within the scope of the invention as defined by the claims.
As shown in fig. 1, the present embodiment provides an adaptive storage system, including:
The device comprises a CPU module 101, a self-adaptive storage management control module 102, an FPGA module 103, a hard disk port switching module 104, a program burner 105, a program storage unit 106 and an adaptive storage protocol program compiling module 107;
the hard disk port switching module 104 is configured to convert a hard disk protocol inserted into a hard disk into a universal protocol;
The self-adaptive storage management control module 102 is used for acquiring first hard disk information of a hard disk through the hard disk port switching module 104, judging whether the current hard disk protocol of the FPGA module 103 and the current hard disk drive of the CPU module 101 are adaptive to the hard disk, and/or determining a new hard disk protocol of the adaptive hard disk and/or an adaptive program corresponding to the new hard disk drive according to the first hard disk information when the current hard disk protocol of the FPGA module 103 is not adaptive to the hard disk and/or the current hard disk drive of the CPU module 101 is not adaptive to the hard disk, and sending an adaptive program compiling instruction of the adaptive program to the adaptive storage protocol program compiling module 107, wherein the hard disk port switching module 104 is connected with a hard disk port, and can be connected with a single hard disk or an heterogeneous hard disk storage matrix, and the types of the hard disk comprise one or more of SAS hard disks, SATA hard disks or NVME hard disks;
An adaptation storage protocol program compiling module 107, configured to compile a program according to an adaptation program compiling instruction to obtain an adaptation program, and store the adaptation program in the program storage unit 106;
The self-adaptive memory management control module 102 is further configured to identify that the adaptive program is successfully saved through an IIC (Inter-INTEGRATED CIRCUIT, integrated circuit) bus, and send an adaptive program writing instruction to the program writer 105;
The program burner 105 is configured to scan the program storage unit 106 according to the adapting program burning instruction, update and burn the scanned adapting program to the FPGA module 103 and/or the CPU module 101, respectively, so that a new hard disk protocol of the FPGA module 103 and/or a new hard disk drive of the CPU module 101 adapt to the hard disk.
The embodiment of the invention has the beneficial effects that:
The self-adaptive storage management control module 102 can collect the first hard disk information of the inserted hard disk through the hard disk port switching module 104, and compile the adaptive programs of different types of hard disks with the aid of the adaptive storage protocol program compiling module 107, so that the problem that the traditional technical scheme cannot be compatible with a plurality of types of hard disks is solved.
In connection with the embodiment shown in fig. 1 above, as shown in fig. 2, the adaptive storage system further includes:
PCIE SWITCH unit module 201 establishes PCIE expansion link with FPGA module 103;
The self-adaptive storage management control module 102 is further configured to calculate a data transmission bandwidth requirement according to the first hard disk information, and send a PCIE resource dynamic allocation instruction to the PCIE SWITCH unit module 201 according to the data transmission bandwidth requirement;
and PCIE SWITCH unit module 201, configured to allocate link resources of the PCIE expansion link according to the PCIE resource dynamic allocation instruction.
In this embodiment, the PCIE SWITCH unit module 201 can improve the PCIE link resource utilization rate, and effectively improve the data bandwidth rate.
In combination with the embodiment shown in fig. 1, the burning process of the self-adaptive storage management control module 102 specifically performs the new hard disk protocol is:
The adaptive storage management control module 102 includes:
the hard disk protocol judging unit is connected with the FPGA module 103 through a protocol checking bus;
The hard disk protocol judging unit is used for obtaining the current hard disk protocol of the I/O port of the FPGA module 103 through the protocol checking bus and judging whether the current hard disk protocol is suitable for the hard disk.
The adaptive storage management control module 102 further includes:
a hard disk protocol burning control unit, configured to determine, according to the first hard disk information, an adaptation program of a new hard disk protocol adapted to the hard disk when the current hard disk protocol is not adapted to the hard disk, and send an adaptation program compiling instruction of the adaptation program corresponding to the new hard disk protocol to the adaptation storage protocol compiling module 107;
The adaptation storage protocol program compiling module 107 is specifically configured to compile a program according to an adaptation program compiling instruction to obtain an adaptation program of the new hard disk protocol, and store the adaptation program in the program storage unit 106;
the hard disk protocol burning control unit is further configured to send an adaptation program burning instruction to the program burner 105 after the success of the storage of the adaptation program of the new hard disk protocol is identified through the IIC bus;
the program writer 105 is configured to scan the program storage unit 106 according to the adapting program writing instruction, and update and write the adapting program of the new hard disk protocol obtained by scanning to the FPGA module 103.
In combination with the embodiments shown in fig. 1 and 2 above, as shown in fig. 3, in some embodiments of the present invention, the CPU module 101 includes:
a CPU module 301, a data processor 302, a BIOS system module 303, and a BIOS hard drive module 304;
The BIOS system module 303, configured to store all drivers that the CPU module 301 normally operates;
The BIOS hard drive module 304 is configured to store a current hard drive;
The data processor 302 is configured to store all the drives of the BIOS system module 303, refresh and call the hard disk drive of the BIOS hard disk drive module 304 in real time, and fuse the drives of the BIOS system module 303 and the BIOS hard disk drive module 304;
The CPU module 301 is configured to obtain, when the hard disk protocol is adapted to the hard disk, a current hard disk drive through the data processor, identify and scan the hard disk by using the current hard disk drive, obtain second hard disk information, and send the second hard disk information to the self-adaptive storage management control module 102.
In connection with the embodiment illustrated in FIG. 3 above, in some embodiments of the invention, the adaptive storage management control module 102 further comprises:
The hard disk drive judging unit is configured to obtain the second hard disk information fed back by the CPU module 301, judge whether the second hard disk information is consistent with the first hard disk information, determine that the current hard disk drive is suitable for the hard disk if the second hard disk information is consistent with the first hard disk information, and determine that the current hard disk drive is not suitable for the hard disk if the second hard disk information is not consistent with the first hard disk information.
The adaptive storage management control module 102 further includes:
A hard disk drive burning control unit, configured to determine, according to the first hard disk information, an adaptation program of a new hard disk drive adapted to the hard disk when the current hard disk drive is not adapted to the hard disk, and send an adaptation program compiling instruction corresponding to the adaptation program of the new hard disk drive to the adaptation storage protocol program compiling module 107;
An adaptation storage protocol program compiling module 107, specifically configured to compile a program according to an adaptation program compiling instruction to obtain an adaptation program of a new hard disk drive, and store the adaptation program in the program storage unit 106;
The hard disk drive burning control unit is further configured to send an adapter program burning instruction to the program burner 105 after the success of the storage of the adapter program of the new hard disk drive is identified through the IIC bus;
The program writer 105 is configured to scan the program storage unit 106 according to the adaptive program writing instruction, and update and write the adaptive program of the new hard disk drive obtained by scanning to the BIOS hard disk drive module 304;
The data processor 302 is further configured to call a new hard disk drive of the BIOS hard disk drive module 304, and fuse the drive of the BIOS system module 303 with the new hard disk drive;
The CPU module 301 is configured to obtain a new hard disk drive through the data processor 302.
In connection with the embodiments shown in fig. 2 and 3 above, in some embodiments of the invention, the adaptive storage management control module 102 further includes:
And the dormancy control unit is used for controlling and keeping PCIE SWITCH the unit module 201, the FPGA module 103 and the hard disk port switching module 104 in a working state when the current hard disk drive is matched with the hard disk, and controlling the program burner 105, the program storage unit 106 and the adaptive storage protocol program compiling module 107 in a dormancy state.
The self-adaptive storage system has the following beneficial effects by combining the embodiments described above:
the self-adaptive storage management control module can acquire first hard disk information of the inserted hard disk through the hard disk port switching module, and compile adaptive programs of different types of hard disks with the aid of the adaptive storage protocol program compiling module, so that the problem that the traditional technical scheme cannot be compatible with multiple types of hard disks is solved;
the self-adaptive storage management control module can calculate the data transmission bandwidth requirement according to the hard disk information, dynamically allocate PCIE resources according to the requirement, save usable resources of the system and improve the data processing efficiency;
The problem of data loss caused by restarting and refreshing hard disk information by closing the system every time a new hard disk is inserted in the prior art is solved, the inserted new hard disk information can be dynamically updated without restarting the system, and the user experience is improved.
In the embodiments shown in fig. 1 to 3 above, the self-adaptive storage system is described, and the self-adaptive storage method applied to the self-adaptive storage system is described below by way of embodiments.
As shown in fig. 4, the present embodiment provides an adaptive storage method, which includes:
401, the self-adaptive storage management control module collects first hard disk information of a hard disk through the hard disk port switching module and judges whether a current hard disk protocol of the FPGA module and a current hard disk drive of the CPU module are adaptive to the hard disk or not;
402, when the current hard disk protocol of the FPGA module is not matched with the hard disk and/or the current hard disk drive of the CPU module is not matched with the hard disk, determining a new hard disk protocol of the matched hard disk and/or an matched program corresponding to the new hard disk drive according to the first hard disk information, and sending an matched program compiling instruction of the matched program to an matched storage protocol program compiling module;
403, the adaptation storage protocol program compiling module compiles the program according to the adaptation program compiling instruction to obtain an adaptation program, and stores the adaptation program into the program storage unit;
404, after the self-adaptive storage management control module identifies that the adaptive program is successfully stored through the IIC bus, an adaptive program recording instruction is sent to the program recorder;
And 405, the program burner scans a program storage unit according to the adaptive program burning instruction, respectively updates and burns the scanned adaptive program to the FPGA module and/or the CPU module, so that a new hard disk protocol of the FPGA module and/or a new hard disk drive of the CPU module are adapted to the hard disk.
In the embodiment shown in fig. 4, in step 402, it is determined whether the current hard disk protocol of the FPGA module and the current hard disk drive of the CPU module are adapted to the hard disk, and in fact, the following specific implementation process schematic diagrams of the adaptive storage method in the embodiment shown in fig. 5 are obtained after refinement:
501, the self-adaptive storage management control module collects first hard disk information of a hard disk through the hard disk port switching module;
502, the self-adaptive storage management control module acquires the current hard disk protocol of the I/O port of the FPGA module through a protocol checking bus, judges whether the current hard disk protocol is adaptive to a hard disk, if not, executes step 503, and if so, executes step 505;
503, the self-adapting storage management control module determines an adapting program of a new hard disk protocol of an adapting hard disk according to the first hard disk information, and sends an adapting program compiling instruction of the adapting program of the new hard disk protocol to the adapting storage protocol program compiling module;
504, the program writer scans a program storage unit according to the adaptive program writing instruction, and updates and writes the adaptive program of the new hard disk protocol obtained by scanning to the FPGA module;
after the FPGA module burns the new hard disk protocol, returning to step 502 again to perform the adaptation judgment of the hard disk protocol until the hard disk protocol of the FPGA module adapts to the hard disk;
Step 505, obtaining the second hard disk information fed back by the CPU module, judging whether the second hard disk information is consistent with the first hard disk information, if so, determining that the current hard disk drive is suitable for the hard disk, executing step 508, and if not, determining that the current hard disk drive is not suitable for the hard disk, executing step 506;
506, the self-adaptive storage management control module determines an adaptive program of a new hard disk drive of an adaptive hard disk according to the first hard disk information, and sends an adaptive program compiling instruction of the adaptive program corresponding to the new hard disk drive to the adaptive storage protocol program compiling module; the hard disk drive burning control unit is also used for sending an adaptation program burning instruction to the program burner after the adaptation program of the new hard disk drive is identified to be successfully stored through the IIC bus;
507, the program writer scans the program storage unit according to the adaptive program writing instruction, and updates and writes the adaptive program of the new hard disk drive obtained by scanning to the BIOS hard disk drive module;
The data processor calls a new hard disk drive of the BIOS hard disk drive module to fuse the drive of the BIOS system module and the new hard disk drive, the CPU module obtains the new hard disk drive through the data processor, and after the new hard disk drive is burnt, the step 505 is returned again to carry out the adaptation judgment of the hard disk drive until the hard disk is adapted;
508, the self-adaptive storage management control module controls and maintains PCIE SWITCH unit modules, the FPGA module and the hard disk port switching module to be in a working state, and controls the program burner, the program storage unit and the adaptive storage protocol program compiling module to be in a dormant state.
It should be appreciated that in embodiments of the present invention, the Processor may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose Processor, digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATEARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory may include read only memory and random access memory and provide instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store information of the device type.
The readable storage medium is a computer readable storage medium, which may be an internal storage unit of the controller according to any one of the foregoing embodiments, for example, a hard disk or a memory of the controller. The readable storage medium may also be an external storage device of the controller, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like, which are provided on the controller. Further, the readable storage medium may also include both an internal storage unit and an external storage device of the controller. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium may also be used to temporarily store data that has been output or is to be output.
Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The readable storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a random access Memory (RAM, randomAccess Memory), a magnetic disk, or an optical disk.
It is to be understood that the same or similar parts in the above embodiments may be referred to each other, and that in some embodiments, the same or similar parts in other embodiments may be referred to.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.