RAID chip and system

By calculating the starting offset address of the disk channel and generating operation commands through the hardware structure of the RAID chip, the problem of limited host CPU computing efficiency is solved, and the write operation efficiency is improved.

CN119025046APending Publication Date: 2024-11-26SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411251757.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The host CPU's efficiency in calculating memory addresses during RAID write operations is limited, which affects disk write efficiency.

Method used

A RAID chip is provided, comprising an address calculation module, an accumulation module, a detection module, and a command generation module. It calculates the starting offset address of the disk channel and generates operation commands through hardware structure, reducing dependence on the host CPU.

Benefits of technology

It improves the efficiency of memory address calculation and disk write instruction generation, reduces the computational burden on the host CPU, and enhances write operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025046A_ABST
    Figure CN119025046A_ABST
Patent Text Reader

Abstract

The invention discloses an RAID (Redundant Array of Independent Disks) chip and system in the technical field of computers. According to the RAID chip provided by the invention, the initial offset address of the disk channel can be calculated based on a hardware structure, and the operation command (namely the disk writing instruction) of the disk channel is generated according to the initial offset address without depending on the computing power of a host CPU, so that the influence of the host CPU on memory address calculation can be reduced, the memory address calculation efficiency and the disk writing instruction generation efficiency can be improved, and the user experience is improved. Therefore, the write operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a RAID chip and system. Background Art

[0002] During a RAID (Redundant Arrays of Independent Disks) write operation, the host CPU is usually used to calculate the storage address of the data to be written in the memory, and then the disk write command containing this address is determined based on this. However, due to the heavy workload of the host CPU, the efficiency of calculating the memory address is limited by the actual performance and real-time operation of the host CPU, which may affect the efficiency of writing to the disk in extreme cases.

[0003] Therefore, how to reduce the influence of the host CPU on memory address calculation is a problem that technical personnel in this field need to solve. Summary of the invention

[0004] In view of this, the purpose of this application is to provide a RAID chip and system to reduce the influence of the host CPU on the memory address calculation. The specific solution is as follows:

[0005] In a first aspect, the present application provides a RAID chip, including:

[0006] An address calculation module is used to calculate the starting offset addresses of M disk channels; M is the number of disks included in the RAID;

[0007] M accumulation modules connected to the address calculation module are used to calculate the starting offset address of disk channel X+M according to the starting offset address of disk channel X; X is an integer;

[0008] M detection modules connected one-to-one with the M accumulation modules, used to detect the calculation results of the accumulation modules connected to them, and correct the starting offset address of the disk channel X+M according to the detection results;

[0009] The command generation module is used to generate the operation command of each disk channel according to the starting offset address of the disk channel.

[0010] Optionally, if M is equal to 7, the address calculation module includes:

[0011] A disk channel 0 starting offset address calculation unit, used to determine that the starting offset address of the disk channel 0 is 0;

[0012] The disk channel 1 starting offset address calculation unit is used to determine the starting offset address of the disk channel 1 as the size of the number of disk data blocks;

[0013] The disk channel 2 starting offset address calculation unit is used to concatenate 0 and the binary representation of the number of disk data blocks to obtain the starting offset address of the disk channel 2;

[0014] A disk channel 3 starting offset address calculation unit, used for adding the starting offset address of disk channel 2 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 3;

[0015] A disk channel 4 start offset address calculation unit is used to concatenate 00 and the binary representation of the number of disk data blocks to obtain the start offset address of disk channel 4;

[0016] A disk channel 5 starting offset address calculation unit, used for adding the starting offset address of disk channel 4 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 5;

[0017] The disk channel 6 starting offset address calculation unit is used to concatenate the starting offset addresses of 0 and disk channel 3 to obtain the starting offset address of disk channel 6;

[0018] The disk channel 7 starting offset address calculation unit is used to add the starting offset address of the disk channel 4 and the starting offset address of the disk channel 3 to obtain the starting offset address of the disk channel 7.

[0019] Optionally, the disk channel 2 start offset address calculation unit includes: a first splicing logic device; the first splicing logic device sequentially splices 0 and the binary representation of the number of disk data blocks to obtain the start offset address of the disk channel 2;

[0020] Accordingly, the disk channel 4 start offset address calculation unit includes: a second splicing logic device; the second splicing logic device sequentially splices 00 and the binary representation of the number of disk data blocks to obtain the start offset address of the disk channel 4;

[0021] Correspondingly, the disk channel 6 starting offset address calculation unit includes: a third splicing logic device; the third splicing logic device sequentially splices 0 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 6.

[0022] Optionally, the disk channel 3 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of the disk channel 2 and the starting offset address of the disk channel 1 to obtain the starting offset address of the disk channel 3;

[0023] Accordingly, the disk channel 5 starting offset address calculation unit includes: a second adder; the second adder adds the starting offset address of the disk channel 4 and the starting offset address of the disk channel 1 to obtain the starting offset address of the disk channel 5;

[0024] Correspondingly, the disk channel 7 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of the disk channel 4 and the starting offset address of the disk channel 3 to obtain the starting offset address of the disk channel 7.

[0025] Optionally, the arbitrary accumulation module includes:

[0026] A first selector is used to select between the opposite number of the start offset address of the disk channel X and the target value, and output a first selection result; the target value is: the product of the number of disk data blocks and the number of command generation modules;

[0027] A second selector, used to select between the starting offset address of the disk channel X and the output result of the register, and output a second selection result;

[0028] an adder, configured to add the first selection result and the second selection result, and transmit the addition result to the register;

[0029] The register is used to store and output the addition result.

[0030] Optionally, any detection module is used to: if the calculation result of the accumulation module to which it is connected is used for command generation and is a negative number, then determine the sum of the calculation result and the number of disk data blocks; if the sum is greater than zero, correct the starting offset address of the disk channel X+M to zero, and mark the starting offset address of the disk channel X+M as valid; if the sum is not greater than zero, mark the starting offset address of the disk channel X+M as invalid.

[0031] Optionally, any detection module is used to:

[0032] If the calculation result of the accumulator module connected to it is used for command generation and is a non-negative number, the starting offset address of the disk channel X+M is corrected to the calculation result of the current accumulator module, and the starting offset address of the disk channel X+M is marked as valid.

[0033] Optionally, any detection module is used to:

[0034] If the calculation result of the accumulation module connected to it is not used for command generation, the calculation result of the current accumulation module is discarded.

[0035] Optionally, it also includes:

[0036] A host interaction module connected to the address calculation module, used to receive a disk operation request sent by the host, and send a corresponding address calculation instruction to the address calculation module according to the disk operation request;

[0037] Correspondingly, the address calculation module calculates the starting offset addresses of the M disk channels according to the address calculation instruction.

[0038] In a second aspect, the present application provides a RAID system, including: a host and any of the RAID chips described above.

[0039] It can be seen from the above scheme that the present application provides a RAID chip, including: an address calculation module, used to calculate the starting offset addresses of M disk channels; M is the number of disks included in the RAID; M accumulation modules connected to the address calculation module, used to calculate the starting offset address of disk channel X+M according to the starting offset address of disk channel X; X is an integer; M detection modules connected one-to-one to the M accumulation modules, used to detect the calculation results of the accumulation modules connected to themselves, and correct the starting offset address of disk channel X+M according to the detection results; a command generation module, used to generate an operation command for each disk channel according to the starting offset address of the disk channel.

[0040] It can be seen that the RAID chip provided in the present application can calculate the starting offset address of the disk channel based on the hardware structure, and generate the operation command of the disk channel (i.e., write disk instruction) accordingly, without relying on the host CPU computing power. Therefore, it can reduce the influence of the host CPU on the memory address calculation, and can also improve the memory address calculation efficiency and the write disk instruction generation efficiency, thereby improving the write operation efficiency.

[0041] Correspondingly, a RAID system provided by the present application also has the above technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 A schematic diagram of a RAID chip disclosed in this application;

[0044] Figure 2 A schematic diagram of an address calculation module disclosed in this application;

[0045] Figure 3 This is a schematic diagram of an accumulation module disclosed in this application;

[0046] Figure 4 A schematic diagram of another RAID chip disclosed in this application;

[0047] Figure 5 A process schematic diagram of a command generation method disclosed in this application;

[0048] Figure 6 This is a schematic diagram of information involved in a command generation method disclosed in this application;

[0049] Figure 7 This is a schematic diagram of an Adjust detection module disclosed in this application;

[0050] Figure 8 A server structure diagram provided for this application;

[0051] Fig. 9 A terminal structure diagram provided for this application. DETAILED DESCRIPTION

[0052] 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 only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other examples obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] At present, during the RAID write operation, the host CPU is generally used to calculate the storage address of the data to be written in the memory, and the disk write command containing this address is determined accordingly. However, due to the heavy workload of the host CPU, the efficiency of memory address calculation is limited by the actual performance and real-time operation of the host CPU, which may affect the efficiency of disk writing in extreme cases. To this end, the present application provides a RAID chip that can reduce the impact of the host CPU on memory address calculation, improve the efficiency of memory address calculation and disk write instruction generation, and thus improve the efficiency of write operations.

[0054] See also Figure 1 As shown, the embodiment of the present application discloses a RAID chip, including:

[0055] The address calculation module is used to calculate the starting offset addresses of M disk channels; M is the number of disks included in the RAID.

[0056] The M accumulation modules connected to the address calculation module are used to calculate the starting offset address of the disk channel X+M according to the starting offset address of the disk channel X; X is an integer.

[0057] The M detection modules connected one-to-one with the M accumulation modules are used to detect the calculation results of the accumulation modules connected to them, and correct the starting offset address of the disk channel X+M according to the detection results.

[0058] The command generation module is used to generate the operation command of each disk channel according to the starting offset address of the disk channel.

[0059] In one example, any detection module is used to: if the calculation result of the accumulation module connected to it is used for command generation and is non-negative, then correct the starting offset address of the disk channel X+M to the calculation result of the current accumulation module, and mark the starting offset address of the disk channel X+M as valid. If the calculation result of the accumulation module connected to it is not used for command generation, then discard the calculation result of the current accumulation module.

[0060] In one example, if M is equal to 7, the address calculation module includes: a disk channel 0 starting offset address calculation unit, used to determine that the starting offset address of disk channel 0 is 0; a disk channel 1 starting offset address calculation unit, used to determine that the starting offset address of disk channel 1 is the size of the number of disk data blocks; a disk channel 2 starting offset address calculation unit, used to concatenate 0 and the binary representation of the number of disk data blocks to obtain the starting offset address of disk channel 2; a disk channel 3 starting offset address calculation unit, used to add the starting offset address of disk channel 2 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 3; and a disk channel 4 starting offset address calculation unit, used to calculate the starting offset address of disk channel 1 and the starting offset address of disk channel 2. The starting offset address calculation unit is used to concatenate 00 and the binary representation of the number of disk data blocks to obtain the starting offset address of disk channel 4; the starting offset address calculation unit of disk channel 5 is used to add the starting offset address of disk channel 4 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 5; the starting offset address calculation unit of disk channel 6 is used to concatenate 0 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 6; the starting offset address calculation unit of disk channel 7 is used to add the starting offset address of disk channel 4 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 7. For details, please refer to Figure 2 .

[0061] In one example, the disk channel 2 starting offset address calculation unit includes: a first splicing logic device; the first splicing logic device sequentially splices 0 and the binary representation of the number of disk data blocks to obtain the starting offset address of disk channel 2; accordingly, the disk channel 4 starting offset address calculation unit includes: a second splicing logic device; the second splicing logic device sequentially splices 00 and the binary representation of the number of disk data blocks to obtain the starting offset address of disk channel 4; accordingly, the disk channel 6 starting offset address calculation unit includes: a third splicing logic device; the third splicing logic device sequentially splices 0 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 6.

[0062] In one example, the disk channel 3 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of disk channel 2 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 3; accordingly, the disk channel 5 starting offset address calculation unit includes: a second adder; the second adder adds the starting offset address of disk channel 4 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 5; accordingly, the disk channel 7 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of disk channel 4 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 7.

[0063] In one example, the arbitrary accumulation module includes: a first selector, used to select between the opposite number of the starting offset address of the disk channel X and the target value, and output the first selection result; the target value is: the product of the number of disk data blocks and the number of command generation modules; a second selector, used to select between the starting offset address of the disk channel X and the output result of the register, and output the second selection result; an adder, used to add the first selection result and the second selection result, and transmit the addition result to the register; the register is used to store and output the addition result. For details, please refer to Figure 3 .

[0064] In one example, any detection module is used to: if the calculation result of the accumulation module connected to it is used for command generation and is a negative number, then determine the sum of the calculation result and the number of disk data blocks, if the sum is greater than zero, then correct the starting offset address of the disk channel X+M to zero, and mark the starting offset address of the disk channel X+M as valid; if the sum is not greater than zero, then mark the starting offset address of the disk channel X+M as invalid. For details, please refer to Figure 7 .

[0065] In one example, it also includes: a host interaction module connected to the address calculation module, used to receive a disk operation request sent by the host, and send a corresponding address calculation instruction to the address calculation module according to the disk operation request; accordingly, the address calculation module calculates the starting offset addresses of M disk channels according to the address calculation instruction.

[0066] It can be seen that the RAID chip provided in this embodiment can calculate the starting offset address of the disk channel based on the hardware structure, and generate the operation command of the disk channel (i.e., write disk instruction) accordingly, without relying on the host CPU computing power. Therefore, it can reduce the influence of the host CPU on the memory address calculation, and can also improve the memory address calculation efficiency and the write disk instruction generation efficiency, thereby improving the write operation efficiency.

[0067] In one example, the address calculation module (Base Start Offset) is used to calculate the basic offset starting position. This module takes into account factors such as circuit implementation area and calculation speed, and adopts an 8-channel concurrent calculation mode. The logical structure is simple and easy to implement. Figure 2 As shown. Among them, "C" represents the splicing logic device, and the function it implements is to splice the specified value to the low bit of an operand. For example, if the input of one of the splicing logic devices is ChunkSize (number of disk data blocks) and 0, the output is ChunkSize&0, which multiplies ChunkSize by 2. "+" represents an unsigned adder. The dotted value box represents the channel number. Figure 2 The module shown implements the basic offset starting position calculation for channels 0 to 7.

[0068] Figure 2 The address calculation module shown in the figure realizes the calculation of the starting positions of 8 channels. When the system contains more disk channels, the Cnt accumulation module is required to realize multiple rounds of accumulation calculation. Its logic is as follows: Figure 3 As shown. Figure 3 In the figure, "-Offset" is the opposite of the binary number of the Offset information, which is usually a negative number. For example, when Offset is 5, the 8-bit binary expression is 8'b00000101, then -Offset is -5, that is, 8'b11111011. N×ChunkSize, N is the number of "command generation modules", when N=4, ChunkSize=16, the value is 64. FirstCnt is: the mark signal for the start channel to start calculation, which can be understood as the beginning of this calculation. When the signal is 1, the binary logic outputs -Offset, and when it is 0, it outputs N×ChunkSize. "+" represents a signed adder, and the two inputs are the output of the binary logic and the output of a channel in the address calculation module. It can be seen that the accumulation module includes: two selectors, an adder and a register.

[0069] If Offset=70, ChunkSize=16, command generation module N=8, and the number of disk channels is 32, then all 8 calculation channels of BaseStart Offset are running, and Cnt0~Cnt7 are all calculated, and 4 rounds of calculation are performed, then the calculation results are shown in Table 1.

[0070] Table 1

[0071]

[0072] If Offset=5, ChunkSize=32, command generation module N=4, and the number of disk channels is 32, then the four calculation channels of BaseStart Offset are running, that is, calculation channels 0~3, then Cnt0~Cnt3 execute calculations, and 8 rounds of calculations are performed. The calculation results are shown in Table 2.

[0073] Table 2

[0074]

[0075] If Offset=19, ChunkSize=64, command generation module N=2, and the number of disk channels is 8. At this time, the two calculation channels of BaseStart Offset are running, that is, calculation channels 0~1, then Cnt0~Cnt1 perform calculations, and 4 rounds of calculations are performed, and the calculation results are shown in Table 3.

[0076] Table 3

[0077]

[0078] If Offset=7, ChunkSize=8, command generation module N=1, and the number of disk channels is 8. At this time, Base StartOffset has only one calculation channel running, that is, calculation channel 0, then Cnt0 performs calculations and performs 8 rounds of calculations. The calculation results are shown in Table 4.

[0079] Table 4

[0080]

[0081] It should also be noted that the output of the Cnt accumulation module may need to be adjusted, so an Adjust (detection module) is connected after each Cnt accumulation module to adjust the Cnt output result. As shown in Tables 1 to 4, the first round of calculation results include negative numbers. The main function of the Adjust module is to add ChunkSize (the value in this example is 16) when the Cnt calculation result Cnt Data is valid (valid for subsequent command generation, otherwise invalid) and is a negative number. When the sum after addition is greater than 0, the output correction result Adjust Data is 0, and Valid is valid; otherwise Valid is invalid. When the Cnt calculation result CntData is valid and non-negative, it is directly output effectively without adjustment. For details, please refer to Figure 7 .exist Figure 7 In the Adjust detection module, the input data includes: ChunkSize, Cnt Data and whether it is valid, and the output data is: the corrected Cnt Data and whether it is valid.

[0082] If eight command generation modules are configured, calculations are performed for 32 disk channels, the RAID group ChunkSize is 16, and the input IO Offset information is 3, the calculation results of each stage are shown in Table 5.

[0083] Table 5

[0084]

[0085] In one example, the chip circuit structure composed of the Base Start Offset, Cnt accumulation module and Adjust detection module is as follows: Figure 4 As shown. Figure 4 In the example, Base Start Offset calculates the starting offset addresses of channels 0 to 7. The corresponding 8 Cnt accumulation modules can calculate the starting offset addresses of more channels according to actual needs. At the same time, the corresponding Adjust detection module detects and adjusts the output of the Cnt accumulation module to determine the output result for generating the disk write command.

[0086] exist Figure 2 The RAID chip implemented on the basis of can directly generate corresponding disk commands according to configuration information, IO information, RAID information, etc. Figure 5 As shown. Among them, the configuration information is generally the register logic used to control the operation mode of the system. Figure 5 The "number of command generation modules" is the number N of "command generation modules" in the figure. IO information is the relevant information generated when the NVMe command is preprocessed, where Offset is the starting position of the current command corresponding to a stripe in the RAID group. Among them, FirstCnt is the marking signal for the start of calculation of the starting channel, and this signal is invalid in subsequent calculations. RAID information is: the configuration information of the current RAID group, and only the ChunkSize value is used in this device. It should be additionally explained that ChunkSize generally refers to the data block size of a disk in a stripe. The calculation method is the unit data block size multiplied by the number of unit data blocks. For example, the unit data block size is 4KB, and the number of disk data blocks is 16, then ChunkSize=4KB×16=64KB. For the convenience of description, only the number of data blocks is used to describe the ChunkSize size. Channel information and other information are used to generate relevant information of disk channel commands. Accordingly, the above information can refer to Figure 6 .

[0087] exist Figure 5In the disk command generation module group, there are several "disk drive command generation modules (i.e., command generation modules)", which can be 1 or N, and their function is mainly used to generate disk channel commands. If the command generation efficiency is not considered, 1 "disk drive command generation module" can be used, and this module can generate corresponding M disk channel commands through multiple rounds of execution. If the system needs to quickly generate multiple disk channel commands, multiple "disk drive command generation modules" can be used for concurrent execution, and the corresponding M disk channel commands can be quickly generated through 1 or more rounds of execution. When the system has 32 disk channels and a command covers these 32 disks, if the module contains 1 "disk drive command generation module", 32 rounds need to be calculated. If the module contains 8 "disk drive command generation modules", only 4 rounds need to be calculated.

[0088] The disk command queue is used to store the disk channel commands generated by the disk command generation module group.

[0089] It can be seen that this embodiment proposes a computing device with a simple structure and balanced area and speed. The device can input easily available information of the system, and according to the system implementation, it can quickly and concurrently obtain the starting offset address in the multi-channel command, and can obtain the offset address of different channels in a single step with minimum resource logic, which can flexibly, quickly and effectively reduce the CPU load, and improve the logical execution speed and system availability of the system. Specifically, in the Base Start Offset submodule, an 8-channel concurrent computing structure is adopted, which mainly considers the number of disk channels commonly used in RAID acceleration devices, as well as the balance of logical implementation resources and speed.

[0090] A RAID system provided in an embodiment of the present application is introduced below. The RAID system described below can be referenced to other embodiments described in this document.

[0091] An embodiment of the present application discloses a RAID system, including: a host and the RAID chip described in any of the above embodiments.

[0092] In one example, the RAID chip includes:

[0093] An address calculation module is used to calculate the starting offset addresses of M disk channels; M is the number of disks included in the RAID;

[0094] M accumulation modules connected to the address calculation module are used to calculate the starting offset address of the disk channel X+M according to the starting offset address of the disk channel X; X is an integer;

[0095] M detection modules connected one-to-one with the M accumulation modules, used to detect the calculation results of the accumulation modules connected to them, and correct the starting offset address of the disk channel X+M according to the detection results;

[0096] The command generation module is used to generate the operation command of each disk channel according to the starting offset address of the disk channel.

[0097] In one example, if M is equal to 7, the address calculation module includes:

[0098] A disk channel 0 starting offset address calculation unit, used to determine that the starting offset address of the disk channel 0 is 0;

[0099] The disk channel 1 starting offset address calculation unit is used to determine the starting offset address of the disk channel 1 as the size of the number of disk data blocks;

[0100] The disk channel 2 starting offset address calculation unit is used to concatenate 0 and the binary representation of the number of disk data blocks to obtain the starting offset address of the disk channel 2;

[0101] A disk channel 3 starting offset address calculation unit, used for adding the starting offset address of disk channel 2 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 3;

[0102] A disk channel 4 start offset address calculation unit is used to concatenate 00 and the binary representation of the number of disk data blocks to obtain the start offset address of disk channel 4;

[0103] A disk channel 5 starting offset address calculation unit, used for adding the starting offset address of disk channel 4 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 5;

[0104] The disk channel 6 starting offset address calculation unit is used to concatenate the starting offset addresses of 0 and disk channel 3 to obtain the starting offset address of disk channel 6;

[0105] The disk channel 7 starting offset address calculation unit is used to add the starting offset address of the disk channel 4 and the starting offset address of the disk channel 3 to obtain the starting offset address of the disk channel 7.

[0106] In one example, the disk channel 2 start offset address calculation unit includes: a first splicing logic device; the first splicing logic device sequentially splices 0 and the binary representation of the number of disk data blocks to obtain the start offset address of the disk channel 2;

[0107] Accordingly, the disk channel 4 start offset address calculation unit includes: a second splicing logic device; the second splicing logic device sequentially splices 00 and the binary representation of the number of disk data blocks to obtain the start offset address of the disk channel 4;

[0108] Correspondingly, the disk channel 6 starting offset address calculation unit includes: a third splicing logic device; the third splicing logic device sequentially splices 0 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 6.

[0109] In one example, the disk channel 3 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of the disk channel 2 and the starting offset address of the disk channel 1 to obtain the starting offset address of the disk channel 3;

[0110] Accordingly, the disk channel 5 starting offset address calculation unit includes: a second adder; the second adder adds the starting offset address of the disk channel 4 and the starting offset address of the disk channel 1 to obtain the starting offset address of the disk channel 5;

[0111] Correspondingly, the disk channel 7 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of the disk channel 4 and the starting offset address of the disk channel 3 to obtain the starting offset address of the disk channel 7.

[0112] In one example, the arbitrary accumulation module includes:

[0113] A first selector is used to select between the opposite number of the start offset address of the disk channel X and the target value, and output a first selection result; the target value is: the product of the number of disk data blocks and the number of command generation modules;

[0114] A second selector, used to select between the starting offset address of the disk channel X and the output result of the register, and output a second selection result;

[0115] an adder, used for adding the first selected result and the second selected result, and transmitting the added result to a register;

[0116] Register, used to store and output the addition result.

[0117] In one example, any detection module is used to: if the calculation result of the accumulation module to which it is connected is used for command generation and is a negative number, then determine the sum of the calculation result and the number of disk data blocks; if the sum is greater than zero, then correct the starting offset address of the disk channel X+M to zero, and mark the starting offset address of the disk channel X+M as valid; if the sum is not greater than zero, then mark the starting offset address of the disk channel X+M as invalid.

[0118] In one example, any detection module is used to:

[0119] If the calculation result of the accumulator module connected to it is used for command generation and is a non-negative number, the starting offset address of the disk channel X+M is corrected to the calculation result of the current accumulator module, and the starting offset address of the disk channel X+M is marked as valid.

[0120] In one example, any detection module is used to:

[0121] If the calculation result of the accumulation module connected to it is not used for command generation, the calculation result of the current accumulation module is discarded.

[0122] In one example, it also includes:

[0123] A host interaction module connected to the address calculation module is used to receive a disk operation request sent by the host and send a corresponding address calculation instruction to the address calculation module according to the disk operation request;

[0124] Correspondingly, the address calculation module calculates the starting offset addresses of the M disk channels according to the address calculation instruction.

[0125] Among them, for more specific working processes of each module and unit in this embodiment, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0126] It can be seen that this embodiment provides a command generation device, which can calculate the starting offset address of the disk channel based on the hardware structure, and generate the operation command of the disk channel (i.e., write disk instruction) accordingly, without relying on the host CPU computing power. Therefore, it can reduce the influence of the host CPU on the memory address calculation, and can also improve the memory address calculation efficiency and the write disk instruction generation efficiency, thereby improving the write operation efficiency.

[0127] An electronic device provided in an embodiment of the present application is introduced below, and the electronic device described below can be cross-referenced with other embodiments described herein. The electronic device can be any functional module in the above-mentioned RAID chip.

[0128] The present application discloses an electronic device, including:

[0129] Memory, used to store computer programs;

[0130] A processor is used to execute the computer program to implement the method disclosed in any of the above embodiments.

[0131] Furthermore, the present application also provides an electronic device. The electronic device can be arranged in Figure 8 The server side shown in FIG. 1 may also be located at Fig. 9Terminal shown.

[0132] Figure 8 A schematic diagram of the structure of a server provided in an embodiment of the present application. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. The memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the relevant steps in the command generation disclosed in any of the aforementioned embodiments.

[0133] In this embodiment, the power supply is used to provide working voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0134] In addition, the memory as a carrier for resource storage can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include operating system, computer programs and data, etc. The storage method can be temporary storage or permanent storage.

[0135] The operating system is used to manage and control the hardware devices and computer programs on the server to realize the operation and processing of the data in the memory by the processor, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the command generation method disclosed in any of the aforementioned embodiments, the computer program can further include computer programs that can be used to complete other specific tasks. In addition to data such as application update information, the data can also include data such as application developer information.

[0136] Fig. 9 A schematic diagram of the structure of a terminal provided in an embodiment of the present application, the terminal may specifically include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer, etc.

[0137] Generally, the terminal in this embodiment includes: a processor and a memory.

[0138] Among them, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0139] The memory may include one or more computer non-volatile storage media, which may be non-transitory. The memory may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor, it can implement the relevant steps in the command generation method executed by the terminal side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, update information of the application.

[0140] In some embodiments, the terminal may also include a display screen, an input and output interface, a communication interface, a sensor, a power supply, and a communication bus.

[0141] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than those shown in the figure.

[0142] A non-volatile storage medium provided in an embodiment of the present application is introduced below. The non-volatile storage medium described below can be cross-referenced with other embodiments described herein.

[0143] A non-volatile storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the command generation method disclosed in the above embodiment. The non-volatile storage medium is a computer-readable non-volatile storage medium, which, as a carrier for storing resources, may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system, a computer program and data, etc., and the storage method may be temporary storage or permanent storage.

[0144] A computer program product provided in an embodiment of the present application is introduced below. The computer program product described below can be referenced to other embodiments described in this document.

[0145] A computer program product comprises a computer program / instruction, which implements the steps of the command generation method disclosed above when executed by a processor.

[0146] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0147] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of non-volatile storage medium known in the art.

[0148] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A RAID chip, characterized in that: include: An address calculation module is used to calculate the starting offset addresses of M disk channels; M is the number of disks included in the RAID; M accumulation modules connected to the address calculation module are used to calculate the starting offset address of disk channel X+M according to the starting offset address of disk channel X; X is an integer; M detection modules connected one-to-one with the M accumulation modules, used to detect the calculation results of the accumulation modules connected to them, and correct the starting offset address of the disk channel X+M according to the detection results; The command generation module is used to generate the operation command of each disk channel according to the starting offset address of the disk channel.

2. The RAID chip according to claim 1, characterized in that: If M is equal to 7, the address calculation module includes: A disk channel 0 starting offset address calculation unit, used to determine that the starting offset address of the disk channel 0 is 0; The disk channel 1 starting offset address calculation unit is used to determine the starting offset address of the disk channel 1 as the size of the number of disk data blocks; The disk channel 2 starting offset address calculation unit is used to concatenate 0 and the binary representation of the number of disk data blocks to obtain the starting offset address of the disk channel 2; A disk channel 3 starting offset address calculation unit, used for adding the starting offset address of disk channel 2 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 3; A disk channel 4 start offset address calculation unit is used to concatenate 00 and the binary representation of the number of disk data blocks to obtain the start offset address of disk channel 4; A disk channel 5 starting offset address calculation unit, used for adding the starting offset address of disk channel 4 and the starting offset address of disk channel 1 to obtain the starting offset address of disk channel 5; The disk channel 6 starting offset address calculation unit is used to concatenate the starting offset addresses of 0 and disk channel 3 to obtain the starting offset address of disk channel 6; The disk channel 7 starting offset address calculation unit is used to add the starting offset address of the disk channel 4 and the starting offset address of the disk channel 3 to obtain the starting offset address of the disk channel 7.

3. The RAID chip according to claim 2, characterized in that: The disk channel 2 start offset address calculation unit includes: a first splicing logic device; the first splicing logic device sequentially splices 0 and the binary representation of the number of disk data blocks to obtain the start offset address of the disk channel 2; Accordingly, the disk channel 4 start offset address calculation unit includes: a second splicing logic device; the second splicing logic device sequentially splices 00 and the binary representation of the number of disk data blocks to obtain the start offset address of the disk channel 4; Correspondingly, the disk channel 6 starting offset address calculation unit includes: a third splicing logic device; the third splicing logic device sequentially splices 0 and the starting offset address of disk channel 3 to obtain the starting offset address of disk channel 6.

4. The RAID chip according to claim 2, characterized in that: The disk channel 3 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of the disk channel 2 and the starting offset address of the disk channel 1 to obtain the starting offset address of the disk channel 3; Accordingly, the disk channel 5 starting offset address calculation unit includes: a second adder; the second adder adds the starting offset address of the disk channel 4 and the starting offset address of the disk channel 1 to obtain the starting offset address of the disk channel 5; Correspondingly, the disk channel 7 starting offset address calculation unit includes: a first adder; the first adder adds the starting offset address of the disk channel 4 and the starting offset address of the disk channel 3 to obtain the starting offset address of the disk channel 7.

5. The RAID chip according to claim 1, characterized in that: The arbitrary accumulation module includes: A first selector is used to select between the opposite number of the start offset address of the disk channel X and the target value, and output a first selection result; the target value is: the product of the number of disk data blocks and the number of command generation modules; A second selector, used to select between the starting offset address of the disk channel X and the output result of the register, and output a second selection result; an adder, configured to add the first selection result and the second selection result, and transmit the addition result to the register; The register is used to store and output the addition result.

6. The RAID chip according to claim 1, characterized in that: The arbitrary detection module is used for: if the calculation result of the accumulation module connected to itself is used for command generation and is a negative number, then the sum of the calculation result and the number of disk data blocks is determined; if the sum is greater than zero, the starting offset address of the disk channel X+M is corrected to zero, and the starting offset address of the disk channel X+M is marked as valid; if the sum is not greater than zero, the starting offset address of the disk channel X+M is marked as invalid.

7. The RAID chip according to claim 6, characterized in that: Any detection module is used to: If the calculation result of the accumulator module connected to it is used for command generation and is a non-negative number, the starting offset address of the disk channel X+M is corrected to the calculation result of the current accumulator module, and the starting offset address of the disk channel X+M is marked as valid.

8. The RAID chip according to claim 6, characterized in that: Any detection module is used to: If the calculation result of the accumulation module connected to it is not used for command generation, the calculation result of the current accumulation module is discarded.

9. The RAID chip according to any one of claims 1 to 8, characterized in that: Also includes: A host interaction module connected to the address calculation module, used to receive a disk operation request sent by the host, and send a corresponding address calculation instruction to the address calculation module according to the disk operation request; Correspondingly, the address calculation module calculates the starting offset addresses of the M disk channels according to the address calculation instruction.

10. A RAID system, characterized in that: include: A host and a RAID chip as claimed in any one of claims 1 to 9.