Control page linked list construction method, device and equipment based on control page linked list template
By dividing the control page linked list template into multiple template blocks and specifying correction information blocks during the construction process, the problems of high IO read/write performance and high CPU utilization are solved, and efficient control page linked list construction is achieved.
Patent Information
- Application Number
- CN202411203587.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-08-29
AI Technical Summary
In existing technologies, the read/write performance of IO is affected by the large amount of data in the control page linked list template, and the CPU utilization is too high when constructing the control page linked list.
By dividing the control page linked list template into multiple template blocks and specifying the correction information blocks using the build command, the host sends the starting position, size, and correction value of the correction information blocks, thereby making corrections in the build device, avoiding copying the entire template locally and reducing data transfer volume.
It reduces the impact on I/O read/write performance, decreases CPU utilization, and improves build efficiency.
Smart Images

Figure CN119396330B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage technology, and specifically to a method, apparatus, and device for constructing a control page linked list based on a control page linked list template. Background Technology
[0002] A control page linked list is a linked list composed of multiple control pages arranged in sequence. Each control page can include several commands that need to be executed sequentially. To reduce the complexity of constructing a control page linked list, one or more control page linked list templates can be created in advance, and then the control page linked list can be constructed based on these templates. However, the control page templates contain a large amount of data, which can significantly impact I / O read and write performance during the construction of the control page linked list. Summary of the Invention
[0003] In view of this, the present invention provides a method for constructing a control page linked list based on a control page linked list template, a control page linked list construction device, an electronic device, and a computer-readable storage medium, which has minimal impact on IO read and write performance.
[0004] This invention provides a method for constructing a control page linked list based on a control page linked list template, the method comprising:
[0005] The system receives a build command from the host. The build command is used to specify the correction information block of the target template block that needs to be corrected in the control page linked list template. The correction information block includes the template block start position, template block size, correction position, and correction value corresponding to each correction position of the target template block.
[0006] Starting from the template start position, the target template block is obtained from the control page linked list template according to the template block size, and the content at each of the correction positions in the target template block is corrected to the correction value corresponding to the correction position;
[0007] Based on the revised target template block, construct a control page linked list.
[0008] In another aspect, the present invention provides a control page linked list construction apparatus based on a control page linked list template, wherein the control page linked list template is divided into multiple template blocks; the apparatus includes:
[0009] The host configuration unit is used to receive a build command issued by the host. The build command is used to specify the correction information block of the target template block that needs to be corrected in the control page linked list template. The correction information block includes the template block start position, template block size, correction position, and correction value corresponding to each correction position of the target template block.
[0010] The template reading unit is used to retrieve the target template block from the control page linked list template, starting from the beginning position of the template and according to the size of the template block;
[0011] A template correction unit is used to correct the content at each correction position in the target template block to the correction value corresponding to the correction position.
[0012] A construction unit is used to construct a control page linked list based on the corrected target template block.
[0013] In another aspect, the present invention provides an electronic device comprising a processor and a memory, the memory being used to store a computer program which, when executed by the processor, implements the method described above.
[0014] In another aspect, the present invention provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the method described above.
[0015] In some embodiments of this application, a correction information block for the target template block to be corrected in the control page linked list template is specified by a construction command. This allows the target template block to be obtained from the control page linked list template based on the template start position and size in the correction information block. Furthermore, the target template block can be corrected based on the correction position and correction value in the correction information block, and the control page linked list can be constructed based on the corrected target template block. This avoids the problem of copying the entire control page linked list template to the local control page linked list construction device, thereby significantly reducing data transmission volume and minimizing the impact on I / O read / write performance. Attached Figure Description
[0016] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings:
[0017] Figure 1 A flowchart illustrating a method for constructing a control page linked list according to an embodiment of this application is shown.
[0018] Figure 2 A schematic diagram of a control page linked list template provided in one embodiment of this application is shown;
[0019] Figure 3 This illustration shows a schematic diagram of the relationship between a startup command, a descriptor, and a correction information block provided in one embodiment of this application;
[0020] Figure 4 This illustration shows a schematic diagram of the relationship between the startup command, descriptor, and correction information block provided in another embodiment of this application;
[0021] Figure 5 This illustration shows a schematic diagram of the relationship between the startup command, descriptor, and correction information block provided in another embodiment of this application;
[0022] Figure 6 A schematic diagram of a control page linked list construction apparatus provided in one embodiment of this application is shown;
[0023] Figure 7 This illustration shows a schematic diagram of the overall process for constructing a control page linked list according to an embodiment of this application;
[0024] Figure 8 A schematic diagram of an electronic device provided in one embodiment of this application is shown. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0026] Some commands in the control page linked list template may be incomplete. When constructing a control page linked list based on the control page linked list template, you only need to correct the incomplete commands in the control page linked list template according to the actual situation to construct the control page linked list.
[0027] Currently, in technologies that construct control page lists based on control page list templates, the entire construction process is typically performed by the host, resulting in excessive CPU usage. To address this issue, some technologies have proposed a control page list construction device. This device can construct the control page list based on construction commands issued by the host, allowing the host to exit the construction process immediately after issuing the command, thus significantly reducing CPU usage. However, these devices generally copy the entire control page list template locally and then modify the commands within the copied template to construct the control page list. Since the control page list template contains a large amount of data, copying it locally significantly impacts I / O read / write performance.
[0028] Therefore, this application first provides a method for constructing a control page linked list based on a control page linked list template, which has minimal impact on I / O read / write performance during the construction process. The control page linked list construction method can be applied to a control page linked list construction device. Specifically, in this application, the control page linked list template can be divided into multiple template blocks, and the sizes of different template blocks can be different; for example, template block A is 512KB in size, and template block B is 204KB in size. (See also...) Figure 1 This is a flowchart illustrating a method for constructing a control page linked list according to an embodiment of this application. Figure 1 In this context, the method for constructing a control page linked list includes the following steps:
[0029] Step S101: Receive a build command sent by the host. The build command is used to specify the correction information block of the target template block that needs to be corrected in the control page linked list template. The correction information block includes the template block start position, template block size, correction position, and correction value corresponding to each correction position of the target template block.
[0030] Specifically, a correction information block can be understood as a data set, including correction-related information for the target template block. The build startup command can be used to specify the correction information block for the target template block. For example, using... Figure 2 Taking the control page linked list template as an example. Assuming that template block 2 is the target template block that needs to be corrected, the build start command issued by the host can specify the template block start position D1, template block size, correction positions AA and BB, correction value abcd at correction position AA, and correction value abcd1 at correction position BB.
[0031] In this embodiment, the size of different target template blocks can be set according to actual needs, that is, the template block sizes of different target template blocks specified by the build command can be different.
[0032] In this embodiment, the starting position of the target template block can be the starting storage address of the target template block. Based on the starting position and the size of the target template block, the target template block can be read from storage. The correction position of the target template block can be the starting storage address of the region of the target template block that needs to be corrected. The storage address in this application can be represented by an offset address, an index address, etc., and this application does not impose any limitations on this.
[0033] Normally, before constructing the control page linked list, the host can determine the target template block to be corrected, the starting position of the target template block, the size of the template block, the correction position, and the correction value corresponding to each correction position in the control page linked list template. The host can send the above information to the control page linked list construction device through a build start command. The control page linked list construction device then constructs the control page linked list based on the correction information block specified in the build start command. After issuing the build start command, the host can exit the control page linked list construction process, and the control page linked list construction device continues to construct the control page linked list based on the following steps S102 and S103.
[0034] Step S102: Starting from the template start position, according to the template block size, obtain the target template block from the control page linked list template, and correct the content at each correction position in the target template block to the correction value corresponding to the correction position.
[0035] Specifically, the control page list template can be stored outside the control page list construction device. Based on the correction information block specified by the construction command, the target template block in the control page list template can be copied locally, and the content at each correction position of the target template block can be replaced locally with the corresponding correction value. For example, ... Figure 2 Replace the content at position AA in the correction section with abcd.
[0036] Step S103: Based on the corrected target template block, construct the control page linked list.
[0037] In this embodiment, before the host issues the build command, the host can copy the control page list template located in the first storage location to a specified location to obtain an initial control page list located at the specified location. After the control page list building device corrects the target template block, the corrected target template block can replace the uncorrected target template block in the initial control page list to build the required target control page list from the initial control page list.
[0038] Specifically, the control page list template can be stored in persistent storage, thus permanently saving the control page list template. The initial control page list can be stored in memory, so that after the target control page list is constructed based on the initial control page list, the initial control page list can be executed.
[0039] It should be noted that although the embodiment shown in this application also includes a step of copying the control page list template, its principle differs from that of copying the control page list template in some technologies. In some technologies, the control page list template is copied to the local machine of the control page list construction device, and then the commands in the control page list template are modified locally to obtain the constructed target control page list. The target control page list is then copied to a designated location (e.g., memory). In the technical solution of this application, the target template block in the control page list template is copied locally, and the control page list template is copied to a designated location to obtain the initial control page list. Then, after modifying the target template block locally, the modified target template block replaces the unmodified target template block in the initial control page list. This eliminates the process of copying the control page list template locally, reducing data transfer volume and thus mitigating the impact on I / O read / write performance.
[0040] In summary, in some embodiments of this application, a correction information block for the target template block to be corrected in the control page linked list template is specified by a construction command. This allows the target template block to be obtained from the control page linked list template based on the template start position and size in the correction information block. Furthermore, the target template block can be corrected based on the correction position and correction value in the correction information block, and the control page linked list can be constructed based on the corrected target template block. This avoids the problem of copying the entire control page linked list template to the local control page linked list construction device, thereby significantly reducing data transmission volume and minimizing the impact on I / O read / write performance.
[0041] In some embodiments, when the control page linked list template includes multiple target template blocks that need to be corrected, each target template block may have its own corresponding correction information block. Before issuing a build command to the control page linked list building device, the host may pre-store the correction information blocks corresponding to each target template block in a designated second storage area, so that each correction information block has its own corresponding second storage address. When issuing the build command, the host simply sends the second storage address of the correction information block to the control page linked list building device. The control page linked list building device can then read the contents of the correction information block from the second storage area corresponding to the second storage address. This significantly reduces the amount of data transfer between the host and the control page linked list building device.
[0042] Furthermore, to distribute the storage addresses of each correction information block to the control page list construction device, this application proposes the concept of a descriptor. The descriptor is used to specify the storage address of the correction information block. Before the host issues the construction command, the descriptor can be stored in the first storage area. In this way, the descriptor has a corresponding first storage address. The construction command issued by the host can directly specify the first storage address of the descriptor, thereby further reducing the amount of data transmission.
[0043] Based on the above description, after receiving the build command, the method of this application may further include:
[0044] Based on the storage address specified in the build command, read the descriptor from the first storage area, and based on the storage address specified in the descriptor, read the correction information block from the second storage area.
[0045] Specifically, descriptors and correction information blocks can each have their own corresponding data structures. A data structure is defined by dividing the data in the descriptor and correction information block into multiple parts (also called fields), and specifying the meaning, format, and length of each field. For easier understanding, please refer to the relevant documentation. Figure 3 This is a schematic diagram illustrating the relationship between a startup command, a descriptor, and a correction information block, provided in one embodiment of this application. Figure 3 In this context, the descriptor can be divided into n fields, each specifying the storage address of a correction information block, and each field can be 30 bits long. Similarly, the correction information block can be divided into fields such as reserved, template block size, template start position and correction position, and correction value, with the meanings of each field as follows:
[0046] Reserved: This field has no meaning at the moment;
[0047] Template block size: Indicates the size of the target template block;
[0048] Template start position and correction position: These indicate the starting storage address of the target template block and the correction position within the target template block;
[0049] Correction value: This field corresponds one-to-one with the correction position and represents the correction value at that position. In this application, the correction value field can either directly store the correction value corresponding to the correction position or store the storage address of the correction value. The correction value can be read from the storage address of the correction value.
[0050] Compared to directly setting the correction information blocks of each target template block in the build command and issuing them to the control page linked list build device, Figure 3 In the illustrated embodiment, this hierarchical data structure design can significantly reduce the amount of data in the build commands.
[0051] However, in Figure 3 In the illustrated embodiment, if the target template block has many correction positions and the length of the template start position and correction position fields is limited, it may be impossible to transmit more correction positions. Therefore, in conjunction with the reference... Figure 4 This is a schematic diagram illustrating the relationship between the startup command, descriptor, and correction information block, provided in another embodiment of this application. Figure 4 In the code, the correction information block includes a total information block and a correction position block. The correction position block specifies the correction position of the target template block. Specifically, the correction position block's data structure includes multiple position fields, each specifying one of the correction positions in the target template block. Specifically, the target template block can be divided into words, each word having a preset length (e.g., 50 bytes). Each position field can represent a correction position using three sub-fields: word offset, bit offset, and bit width. Where:
[0052] The character offset is used to locate the target character that needs to be corrected in the target template block, that is, which character in the target template block needs to be corrected;
[0053] The bit offset is used to locate the correction start position in the target word, that is, from which data bit in the target word to start the correction;
[0054] Bit width indicates the number of data bits that need to be corrected in the target word, starting from the bit offset.
[0055] For example, assuming the word offset is 3, the bit offset is 4, and the bit width is 5, it means that the correction starts from the 4th data bit of the 3rd word in the target template block, and the number of data bits to be corrected is 5. That is, the 4th to 8th data bits of the 3rd word in the target template block need to be corrected.
[0056] Before the host issues the build start command, the correction location block can be stored in the third storage area, thus assigning a corresponding storage address to the correction location block. The total information block can be used to specify the storage address of the correction location block. Based on this, reading the correction information block from the second storage area according to the storage address specified by the descriptor can include:
[0057] Based on the storage address specified by the descriptor, the total information block is read from the second storage area, and based on the storage address of the correction location block specified by the total information block, the correction location block is read from the third storage area.
[0058] In this way, by storing the correction position separately in the correction position block, the problem of not being able to specify too many correction positions when the field length in the information block is limited is effectively avoided.
[0059] Continue reading Figure 4In some embodiments, in the data structure design of the correction location block, the size of each correction location block can be a fixed size (e.g., 512B), and the number of location fields in the correction location block can be fixed, such as 10. However, in practice, the target template block may not have 10 correction locations; that is, it may only use a few location fields from the correction location block to specify the correction location. To distinguish these location fields actually used to specify the correction location, the multiple location fields in the correction location block can have a sequential order, for example, the location fields can be sorted in the order of DW1>DW2>DW3… The total information block can also be used to specify the number of location fields in the correction location block actually used to specify the correction location. Specifically, Figure 4 In the main information block, the field "Valid Correction Word Size" can be used to specify the number of position fields actually used to specify the correction position in the correction position block. For example, when the valid correction word size is 3, it means that there are 3 position fields in the correction position block used to specify the correction position.
[0060] Based on the above description, after reading the correction position block, the correction position specified by the correction position block can be obtained using the following method:
[0061] According to the order of the position fields in the correction position block, traverse the correction positions specified by each position field in turn;
[0062] The iteration stops once the number of position fields traversed reaches the number of position fields specified by the correction information block.
[0063] In this way, the actual position field used to specify the correction position in the correction position block is effectively identified, ensuring the correction accuracy.
[0064] In some embodiments, the "Valid Correction Word Size" field in the above-mentioned general information block can also be located in the correction address block. This reduces the amount of data in the correction block, allowing it to contain other data related to building the control page linked list template.
[0065] Continue reading Figure 4 In some embodiments, the third storage area for storing the correction location block can be located within the control page list construction device, thereby improving data read speed. Alternatively, the third storage area can be located outside the control page list construction device, thus reducing storage consumption within the control page list construction device. The location of the third storage area can be selected based on the specific circumstances.
[0066] Based on the above description, the main information block can also be used to specify the location of the third storage area. Specifically, the "pattern" field in the main information block can be used to specify the location of the third storage area. When the pattern field takes the first value, it indicates that the third storage area is located in the control page list construction device; when the pattern field takes the second value, it indicates that the third storage area is located outside the control page list construction device.
[0067] Furthermore, in Figures 3 to 4 In the illustrated embodiment, the descriptors specify the storage location of each correction information block, and the corresponding data volume may be large. To reduce the data transfer volume between the host and the control page list construction device, this application proposes the concept of a correction table. One or more correction information blocks reside in the same correction table, and the correction information blocks in the same correction table have contiguous storage addresses. Specifically, the descriptor specifies the storage address of each correction information block by specifying the storage address of the correction table and the number of correction information blocks included in the correction table. Specifically, the storage address of the correction table can be an index address. Based on the index address, the offset address of the correction table can be calculated. For example:
[0068] When the size of the correction table is 512B, the offset address of the correction table is equal to the index address shifted left by 9 bits;
[0069] When the size of the correction table is 1024B, the offset address of the correction table is equal to the index address shifted left by 10 bits;
[0070] When the size of the correction table is 2048B, the offset address of the correction table is equal to the index address shifted left by 11 bits.
[0071] After determining the offset address of the correction table, and combining it with the base address of the correction table (which can be pre-configured), the starting storage address of the correction table can be determined. Based on the data design of the correction information blocks, it is known that the correction information blocks of different target template blocks can have the same size (e.g., all 512KB). Therefore, starting from the starting storage address of the correction table, the storage address of a correction information block can be located at intervals of one correction information block size. Combining this with the number of correction information blocks included in the correction table, the ending storage address of the correction table can be determined. In this way, specifying the storage addresses of multiple correction information blocks using a single correction table significantly reduces the amount of data in the descriptor.
[0072] See also Figure 5 This is a schematic diagram illustrating the relationship between the startup command, descriptor, and correction information block, provided in another embodiment of this application. Figure 5The descriptor shown includes a specified number of correction table fields (DW11-DW19), supports specifying the index addresses of 8 correction tables, and each correction table can support specifying the storage addresses of 128 correction information blocks. Of course, in the specific data structure design, it can be designed according to the actual situation, and this application does not impose any restrictions on it.
[0073] Similar to the correction location block, the number of correction table fields in the descriptor used to specify the correction table index address can be fixed, such as 8. However, in practice, the number of correction tables needed to specify the index address may be less than 8; that is, only a few correction table fields in the descriptor may be used to specify the storage address of the correction information block. To distinguish the correction table fields actually used, the descriptor's data structure may include a correction table number field and a first number of correction table fields. The first number of correction table fields have a sequential order, and each correction table field is used to specify the storage address of one correction table and the number of correction information blocks included in the correction table. The correction table number field is used to specify the number of correction table fields actually used in the descriptor.
[0074] After reading the descriptor, the storage address of each correction information block specified by the descriptor can be obtained using the following method;
[0075] Following the order of the fields in the correction table, starting from the first correction table field, the storage address of the correction table and the number of corresponding correction information blocks specified in each correction table field are traversed sequentially.
[0076] Based on the index address of the correction table obtained by traversal and the number of correction information blocks included in the correction table, the storage address of each correction information block in each correction table is determined in turn.
[0077] The iteration operation stops once the number of fields in the correction table reaches the value of the correction table quantity field.
[0078] In this way, the actual correction table fields can be accurately distinguished, thus improving the accuracy of the correction.
[0079] In some embodiments, in order to accurately complete the replacement of the target template block in step S103, the correction information block is also used to specify the storage address of the target template block in the initial control page linked list. Specifically, refer to [reference needed]. Figure 5 The "Target Template Storage Address" field in the general information block can be used to specify the storage address of the target template block in the initial control page linked list. The control page linked list constructed based on the corrected target template block can include:
[0080] Based on the storage address of the target template block specified by the correction information block in the initial control page linked list, the target template block in the initial control page linked list is replaced with the corrected target template block to construct the required target control page linked list from the initial control page linked list.
[0081] In some embodiments, when the target control page list includes multiple control pages, the physical storage addresses between control pages may not be contiguous, but the physical storage addresses within the same control page may be contiguous. Considering that multiple control pages in the target control page list need to be executed consecutively, the descriptor can also be used to specify the starting storage address of the target control page list, the number of control pages included in the target control page list, and the storage address of each control page. Thus, based on the information specified by the descriptor, execution can begin from the starting storage address of the target control page list, and then, based on the storage addresses of each control page, consecutive execution between different control pages can be achieved. Furthermore, based on the number of control pages, it can be determined when the execution of the target control page list ends. Based on the above description, after constructing the target control page list, the method of this application may further include:
[0082] The starting storage address of the target control page list specified by the descriptor, the number of control pages included in the target control page list, and the storage address of each control page are returned to the object (such as the engine) that needs to execute the target control page list.
[0083] In this way, it is ensured that objects executing the target control page linked list can execute each linked list in the target control page linked list consecutively, and the time point at which the execution of the target control page linked list ends is determined.
[0084] In some embodiments, replacing the target template block in the initial control page list with the corrected target template block may include:
[0085] After the first target template block is corrected, the replacement operation of the target template block is paused, and the process continues to wait for one or more second target template blocks to be corrected after the first target template block.
[0086] If the first target template block and the second target template block are consecutive target template blocks in the initial control page linked list, then the corrected first target template block and the second target template block are aggregated into an aggregated target template, and the target template block replacement operation is performed based on the aggregated target template.
[0087] This aggregation method reduces the number of times data is written to storage, thus minimizing the impact on storage performance.
[0088] Specifically, after the first target template block is corrected, the "target template storage address" and "template block size" in the corresponding total information block can be recorded. Upon receiving the corrected second target template block A, if any of the following conditions are met, the first target template block and the second target template block A can be considered continuous:
[0089] Condition 1: Add the "target template storage address" and "template block size" corresponding to the first target template block, and the result is the "target template storage address" in the total information block corresponding to the second target template block A;
[0090] Condition 2: Add the "target template storage address" and "template block size" corresponding to the second target template block A, and the result is the "target template storage address" in the total information block corresponding to the first target template block.
[0091] When it is determined that the first target template block and the second target template block A are consecutive target template blocks, the target template block replacement operation can be paused, and the process can continue to wait for the second target template block B. After receiving the corrected second target template block B, if either the first target template block or the second target template block A is consecutive with the second target template block B, the process can continue to wait for the second target template block C until a newly received corrected second target template block appears that is not consecutive with the previous target template blocks, at which point the target template block replacement operation is triggered.
[0092] In some embodiments, Figure 5 The "target template storage address" refers to the logical storage address of the target template block. On one hand, even if logical storage addresses are consecutive, their corresponding physical storage addresses are not necessarily consecutive. On the other hand, as mentioned earlier, physical storage addresses between control pages may not be consecutive, but physical storage addresses within the same control page can be consecutive. Therefore, when determining whether two target template blocks are consecutive based on the above method of adding the "target template storage address" and "template block size," if the sum of the "target template storage address" and "template block size" of the previous target template block equals the "target template storage address" of the next target template block, it is necessary to determine whether the physical storage addresses corresponding to the "target template storage addresses" of the two target template blocks are located within the same control page. If so, the two target template blocks are determined to be consecutive; otherwise, they are determined not to be consecutive.
[0093] In some embodiments, the above-described correction of the target template block when the target template block has multiple correction positions may include:
[0094] Based on the correction information block specified in the build command, multiple correction locations are corrected in parallel.
[0095] This improves the efficiency of the correction process. For details on how to perform parallel corrections, please refer to the device description; it will not be elaborated here.
[0096] Corresponding to the method for constructing a control page linked list, this application also provides a control page linked list construction apparatus based on a control page linked list template. (See also...) Figure 6 This is a schematic diagram of a control page linked list construction apparatus 600 provided in one embodiment of this application. Figure 6 In the control page linked list construction device 600, there are a host configuration unit 611, a template reading unit 625, and a template correction unit 618. Among them,
[0097] The host configuration unit 611 is used to receive build commands issued by the host. The build command is used to specify the correction information block of the target template block that needs to be corrected in the control page linked list template. The correction information block includes the template block start position, template block size, correction position, and correction value corresponding to each correction position of the target template block.
[0098] Specifically, the host configuration unit 611 can simultaneously receive a preset number of build commands. The control page list build device 600 may also include a build buffer 612. The build buffer 612 is used to store the build commands received by the host configuration unit 611.
[0099] In some embodiments, the construction buffer 612 can be implemented based on an 8x32b FIFO.
[0100] Based on the correction information block specified in the build command, the template reading unit 625 is used to retrieve the target template block from the control page linked list template, starting from the template start position and according to the template block size. Specifically, based on the mode setting (see the description of the mode in the above method), the template reading unit 625 can choose to read the target template block from the template internal buffer 626 of the control page linked list construction device 600, or it can choose to read the target template block from the external storage of the control page linked list construction device 600.
[0101] The template correction unit 618 is used to correct the content at each correction position in the target template block to the correction value corresponding to the correction position. The construction unit 622 is used to construct a control page linked list based on the corrected target template block.
[0102] In some embodiments, the build command is specifically used to specify the storage address of a descriptor, and the descriptor is used to specify the storage address of a correction information block; the control page list construction apparatus 600 further includes a descriptor reading unit 613 and a correction information reading unit 620, wherein the descriptor reading unit 613 is used to read the descriptor from a first storage area according to the storage address specified by the build command. The correction information reading unit 620 is used to read the correction information block from a second storage area according to the storage address specified by the descriptor.
[0103] In some embodiments, the correction information block includes a total information block and a correction position block. The correction position block specifies the correction position of the target template block, and the total information block specifies the template start position, template block size, correction value, and storage address of the correction position block of the target template block. The correction information reading unit 620 specifically includes a total information block reading unit 615, a correction position block reading unit 617, a correction value buffer 620, a first word buffer 616, and a correction position buffer 619, wherein:
[0104] The total information block reading unit 615 is used to read the total information block from the second storage area according to the storage address specified by the descriptor, and save the storage address of the template start position, template block size and correction position block specified by the total information block to the first word buffer 616, and save the correction value specified by the total information block to the correction value buffer 620.
[0105] The correction position block reading unit 617 is used to read the correction position block from the third storage area based on the storage address of the correction position block in the first-word buffer, and save the correction position specified by the correction position block to the correction position buffer 619. Specifically, the control page list construction device 600 may include an internal correction position buffer 614. The internal correction position buffer 614 is used to store the correction position block within the control page list construction device 600. If the value of the "pattern" field in the first-word buffer 616 is a first value, the correction position block reading unit 617 can read the correction position block from the internal correction position buffer 614; if the value of the "pattern" field in the first-word buffer 616 is a second value, the correction position block reading unit 617 can read the correction position block from the third storage area outside the control page list construction device 600.
[0106] In some embodiments, the template correction unit 618 is specifically used to correct the target template block based on the information in the correction value buffer 620, the first character buffer 616, and the correction position buffer 619.
[0107] In some embodiments, the control page linked list template is copied to a specified location to obtain an initial control page linked list located at the specified location. The correction information block is also used to specify the storage address of the target template block in the initial control page linked list.
[0108] The construction unit 622 is specifically used to replace the target template block in the initial control page linked list with the corrected target template block according to the storage address of the target template block specified by the correction information block in the initial control page linked list, so as to construct the required target control page linked list from the initial control page linked list.
[0109] In some embodiments, the control page linked list construction device 600 further includes an aggregation information buffer 621. The template correction unit 618 is specifically used to save the corrected target template block to the aggregation information buffer 621. The construction unit 622 is specifically used to determine whether the first target template block and the second target template block in the aggregation information buffer 621 are consecutive target template blocks in the initial control page linked list. If so, the corrected first target template block and the second target template block are aggregated into an aggregated target template, and a target template block replacement operation is performed based on the aggregated target template.
[0110] In some embodiments, the host configuration unit 611 can also be used to configure information related to the build control page linked list template, such as configuring the build buffer 612, configuring the correction value buffer 620, configuring the correction position buffer 619, etc.
[0111] For details on the beneficial effects of the control page linked list construction device 600, please refer to the description related to the control page linked list construction method, which will not be repeated here.
[0112] See also Figure 7 This is a schematic diagram illustrating the overall process of constructing a control page linked list, as provided in one embodiment of this application. (See also...) Figure 6 , Figure 7 The flowchart in the process can be divided into the following major steps:
[0113] 1) The descriptor reading unit 613 periodically checks whether there is a build command in the build buffer 612. If there is no build command in the build buffer 612, step 1) is repeated; if there is a build command in the build buffer 612, step 2) is executed.
[0114] 2) The descriptor reading unit 613 reads the descriptor from the first storage area according to the storage address specified by the construction command;
[0115] 3) The total information block reading unit 615 reads the total information block from the second storage area according to the storage address specified by the descriptor, and reads the first word (i.e., ...) from the total information block. Figure 5 The first line of the total information block is written into the first word buffer, and the correction value in the total information block is written into the correction value buffer 620;
[0116] 4) The position block reading unit 617 and the template reading unit 625 periodically check whether the first word buffer is empty. If it is not empty, proceed to step 5); if it is empty, proceed to step 3).
[0117] 5) If the pattern field in the first word buffer is the first value, the read template unit 625 reads the target template block from the internal storage of the control page list device 600 based on the template block start position of the target template block in the first word buffer; if the pattern in the first word buffer is the second value, the read template unit 625 reads the target template block from the external storage of the control page list device 600 based on the template block start position of the target template block in the first word buffer.
[0118] 6) Write the read target template block into template buffer 623;
[0119] 7) After the target template block is read, the correction position block reading unit 617 reads the correction position block according to the storage address of the correction position specified by the first word buffer 616. Specifically, if the pattern field in the first word buffer is a first value, the correction position block reading unit 617 reads the target template block from the internal storage of the control page list device 600 based on the template block start position of the target template block in the first word buffer; if the pattern in the first word buffer is a second value, the correction position block reading unit 617 reads the target template block from the external storage of the control page list device 600 based on the template block start position of the target template block in the first word buffer.
[0120] 8) The correction position block reading unit 617 saves the read correction position block to the correction position buffer 619 and determines whether the correction position has been completely read. If the correction position has been completely read, it returns to step 4) above; if the correction position has not been completely read, it returns to step 7).
[0121] 9) The template correction unit 618 periodically checks whether there is data in the correction value buffer 620 and the correction position buffer 619. If there is data in the correction value buffer 620 and the correction position buffer 619, the template correction is triggered; if there is no data in the correction value buffer 620 and the correction position buffer 619, the unit continues to check whether there is data in the correction value buffer 620 and the correction position buffer 619.
[0122] 10) When the target template block is corrected, the template correction unit 618 performs an aggregation check on multiple target template blocks. If the multiple target template blocks are consecutive template blocks, the multiple target template blocks are written into the aggregation buffer.
[0123] 11) Based on the target template block in the aggregation buffer, the construction unit 622 performs a replacement operation on the target template block of the initial control page linked list copied from the control page linked list template to construct the target control page linked list.
[0124] This concludes the explanation of the entire plan.
[0125] Please see Figure 8 The diagram below illustrates an electronic device according to an embodiment of this application. The electronic device includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the method described above.
[0126] The processor can be a central processing unit (CPU). It can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.
[0127] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of this invention. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods described in the above embodiments.
[0128] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0129] One embodiment of this application also provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the above-described method.
[0130] Although the implementation method of the present invention has been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for constructing a control page linked list based on a control page linked list template, characterized in that, The control page linked list template can be divided into multiple template blocks; the method includes: The system receives a build command from the host. The build command is used to specify the correction information block of the target template block that needs to be corrected in the control page linked list template. The correction information block includes the template block start position, template block size, correction position, and correction value corresponding to each correction position of the target template block. Starting from the template start position, the target template block is obtained from the control page linked list template according to the template block size, and the content at each of the correction positions in the target template block is corrected to the correction value corresponding to the correction position; Based on the revised target template block, construct a control page linked list; Before the host issues the build command, the control page list template is copied to a specified location to obtain an initial control page list located at the specified location. The correction information block is also used to specify the storage address of the target template block in the initial control page list. Based on the corrected target template block, constructing a control page linked list includes: Based on the storage address of the target template block specified by the correction information block in the initial control page linked list, the corrected target template block is used to replace the target template block in the initial control page linked list, so as to construct the required target control page linked list from the initial control page linked list.
2. The method as described in claim 1, characterized in that, The construction command is specifically used to specify the storage address of the descriptor, and the descriptor is used to specify the storage address of the correction information block; After receiving the build command, the method further includes: The descriptor is read from the first storage area according to the storage address specified by the build command, and the correction information block is read from the second storage area according to the storage address specified by the descriptor.
3. The method as described in claim 2, characterized in that, One or more of the correction information blocks are located in the same correction table, and the correction information blocks located in the same correction table have consecutive storage addresses; the descriptor specifically specifies the storage address of each correction information block by specifying the storage address of the correction table and the number of correction information blocks included in the correction table.
4. The method as described in claim 3, characterized in that, The data structure of the descriptor includes a correction table quantity field and a first quantity of correction table fields. The first quantity of correction table fields have a sequential order. Each correction table field is used to specify the storage address of one of the correction tables and the number of correction information blocks included in the correction table. The correction table quantity field is used to specify the number of correction table fields actually used in the descriptor. After reading the descriptor, the storage addresses of each correction information block specified by the descriptor are obtained by the following method; According to the order of the fields in the correction table, starting from the first field, the storage address of the correction table and the number of corresponding correction information blocks specified by each field are traversed sequentially. Based on the index address of the correction table obtained by traversal and the number of correction information blocks included in the correction table, the storage address of each correction information block in each correction table is determined sequentially. The iteration operation stops once the number of fields in the correction table reached the value of the correction table quantity field.
5. The method as described in claim 2, characterized in that, The correction information block includes a total information block and a correction position block. The correction position block is used to specify the correction position of the target template block. The total information block is used to specify the template start position, template block size, correction value, and storage address of the correction position block of the target template block. The step of reading the correction information block from the second storage area according to the storage address specified by the descriptor includes: The total information block is read from the second storage area according to the storage address specified by the descriptor, and the correction location block is read from the third storage area according to the storage address specified by the total information block.
6. The method as described in claim 5, characterized in that, The data structure of the correction position block includes multiple position fields in sequence, each position field is used to specify one of the correction positions of the target template block, and the total information block is also used to specify the number of position fields in the correction position block that are actually used to specify the correction positions; After reading the correction position block, the correction position specified by the correction information block is obtained using the following method: According to the order of the position fields in the correction position block, the correction positions specified by each position field are traversed sequentially; The iteration stops once the number of position fields traversed reaches the number of position fields specified by the correction information block.
7. The method as described in claim 2, characterized in that, When the target control page list includes multiple control pages, the descriptor is further used to specify the starting storage address of the target control page list, the number of control pages included in the target control page list, and the storage address of each control page; After constructing the target control page linked list, the method further includes: The starting storage address of the target control page list specified by the descriptor, the number of control pages included in the target control page list, and the storage address of each control page are returned to the object that needs to execute the target control page list.
8. The method as described in claim 1, characterized in that, The step of replacing the target template block in the initial control page list with the corrected target template block includes: After the first target template block is corrected, the replacement operation of the target template block is paused, and the process continues to wait for one or more second target template blocks that are corrected after the first target template block. If the first target template block and the second target template block are consecutive target template blocks in the initial control page linked list, then the corrected first target template block and the second target template block are aggregated into an aggregated target template, and a target template block replacement operation is performed based on the aggregated target template.
9. The method as described in claim 1, characterized in that, When the target template block has multiple correction positions, the target template block is corrected, including: Based on the correction information block specified by the construction command, the multiple correction positions are corrected in parallel.
10. A control page linked list construction device based on a control page linked list template, characterized in that, The control page linked list template is divided into multiple template blocks; the device includes: The host configuration unit is used to receive a build command issued by the host. The build command is used to specify the correction information block of the target template block that needs to be corrected in the control page linked list template. The correction information block includes the template block start position, template block size, correction position, and correction value corresponding to each correction position of the target template block. The template reading unit is used to retrieve the target template block from the control page linked list template, starting from the beginning position of the template and according to the size of the template block; A template correction unit is used to correct the content at each correction position in the target template block to the correction value corresponding to the correction position. A construction unit is used to construct a control page linked list based on the corrected target template block. Before the host issues the construction command, the control page linked list template is copied to a specified location to obtain an initial control page linked list at that specified location. The correction information block is also used to specify the storage address of the target template block in the initial control page linked list. When constructing the control page linked list based on the corrected target template block, the corrected target template block is used to replace the target template block in the initial control page linked list according to the storage address specified by the correction information block, so as to construct the required target control page linked list from the initial control page linked list.
11. The apparatus as claimed in claim 10, characterized in that, The construction command is specifically used to specify the storage address of the descriptor, and the descriptor is used to specify the storage address of the correction information block; The device further includes a read descriptor unit and a read correction information unit, wherein: The read descriptor unit is used to read the descriptor from the first storage area according to the storage address specified by the build command; The read correction information unit is used to read the correction information block from the second storage area according to the storage address specified by the descriptor.
12. The apparatus as claimed in claim 11, characterized in that, The correction information block includes a total information block and a correction position block. The correction position block is used to specify the correction position of the target template block. The total information block is used to specify the template start position, template block size, correction value, and storage address of the correction position block of the target template block. The read correction information unit specifically includes a total information block read unit, a correction position block read unit, a correction value buffer, a first word buffer, and a correction position buffer, wherein: The total information block reading unit is used to read the total information block from the second storage area according to the storage address specified by the descriptor, and save the storage address of the template start position, the template block size and the correction position block specified by the total information block to the first word buffer, and save the correction value specified by the total information block to the correction value buffer; The correction position block reading unit is used to read the correction position block from the third storage area based on the storage address of the correction position block in the first word buffer, and save the correction position specified by the correction position block to the correction position buffer.
13. The apparatus as claimed in claim 12, characterized in that, The template correction unit is specifically used to correct the target template block based on the information in the correction value buffer, the first character buffer, and the correction position buffer.
14. The apparatus as claimed in claim 10, characterized in that, The control page linked list template is copied to a specified location to obtain an initial control page linked list located at the specified location. The correction information block is also used to specify the storage address of the target template block in the initial control page linked list. The construction unit is specifically used to replace the target template block in the initial control page linked list with the corrected target template block according to the storage address of the target template block specified by the correction information block in the initial control page linked list, so as to construct the required target control page linked list from the initial control page linked list.
15. The apparatus as claimed in claim 14, characterized in that, The device further includes an aggregation information buffer. The template correction unit is specifically used to save the corrected target template block to the aggregation information buffer. The construction unit is specifically used to determine whether the first target template block and the second target template block in the aggregation information buffer are consecutive target template blocks in the initial control page linked list. If so, the corrected first target template block and the second target template block are aggregated into an aggregated target template, and a target template block replacement operation is performed based on the aggregated target template.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 9.
17. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory being used to store a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Method and system for constructing control page chain table, storage medium and equipment
CN114048149A
Data transmission method, and storage controller and list management circuit using the same
US20180052634A1