Storage space adjustment method, device, storage medium and electronic device

By detecting the read and write performance parameters of the disk array card and dynamically adjusting the storage space, the problem of low upgrade efficiency of disk array card is solved, the upgrade efficiency and overall performance are improved, and data integrity is ensured.

CN118708135BActive Publication Date: 2025-01-03SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411210911.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-01-03
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Disk array cards are inefficient during upgrades, resulting in insufficient cache space, which may lead to data loss or inconsistency, and will not meet the optimal performance requirements under high loads.

Method used

By detecting the current read and write performance parameters of the disk array card, the capacity of the first storage space is dynamically adjusted, and the second storage space is used to allocate or free up the storage space for the first storage space, ensuring that the firmware files are updated in the target flash space, and improving the disk array Card upgrade efficiency.

Benefits of technology

Improves the firmware update efficiency of disk array cards, reduces the impact on user I/O, optimizes overall performance, and ensures data integrity and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708135B_ABST
    Figure CN118708135B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a storage space adjustment method, device, storage medium and electronic device, wherein the method includes: receiving a firmware update request; responding to the firmware update request, detecting the target performance parameter of the disk array card; detecting the target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate the target adjustment direction and target storage capacity of the first storage space; adjusting the first storage space using the second storage space according to the target adjustment parameter to obtain a target memory space divided into a third storage space and a fourth storage space; storing the target firmware file corresponding to the firmware update request in the third storage space. Through the present application, the problem of low efficiency of disk array card upgrade is solved, thereby achieving the effect of improving the efficiency of disk array card upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a method, device, storage medium, and electronic device for adjusting storage space. Background Art

[0002] At present, general disk array cards will divide a fixed memory space in the memory space as cache space. In the scenario of disk array card firmware upgrade, part of the cache space will be occupied, resulting in the cache space being unable to meet the optimal performance requirements under the workload. For example, when the disk array card is under high load, if the cache space is insufficient to handle concurrent access requests, data loss or inconsistency may occur, thereby endangering the integrity and consistency of the data.

[0003] In view of the problems in the related art, such as low efficiency of disk array card upgrade, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a storage space adjustment method, device, storage medium and electronic device to at least solve the problem of low efficiency of disk array card upgrade in the related art.

[0005] According to an embodiment of the present application, a storage space adjustment method is provided, which is applied to a processor deployed in a disk array card, wherein the disk array card includes a target memory space and a target flash memory space, wherein the target memory space is divided into a first storage space and a second storage space, wherein the first storage space is used to receive a firmware file of the disk array card and send a verified firmware file to the target flash memory space, wherein the target flash memory space is used to update the firmware of the disk array card using the firmware file, and wherein the method includes:

[0006] receiving a firmware update request, wherein the firmware update request is used to request to perform a firmware update operation on the disk array card;

[0007] In response to the firmware update request, detecting a target performance parameter of the disk array card, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at a current moment;

[0008] detecting a target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate a target adjustment direction and a target storage capacity of the first storage space;

[0009] adjusting the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space;

[0010] The target firmware file corresponding to the firmware update request is stored in the third storage space, wherein the third storage space is used to receive the target firmware file and send the verified target firmware file to the target flash memory space.

[0011] In an exemplary embodiment, the detecting the target performance parameter of the disk array card includes: controlling a monitoring tool to obtain the number of read and write times per second, bandwidth parameter and delay parameter of the disk array card at the current moment, wherein the monitoring tool is used to call an application programming interface provided by a driver of the disk array card to obtain the number of read and write times per second, the bandwidth parameter and the delay parameter of the disk array card; and receiving the number of read and write times per second, the bandwidth parameter and the delay parameter of the disk array card transmitted by the monitoring tool as the target performance parameter of the disk array card.

[0012] In an exemplary embodiment, detecting the target adjustment parameter of the first storage space according to the target performance parameter includes: detecting the performance change rate of the first storage space according to the target performance parameter and the initial performance parameter of the disk array card, wherein the initial performance parameter is used to indicate the read and write performance of the disk array card at the previous moment of the current moment, and the performance change rate is used to indicate the change speed of the read and write performance of the disk array card within a unit time; detecting the target adjustment direction and the target storage capacity of the first storage space as the target adjustment parameter according to the performance change rate and the initial storage capacity of the first storage space, wherein the initial storage capacity is used to indicate the size of the first storage space at the current moment.

[0013] In an exemplary embodiment, detecting the performance change rate of the first storage space based on the target performance parameter and the initial performance parameter of the disk array card includes: acquiring the initial performance parameter of the disk array card; inputting the target performance parameter and the initial performance parameter into a target detection model to obtain the performance change rate output by the target detection model, wherein the target detection model is used to detect the target read-write performance corresponding to the target performance parameter based on the linear relationship between the performance parameter and the read-write performance, and calculate the change rate of the target read-write performance relative to the initial read-write performance as the performance change rate for output, and the initial read-write performance is the read-write performance corresponding to the initial performance parameter obtained by detecting the linear relationship between the performance parameter and the read-write performance at the previous moment.

[0014] In an exemplary embodiment, before inputting the target performance parameter and the initial performance parameter into the target detection model to obtain the performance change rate output by the target detection model, the method further includes: obtaining a training data set of the disk array card, wherein the training data set includes historical performance parameters of the disk array card at multiple historical moments and the read and write performance of the disk array card at each of the multiple historical moments; and constructing an initial detection model by the following formula: ,in, It is used to indicate the linear relationship between the performance parameter of the disk array card and the read / write performance, where I is the read / write performance of the disk array card, is the initial value of the read and write performance of the disk array card, to is the performance parameter of the disk array card, to is the coefficient corresponding to the performance parameter of the disk array card, t is a historical moment, and t-1 is the moment before the historical moment; the initial detection model is trained using the training data set until the coefficient corresponding to each performance parameter in the initial detection model is obtained, and the initial detection model with the coefficient corresponding to each performance parameter determined is determined as the target detection model.

[0015] In an exemplary embodiment, detecting the target adjustment direction and the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity of the first storage space as the target adjustment parameters includes: detecting the initial storage capacity of the first storage space; detecting the target adjustment direction of the first storage space according to the performance change rate, and calculating the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity, wherein the target adjustment direction is used to indicate releasing storage space for the first storage space or allocating storage space for the first storage space, and the target storage capacity is proportional to the performance change rate.

[0016] In an exemplary embodiment, detecting the target adjustment direction of the first storage space according to the performance change rate includes: when the performance change rate is greater than 0, determining that the target adjustment direction is to allocate storage space to the first storage space; when the performance change rate is less than or equal to 0, determining that the target adjustment direction is to release storage space in the first storage space; calculating the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity includes: substituting the performance change rate and the initial storage capacity into the following formula to calculate the target storage capacity C: ,in, is the initial storage capacity, and R is the performance change rate.

[0017] In an exemplary embodiment, the method of adjusting the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into third storage space and fourth storage space includes: detecting the adjustment amount of the first storage space according to the initial storage capacity of the first storage space and the target storage capacity, wherein the initial storage capacity is used to indicate the size of the first storage space at the current moment, and the adjustment amount is equal to the difference between the initial storage capacity and the target storage capacity; when the target adjustment parameter is used to indicate the use of the second storage space to allocate storage space to the first storage space, using the second storage space to allocate the storage space of the adjustment amount to the first storage space, to obtain the target memory space divided into the third storage space and the fourth storage space. The target memory space is divided into three storage spaces and the fourth storage space, wherein the third storage space is the first storage space with the storage space of the adjustment amount added, and the fourth storage space is the second storage space with the storage space of the adjustment amount released; when the target adjustment parameter is used to indicate the use of the second storage space to release storage space for the first storage space, the second storage space is used to release the storage space of the adjustment amount for the first storage space, so as to obtain the target memory space divided into the third storage space and the fourth storage space, wherein the third storage space is the first storage space with the storage space of the adjustment amount released, and the fourth storage space is the second storage space with the storage space of the adjustment amount added.

[0018] In an exemplary embodiment, when the target adjustment parameter is used to indicate the use of the second storage space to allocate storage space for the first storage space, the second storage space is used to allocate the adjustment amount of storage space to the first storage space, so as to obtain the target memory space divided into the third storage space and the fourth storage space, including: calling an allocation function to allocate the adjustment amount of storage space to the first storage space, wherein the allocation function includes the adjustment amount; merging the adjustment amount of storage space allocated to the first storage space and the first storage space into the third storage space, so as to obtain the target memory space divided into the third storage space and the fourth storage space.

[0019] In an exemplary embodiment, when the target adjustment parameter is used to indicate the use of the second storage space to release storage space for the first storage space, the second storage space is used to release the storage space of the adjustment amount for the first storage space, and the target memory space divided into the third storage space and the fourth storage space is obtained, including: detecting the target starting address of the storage space of the adjustment amount allowed to be released in the first storage space; calling a release function to release the storage space of the adjustment amount from the first storage space, wherein the release function carries the adjustment amount and the target starting address of the storage space to be released in the first storage space; and determining the first storage space from which the storage space of the adjustment amount is released as the third storage space, and obtaining the target memory space divided into the third storage space and the fourth storage space.

[0020] In an exemplary embodiment, before detecting the target adjustment parameters of the first storage space according to the target performance parameters, the method further includes: defining a node structure and a least recently used cache structure, wherein the node structure is used to define the first storage space and the second storage space divided in the target memory space, and the least recently used cache structure is used to select a storage space with a usage frequency less than a frequency threshold to perform a release operation when the storage space in the target memory space needs to be released; calling an initialize least recently used cache function to create the first storage space in the target memory space, wherein the initialize least recently used cache function carries the memory amount of the first storage space and pointers to the head and tail of a linked list of the first storage space.

[0021] According to another embodiment of the present application, a storage space adjustment device is provided, which is applied to a processor deployed in a disk array card, wherein the disk array card includes a target memory space and a target flash memory space, wherein the target memory space is divided into a first storage space and a second storage space, wherein the first storage space is used to receive a firmware file of the disk array card and send a verified firmware file to the target flash memory space, wherein the target flash memory space is used to update the firmware of the disk array card using the firmware file, wherein the device includes:

[0022] A receiving module, used for receiving a firmware update request, wherein the firmware update request is used for requesting to perform a firmware update operation on the disk array card;

[0023] A first detection module, configured to respond to the firmware update request and detect a target performance parameter of the disk array card, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at a current moment;

[0024] a second detection module, configured to detect a target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate a target adjustment direction and a target storage capacity of the first storage space;

[0025] an adjustment module, configured to adjust the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space;

[0026] The storage module is used to store the target firmware file corresponding to the firmware update request in the third storage space, wherein the third storage space is used to receive the target firmware file and send the verified target firmware file to the target flash memory space.

[0027] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0028] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0029] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0030] Through the present application, a firmware update request is received, wherein the firmware update request is used to request a firmware update operation to be performed on a disk array card; in response to the firmware update request, a target performance parameter of the disk array card is detected, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at the current moment; a target adjustment parameter of the first storage space is detected according to the target performance parameter, wherein the target adjustment parameter is used to indicate the target adjustment direction and target storage capacity of the first storage space; the first storage space is adjusted using the second storage space according to the target adjustment parameter to obtain a target memory space divided into a third storage space and a fourth storage space; the target firmware file corresponding to the firmware update request is stored in the third storage space, wherein the third storage space is used to receive the target firmware file and send the target firmware file that has passed the validation to the target flash memory space. That is, the first storage space is adjusted according to the read and write performance of the disk array card at the current moment, so that the third storage space allows the firmware file of the disk array card to be received and the firmware file that has passed the validation to be sent to the target flash memory space, thereby solving the problem of low efficiency of upgrading the disk array card and achieving the effect of improving the upgrade efficiency of the disk array card. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a hardware structure block diagram of a server device of a storage space adjustment method according to an embodiment of the present application;

[0032] Figure 2 is a flow chart of a method for adjusting storage space according to an embodiment of the present application;

[0033] Figure 3 is a flowchart of a training process of an initial detection model according to an embodiment of the present application;

[0034] Figure 4 is a schematic diagram of a storage space management method according to an embodiment of the present application;

[0035] Figure 5 is a schematic diagram of a firmware upgrade process according to an embodiment of the present application;

[0036] Figure 6 is a schematic diagram of a target memory space adjustment process according to an embodiment of the present application;

[0037] Figure 7 is a schematic diagram of an interaction process between a RAID card and a host according to an embodiment of the present application;

[0038] Figure 8 is a flowchart of a firmware upgrade process according to an embodiment of the present application;

[0039] Fig. 9 is a structural block diagram of a storage space adjustment device according to an embodiment of the present application;

[0040] Fig.10 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0043] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a storage space adjustment method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0044] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the storage space adjustment method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0046] In order to enable those skilled in the art to better understand the storage space adjustment method proposed in the present application, the disk array card and the firmware upgrade scenario of the disk array card are introduced as follows:

[0047] Disk array card: The disk array card combines multiple independent physical hard disks in different ways to form a logical hard disk to improve storage performance and data redundancy technology, as well as to achieve faster I / O (Input / Output) processing.

[0048] Firmware Update: Firmware update is the process of updating a device's software program by installing a new firmware version. Firmware updates can also improve device functionality, fix vulnerabilities and bugs, and introduce new features.

[0049] In the related art, when updating the disk array card firmware online, it is necessary for the host side to complete the issuance of the firmware update command and the download process of the firmware file online, and send it to the disk array card through NVMe (Non Volatile Memory Express, non-volatile memory host controller interface specification) command sub-packaging, and the disk array card stores the firmware file in the cache space (i.e., the first storage space) in the target memory space of the disk array card. After the integrity check and signature verification process in the cache space, the firmware file is written from the cache space to the target flash memory space of the disk array card to complete the firmware update process of the disk array card.

[0050] When users send I / O through the logical hard disk of the disk array card combination, it will pass through the disk array card cache space and then to the actual physical hard disk. When the disk array card's online firmware is upgraded, it will also pass through the cache space and then be written to the corresponding non-volatile media. This may cause the disk array card's read and write cache to be unable to simultaneously meet the optimal performance requirements under the workload. This means that if the cache space is set too small, performance may be degraded and the acceleration effect provided by the cache cannot be fully utilized; conversely, if the cache space is set too large, resources will be wasted and the cache space may be overfilled, increasing latency.

[0051] In order to solve the above problems and reduce the impact of the disk array card firmware update on the user I / O, the storage space adjustment method proposed in the present application uses the read and write performance of the disk array card at the current moment to dynamically adjust the cache in real time during the firmware update process, thereby maximizing the I / O read and write performance of the disk array card during the firmware update and reducing the impact of the firmware update on the user's business. At the same time, since the read and write cache size of the disk array card is dynamically adjusted, it can be optimized according to the actual situation to improve the overall performance of the disk array card.

[0052] In this embodiment, a storage space adjustment method is provided, which is applied to a processor deployed in a disk array card. The disk array card includes a target memory space and a target flash memory space. The target memory space is divided into a first storage space and a second storage space. The first storage space is used to receive a firmware file of the disk array card and send a verified firmware file to the target flash memory space. The target flash memory space is used to update the firmware of the disk array card using the firmware file. Figure 2 is a flow chart of a method for adjusting storage space according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0053] Step S202, receiving a firmware update request, wherein the firmware update request is used to request to perform a firmware update operation on the disk array card;

[0054] Step S204, responding to the firmware update request, detecting a target performance parameter of the disk array card, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at the current moment;

[0055] Step S206, detecting a target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate a target adjustment direction and a target storage capacity of the first storage space;

[0056] Step S208, adjusting the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space;

[0057] Step S210: storing the target firmware file corresponding to the firmware update request in the third storage space, wherein the third storage space is used to receive the target firmware file and send the verified target firmware file to the target flash memory space.

[0058] Through the above steps, a firmware update request is received, wherein the firmware update request is used to request a firmware update operation to be performed on a disk array card; in response to the firmware update request, a target performance parameter of the disk array card is detected, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at the current moment; a target adjustment parameter of the first storage space is detected according to the target performance parameter, wherein the target adjustment parameter is used to indicate the target adjustment direction and target storage capacity of the first storage space; the first storage space is adjusted using the second storage space according to the target adjustment parameter to obtain a target memory space divided into a third storage space and a fourth storage space; the target firmware file corresponding to the firmware update request is stored in the third storage space, wherein the third storage space is used to receive the target firmware file and send the target firmware file that has passed the validation to the target flash memory space. That is, the first storage space is adjusted according to the read and write performance of the disk array card at the current moment, so that the third storage space allows the firmware file of the disk array card to be received and the firmware file that has passed the validation to be sent to the target flash memory space, thereby solving the problem of low efficiency of upgrading the disk array card and achieving the effect of improving the upgrade efficiency of the disk array card.

[0059] In the technical solution provided in the above step S202, the above first storage space is a cache space divided from the target memory space, the firmware file of the disk array card is received through the cache space and the verified firmware file is sent to the storage space of the target flash memory space.

[0060] Optionally, in this embodiment, the above-mentioned firmware update request can be but is not limited to being sent to the processor in the disk array card in various situations, such as: when the user chooses to check for updates and install firmware updates released by the manufacturer through the operating system or a dedicated software interface, a firmware update request is generated and sent to the processor in the disk array card; the disk array card is set to automatically check and download firmware updates, once a new version is detected, the disk array card automatically downloads it and generates a firmware update request and sends it to the processor in the disk array card when the configured time is reached, etc.

[0061] In the technical solution provided in the above step S204, one or more performance parameters indicating the read and write performance of the disk array card at the current moment may be detected but is not limited to being used as target performance parameters. The target performance parameters may include but are not limited to: the number of I / O requests processed by the disk array card per unit time, the average amount of data read and written by the disk array card per unit time, the speed at which the disk array card processes a single I / O request, etc.

[0062] Optionally, in this embodiment, one or more performance parameters indicating the read and write performance of the disk array card at the current moment can be detected in a variety of ways, but not limited to, such as: using a performance monitoring tool built into the operating system to collect the performance parameters of the disk array card; using a third-party performance monitoring tool to collect the performance parameters of the disk array card; real-time monitoring of performance parameters through an API (Application Programming Interface) interface provided by the operating system, etc.

[0063] In an exemplary embodiment, the target performance parameters of the disk array card can be detected in the following manner but is not limited to: controlling a monitoring tool to obtain the number of read and write times per second, bandwidth parameters and delay parameters of the disk array card at the current moment, wherein the monitoring tool is used to call an application programming interface provided by a driver of the disk array card to obtain the number of read and write times per second, the bandwidth parameters and the delay parameters of the disk array card; and receiving the number of read and write times per second, the bandwidth parameters and the delay parameters of the disk array card transmitted by the monitoring tool as the target performance parameters of the disk array card.

[0064] Optionally, in this embodiment, the monitoring tool may be, but is not limited to, a performance monitoring tool built into the operating system, or may be a third-party performance monitoring tool, etc.

[0065] Optionally, in this embodiment, the IOPS (Input / Output Operations Per Second), bandwidth parameters and latency parameters of the disk array card at the current moment are obtained through a monitoring tool as target performance parameters of the disk array card.

[0066] In the technical solution provided in the above step S206, the storage performance of the first storage space at the current moment can be detected according to the target performance parameter, and then the storage performance of the first storage space at the current moment is compared with the storage performance of the first storage space at the previous moment to determine the adjustment direction and adjustment amount of the first storage space to obtain the target adjustment parameter. Alternatively, the storage performance of the first storage space at the current moment obtained by detecting the target performance parameter can be compared with a set performance threshold to determine the adjustment direction and adjustment amount of the first storage space to obtain the target adjustment parameter, for example: when the storage performance of the first storage space at the current moment is less than or equal to the set first performance threshold, the adjustment direction is determined to allocate storage space for the first storage space, and the adjustment amount of the first storage space is determined according to the difference between the storage performance of the first storage space at the current moment and the first performance threshold; when the storage performance of the first storage space at the current moment is greater than or equal to the set second performance threshold, the adjustment direction is determined to release the storage space in the first storage space, and the adjustment amount of the first storage space is determined according to the difference between the storage performance of the first storage space at the current moment and the second performance threshold, etc. It should be noted that the first performance threshold is less than the second performance threshold.

[0067] Optionally, in this embodiment, the adjustment amount of the first storage space can be represented by but not limited to the size of the target adjustment parameter, and the adjustment direction of the first storage space can be represented by the positive and negative directions of the target adjustment parameter. For example: when the target adjustment parameter is +A, the adjustment amount of the first storage space is determined to be A, and the adjustment direction of the first storage space is to allocate storage space to the first storage space; or, when the target adjustment parameter is -B, the adjustment amount of the first storage space is determined to be B, and the adjustment direction of the first storage space is to release storage space in the first storage space, etc.

[0068] In an exemplary embodiment, the target adjustment parameter of the first storage space can be detected according to the target performance parameter in the following manner, but is not limited to: detecting the performance change rate of the first storage space according to the target performance parameter and the initial performance parameter of the disk array card, wherein the initial performance parameter is used to indicate the read and write performance of the disk array card at the previous moment before the current moment, and the performance change rate is used to indicate the change speed of the read and write performance of the disk array card within a unit time; detecting the target adjustment direction and the target storage capacity of the first storage space as the target adjustment parameter according to the performance change rate and the initial storage capacity of the first storage space, wherein the initial storage capacity is used to indicate the size of the first storage space at the current moment.

[0069] Optionally, in this embodiment, the initial performance parameter can be calculated based on the read and write times per second, bandwidth parameters and delay parameters of the disk array card at the last moment, but is not limited to, for example, the sum of the read and write times per second, bandwidth parameters and delay parameters of the disk array card at the last moment is calculated as the initial performance parameter. Alternatively, the weighted sum of the read and write times per second, bandwidth parameters and delay parameters of the disk array card at the last moment is calculated as the initial performance parameter, etc.

[0070] Optionally, in this embodiment, the calculation of the target performance parameter according to the current read / write times per second, bandwidth parameter and delay parameter of the disk array card may include, but is not limited to: calculating the sum of the current read / write times per second, bandwidth parameter and delay parameter of the disk array card as the target performance parameter. Alternatively, calculating the weighted sum of the current read / write times per second, bandwidth parameter and delay parameter of the disk array card as the target performance parameter, etc.

[0071] Optionally, in this embodiment, detecting the performance change rate of the first storage space according to the target performance parameter and the initial performance parameter of the disk array card may include, but is not limited to: calculating the change value of the target performance parameter compared to the initial performance parameter as the performance change rate of the first storage space. Alternatively, calculating the ratio of the change value of the target performance parameter compared to the initial performance parameter to the initial performance parameter as the performance change rate of the first storage space.

[0072] Optionally, in this embodiment, detecting the adjustment direction and adjustment amount of the first storage space based on the performance change rate and the first memory capacity of the first storage space as target adjustment parameters may include but is not limited to: when the performance change rate is a positive value, determining that the adjustment direction of the first storage space is to release storage space from the first storage space; when the performance change rate is a negative value, determining that the adjustment direction of the first storage space is to allocate storage space to the first storage space; determining the adjustment amount of the first storage space based on the performance change rate and the first storage space, etc.

[0073] In an exemplary embodiment, the performance change rate of the first storage space can be detected according to the target performance parameter and the initial performance parameter of the disk array card in the following manner, but is not limited to: obtaining the initial performance parameter of the disk array card; inputting the target performance parameter and the initial performance parameter into a target detection model to obtain the performance change rate output by the target detection model, wherein the target detection model is used to detect the target read-write performance corresponding to the target performance parameter according to the linear relationship between the performance parameter and the read-write performance, and calculate the change rate of the target read-write performance relative to the initial read-write performance as the performance change rate for output, and the initial read-write performance is the read-write performance corresponding to the initial performance parameter obtained by detecting the linear relationship between the performance parameter and the read-write performance at the previous moment.

[0074] Optionally, in this embodiment, the target detection model can be, but is not limited to, describing the linear relationship between performance parameters and read / write performance based on linear equations, and the linear equations can be, but are not limited to, including: simple linear regression, multivariate linear regression, a system of linear algebraic equations, linear algebra, etc.

[0075] In an exemplary embodiment, before inputting the target performance parameter and the initial performance parameter into the target detection model to obtain the performance change rate output by the target detection model, the target detection model may be obtained in the following manner, but is not limited to: obtaining a training data set of the disk array card, wherein the training data set includes historical performance parameters of the disk array card at multiple historical moments and the read and write performance of the disk array card at each of the multiple historical moments; and constructing an initial detection model by the following formula: ,in, It is used to indicate the linear relationship between the performance parameter of the disk array card and the read / write performance, where I is the read / write performance of the disk array card, is the initial value of the read and write performance of the disk array card, to is the performance parameter of the disk array card, to is the coefficient corresponding to the performance parameter of the disk array card, t is a historical moment, and t-1 is the moment before the historical moment; the initial detection model is trained using the training data set until the coefficient corresponding to each performance parameter in the initial detection model is obtained, and the initial detection model with the coefficient corresponding to each performance parameter determined is determined as the target detection model.

[0076] Optionally, in this embodiment, the coefficient of each performance parameter in the initial detection model is trained by training the training data set, and the coefficient of the performance parameter can be used, but is not limited to, to indicate the influence of each performance parameter on the performance change rate.

[0077] In an exemplary embodiment, an example of a training process of an initial detection model is provided. Figure 3 is a flowchart of a training process of an initial detection model according to an embodiment of the present application, such as Figure 3 As shown, the initial detection model can be trained through, but is not limited to, the following process until the target detection model is obtained:

[0078] Step S302: Collect the IOPS, bandwidth, latency, etc. of the disk array card in historical time. It should be noted that the data in the training data set needs to be as comprehensive and accurate as possible to improve the accuracy of the prediction;

[0079] Step S304: preprocessing the collected IOPS, bandwidth, latency and other parameters, including removing outliers, filling missing data, normalizing data and other operations to obtain a training data set, and selecting the IOPS, bandwidth and latency of the disk array card in historical time as the performance parameters of the disk array card;

[0080] Step S306: Constructing an initial detection model ,in, , I is the read and write performance of the disk array card, is the initial value of the read and write performance of the disk array card. is the IOPS of the disk array card, is the bandwidth of the disk array card, is the delay of the disk array card, t is a historical moment in the historical time, t-1 is the previous moment of the historical moment, It is the coefficient corresponding to the IOPS of the disk array card, which is used to indicate the impact of IOPS on the performance change rate. It is the coefficient corresponding to the bandwidth of the disk array card, which is used to indicate the influence of bandwidth on the performance change rate. It is the coefficient corresponding to the delay of the disk array card, which is used to indicate the influence of the delay on the performance change rate;

[0081] Step S308: Use the training data set to train the initial detection model until the coefficient corresponding to each performance parameter is determined (i.e. , and ) to obtain the target detection model.

[0082] It is worth noting that the collection of historical performance data of RAID cards depends on different scenarios of RAID cards. It is necessary to pre-process the data in combination with specific I / O scenarios and historical experience to ensure that the data is as comprehensive and accurate as possible, and use the coefficients of the features to train the linear regression model. The coefficients of the model can be determined by the residual sum of squares between the actual observation value and the model prediction value using, but not limited to, the least squares regression analysis method. Other regression analysis methods that can be implemented can also be used to determine the coefficients.

[0083] In an exemplary embodiment, the target adjustment direction and the target storage capacity of the first storage space can be detected as the target adjustment parameters based on the performance change rate and the initial storage capacity of the first storage space in the following manner but is not limited to: detecting the initial storage capacity of the first storage space; detecting the target adjustment direction of the first storage space based on the performance change rate, and calculating the target storage capacity of the first storage space based on the performance change rate and the initial storage capacity, wherein the target adjustment direction is used to indicate releasing storage space for the first storage space or allocating storage space for the first storage space, and the target storage capacity is proportional to the performance change rate.

[0084] Optionally, in this embodiment, the size of the current storage space of the first storage space is detected as the initial storage capacity of the first storage space. The above performance change rate is used to indicate the change of the storage performance of the first storage space at the current moment compared with the storage performance at the previous moment. When the performance change rate is greater than 0, it is considered that the storage performance of the first storage space at the current moment has improved compared with the storage performance at the previous moment; when the performance change rate is less than 0, it is considered that the storage performance of the first storage space at the current moment has decreased compared with the storage performance at the previous moment.

[0085] Optionally, in this embodiment, detecting the target adjustment direction of the first storage space based on the performance change rate may include but is not limited to: when the performance change rate is greater than or equal to a first threshold, determining the target adjustment direction as allocating storage space to the first storage space; when the performance change rate is less than or equal to a second threshold, determining the target adjustment direction as releasing storage space in the first storage space, and the first threshold is greater than the second threshold; or, when the performance change rate is greater than or equal to 0, determining the target adjustment direction as allocating storage space to the first storage space; when the performance change rate is less than 0, determining the target adjustment direction as releasing storage space in the first storage space.

[0086] Optionally, in this embodiment, calculating the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity may include but is not limited to: calculating the sum of the initial storage capacity and the product of the performance change rate and the initial storage capacity as the target storage capacity, etc.

[0087] In an exemplary embodiment, the target adjustment direction of the first storage space may be detected according to the performance change rate in the following manner, but is not limited to: when the performance change rate is greater than 0, determining the target adjustment direction is to allocate storage space to the first storage space; when the performance change rate is less than or equal to 0, determining the target adjustment direction is to release storage space in the first storage space; calculating the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity includes: substituting the performance change rate and the initial storage capacity into the following formula to calculate the target storage capacity C: ,in, is the initial storage capacity, and R is the performance change rate.

[0088] Optionally, in this embodiment, the I / O performance index is monitored in real time, the I / O performance index is input into the trained target detection model, and the corresponding performance change rate is output through the target detection model. The target storage capacity of the disk array card is detected in real time according to the performance change rate, and the storage capacity of the disk array card is dynamically adjusted to achieve balanced read and write performance of the disk array card.

[0089] In the technical solution provided in the above step S208, the first storage space can be adjusted using the second storage space according to the target adjustment direction and target storage capacity indicated by the target adjustment parameter to obtain a target memory space divided into a third storage space and a fourth storage space.

[0090] In an exemplary embodiment, the first storage space can be adjusted using the second storage space according to the target adjustment parameter to obtain the target memory space divided into the third storage space and the fourth storage space in the following manner but is not limited to: detecting the adjustment amount of the first storage space according to the initial storage capacity of the first storage space and the target storage capacity, wherein the initial storage capacity is used to indicate the size of the first storage space at the current moment, and the adjustment amount is equal to the difference between the initial storage capacity and the target storage capacity; when the target adjustment parameter is used to indicate the use of the second storage space to allocate storage space to the first storage space, using the second storage space to allocate the storage space of the adjustment amount to the first storage space to obtain the target memory space divided into the third storage space and the fourth storage space. The target memory space of the third storage space and the fourth storage space, wherein the third storage space is the first storage space with the storage space of the adjustment amount added, and the fourth storage space is the second storage space with the storage space of the adjustment amount released; in a case where the target adjustment parameter is used to indicate the use of the second storage space to release storage space for the first storage space, the second storage space is used to release the storage space of the adjustment amount for the first storage space, thereby obtaining the target memory space divided into the third storage space and the fourth storage space, wherein the third storage space is the first storage space with the storage space of the adjustment amount released, and the fourth storage space is the second storage space with the storage space of the adjustment amount added.

[0091] Optionally, in this embodiment, the difference between the initial storage capacity and the target storage capacity is calculated as the adjustment amount of the first storage space, and storage space is allocated to the first storage space according to the adjustment amount, or storage space is released from the first storage space. For example: when the target adjustment parameter is less than 0, the second storage space is used to allocate storage space for the adjustment amount to the first storage space, the first storage space to which the storage space for the adjustment amount is added is determined as the third storage space, and the storage space remaining in the target storage space is determined as the fourth storage space; when the target adjustment parameter is greater than 0, the second storage space is used to release storage space for the first storage space by the adjustment amount, the first storage space to which the storage space for the adjustment amount is released is determined as the third storage space, and the storage space remaining in the target storage space is determined as the fourth storage space.

[0092] In an exemplary embodiment, the following method can be used, but is not limited to, in a case where the target adjustment parameter is used to indicate the use of the second storage space to allocate storage space for the first storage space, to allocate storage space of the adjustment amount to the first storage space using the second storage space, thereby obtaining the target memory space divided into the third storage space and the fourth storage space: calling an allocation function to allocate storage space of the adjustment amount to the first storage space, wherein the allocation function includes the adjustment amount; merging the storage space of the adjustment amount allocated to the first storage space and the first storage space into the third storage space, thereby obtaining the target memory space divided into the third storage space and the fourth storage space.

[0093] Optionally, in this embodiment, it is possible but not limited to requesting the second storage space to release the adjusted amount of storage space through an allocation function, and adding the adjusted amount of storage space released by the second storage space to the first storage space to obtain the third storage space.

[0094] In an exemplary embodiment, the following method can be used, but is not limited to, in a case where the target adjustment parameter is used to indicate the use of the second storage space to release storage space for the first storage space, to use the second storage space to release the storage space of the adjustment amount for the first storage space, so as to obtain the target memory space divided into the third storage space and the fourth storage space: detecting the target starting address of the storage space of the adjustment amount allowed to be released in the first storage space; calling a release function to release the storage space of the adjustment amount from the first storage space, wherein the release function carries the adjustment amount and the target starting address of the storage space to be released in the first storage space; determining the first storage space from which the storage space of the adjustment amount is released as the third storage space, so as to obtain the target memory space divided into the third storage space and the fourth storage space.

[0095] Optionally, in this embodiment, the starting address of the storage space in the first storage space that does not store data can be detected but is not limited to being determined as the target starting address; or, the starting address of the storage space of expired data in the first storage space can be determined as the target starting address, etc.

[0096] In an exemplary embodiment, before detecting the target adjustment parameters of the first storage space according to the target performance parameters, the following method may be used but is not limited to: defining a node structure and a least recently used cache structure, wherein the node structure is used to define the first storage space and the second storage space divided in the target memory space, and the least recently used cache structure is used to select a storage space with a usage frequency less than a frequency threshold to perform a release operation when the storage space in the target memory space needs to be released; calling an initialize least recently used cache function to create the first storage space in the target memory space, wherein the initialize least recently used cache function carries the memory amount of the first storage space and pointers to the head and tail of a linked list of the first storage space.

[0097] In an exemplary embodiment, an example of a method for managing a storage space is provided. Figure 4 is a schematic diagram of a storage space management method according to an embodiment of the present application, such as Figure 4 As shown, two data structures, a bidirectional linked list and a hash table, are used to manage storage space. The bidirectional linked list is used to maintain the most recent use order of cache items (i.e., data stored in the first storage space). The head of the linked list stores the most recently used cache items, and the tail stores the cache items that have not been used for the longest time. When a cache item is accessed, it is moved to the head of the linked list, indicating that it has been used recently. When a cache item needs to be eliminated to make room, the item that has not been used for the longest time is directly removed from the tail of the linked list.

[0098] Hash tables are used to quickly locate cache items. The key is the unique identifier of the cache item (such as Key1, Key2, etc.), and the value is a pointer to the corresponding node in the doubly linked list. Hash tables provide O(1) time complexity search efficiency and can quickly access, update, or delete cache items.

[0099] During the firmware upgrade process, the cache (i.e., the first storage space) size is dynamically adjusted according to actual needs and performance, that is, the cache is adjusted to (C0+C0*R) based on the initial cache C0. In the software architecture, the bidirectional linked list and hash table are adjusted by applying for (malloc) and releasing (free) memory to achieve the purpose of adjusting the cache. By combining the use of the bidirectional linked list and hash table, the cache space with the lowest utilization rate can be eliminated first, and fast access to cache items can be achieved while maintaining the order of cache item usage.

[0100] In an exemplary embodiment, an example of a firmware upgrade process is provided. Figure 5 is a schematic diagram of a firmware upgrade process according to an embodiment of the present application, such as Figure 5As shown, taking the disk array card as a RAID card, the first storage space as a cache, and the second storage space as the storage space in the memory other than the cache as an example, when the RAID card firmware is upgraded, it is necessary to complete the issuance of the firmware upgrade command and the download process of the firmware package online by the host side, and send it to the RAID card through NVMe command sub-packaging, and the RAID card stores the firmware file in the cache. After the integrity check and signature verification process, the firmware file is written from the cache to the Flash firmware partition to complete the firmware upgrade process.

[0101] When the user sends I / O through the logical hard disk of the RAID card combination, it will pass through the RAID card cache and then to the actual physical hard disk. When the RAID card is upgraded online, it will also pass through the cache and be written to the corresponding non-volatile medium. In order to reduce the impact of firmware upgrades on user IO and improve the IO read and write performance during RAID card firmware upgrades, this application dynamically adjusts the cache in real time according to the IO read and write performance change rate during RAID card firmware upgrades to achieve optimal IO read and write performance. To predict the read and write performance change rate of the RAID card, a pre-calculation algorithm needs to be used to analyze existing data and predict performance changes during firmware upgrades.

[0102] In the related art, since the cache size of the RAID card is fixed in the hardware architecture design and cannot be adjusted during software operation, this is related to factors such as the complexity of the hardware design and cost constraints. At the same time, in order to ensure that the system can provide reliable performance and consistent results under different operating environments and loads during the operation of the RAID card system, the cache cannot be adjusted. In the storage space adjustment method proposed in this application, in order to improve the I / O performance during firmware upgrades, a unique cache dynamic adjustment model is designed to achieve the best performance during firmware upgrades, especially in high-load I / O scenarios, solving the performance degradation problem caused by the firmware upgrade process.

[0103] It should be noted that the above cache can be a memory space opened in SDRAM (Synchronous Dynamic Random-Access Memory), DDR (Double Data Rate), etc. The software architecture needs to support adjustable cache, that is, the cache can be adjusted by applying for and releasing memory. The cache medium can be determined according to the board hardware architecture, and its characteristics are all volatile storage media. The above physical disk can be, but is not limited to, HDD (Hard Disk Drive) or SSD (Solid State Drive), etc. The specific interface type is determined by the hardware architecture, and its characteristics are all non-volatile storage media.

[0104] During the adjustment of the read-write cache of the RAID card, the integrity and consistency of the data must be considered to prevent data corruption, loss or inconsistency. During the adjustment of the cache of the RAID card, you can, but are not limited to, choose to use synchronous write operations to ensure data consistency. The synchronous write operation will wait for the data to be completely written to the disk and return a successful response, which can avoid inconsistencies between cache data and disk data. At the same time, the consistency between the cache and disk data is checked in real time, and possible data inconsistencies are repaired. In addition, during the adjustment of the cache of the RAID card, it is necessary to ensure that the RAID card super capacitor is normal to keep the data in the cache intact in the event of a power outage or unexpected power failure. This prevents data from being lost in the cache and continues to be written to the disk after the power is restored.

[0105] In the technical solution provided in the above step S210, the target firmware file is stored in the third storage space, the third storage space receives the target firmware file and performs verification, and sends the verified target firmware file to the target flash memory space.

[0106] In an exemplary embodiment, after storing the target firmware file corresponding to the firmware update request in the third storage space, the following methods may be used but are not limited to: querying the current firmware update progress of the firmware of the disk array card; when it is found that the current firmware update progress of the firmware of the disk array card is completed, restoring the target memory space to the first storage space and the second storage space; when it is found that the current firmware update progress of the firmware of the disk array card is not completed, continuing to detect the target performance parameter of the disk array card until it is found that the current firmware update progress of the firmware of the disk array card is completed.

[0107] In an exemplary embodiment, an example of a target memory space adjustment process is provided. Figure 6 is a schematic diagram of a target memory space adjustment process according to an embodiment of the present application, such as Figure 6 As shown, C0 is the initial cache (first storage space) allocated in the memory. During the firmware upgrade process, the cache size is dynamically adjusted according to actual needs and performance, that is, the cache is adjusted to C0+C0*R based on the initial cache C0. After the firmware upgrade process is completed, the cache is restored to the initial cache.

[0108] Optionally, in this embodiment, since the related technology will have a certain impact on the I / O performance during the online firmware upgrade of the RAID card, the cache read and write size cannot be adjusted adaptively. If the cache size is set too small, it may cause performance degradation or increase delay. The storage space adjustment method proposed in this application optimizes the read and write performance and IO load balance during the RAID card firmware upgrade. By dynamically adjusting the read and write cache size of the RAID card, the method can improve the read and write performance of the RAID card and reduce the IO load. The cache size is dynamically adjusted according to the workload of the RAID card to achieve better IO load balance, improve the performance and stability of the RAID card, and ensure business continuity. In order to better understand the process of adjusting the above storage space in the storage space adjustment method proposed in this application, the above process is described in conjunction with the optional embodiment below, but it is not used to limit the technical solution of the embodiment of this application.

[0109] In an exemplary embodiment, an example of an interaction process between a RAID card and a host is provided. Figure 7 is a schematic diagram of an interaction process between a RAID card and a host according to an embodiment of the present application, such as Figure 7 As shown, the RAID card predetermines the regression model coefficient (target detection model) for predicting the performance change rate and performs initialization; when the host receives the firmware upgrade command, the host performs I / O interaction with the RAID card and starts the firmware upgrade; the RAID card I / O read / write performance dynamic adjustment process is performed, and the cache size is dynamically adjusted according to the performance change rate to balance the read and write performance; when the firmware upgrade is completed, the RAID card I / O read / write performance dynamic adjustment process is completed and the initial I / O performance is restored.

[0110] It should be noted that the storage space adjustment method proposed in the present application can be applicable to different types of RAID cards, including hardware RAID cards and software RAID cards. For different types of RAID cards, it is necessary to implement them accordingly according to their hardware and software configurations. For example, for a hardware RAID card, it is necessary to access the hardware configuration of the RAID card through the driver of the RAID card, and calculate the performance change rate and adjust the cache size according to the hardware configuration. For a software RAID card, it is necessary to access the software configuration of the RAID card through a software interface, and calculate the performance change rate and adjust the cache size according to the software configuration.

[0111] In an exemplary embodiment, an example of a firmware upgrade process is provided. Figure 8 is a flowchart of a firmware upgrade process according to an embodiment of the present application, such as Figure 8 As shown, the firmware update of the disk array card can be achieved through but not limited to the following process:

[0112] Upload the firmware upgrade file to the host to ensure the normal operation of the IO service, and initiate the RIAD card online firmware upgrade from the host;

[0113] Real-time monitoring of IO performance indicators during RAID card firmware upgrades, select appropriate monitoring tools on the host to collect and monitor RAID IO performance indicators. These tools can be performance monitoring tools provided by the operating system or third-party monitoring software. The RAID card host driver software completes the collection of IO performance indicators during firmware upgrades, and sends the collected performance data to the RAID card controller via NVMe commands. The RAID card real-time monitoring software module completes command parsing and inputs the indicator parameters into the existing model to calculate the corresponding performance change rate;

[0114] The RAID card cache size is dynamically adjusted in real time according to the performance change rate to achieve balanced read and write performance. When the RAID card detects that the performance change rate is large and exceeds the threshold, the cache size is dynamically adjusted to improve the read and write performance of the RAID card and reduce the IO load, so that the read and write performance of the RAID card remains stable during the firmware upgrade without affecting the host business operation.

[0115] Check the progress of the RAID card firmware upgrade. If the firmware upgrade is complete, stop the RAID card IO read / write performance dynamic adjustment process and restore the initial IO performance. If the firmware upgrade is not complete, continue with step 5 until the firmware upgrade is complete and exit.

[0116] It is worth noting that in the solution proposed in this application, it is possible but not limited to first applying for a dynamically adjustable cache space, and then the RAID card driver starts the I / O read / write performance dynamic adjustment process. The specific method includes:

[0117] / / Define the cache structure:

[0118] typedef struct Node { int key;

[0119] int value;

[0120] struct Node* prev;

[0121] struct Node* next;

[0122] } Node;

[0123] typedef struct LRUCache { int capacity;

[0124] int size;

[0125] Node* head;

[0126] Node* tail;

[0127] } LRUCache;

[0128] / / Initialize the cache:

[0129] LRUCache* initLRUCache(int capacity) { LRUCache* cache =(LRUCache*)malloc(sizeof(LRUCache));

[0130] cache->capacity = capacity;

[0131] cache->size = 0;

[0132] cache->head = NULL;

[0133] cache->tail = NULL;

[0134] return cache;

[0135] } LRUCache* initialCache = initLRUCache(C0); / / C0 is the initial cache capacity.

[0136] The above process completes the initial cache application process. If the cache needs to be adjusted, the cache capacity can be adjusted in the following ways, but not limited to:

[0137] / / Adjust cache capacity:

[0138] int C = C0 + C0*R ;

[0139] LRUCache* extendedCache = (LRUCache*)realloc(initialCache, sizeof(LRUCache) + C * sizeof(Node));

[0140] extendedCache->capacity = C;

[0141] / / Treat the extended cache as the entire LRU cache;

[0142] LRUCache* lruCache = extendedCache;

[0143] Through the storage space adjustment method proposed in this application, a performance change rate model is proposed, and the model and characteristic coefficients are determined by using a prediction algorithm to analyze existing data. When the RAID card firmware is upgraded, the performance indicators are monitored in real time and the read-write performance change rate is calculated. The read-write cache size of the RAID card is automatically adjusted according to the calculated performance change rate. During the firmware upgrade process, not only the reliability and security of the RAID card are guaranteed, but also the read-write performance of the RAID card is taken into consideration, and the read-write cache size of the RAID card is automatically adjusted according to the performance change rate, as well as the cache size of the RAID card, so as to maximize the read-write performance and stability of the RAID card.

[0144] The storage space adjustment method proposed in this application realizes the automatic adjustment of the read-write cache size of the RAID card through the RAID card driver without adding hardware, which can optimize the read-write performance when the RAID card firmware is upgraded. The adjustment of the cache size can be optimized according to actual conditions to improve the host read-write performance and stability. Since formulas and derivation processes are used to calculate the performance change rate and adjust the cache size, the influence of subjective factors and errors can be avoided. At the same time, since the cache size is automatically adjusted and the read-write performance of the RAID card is recalculated, the maintainability of the RAID card can be improved, and the operational risk and maintenance cost of the administrator can be reduced. The storage space adjustment method proposed in the present application can support different types of RAID cards, including hardware RAID cards and software RAID cards. Since it is optimized based on the read and write performance and cache size of the RAID card, it can be applicable to different hardware and software configurations of different RAID cards. During the RAID card firmware upgrade process, the normal operation of the RAID card is guaranteed to avoid data loss and hardware failure. At the same time, by automatically adjusting the read and write cache size of the RAID card, the wear and damage to the RAID card can be reduced, and the reliability and life of the RAID card can be improved. During the RAID card firmware upgrade process, the cache size is dynamically adjusted to handle concurrent access requests, reducing the occurrence of data loss or inconsistency, and ensuring data integrity and consistency.

[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including a number of instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0146] In this embodiment, a storage space adjustment device is also provided, which is applied to a processor deployed in a disk array card, wherein the disk array card includes a target memory space and a target flash memory space, wherein the target memory space is divided into a first storage space and a second storage space, wherein the first storage space is used to receive the firmware file of the disk array card and send the verified firmware file to the target flash memory space, wherein the target flash memory space is used to update the firmware of the disk array card using the firmware file, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.

[0147] Fig. 9 is a structural block diagram of a storage space adjustment device according to an embodiment of the present application, such as Fig. 9 As shown, the device comprises:

[0148] The receiving module 0902 is used to receive a firmware update request, wherein the firmware update request is used to request to perform a firmware update operation on the disk array card;

[0149] A first detection module 0904 is used to respond to the firmware update request and detect a target performance parameter of the disk array card, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at a current moment;

[0150] A second detection module 0906, configured to detect a target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate a target adjustment direction and a target storage capacity of the first storage space;

[0151] An adjustment module 0908, configured to adjust the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space;

[0152] The storage module 0910 is used to store the target firmware file corresponding to the firmware update request in the third storage space, wherein the third storage space is used to receive the target firmware file and send the verified target firmware file to the target flash memory space.

[0153] Through the above device, a firmware update request is received, wherein the firmware update request is used to request a firmware update operation to be performed on a disk array card; in response to the firmware update request, a target performance parameter of the disk array card is detected, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at the current moment; a target adjustment parameter of the first storage space is detected according to the target performance parameter, wherein the target adjustment parameter is used to indicate the target adjustment direction and target storage capacity of the first storage space; the first storage space is adjusted using the second storage space according to the target adjustment parameter to obtain a target memory space divided into a third storage space and a fourth storage space; the target firmware file corresponding to the firmware update request is stored in the third storage space, wherein the third storage space is used to receive the target firmware file and send the target firmware file that has passed the validation to the target flash memory space. That is, the first storage space is adjusted according to the read and write performance of the disk array card at the current moment, so that the third storage space allows the firmware file of the disk array card to be received and the firmware file that has passed the validation to be sent to the target flash memory space, thereby solving the problem of low efficiency of upgrading the disk array card and achieving the effect of improving the upgrade efficiency of the disk array card.

[0154] In an exemplary embodiment, the first detection module includes:

[0155] A control unit, used for controlling the monitoring tool to obtain the number of read and write times per second, the bandwidth parameter and the delay parameter of the disk array card at the current moment, wherein the monitoring tool is used for calling an application programming interface provided by a driver of the disk array card to obtain the number of read and write times per second, the bandwidth parameter and the delay parameter of the disk array card;

[0156] The receiving unit is used to receive the number of read and write times per second, the bandwidth parameter and the delay parameter of the disk array card transmitted by the monitoring tool as the target performance parameter of the disk array card.

[0157] In an exemplary embodiment, the second detection module includes:

[0158] a first detection unit, configured to detect a performance change rate of the first storage space according to the target performance parameter and an initial performance parameter of the disk array card, wherein the initial performance parameter is used to indicate the read and write performance of the disk array card at a moment before the current moment, and the performance change rate is used to indicate a change speed of the read and write performance of the disk array card in a unit time;

[0159] A second detection unit is used to detect the target adjustment direction and the target storage capacity of the first storage space as the target adjustment parameters according to the performance change rate and the initial storage capacity of the first storage space, wherein the initial storage capacity is used to indicate the size of the first storage space at the current moment.

[0160] In an exemplary embodiment, the first detection unit is used to: obtain the initial performance parameters of the disk array card; input the target performance parameters and the initial performance parameters into a target detection model to obtain the performance change rate output by the target detection model, wherein the target detection model is used to detect the target read-write performance corresponding to the target performance parameters based on the linear relationship between performance parameters and read-write performance, and calculate the change rate of the target read-write performance relative to the initial read-write performance as the performance change rate for output, and the initial read-write performance is the read-write performance corresponding to the initial performance parameters detected at the previous moment based on the linear relationship between performance parameters and read-write performance.

[0161] In an exemplary embodiment, before inputting the target performance parameter and the initial performance parameter into a target detection model to obtain the performance change rate output by the target detection model, the device further includes:

[0162] An acquisition module, used for acquiring a training data set of the disk array card, wherein the training data set includes historical performance parameters of the disk array card at multiple historical moments and the read and write performance of the disk array card at each of the multiple historical moments;

[0163] Building module, used to build the initial detection model through the following formula: ,in, It is used to indicate the linear relationship between the performance parameter of the disk array card and the read / write performance, where I is the read / write performance of the disk array card, is the initial value of the read and write performance of the disk array card, to is the performance parameter of the disk array card, to is the coefficient corresponding to the performance parameter of the disk array card, t is the historical moment, and t-1 is the moment before the historical moment;

[0164] A training module is used to train the initial detection model using the training data set until the coefficient corresponding to each performance parameter in the initial detection model is obtained, and the initial detection model with the coefficient corresponding to each performance parameter determined is determined as the target detection model.

[0165] In an exemplary embodiment, the second detection unit is further used to: detect the initial storage capacity of the first storage space; detect the target adjustment direction of the first storage space according to the performance change rate, and calculate the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity, wherein the target adjustment direction is used to indicate releasing storage space for the first storage space or allocating storage space for the first storage space, and the target storage capacity is proportional to the performance change rate.

[0166] In an exemplary embodiment, the second detection unit is further configured to: when the performance change rate is greater than 0, determine that the target adjustment direction is to allocate storage space to the first storage space; when the performance change rate is less than or equal to 0, determine that the target adjustment direction is to release storage space in the first storage space; and substitute the performance change rate and the initial storage capacity into the following formula to calculate the target storage capacity C: ,in, is the initial storage capacity, and R is the performance change rate.

[0167] In an exemplary embodiment, the adjustment module includes:

[0168] a third detection unit, configured to detect an adjustment amount of the first storage space according to an initial storage capacity of the first storage space and the target storage capacity, wherein the initial storage capacity is used to indicate a size of the first storage space at the current moment, and the adjustment amount is equal to a difference between the initial storage capacity and the target storage capacity;

[0169] an allocating unit, configured to allocate storage space of the adjustment amount to the first storage space using the second storage space, when the target adjustment parameter is used to indicate that storage space is allocated to the first storage space using the second storage space, so as to obtain the target memory space divided into the third storage space and the fourth storage space, wherein the third storage space is the first storage space with storage space of the adjustment amount added thereto, and the fourth storage space is the second storage space with storage space of the adjustment amount released therefrom;

[0170] A release unit is used to release the storage space of the adjustment amount for the first storage space using the second storage space when the target adjustment parameter is used to indicate the use of the second storage space to release storage space for the first storage space, thereby obtaining the target memory space divided into the third storage space and the fourth storage space, wherein the third storage space is the first storage space with the storage space of the adjustment amount released, and the fourth storage space is the second storage space with the storage space of the adjustment amount increased.

[0171] In an exemplary embodiment, the allocation unit is also used to: call an allocation function to allocate storage space for the adjustment amount to the first storage space, wherein the allocation function includes the adjustment amount; merge the storage space for the adjustment amount allocated to the first storage space and the first storage space into the third storage space, to obtain the target memory space divided into the third storage space and the fourth storage space.

[0172] In an exemplary embodiment, the release unit is also used to: detect the target starting address of the storage space of the adjustment amount that is allowed to be released in the first storage space; call a release function to release the storage space of the adjustment amount from the first storage space, wherein the release function carries the adjustment amount and the target starting address of the storage space to be released in the first storage space; determine the first storage space from which the storage space of the adjustment amount is released as the third storage space, and obtain the target memory space divided into the third storage space and the fourth storage space.

[0173] In an exemplary embodiment, before detecting the target adjustment parameter of the first storage space according to the target performance parameter, the apparatus further includes:

[0174] A definition module, used to define a node structure and a least recently used cache structure, wherein the node structure is used to define the first storage space and the second storage space divided in the target memory space, and the least recently used cache structure is used to select a storage space with a usage frequency less than a frequency threshold to perform a release operation when the storage space in the target memory space needs to be released;

[0175] A calling module is used to call an initialization least recently used cache function to create the first storage space in the target memory space, wherein the initialization least recently used cache function carries the memory amount of the first storage space and pointers to the head and tail of the linked list of the first storage space.

[0176] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0177] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0178] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0179] An embodiment of the present application further provides an electronic device, Fig.10 is a structural block diagram of an electronic device according to an embodiment of the present application, such as Fig.10 As shown, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the method embodiments described above.

[0180] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0181] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0182] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0183] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0184] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0185] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0186] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for adjusting storage space, characterized in that: A method for applying to a processor deployed in a disk array card, wherein the disk array card includes a target memory space and a target flash memory space, wherein the target memory space is divided into a first storage space and a second storage space, wherein the first storage space is used to receive a firmware file of the disk array card and send a verified firmware file to the target flash memory space, wherein the target flash memory space is used to update the firmware of the disk array card using the firmware file, and wherein the method includes: receiving a firmware update request, wherein the firmware update request is used to request to perform a firmware update operation on the disk array card; In response to the firmware update request, detecting a target performance parameter of the disk array card, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at a current moment; detecting a target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate a target adjustment direction and a target storage capacity of the first storage space; adjusting the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space; The target firmware file corresponding to the firmware update request is stored in the third storage space, wherein the third storage space is used to receive the target firmware file and send the verified target firmware file to the target flash memory space.

2. The method according to claim 1, characterized in that The detecting the target performance parameter of the disk array card includes: Controlling the monitoring tool to obtain the read / write times per second, the bandwidth parameter and the delay parameter of the disk array card at the current moment, wherein the monitoring tool is used to call an application programming interface provided by a driver of the disk array card to obtain the read / write times per second, the bandwidth parameter and the delay parameter of the disk array card; The read and write times per second, the bandwidth parameter and the delay parameter of the disk array card transmitted by the monitoring tool are received as the target performance parameter of the disk array card.

3. The method according to claim 1, characterized in that The detecting a target adjustment parameter of the first storage space according to the target performance parameter includes: Detecting a performance change rate of the first storage space according to the target performance parameter and an initial performance parameter of the disk array card, wherein the initial performance parameter is used to indicate the read and write performance of the disk array card at a moment before the current moment, and the performance change rate is used to indicate a change speed of the read and write performance of the disk array card in a unit time; The target adjustment direction and the target storage capacity of the first storage space are detected as the target adjustment parameters according to the performance change rate and the initial storage capacity of the first storage space, wherein the initial storage capacity is used to indicate the size of the first storage space at the current moment.

4. The method according to claim 3, characterized in that The detecting the performance change rate of the first storage space according to the target performance parameter and the initial performance parameter of the disk array card includes: Obtaining the initial performance parameters of the disk array card; The target performance parameters and the initial performance parameters are input into a target detection model to obtain the performance change rate output by the target detection model, wherein the target detection model is used to detect the target read-write performance corresponding to the target performance parameters based on the linear relationship between the performance parameters and the read-write performance, and calculate the change rate of the target read-write performance relative to the initial read-write performance and output it as the performance change rate, and the initial read-write performance is the read-write performance corresponding to the initial performance parameters detected at the previous moment based on the linear relationship between the performance parameters and the read-write performance.

5. The method according to claim 4, characterized in that Before inputting the target performance parameter and the initial performance parameter into a target detection model to obtain the performance change rate output by the target detection model, the method further includes: Acquire a training data set of the disk array card, wherein the training data set includes historical performance parameters of the disk array card at multiple historical moments and the read and write performance of the disk array card at each of the multiple historical moments; The initial detection model is constructed using the following formula: ,in, It is used to indicate the linear relationship between the performance parameter of the disk array card and the read / write performance, where I is the read / write performance of the disk array card, is the initial value of the read and write performance of the disk array card, to is the performance parameter of the disk array card, to is the coefficient corresponding to the performance parameter of the disk array card, t is the historical moment, and t-1 is the moment before the historical moment; The initial detection model is trained using the training data set until a coefficient corresponding to each performance parameter in the initial detection model is obtained, and the initial detection model in which the coefficient corresponding to each performance parameter is determined is determined as the target detection model.

6. The method according to claim 3, characterized in that The detecting the target adjustment direction and the target storage capacity of the first storage space as the target adjustment parameter according to the performance change rate and the initial storage capacity of the first storage space includes: detecting the initial storage capacity of the first storage space; The target adjustment direction of the first storage space is detected according to the performance change rate, and the target storage capacity of the first storage space is calculated according to the performance change rate and the initial storage capacity, wherein the target adjustment direction is used to indicate releasing storage space for the first storage space or allocating storage space for the first storage space, and the target storage capacity is proportional to the performance change rate.

7. The method according to claim 6, characterized in that The detecting the target adjustment direction of the first storage space according to the performance change rate includes: when the performance change rate is greater than 0, determining that the target adjustment direction is to allocate storage space to the first storage space; when the performance change rate is less than or equal to 0, determining that the target adjustment direction is to release storage space in the first storage space; The calculating the target storage capacity of the first storage space according to the performance change rate and the initial storage capacity includes: substituting the performance change rate and the initial storage capacity into the following formula to calculate the target storage capacity C: ,in, is the initial storage capacity, and R is the performance change rate.

8. The method according to claim 1, characterized in that The step of adjusting the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space includes: detecting an adjustment amount of the first storage space according to an initial storage capacity of the first storage space and the target storage capacity, wherein the initial storage capacity is used to indicate a size of the first storage space at the current moment, and the adjustment amount is equal to a difference between the initial storage capacity and the target storage capacity; In a case where the target adjustment parameter is used to indicate using the second storage space to allocate storage space to the first storage space, using the second storage space to allocate the storage space of the adjustment amount to the first storage space, to obtain the target memory space divided into the third storage space and the fourth storage space, wherein the third storage space is the first storage space with the storage space of the adjustment amount added, and the fourth storage space is the second storage space with the storage space of the adjustment amount released; In a case where the target adjustment parameter is used to indicate the use of the second storage space to release storage space for the first storage space, the second storage space is used to release the storage space of the adjustment amount for the first storage space, and the target memory space divided into the third storage space and the fourth storage space is obtained, wherein the third storage space is the first storage space with the storage space of the adjustment amount released, and the fourth storage space is the second storage space with the storage space of the adjustment amount increased.

9. The method according to claim 8, characterized in that In a case where the target adjustment parameter is used to indicate using the second storage space to allocate storage space to the first storage space, using the second storage space to allocate storage space of the adjustment amount to the first storage space, to obtain the target memory space divided into the third storage space and the fourth storage space, comprising: Calling an allocation function to allocate storage space of the adjustment amount to the first storage space, wherein the allocation function includes the adjustment amount; The storage space of the adjustment amount allocated to the first storage space and the first storage space are combined into the third storage space to obtain the target memory space divided into the third storage space and the fourth storage space.

10. The method according to claim 8, characterized in that In a case where the target adjustment parameter is used to indicate using the second storage space to release storage space for the first storage space, using the second storage space to release storage space of the adjustment amount for the first storage space, to obtain the target memory space divided into the third storage space and the fourth storage space, comprising: Detecting a target starting address of a storage space of the adjustment amount allowed to be released in the first storage space; Calling a release function to release the storage space of the adjustment amount from the first storage space, wherein the release function carries the adjustment amount and the target starting address of the storage space to be released in the first storage space; The first storage space from which the adjustment amount of storage space is released is determined as the third storage space, and the target memory space divided into the third storage space and the fourth storage space is obtained.

11. The method according to claim 1, characterized in that: Before detecting the target adjustment parameter of the first storage space according to the target performance parameter, the method further includes: A node structure and a least recently used cache structure are defined, wherein the node structure is used to define the first storage space and the second storage space divided in the target memory space, and the least recently used cache structure is used to select a storage space with a usage frequency less than a frequency threshold to perform a release operation when the storage space in the target memory space needs to be released; The first storage space is created in the target memory space by calling the function for initializing the least recently used cache, wherein the function for initializing the least recently used cache carries the memory amount of the first storage space and the pointers to the head and tail of the linked list of the first storage space.

12. A storage space adjustment device, characterized in that: The device is applied to a processor deployed in a disk array card, the disk array card includes a target memory space and a target flash memory space, the target memory space is divided into a first storage space and a second storage space, the first storage space is used to receive a firmware file of the disk array card and send the verified firmware file to the target flash memory space, the target flash memory space is used to update the firmware of the disk array card using the firmware file, and the device includes: A receiving module, used for receiving a firmware update request, wherein the firmware update request is used for requesting to perform a firmware update operation on the disk array card; A first detection module, configured to respond to the firmware update request and detect a target performance parameter of the disk array card, wherein the target performance parameter is used to indicate the read and write performance of the disk array card at a current moment; a second detection module, configured to detect a target adjustment parameter of the first storage space according to the target performance parameter, wherein the target adjustment parameter is used to indicate a target adjustment direction and a target storage capacity of the first storage space; an adjustment module, configured to adjust the first storage space using the second storage space according to the target adjustment parameter to obtain the target memory space divided into a third storage space and a fourth storage space; The storage module is used to store the target firmware file corresponding to the firmware update request in the third storage space, wherein the third storage space is used to receive the target firmware file and send the verified target firmware file to the target flash memory space.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.