Storage control method and device, electronic equipment and storage medium

By determining the request sending mode in cloud storage and managing storage requests using a ring queue, the problem of storage request loss in cloud storage is solved, the storage reliability and request accuracy are improved, and the success rate of data operations is ensured.

CN118939191APending Publication Date: 2024-11-12YISIXIN TECH SHANGHAI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410980119.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The physical lines of cloud storage are long and greatly affected by the network environment, which leads to the easy loss of storage requests during transmission, affecting the reliability of storage, and may lead to application abnormalities and virtual machine system crashes, and even system disk irrecoverability damage.

Method used

A storage control method is proposed, including obtaining storage requests, determining the request sending mode, resending the request when sending fails, ensuring the accuracy and order of the requests through ring queues and descriptor index management, and recording the request status and order using tables to Send requests out of order or sequentially.

Benefits of technology

Improve the accuracy of storage requests and the success rate of data operations, enhance the reliability of storage, and ensure that failed requests can be resent accurately, thereby reducing the risk of system crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939191A_ABST
    Figure CN118939191A_ABST
Patent Text Reader

Abstract

The invention relates to a storage control method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining at least one storage request which is used for requesting a storage cluster to execute data operation; under the condition that at least one storage request fails to be sent, a request sending mode is determined, and the request sending mode represents the sending sequence of the at least one storage request; according to a request sending mode, determining a to-be-retransmitted request to be retransmitted, the to-be-retransmitted request being the same as the data operation requested to be executed by the storage request; and sending the to-be-retransmitted request. By using the method disclosed by the invention, the storage request which fails to be sent can be accurately sent again, so that the accuracy of receiving the storage request by the storage cluster is improved, and the probability that the storage cluster can correctly execute the data operation indicated by the storage request is also improved. And the storage reliability is improved on the whole.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a storage control method and device, an electronic device, and a storage medium. Background Art

[0002] Compared with traditional local storage, cloud storage physical lines are longer and are more affected by the network environment. An interruption at any point in the line may cause storage request loss, affecting storage reliability.

[0003] The reduced reliability of storage will lead to many disadvantages. For example, a storage request is being forwarded, which includes instructions and data. If an accident occurs during the forwarding process, the storage request may be lost, that is, the instructions and data in the storage request are not correctly delivered to the target hardware. This may cause application anomalies, even virtual machine system crashes, and irreversible damage to the system disk, resulting in losses. Summary of the invention

[0004] In view of this, the present disclosure proposes a storage control solution.

[0005] According to one aspect of the present disclosure, a storage control method is provided, including: obtaining at least one storage request, the storage request being used to request a storage cluster to perform a data operation; in the event that at least one of the storage requests fails to be sent, determining a request sending mode, the request sending mode characterizing a sending order of the at least one storage request; determining a request to be resent according to the request sending mode, the request to be resent performing the same data operation as the storage request; and sending the request to be resent.

[0006] In one possible implementation, obtaining at least one storage request includes: obtaining a data access index and an available storage location index, wherein the available storage location index indicates a next available location of a first circular queue for storing descriptor indexes, the data access index indicates the location of the next descriptor index that can be obtained and is stored in the first circular queue, and the descriptor index corresponds to the storage request; when the data access index is smaller than the available storage location index, obtaining the at least one storage request based on the available storage location index and the data access index.

[0007] In a possible implementation, the method further includes: allocating a descriptor for the storage request, the descriptor being taken from a descriptor table; storing a descriptor index corresponding to the descriptor in the first circular queue, and updating the available storage location index.

[0008] In a possible implementation, the method also includes: when a single storage request is sent successfully, storing the descriptor index corresponding to the single storage request in a second circular queue, and updating the used storage position index, wherein the used storage position index is used to indicate the next available position of the second circular queue; the request sending mode includes sequential sending, and determining the request to be resent according to the request sending mode includes: setting the access data index equal to the used storage position index to obtain a new access data index; when the new access data index is less than the available storage position index, obtaining the request to be resent according to the new access data index.

[0009] In a possible implementation, a first table is preset, a single record in the first table corresponds one-to-one to a single storage request, the first table includes a first field representing the sending status of the storage request, and a second field representing the sending order of the storage request, the storage request and the descriptor index correspond to each other, and the method also includes: when the descriptor index is obtained, setting the value of the first field in the record corresponding to the storage request to a first identifier; obtaining the maximum value of the second field in the first table; incrementing the maximum value to obtain a new maximum value, and setting the value of the second field in the record corresponding to the storage request in the first table to the new maximum value; the request sending mode includes out-of-order sending, and determining the request to be resent according to the request sending mode includes: obtaining the target record whose first field in the first table is the first identifier, and the sending order corresponding to each of the target records; determining the request to be resent according to the first table index corresponding to the target record; and sending each of the requests to be resent in the sending order.

[0010] In one possible implementation, the method further includes: when a single storage request is sent successfully, storing the descriptor index corresponding to the single storage request in a second circular queue, and updating the used storage position index, wherein the used storage position index is used to indicate the next available position of the second circular queue; after updating the used storage position index, the method further includes: setting the first field in the record corresponding to the storage request in the first table to a second identifier.

[0011] In a possible implementation, after the request to be retransmitted is successfully sent, the method further includes: updating a fetched data index according to the number of the request to be retransmitted.

[0012] According to another aspect of the present disclosure, there is provided a storage control device, comprising:

[0013] A storage request acquisition unit, used to acquire at least one storage request, where the storage request is used to request the storage cluster to perform a data operation;

[0014] a sending mode determining unit, configured to determine a request sending mode when at least one of the storage requests fails to be sent, wherein the request sending mode represents a sending order of the at least one storage request;

[0015] a request to be retransmitted determining unit, configured to determine a request to be retransmitted to be retransmitted according to a request transmission mode, wherein the request to be retransmitted performs the same data operation as the storage request;

[0016] The retransmission unit is used to send the request to be retransmitted.

[0017] In a possible implementation manner, the storage request obtaining unit is further configured to:

[0018] Obtaining a fetch data index and an available storage location index, wherein the available storage location index indicates a next available location of the first circular queue for storing the descriptor index, the fetch data index indicates a location of a next descriptor index that is stored in the first circular queue and can be obtained, and the descriptor index corresponds to the storage request;

[0019] In a case where the retrieved data index is smaller than the available storage location index, the at least one storage request is acquired according to the available storage location index and the retrieved data index.

[0020] In a possible implementation manner, the device further includes:

[0021] A descriptor allocation unit, configured to allocate a descriptor to the storage request, wherein the descriptor is taken from a descriptor table;

[0022] The available storage location index obtaining unit is used to store the descriptor index corresponding to the descriptor in the first circular queue and update the available storage location index.

[0023] In a possible implementation manner, the device further includes:

[0024] a used storage location index obtaining unit, configured to, when a single storage request is sent successfully, store the descriptor index corresponding to the single storage request in the second circular queue, and update the used storage location index, wherein the used storage location index is used to indicate the next available location of the second circular queue;

[0025] The request sending mode includes sequential sending, and the sending mode determination unit is further used to:

[0026] Setting the access data index equal to the used storage location index to obtain a new access data index;

[0027] In the case that the new retrieved data index is smaller than the available storage location index, the request to be resent is obtained according to the new retrieved data index.

[0028] In a possible implementation, a first table is preset, a single record in the first table corresponds to a single storage request one by one, the first table includes a first field representing a storage request sending state, and a second field representing a storage request sending order, the storage request and the descriptor index correspond to each other,

[0029] The device also includes:

[0030] A first field setting unit, configured to set the value of the first field in the record corresponding to the storage request to a first identifier when the descriptor index is obtained;

[0031] a maximum value obtaining unit, used to obtain the maximum value of the second field in the first table;

[0032] A second field setting unit, configured to increment the maximum value to obtain a new maximum value, and set the value of the second field in the record corresponding to the storage request in the first table to the new maximum value;

[0033] The request sending mode includes out-of-order sending, and the sending mode determining unit is further used to:

[0034] Acquire the target records whose first field is the first identifier in the first table, and the sending order corresponding to each of the target records;

[0035] Determine the request to be resent according to the first table index corresponding to the target record;

[0036] The requests to be resent are sent in the sending order.

[0037] In a possible implementation, the used storage location index obtaining unit is further used to, when a single storage request is sent successfully, store the descriptor index corresponding to the single storage request in the second circular queue and update the used storage location index, where the used storage location index is used to indicate the next available location of the second circular queue;

[0038] The first field setting unit is further configured to set the first field in the record corresponding to the storage request in the first table as a second identifier after updating the used storage location index.

[0039] In a possible implementation manner, the device further includes:

[0040] The data index updating unit is used to update the data index according to the number of the requests to be resent after the requests to be resent are successfully sent.

[0041] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0042] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0043] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0044] In the embodiment of the present disclosure, when a storage request fails to be sent, the request sending mode can be determined first, and then the request to be resent can be determined according to the request sending mode, and the request to be resent can be sent. The storage request that failed to be sent can be accurately resent, which not only improves the accuracy of the storage cluster receiving the storage request, but also improves the probability that the storage cluster can correctly execute the data operation indicated by the storage request. The reliability of storage is improved as a whole.

[0045] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0047] Figure 1 A schematic diagram of a cloud storage physical circuit provided in an embodiment of the present disclosure.

[0048] Figure 2 A flowchart of a storage control method provided in an embodiment of the present disclosure.

[0049] Figure 3 A schematic diagram of the structure of a storage control device provided in an embodiment of the present disclosure.

[0050] Figure 4 A schematic diagram of the structure of an electronic device for storage control provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0051] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0052] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0053] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0054] Compared with traditional local storage, cloud storage physical lines are longer. Figure 1 Schematic diagram of a cloud storage physical circuit provided by an embodiment of the present disclosure. Figure 1 As shown, a storage request is initiated by a virtual machine in a host machine and generated by a virtual disk front end. The storage request is obtained by a virtualization function unit located in a data processing unit, and the storage request is parsed by a virtual disk back end, and the storage request is sent to the software for storage protocol conversion in the eCPU. After the software completes the storage protocol conversion, the storage request is sent to the storage cluster through the network. The storage cluster performs operations according to the storage request. If the storage cluster successfully receives and executes the operation, it will feedback a message to the data processing unit. Only when the data processing unit successfully receives the feedback message, it indicates that the storage request has been successfully sent.

[0055] It can be seen that the entire link includes the virtual machine, virtual disk front end, virtualization function unit, virtual disk back end, software, physical port of data processing unit, local area network, and storage cluster. If any point in this link is interrupted, the storage request will fail to be sent, seriously affecting the reliability of storage.

[0056] In view of this, the present disclosure designs a storage control method, which can accurately resend a storage request that fails to be sent based on a request sending mode, thereby improving the reliability of storage.

[0057] Figure 2 A flowchart of a storage control method provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:

[0058] S11, obtaining at least one storage request, where the storage request is used to request a storage cluster to perform a data operation.

[0059] The storage request may be generated by the host or input from the outside. The storage request may include: read request, write request, and control request, such as: flush control request, barrier control request, etc. And the obtained storage request is issued.

[0060] S12: in the case that at least one of the storage requests fails to be sent, determining a request sending mode, wherein the request sending mode represents a sending order of the at least one storage request.

[0061] In the case where the data processing unit does not receive a feedback message from the storage cluster, it indicates that the storage request has failed to be sent. In one example, in the case where the data processing unit receives a retransmitted storage request command, it indicates that a certain point in the entire link was interrupted and then reconnected, during which some storage requests may have been lost, resulting in a sending failure, and the storage request needs to be resent. The retransmitted storage request command is sent by the software in the eCPU. In the case of a storage request sending failure, the request sending mode is determined. The request sending modes include: sequential sending and out-of-order sending.

[0062] S13, determining a request to be resent according to the request sending mode, wherein the request to be resent performs the same data operation as the storage request.

[0063] The request to be resent may be a storage request that needs to be resent. The content of the request to be resent is the same as that of the original storage request, and the data operation to be performed by the request is also the same. In different request sending modes, the sending order of storage requests will be different, so the sending order of the request to be resent is also different, and the method of determining the request to be resent is also different. Otherwise, the operation order of the storage cluster and the operation success rate will be affected.

[0064] S14, sending the request to be resent.

[0065] In the embodiment of the present disclosure, when a storage request fails to be sent, the request sending mode can be determined first, and then the request to be resent can be determined according to the request sending mode, and the request to be resent can be sent. The storage request that failed to be sent can be accurately resent, which not only improves the efficiency of resending the storage request, but also improves the probability that the storage cluster can correctly execute the data operation indicated by the storage request. The reliability of storage is improved as a whole.

[0066] In a possible implementation, the method further includes: allocating a descriptor for the storage request, the descriptor being taken from a descriptor table; storing a descriptor index corresponding to the descriptor in the first circular queue, and updating the available storage location index.

[0067] The storage request may be stored in a buffer. The virtual disk front end may allocate a descriptor for the storage request. The descriptor may indicate the storage address of the storage request. If the storage request is stored in a buffer, the descriptor may indicate the buffer. If the storage request is stored in multiple buffers, each buffer corresponds to a descriptor, and these descriptors constitute a descriptor chain, and each descriptor in the descriptor chain points to the next descriptor until the last descriptor. Then, the descriptor may be the first descriptor of the descriptor chain, and the descriptor may indicate the first buffer storing the storage request.

[0068] Furthermore, the virtual disk front end can use the descriptor index to locate the descriptor. A single descriptor index can correspond to one descriptor, or to the first descriptor of a descriptor chain.

[0069] In addition, the descriptors are stored in a descriptor table. Each descriptor table index corresponds to a descriptor. In the present disclosure, the descriptor table index is equivalent to the descriptor index.

[0070] In an embodiment of the present disclosure, a descriptor index may be recorded in a circular queue. For ease of distinction, the circular queue used to store the descriptor index generated by the host is named the first circular queue. In addition, an available storage location index is preset. The available storage location index may indicate the next available location in the first circular queue. After the first circular queue successfully records a descriptor, the available storage location index may be incremented by 1.

[0071] In the disclosed embodiment, the descriptor index is stored by utilizing the sequential storage characteristics of the circular queue, and is used in conjunction with the available storage location index to indicate the next available location in the first circular queue, so that the virtual disk backend can automatically determine whether there is a storage request to be obtained, thereby improving the degree of automation, and the available storage location index is also used to determine requests to be resent, thereby improving the accuracy of determining requests to be resent.

[0072] In one possible implementation, obtaining at least one storage request includes: obtaining a data access index and an available storage location index, wherein the available storage location index indicates a next available location of a first circular queue for storing descriptor indexes, the data access index indicates the location of the next descriptor index that can be obtained and is stored in the first circular queue, and the descriptor index corresponds to the storage request; when the data access index is smaller than the available storage location index, obtaining the at least one storage request based on the available storage location index and the data access index.

[0073] In an embodiment of the present disclosure, a retrieved data index may be preset to indicate the position of the next descriptor index to be obtained by the virtual disk backend in the first circular queue. Since the positions in the first circular queue are used sequentially, the retrieved data index may be incremented by 1 each time the virtual disk backend obtains a descriptor index. When in use, the virtual disk backend may compare the retrieved data index with the available storage location index. When the retrieved data index is smaller than the available storage location index, it means that after the virtual disk backend obtained the descriptor index, a new descriptor index was stored in the first circular queue. Then, there are still descriptor indexes to be obtained for the virtual disk backend. Therefore, when the retrieved data index is smaller than the available storage location index, the virtual disk backend will obtain new descriptors and increment the retrieved data index according to the number of descriptors obtained.

[0074] In the disclosed embodiment, the access data index and the available storage location index are preset. Moreover, due to the characteristics of the circular queue, it is only necessary to compare the access data index and the available storage location index to determine whether a new storage request needs to be obtained, thereby improving the accuracy and efficiency of the judgment. Compared with the front and back ends of the virtual disk determining the need to obtain a new storage request by sending messages, the amount of data transmission is reduced, and it does not depend on the quality of data transmission, which is more reliable.

[0075] In a possible implementation, the method also includes: when a single storage request is sent successfully, storing the descriptor index corresponding to the single storage request in a second circular queue, and updating the used storage position index, wherein the used storage position index is used to indicate the next available position of the second circular queue; the request sending mode includes sequential sending, and determining the request to be resent according to the request sending mode includes: setting the access data index equal to the used storage position index to obtain a new access data index; when the new access data index is less than the available storage position index, obtaining the request to be resent according to the new access data index.

[0076] If the storage cluster receives the storage request and performs the corresponding operation according to the storage request, it means that the storage request is successfully sent. Then the data processing unit will receive a feedback message sent by the storage cluster. In order to facilitate the virtual disk backend to record the successfully sent storage request and the received feedback message, another circular queue can be preset to record the descriptor of the successfully sent storage request. If the storage request is a read request, the circular queue also records the number of bytes to be written. For easy distinction, the circular queue is named the second circular queue. In addition, a used storage location index is preset. The used storage location index can indicate the next available location in the second circular queue.

[0077] As mentioned above, the request sending modes include: sequential sending and out-of-order sending. Sequential sending means that the virtual disk backend will not obtain a new storage request before the current storage request is successfully sent.

[0078] When the request sending mode is sequential sending and the storage request is successfully sent, the values ​​of the used storage location index and the retrieved data index are equal.

[0079] In the case where the virtual disk backend obtains a storage request, the accessed data index will be incremented. In the case where the request sending mode is sequential sending and the storage request is not successfully sent, the used storage location index will not be incremented, so the used storage location index is smaller than the accessed data index; therefore, the accessed data index can be made equal to the used storage location index, that is, the accessed data index is returned to the state where the storage request that failed to be sent is not accessed. In this way, the accessed data index will be smaller than the available location index, and when a retransmission storage request command is received, the storage request that failed to be sent (i.e., the request to be resent) can be automatically retrieved from the buffer specified by the descriptor according to the accessed data index, so that the data processing unit can send the request to be resent until it is successfully sent.

[0080] In the disclosed embodiment, if it is determined that the request sending mode is sequential sending, then the accessed data index can be made equal to the used storage location index, so that the accessed data index is rolled back to the first circular queue position corresponding to the storage request that failed to send, and the request to be resent can be accurately determined and sent. In the case where the request sending mode is sequential sending, there is no need to set up additional buffer resources in the virtual disk backend to track the storage requests that have been sent and not completed. In this way, the storage resources of the virtual disk backend are saved, the complexity of the design is reduced, and the reliability of the system is improved.

[0081] In a possible implementation, a first table is preset, a single record in the first table corresponds one-to-one to a single storage request, the first table includes a first field representing the sending status of the storage request, and a second field representing the sending order of the storage request, the storage request and the descriptor index correspond to each other, and the method also includes: when the descriptor index is obtained, setting the value of the first field in the record corresponding to the storage request to a first identifier; obtaining the maximum value of the second field in the first table; incrementing the maximum value to obtain a new maximum value, and setting the value of the second field in the record corresponding to the storage request in the first table to the new maximum value; the request sending mode includes out-of-order sending, and determining the request to be resent according to the request sending mode includes: obtaining the target record whose first field in the first table is the first identifier, and the sending order corresponding to each of the target records; determining the request to be resent according to the first table index corresponding to the target record; and sending each of the requests to be resent in the sending order.

[0082] In an embodiment of the present disclosure, a first table can be preset. A single record in the first table corresponds one-to-one to a single storage request obtained by the virtual disk backend. The first table includes a first field representing the sending status of the storage request, and a second field representing the sending order of the storage request. In addition, the size of the first table is equal to the size of the descriptor table. In this way, the single record indicated by the first table index corresponds one-to-one to the descriptor indicated by the descriptor table index, and then corresponds one-to-one to the storage request pointed to by the descriptor. Therefore, according to the index of the first table, the descriptor table index can be determined, and then according to the descriptor table index, the descriptor in the table can be located; based on the located descriptor, the storage request is obtained from the buffer.

[0083] Each time a storage request is obtained in the virtual disk backend, including the re-acquisition of a storage request due to a retransmission command, it is obtained from the buffer specified by the descriptor. There is no need to set up additional buffer resources in the virtual disk backend to track the sent and uncompleted storage requests. This saves storage resources in the virtual disk backend, reduces the complexity of the design, and improves the reliability of the system.

[0084] When the virtual disk backend obtains the descriptor index, a record is created in the first table, and the first field in the record is set to the first identifier. For example, the first identifier can be 1. The first identifier can indicate that the storage request corresponding to the record has not been successfully sent. And the second field in the record is set to the maximum value of other second fields in the first table incremented by one, for example, incrementing by one can be incrementing by 1. In this way, every time the virtual disk backend obtains the descriptor index, a record is added at the same index in the first table, and the record indicates the order of the storage request corresponding to the descriptor index; and indicates that the storage request is in a state of not being successfully sent.

[0085] Out-of-order sending means that the virtual disk backend can obtain a new storage request before the current storage request is successfully sent. If the sending mode is out-of-order sending, after receiving the retransmit storage request command, the virtual disk backend obtains the target record whose first field is the first identifier in the first table, and sends the storage request (request to be retransmitted) corresponding to the target record according to the order of the identifiers in the second field of these target records.

[0086] In the embodiment of the present disclosure, if it is determined that the request sending mode is out-of-order sending, then the target record whose first field is the first identifier can be determined from the preset first table, and the target records are automatically and accurately determined and sent as the request to be resent according to the order of the second field records. In the case where the request sending mode is out-of-order sending, the reliability of storage is improved.

[0087] In one possible implementation, the method further includes: when a single storage request is sent successfully, storing the descriptor index corresponding to the single storage request in a second circular queue, and updating the used storage position index, wherein the used storage position index is used to indicate the next available position of the second circular queue; after updating the used storage position index, the method further includes: setting the first field in the record corresponding to the storage request in the first table to a second identifier.

[0088] The data processing unit receives feedback information from the storage cluster, indicating that the storage request is sent successfully. If the storage request is sent successfully, the second ring queue records the descriptor index corresponding to the storage request and obtains the used storage location index. Each time the second ring queue records a new descriptor index, the used storage location index may be incremented by 1.

[0089] Furthermore, after the storage request is successfully sent and the used storage location index is updated, the first field in the record corresponding to the storage request in the first table is set to the second flag, for example, the second flag may be 0. The second flag may indicate that the storage request has been successfully sent.

[0090] In the embodiment of the present disclosure, after the storage request is successfully sent, the first table is maintained, and the record corresponding to the successfully sent storage request is updated to indicate that the storage request has been successfully sent. In this way, the information in the first table can be kept accurate, and when a sending failure occurs next time, the request to be resent can be accurately determined and sent correctly, thereby improving the accuracy of determining and sending the request to be resent.

[0091] In a possible implementation, after the request to be retransmitted is successfully sent, the method further includes: updating a fetched data index according to the number of the request to be retransmitted.

[0092] As mentioned above, after the request to be resent is successfully sent, the used storage location index will be updated. For example, if the number of requests to be resent is N, N is a positive integer, the used storage location index will be incremented by N. Therefore, the access data index can be set equal to the updated used storage location index. Alternatively, the access data index can be increased according to the number of requests to be resent.

[0093] Since the access data index is compared with the available storage location index, it can be determined whether there is a descriptor index to be obtained (i.e., whether there is a storage request to be sent). Therefore, after the resend request is successfully sent, the access data index is updated accordingly, and it can be accurately determined whether there is a request to be sent, thereby reducing the probability of resending a successfully sent storage request and reducing the possibility of wasting resources.

[0094] The storage control method in the present disclosure is introduced below with an embodiment.

[0095] A first circular queue, a second circular queue, a fetched data index, an available storage location index, a used storage location index, a descriptor table, and a first table are preset.

[0096] When the access data index is less than the available storage location index, the virtual disk backend obtains the storage request from the host side and sends the storage request. When the data processing unit receives a feedback message from the access cluster, it indicates that the storage request has been successfully sent. When the feedback message determines that the number of successfully sent storage requests is the first number, the used storage location index is increased by the first number.

[0097] When the data processing unit receives a resend storage request command, it means that a certain point in the entire link is disconnected and then reconnected, and some storage requests may be lost during the period, resulting in a failure to send and need to be resent. Therefore, it is necessary to determine the request sending mode.

[0098] When the request sending mode is sequential sending, set the accessed data index equal to the used storage location index, that is, let the accessed data index return to the state of not using the storage request that failed to send. In this way, the accessed data index is smaller than the available storage location index, so the virtual disk backend will obtain the storage request that was not successfully sent (request to be resent) again according to the accessed data index and resend it. After the request to be resent is successfully sent, the used storage location index is updated. That is, the used storage location index is increased by the number of successfully sent requests to be resent.

[0099] When the request sending mode is out-of-order sending, the storage request (request to be resent) whose first field in the first table is the first identifier can be obtained and resent. After the request to be resent is successfully sent, the used storage location index is updated. That is, the used storage location index is increased by the number of successfully sent requests to be resent. And the access data index is equal to the updated used storage location index. The first field of the record corresponding to the request to be resent in the first table is set to the second identifier.

[0100] Figure 3 Schematic diagram of a storage control device provided by an embodiment of the present disclosure. Figure 3 As shown, the device 20 comprises:

[0101] A storage request acquisition unit 21, configured to acquire at least one storage request, wherein the storage request is used to request a storage cluster to perform a data operation;

[0102] A sending mode determining unit 22, configured to determine a request sending mode when at least one of the storage requests fails to be sent, wherein the request sending mode represents a sending order of the at least one storage request;

[0103] A request to be retransmitted determining unit 23, configured to determine a request to be retransmitted to be retransmitted according to a request transmission mode, wherein the request to be retransmitted performs the same data operation as the storage request;

[0104] The retransmission unit 24 is configured to send the request to be retransmitted.

[0105] In a possible implementation, the storage request obtaining unit 21 is further configured to:

[0106] Obtaining a fetch data index and an available storage location index, wherein the available storage location index indicates a next available location of the first circular queue for storing the descriptor index, the fetch data index indicates a location of a next descriptor index that is stored in the first circular queue and can be obtained, and the descriptor index corresponds to the storage request;

[0107] In a case where the retrieved data index is smaller than the available storage location index, the at least one storage request is acquired according to the available storage location index and the retrieved data index.

[0108] In a possible implementation, the device 20 further includes:

[0109] A descriptor allocation unit, configured to allocate a descriptor to the storage request, wherein the descriptor is taken from a descriptor table;

[0110] The available storage location index obtaining unit is used to store the descriptor index corresponding to the descriptor in the first circular queue and update the available storage location index.

[0111] In a possible implementation, the device 20 further includes:

[0112] a used storage location index obtaining unit, configured to, when a single storage request is sent successfully, store the descriptor index corresponding to the single storage request in the second circular queue, and update the used storage location index, wherein the used storage location index is used to indicate the next available location of the second circular queue;

[0113] The request sending mode includes sequential sending, and the sending mode determining unit 22 is further configured to:

[0114] Setting the access data index equal to the used storage location index to obtain a new access data index;

[0115] In the case that the new retrieved data index is smaller than the available storage location index, the request to be resent is obtained according to the new retrieved data index.

[0116] In a possible implementation, a first table is preset, a single record in the first table corresponds to a single storage request one by one, the first table includes a first field representing a storage request sending state, and a second field representing a storage request sending order, the storage request and the descriptor index correspond to each other,

[0117] The device 20 further comprises:

[0118] A first field setting unit, configured to set the value of the first field in the record corresponding to the storage request to a first identifier when the descriptor index is obtained;

[0119] a maximum value obtaining unit, used to obtain the maximum value of the second field in the first table;

[0120] A second field setting unit, configured to increment the maximum value to obtain a new maximum value, and set the value of the second field in the record corresponding to the storage request in the first table to the new maximum value;

[0121] The request sending mode includes out-of-order sending, and the sending mode determining unit 22 is further used for:

[0122] Acquire the target records whose first field is the first identifier in the first table, and the sending order corresponding to each of the target records;

[0123] Determine the request to be resent according to the first table index corresponding to the target record;

[0124] The requests to be resent are sent in the sending order.

[0125] In one possible implementation,

[0126] The used storage location index obtaining unit is further used to store the descriptor index corresponding to the single storage request in the second circular queue and update the used storage location index when the single storage request is sent successfully, wherein the used storage location index is used to indicate the next available location of the second circular queue;

[0127] The first field setting unit is further configured to set the first field in the record corresponding to the storage request in the first table as a second identifier after updating the used storage location index.

[0128] In a possible implementation, the device 20 further includes:

[0129] The data index updating unit is used to update the data index according to the number of the requests to be resent after the requests to be resent are successfully sent.

[0130] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0131] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0132] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0133] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0134] Figure 4 The structure diagram of the electronic device for storage control provided by the embodiment of the present disclosure. For example, the electronic device 1900 can be provided as a server or a terminal device. Figure 4 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0135] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM or similar.

[0136] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0137] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0138] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0139] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0140] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0141] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0142] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0143] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0144] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0145] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A storage control method, characterized in that: include: Obtain at least one storage request, where the storage request is used to request a storage cluster to perform a data operation; In the case where at least one of the storage requests fails to be sent, determining a request sending mode, the request sending mode representing a sending order of the at least one storage request; Determine, according to the request sending mode, a request to be resent to be resent, wherein the request to be resent and the storage request perform the same data operation; The request to be resent is sent.

2. The method according to claim 1, characterized in that: The obtaining of at least one storage request comprises: Obtaining a fetch data index and an available storage location index, wherein the available storage location index indicates a next available location of the first circular queue for storing the descriptor index, the fetch data index indicates a location of a next descriptor index that is stored in the first circular queue and can be obtained, and the descriptor index corresponds to the storage request; In a case where the retrieved data index is smaller than the available storage location index, the at least one storage request is acquired according to the available storage location index and the retrieved data index.

3. The method according to claim 2, characterized in that The method further comprises: Allocating a descriptor for the storage request, the descriptor being taken from a descriptor table; The descriptor index corresponding to the descriptor is stored in the first circular queue, and the available storage location index is updated.

4. The method according to claim 1, characterized in that: The method further comprises: In the case where a single storage request is sent successfully, storing a descriptor index corresponding to the single storage request in the second circular queue, and updating a used storage position index, wherein the used storage position index is used to indicate a next available position of the second circular queue; The request sending mode includes sequential sending, and determining the request to be resent to be resent according to the request sending mode includes: Setting the access data index equal to the used storage location index to obtain a new access data index; In the case that the new retrieved data index is smaller than the available storage location index, the request to be resent is obtained according to the new retrieved data index.

5. The method according to claim 1, characterized in that A first table is preset, wherein a single record in the first table corresponds to a single storage request one by one, the first table includes a first field representing a storage request sending state, and a second field representing a storage request sending order, the storage request and the descriptor index correspond to each other, The method further comprises: When the descriptor index is obtained, Setting the value of the first field in the record corresponding to the storage request to a first identifier; Obtaining the maximum value of the second field in the first table; Incrementing the maximum value to obtain a new maximum value, and setting the value of the second field in the record corresponding to the storage request in the first table to the new maximum value; The request sending mode includes out-of-order sending, and determining the request to be resent to be resent according to the request sending mode includes: Acquire the target records whose first field is the first identifier in the first table, and the sending order corresponding to each of the target records; Determine the request to be resent according to the first table index corresponding to the target record; The requests to be resent are sent in the sending order.

6. The method according to claim 5, characterized in that The method further comprises: In the case where a single storage request is sent successfully, storing a descriptor index corresponding to the single storage request in the second circular queue, and updating a used storage position index, wherein the used storage position index is used to indicate a next available position of the second circular queue; After updating the used storage location index, the method further includes: The first field in the record corresponding to the storage request in the first table is set as the second identifier.

7. The method according to claim 5, characterized in that After the request to be resent is successfully sent, the method further includes: According to the number of requests to be resent, the fetched data index is updated.

8. A storage control device, characterized in that: include: A storage request acquisition unit, used to acquire at least one storage request, where the storage request is used to request the storage cluster to perform a data operation; a sending mode determining unit, configured to determine a request sending mode when at least one of the storage requests fails to be sent, wherein the request sending mode represents a sending order of the at least one storage request; a request to be retransmitted determining unit, configured to determine a request to be retransmitted to be retransmitted according to a request transmission mode, wherein the request to be retransmitted performs the same data operation as the storage request; The retransmission unit is used to send the request to be retransmitted.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 7 when executing the instructions stored in the memory.

10. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.