Centralized storage command line management method and device and readable storage medium

By splitting the command line to be executed in centralized storage into atomic operations and using multi-threaded parallel processing mechanism, the problem of inefficient execution of command line is solved, significantly improving the user experience.

CN119718587APending Publication Date: 2025-03-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411998813.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Serial control of the command line in centralized storage results in inefficient execution and reduces user experience.

Method used

Split the command line to be executed into several atomic operations, and add them to the corresponding operation queue according to the operation type. Multiple queue processing threads simultaneously process atomic operations in each operation queue, realizing multi-threaded parallel processing.

Benefits of technology

Improves the execution efficiency of command lines in centralized storage and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718587A_ABST
    Figure CN119718587A_ABST
Patent Text Reader

Abstract

The invention discloses a command line management method and device for centralized storage and a readable storage medium, belongs to the field of centralized storage, and aims to solve the problems that (1) a command line is composed of a plurality of atomic operations, and (2) conflicts do not exist during parallel processing of different types of atomic operations. Therefore, the command lines to be executed stored in the centralized mode can be split into the multiple atomic operations, the atomic operations are added into the corresponding operation queues according to the operation types of the atomic operations, and then the atomic operations in the operation queues are processed at the same time through the multiple queue processing threads. In other words, multi-thread parallel processing of the to-be-executed command lines is achieved in the centralized storage, the execution efficiency of the command lines in the centralized storage is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of centralized storage, and in particular to a command line management method, device and readable storage medium for centralized storage. Background Art

[0002] Users can control storage devices through command lines. For centralized storage, there is a lack of a mature command line management method in the relevant technology. Command lines are usually controlled serially to avoid uncontrollable results caused by command line concurrency and achieve controllable user interaction. However, the serial control method of command lines has the problem of low command line execution efficiency, which significantly reduces the user experience.

[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention

[0004] The purpose of the present invention is to provide a command line management method, device and readable storage medium for centralized storage, which can split the command line to be executed in the centralized storage into several atomic operations, and add the atomic operation to the corresponding operation queue according to the operation type of the atomic operation, and then simultaneously process the atomic operations in each operation queue through multiple queue processing threads, that is, multi-threaded parallel processing of the command line to be executed is realized in the centralized storage, thereby improving the execution efficiency of the command line in the centralized storage and improving the user experience.

[0005] To solve the above technical problems, the present invention provides a centralized storage command line management method, comprising:

[0006] Split the centrally stored to-be-executed command lines into several atomic operations;

[0007] For any atomic operation obtained by splitting, add the atomic operation to an operation queue corresponding to the operation type of the atomic operation, wherein a single operation type corresponds to one operation queue, and the total number of operation queues is not less than 2;

[0008] According to the first correspondence, the atomic operations in each of the operation queues are processed simultaneously by multiple queue processing threads, wherein the first correspondence is the correspondence between the queue processing threads and the operation queues, a single operation queue corresponds to one queue processing thread, and the total number of queue processing threads is not less than 2.

[0009] On the other hand, splitting the centrally stored to-be-executed command line into several atomic operations includes:

[0010] For any command line to be executed in the centralized storage, split the command line to be executed into a plurality of atomic operations through a splitting thread corresponding to the command line to be executed, wherein the command line to be executed corresponds to the splitting thread one by one;

[0011] For any atomic operation obtained by splitting, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation includes:

[0012] For any atomic operation obtained by splitting the command line to be executed, the atomic operation is added to an operation queue corresponding to the operation type of the atomic operation through a splitting thread corresponding to the command line to be executed.

[0013] On the other hand, the operation types correspond one-to-one to the operation queues, and the operation queues correspond one-to-one to the queue processing threads.

[0014] On the other hand, for any atomic operation obtained by splitting, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation includes:

[0015] For any atomic operation obtained by splitting, determine whether there is an operation queue corresponding to the operation type of the atomic operation;

[0016] If so, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation;

[0017] If it does not exist, create an operation queue corresponding to the operation type of the atomic operation, and add the atomic operation to the operation queue corresponding to the operation type of the atomic operation;

[0018] The centralized storage command line management method also includes:

[0019] For any of the operation queues, determining whether there is an unprocessed atomic operation in the operation queue;

[0020] If there is no unprocessed atomic operation in the operation queue, destroy the operation queue;

[0021] Determine whether the preset time has passed since the last queue detection action;

[0022] If reached, the step of determining whether there is any unprocessed atomic operation in any of the operation queues is executed.

[0023] On the other hand, the centralized storage command line management method further includes:

[0024] When the execution process of the command line to be executed is unexpectedly interrupted, determining an interruption atomic operation of the interrupted command line, wherein the interrupted command line refers to: the command line to be executed whose execution process is unexpectedly interrupted, and the interruption atomic operation refers to the atomic operation executed by the interrupted command line when the execution process is unexpectedly interrupted;

[0025] According to the operation log of the interrupt command line, starting from the interrupt atomic operation, each atomic operation executed by the interrupt command line is rolled back in the reverse order of the execution order of the atomic operations, wherein the operation log is used to record each atomic operation executed in the command line to be executed and the execution order.

[0026] On the other hand, when the execution process of the command line to be executed is unexpectedly interrupted, after determining the interruption atomic operation of the interruption command line, according to the operation log of the interruption command line, starting from the interruption atomic operation, in the reverse order of the execution order of the atomic operations, before rolling back the atomic operations executed by the interruption command line, the centralized stored command line management method further includes:

[0027] When the interrupt atomic operation is executed, it is determined whether the to-be-executed command line to which the interrupt atomic operation belongs has generated a view change in the user interface;

[0028] If no view change is generated, the following steps are performed: according to the operation log of the interrupt command line, starting from the interrupt atomic operation, in the reverse order of the execution sequence of the atomic operations, each atomic operation executed by the interrupt command line is rolled back;

[0029] If the view has been changed, then according to the operation log of the interrupt command line, starting from the interrupt atomic operation, each atomic operation that has not been executed by the interrupt command line is continuously processed.

[0030] On the other hand, according to the operation log of the interrupt command line, starting from the interrupt atomic operation, in the reverse order of the execution order of the atomic operations, rolling back each atomic operation executed by the interrupt command line includes:

[0031] According to the operation log of the interrupt command line, the atomic operation that has been executed by the interrupt command line is added to the rollback queue;

[0032] For each atomic operation in the rollback queue, rollback processing is performed in the reverse order of the execution order.

[0033] On the other hand, according to the operation log of the interrupt command line, starting from the interrupt atomic operation, continuing to process each atomic operation that has not been executed by the interrupt command line includes:

[0034] According to the operation log of the interrupt command line, for any atomic operation that is not executed by the interrupt command line, the atomic operation is added to the operation queue corresponding to the operation type of the atomic operation, so that each atomic operation that is not executed by the interrupt command line is processed by the queue processing thread corresponding to each operation queue.

[0035] In order to solve the above technical problems, the present invention further provides a centralized storage command line management device, comprising:

[0036] Memory for storing computer programs;

[0037] A processor is used to implement the steps of the centralized storage command line management method as described above when executing the computer program.

[0038] To solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the centralized storage command line management method as described above are implemented.

[0039] Beneficial effect: The present invention provides a method for managing command lines in centralized storage. Considering that (1) a command line is composed of multiple atomic operations and (2) different types of atomic operations do not conflict when processed in parallel, the present invention can split the command line to be executed in centralized storage into several atomic operations, and add the atomic operations to the corresponding operation queues according to the operation type of the atomic operations. Then, the atomic operations in each operation queue are processed simultaneously by multiple queue processing threads. That is, multi-threaded parallel processing of the command line to be executed is realized in centralized storage, thereby improving the execution efficiency of the command line in centralized storage and improving the user experience.

[0040] The present invention also provides a centralized storage command line management device and a computer-readable storage medium, which have the same beneficial effects as the centralized storage command line management method above. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 A flowchart of a centralized storage command line management method provided by the present invention;

[0043] Figure 2 A flowchart of another centralized storage command line management method provided by the present invention;

[0044] Figure 3 A schematic diagram of the structure of a centralized storage command line management device provided by the present invention;

[0045] Figure 4 A schematic diagram of the structure of a centralized storage command line management device provided by the present invention;

[0046] Figure 5 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0047] The core of the present invention is to provide a centralized stored command line management method, device and readable storage medium, which can split the centrally stored to-be-executed command line into several atomic operations, and add the atomic operation to the corresponding operation queue according to the operation type of the atomic operation, and then simultaneously process the atomic operations in each operation queue through multiple queue processing threads, that is, multi-threaded parallel processing of the to-be-executed command line is realized in the centralized storage, thereby improving the execution efficiency of the command line in the centralized storage and improving the user experience.

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Please refer to Figure 1 , Figure 1 A flowchart of a centralized storage command line management method provided by the present invention, the centralized storage command line management method comprising:

[0050] S101: splitting the command line to be executed in the central storage into several atomic operations;

[0051] Specifically, considering the technical problems in the above background technology, and considering that (1) the command line is composed of multiple atomic operations, and (2) there is no conflict when atomic operations of different operation types are processed in parallel, the embodiment of the present invention intends to process different types of atomic operations in parallel, and process the same type of atomic operations in serial, so as to improve the processing efficiency of the command line through the "parallel processing method with atomic operations as the granularity". In order to obtain the atomic operations that constitute the command line, in this step, the centrally stored command line to be executed can first be split into several atomic operations, and use them as the data basis for subsequent steps.

[0052] The centralized storage may be of various types, such as NAS (Network Attached Storage), etc., which is not limited in the embodiment of the present invention.

[0053] S102: For any atomic operation obtained by splitting, add the atomic operation to an operation queue corresponding to the operation type of the atomic operation, wherein a single operation type corresponds to one operation queue, and the total number of operation queues is not less than 2;

[0054] Specifically, in order to better realize the serial processing of atomic operations of the same type and the parallel processing of atomic operations of different types, the embodiment of the present invention utilizes the characteristics of serial processing in the operation queue. Therefore, in this step, an operation queue is allocated corresponding to the atomic operation of a single operation type, and the total number of operation queues is not less than 2, so that it can be used as the data basis for subsequent steps.

[0055] In theory, different operation types may correspond to the same operation queue. For example, the first operation type and the second operation type both correspond to the first operation queue. Although this method reduces the total number of operation queues, it can save operation queue and thread resources.

[0056] S103: According to the first corresponding relationship, the atomic operations in each operation queue are processed simultaneously by multiple queue processing threads, wherein the first corresponding relationship is the corresponding relationship between the queue processing thread and the operation queue, a single operation queue corresponds to one queue processing thread, and the total number of queue processing threads is not less than 2.

[0057] Specifically, in order to realize parallel processing of atomic operations, an embodiment of the present invention can allocate a queue processing thread to a single operation queue, and process the atomic operations in the corresponding operation queue through the queue processing thread, and the total number of queue processing threads is not less than 2, thereby ensuring that atomic operations can be processed in parallel by at least two threads.

[0058] Among them, different operation queues can theoretically correspond to the same queue processing thread. For example, the first operation queue and the second operation queue correspond to the first queue processing thread. Although this method sacrifices some parallelism, it can save thread resources.

[0059] The present invention provides a method for managing command lines in centralized storage. Considering that (1) a command line is composed of multiple atomic operations and (2) different types of atomic operations do not conflict when processed in parallel, the present invention can split the command line to be executed in centralized storage into several atomic operations, and add the atomic operations to the corresponding operation queues according to the operation types of the atomic operations. Then, the atomic operations in each operation queue are processed simultaneously by multiple queue processing threads. That is, multi-threaded parallel processing of the command line to be executed is realized in centralized storage, thereby improving the execution efficiency of the command line in centralized storage and improving the user experience.

[0060] Based on the above embodiments:

[0061] As an optional embodiment, splitting the centrally stored to-be-executed command line into several atomic operations includes:

[0062] For any command line to be executed in the centralized storage, the command line to be executed is split into several atomic operations through a splitting thread corresponding to the command line to be executed, wherein the command line to be executed corresponds to the splitting thread one by one;

[0063] For any atomic operation obtained by splitting, adding the atomic operation to the operation queue corresponding to the operation type of the atomic operation includes:

[0064] For any atomic operation obtained by splitting the command line to be executed, the atomic operation is added to an operation queue corresponding to the operation type of the atomic operation through the splitting thread corresponding to the command line to be executed.

[0065] Specifically, considering that there may be multiple command lines to be executed in the centralized storage at the same time, in order to improve the efficiency of splitting the command lines to be executed and allocating atomic operations, a splitting thread is allocated to each command line to be executed in the embodiment of the present invention. The splitting thread is responsible for the splitting of the corresponding command lines to be executed and the allocation of atomic operations, which can further improve the processing efficiency of the command lines.

[0066] As an optional embodiment, there is a one-to-one correspondence between operation types and operation queues, and there is a one-to-one correspondence between operation queues and queue processing threads.

[0067] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 A flowchart of another centralized storage command line management method provided by the present invention is provided. Figure 2 Modules a to e in the first command line to be executed are atomic operations respectively, and modules f to j in the second command line to be executed can also be atomic operations. Figure 2Where N can be a positive integer from 1 to infinity, that is, each command line to be processed corresponds to a splitting thread one by one. The splitting thread is responsible for splitting the corresponding command line to be executed and allocating atomic operations. For several operation queues, they can be processed in parallel through one-to-one queue processing threads, thereby improving the processing efficiency of the command line.

[0068] Specifically, in order to further improve the parallelism of command line processing, the operation types in the embodiments of the present invention correspond one-to-one to the operation queues, and the operation queues correspond one-to-one to the queue processing threads, so that the atomic operations of each type of operation can be specially processed by a queue processing thread, that is, the atomic operations of each type of operation can be processed in parallel.

[0069] As an optional embodiment, for any atomic operation obtained by splitting, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation includes:

[0070] For any atomic operation obtained by splitting, determine whether there is an operation queue corresponding to the operation type of the atomic operation;

[0071] If it exists, the atomic operation is added to the operation queue corresponding to the operation type of the atomic operation;

[0072] If it does not exist, create an operation queue corresponding to the operation type of the atomic operation, and add the atomic operation to the operation queue corresponding to the operation type of the atomic operation;

[0073] Centralized storage command line management methods also include:

[0074] For any operation queue, determine whether there is an unprocessed atomic operation in the operation queue;

[0075] If there are no unprocessed atomic operations in the operation queue, destroy the operation queue;

[0076] Determine whether the preset time has passed since the last queue detection action;

[0077] If reached, the step of determining whether there is any unprocessed atomic operation in any operation queue is executed.

[0078] Specifically, considering that there may not be an atomic operation of a certain operation type in the centralized storage during certain time periods, in this case there is naturally no need to prepare an operation queue for this operation type. Therefore, the operation queue in the embodiment of the present invention can be generated instantly when needed, and the operation queue can be destroyed when there is no unprocessed atomic operation in the operation queue. That is, for any atomic operation obtained by splitting, it is determined whether there is an operation queue corresponding to the operation type of the atomic operation. If so, the atomic operation is added to the operation queue corresponding to the operation type of the atomic operation; if not, an operation queue corresponding to the operation type of the atomic operation is created, and the atomic operation is added to the operation queue corresponding to the operation type of the atomic operation; for any operation queue, it is determined whether there is an unprocessed atomic operation in the operation queue; if there is no unprocessed atomic operation in the operation queue, the operation queue is destroyed, so that the operation queue is generated when needed and destroyed when not needed, thereby minimizing the occupation of resources by the operation queue.

[0079] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 3 , Figure 3 A schematic diagram of the structure of a centralized storage command line management device provided by the present invention, wherein the command line preprocessing module can perform preprocessing logic on the command line received by the centralized storage, and the command line logic processing module can be used to execute the steps in each embodiment of the present invention.

[0080] The preprocessing logic of the command line may include:

[0081] (1) Verify whether the parameters of the command line meet the relevant standards. Only if they meet the relevant standards can they continue to be executed; for example, it can be determined whether the command line to be executed meets the various standards in the preset standard set, and if they do not meet the standards, the command line to be executed will be refused to be executed.

[0082] Among them, the preset standard set can be set independently, for example, it can include at least one of a preset grammar standard, a preset semantic standard, a preset error handling standard and an input and output standard, and the embodiment of the present invention is not limited here.

[0083] (2) Verify whether the command line belongs to the preset command line set. Only if it belongs to the preset command line set can it be allowed to continue execution. Through the restrictions of the preset command line set, the user's autonomous restrictions on the executable command lines of the centralized storage system can be met. Only when the command line to be executed belongs to the preset command line set can the subsequent steps be carried out. If the command line to be executed does not belong to the preset command line set, the execution of the command line to be executed is rejected.

[0084] The preset command line set may be independently set, and the embodiment of the present invention does not limit this.

[0085] (3) Determine whether the sender of the command line has the command line usage permission corresponding to the operation type of the command line. If so, the execution is allowed to continue; otherwise, the execution is rejected and feedback is given.

[0086] Specifically, each user's "permission to use each type of command line" can be managed. For example, for user A, user A is granted permission to use command lines of operation types 1 and 3, but not granted permission to use command lines of other operation types. Then, when user A issues a command line of operation type 1 or 3, it can be executed. When the operation type of the command line issued by user A does not belong to operation type 1 or 3, the command line is refused to be executed. As an optional embodiment, the centralized storage command line management method also includes:

[0087] When the execution process of the command line to be executed is unexpectedly interrupted, determining the interruption atomic operation of the interrupted command line, wherein the interrupted command line refers to: the command line to be executed whose execution process is unexpectedly interrupted, and the interruption atomic operation refers to the atomic operation executed by the interrupted command line when the execution process is unexpectedly interrupted;

[0088] According to the operation log of the interrupted command line, starting from the interrupted atomic operation, each atomic operation executed in the interrupted command line is rolled back in the reverse order of the atomic operations executed, wherein the operation log is used to record each atomic operation executed in the command line to be executed and the execution order.

[0089] Specifically, considering that when the execution process of the command line is unexpectedly interrupted, the command line is likely to be resent according to the user's operating habits, in order to prevent residual resources and repeated command line operations, the embodiment of the present invention can also use atomic operations as the granularity. When the execution process is unexpectedly interrupted, the various atomic operations that have been executed on the interrupted command line are rolled back starting from the interrupted atomic operation. The specific process includes: when the execution process of the command line to be executed is unexpectedly interrupted, determining the interrupted atomic operation of the interrupted command line, and according to the operation log of the interrupted command line, starting from the interrupted atomic operation, rolling back the various atomic operations that have been executed on the interrupted command line in the reverse order of the execution order of the atomic operations, thereby efficiently and accurately implementing the rollback processing of each atomic operation and clearing residual resources.

[0090] Among them, the command line to be executed involved in the embodiment of the present invention can be considered as a command line for configuration-type operations, and the operation log can also be an operation log of the command line for configuration-type operations. At the same time, centralized storage can also record audit logs for command lines for configuration-type operations. The audit log includes command line execution records, which are convenient for users to view. The command line execution record may include the name, serial number, parameters, status, trigger time, and execution steps of the command line, etc., which are not limited in the embodiment of the present invention.

[0091] Specifically, when the execution process of the command line to be executed is unexpectedly interrupted, determining the interruption atomic operation of the interrupted command line may include: when the execution process of the command line to be executed is unexpectedly interrupted, determining the interruption atomic operation of the interrupted command line through an interruption trigger message; in addition, the interruption atomic operation of the interrupted command line may also be determined through an operation log, which is not limited in the embodiments of the present invention.

[0092] As an optional embodiment, when the execution process of the command line to be executed is unexpectedly interrupted, after determining the interruption atomic operation of the interruption command line, according to the operation log of the interruption command line, starting from the interruption atomic operation, in the reverse order of the execution order of the atomic operations, before rolling back the atomic operations executed by the interruption command line, the centralized stored command line management method further includes:

[0093] When the interrupt atomic operation is executed, it is determined whether the to-be-executed command line to which the interrupt atomic operation belongs has generated a view change in the user interface;

[0094] If no view change is generated, the following steps are executed: according to the operation log of the interrupt command line, starting from the interrupt atomic operation, in the reverse order of the atomic operations executed, each atomic operation executed by the interrupt command line is rolled back;

[0095] If the view has been changed, the interrupt command line will be processed starting from the interrupt atomic operation according to the operation log of the interrupt command line, and the atomic operations that have not been executed by the interrupt command line will be processed continuously.

[0096] Specifically, considering that for the user, when the execution process of the command line is interrupted, if a view change is seen on the user interface (for example, the generation of a file icon), the command line may not be resent because it is believed that the command line has been executed; if no view change is seen on the user interface, the command line may be resent because it is believed that the command line has not been executed. That is, in the case where a view change occurs, the command line that has not been executed should theoretically continue to be executed; and in the case where no view change occurs, the command line that has not been executed should theoretically be rolled back to clear residual resources. Therefore, in the embodiment of the present invention, it can be determined whether the command line to be executed to which the interrupt atomic operation belongs has generated a view change in the user interface when the interrupt atomic operation is executed. If no view change occurs, the following steps are executed: according to the operation log of the interrupt command line, starting from the interrupt atomic operation, each atomic operation that has been executed of the interrupt command line is rolled back in the reverse order of the execution order of the atomic operations; if a view change has occurred, according to the operation log of the interrupt command line, each atomic operation that has not been executed of the interrupt command line is continued to be processed starting from the interrupt atomic operation.

[0097] As an optional embodiment, according to the operation log of the interrupt command line, starting from the interrupt atomic operation, in the reverse order of the execution order of the atomic operations, the rollback processing of each atomic operation executed by the interrupt command line includes:

[0098] According to the operation log of the interrupt command line, the atomic operation that has been executed by the interrupt command line is added to the rollback queue;

[0099] For each atomic operation in the rollback queue, rollback processing is performed in the reverse order of execution.

[0100] Specifically, in order to accurately roll back the atomic operations that have been executed by the interrupt command line in sequence, a dedicated rollback queue can be set in an embodiment of the present invention. According to the operation log of the interrupt command line, the atomic operations that have been executed by the interrupt command line can be added to the rollback queue. For each atomic operation in the rollback queue, rollback processing is performed in reverse order of the execution order.

[0101] Among them, the rollback queue can also be destroyed after use to reduce resource usage.

[0102] As an optional embodiment, according to the operation log of the interrupt command line, starting from the interrupt atomic operation, continuing to process each atomic operation that has not been executed by the interrupt command line includes:

[0103] According to the operation log of the interrupt command line, for any atomic operation that is not executed by the interrupt command line, the atomic operation is added to the operation queue corresponding to the operation type of the atomic operation, so that each atomic operation that is not executed by the interrupt command line is processed by the queue processing thread corresponding to each operation queue.

[0104] Specifically, considering that the atomic operation of the command line whose execution process is accidentally interrupted may no longer exist in each operation queue, in order to continue processing the atomic operations not executed by the interrupted command line, in an embodiment of the present invention, based on the operation log of the interrupted command line, for any atomic operation not executed by the interrupted command line, the atomic operation can be added to the operation queue corresponding to the operation type of the atomic operation, so that each atomic operation not executed by the interrupted command line can be processed by the queue processing thread corresponding to each operation queue.

[0105] Of course, before adding to the operation queue, it is also possible to determine whether there is an atomic operation to be added in the operation queue. If it already exists, the atomic operation will not be added. If it does not exist, the atomic operation can be added to the operation queue corresponding to the operation type.

[0106] Please refer to Figure 4 , Figure 4A schematic diagram of the structure of a centralized storage command line management device provided by the present invention, the centralized storage command line management device includes:

[0107] A memory 41, used for storing computer programs;

[0108] The processor 42 is used to implement the steps of the centralized storage command line management method in the above-mentioned embodiment when executing the computer program.

[0109] For an introduction to the centralized storage command line management device provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the centralized storage command line management method, and the embodiment of the present invention will not be described in detail here.

[0110] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. A computer program 52 is stored on the computer-readable storage medium 51. When the computer program 52 is executed by the processor, the steps of the centralized storage command line management method in the aforementioned embodiment are implemented.

[0111] For an introduction to the computer-readable storage medium provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the centralized storage command line management method, and the embodiment of the present invention will not be described in detail here.

[0112] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the centralized storage command line management method in the aforementioned embodiment.

[0113] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the centralized storage command line management method, and the embodiment of the present invention will not be described in detail here.

[0114] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. It should also be noted that in this specification, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0115] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A centralized storage command line management method, characterized in that: Processors for centralized storage include: Split the centrally stored to-be-executed command lines into several atomic operations; For any atomic operation obtained by splitting, add the atomic operation to an operation queue corresponding to the operation type of the atomic operation, wherein a single operation type corresponds to one operation queue, and the total number of operation queues is not less than 2; According to the first correspondence, the atomic operations in each of the operation queues are processed simultaneously by multiple queue processing threads, wherein the first correspondence is the correspondence between the queue processing threads and the operation queues, a single operation queue corresponds to one queue processing thread, and the total number of queue processing threads is not less than 2.

2. The centralized storage command line management method according to claim 1, characterized in that: Splitting the centrally stored to-be-executed command lines into several atomic operations includes: For any command line to be executed in the centralized storage, split the command line to be executed into a plurality of atomic operations through a splitting thread corresponding to the command line to be executed, wherein the command line to be executed corresponds to the splitting thread one by one; For any atomic operation obtained by splitting, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation includes: For any atomic operation obtained by splitting the command line to be executed, the atomic operation is added to an operation queue corresponding to the operation type of the atomic operation through a splitting thread corresponding to the command line to be executed.

3. The centralized storage command line management method according to claim 1, characterized in that: The operation types correspond one-to-one to the operation queues, and the operation queues correspond one-to-one to the queue processing threads.

4. The centralized storage command line management method according to claim 3, characterized in that: For any atomic operation obtained by splitting, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation includes: For any atomic operation obtained by splitting, determine whether there is an operation queue corresponding to the operation type of the atomic operation; If so, adding the atomic operation to an operation queue corresponding to the operation type of the atomic operation; If it does not exist, create an operation queue corresponding to the operation type of the atomic operation, and add the atomic operation to the operation queue corresponding to the operation type of the atomic operation; The centralized storage command line management method also includes: For any of the operation queues, determining whether there is an unprocessed atomic operation in the operation queue; If there is no unprocessed atomic operation in the operation queue, destroy the operation queue; Determine whether the preset time has passed since the last queue detection action; If reached, the step of determining whether there is any unprocessed atomic operation in any of the operation queues is executed.

5. The centralized storage command line management method according to any one of claims 1 to 4, characterized in that: The centralized storage command line management method also includes: When the execution process of the command line to be executed is unexpectedly interrupted, determining an interruption atomic operation of the interrupted command line, wherein the interrupted command line refers to: the command line to be executed whose execution process is unexpectedly interrupted, and the interruption atomic operation refers to the atomic operation executed by the interrupted command line when the execution process is unexpectedly interrupted; According to the operation log of the interrupt command line, starting from the interrupt atomic operation, each atomic operation executed by the interrupt command line is rolled back in the reverse order of the execution order of the atomic operations, wherein the operation log is used to record each atomic operation executed in the command line to be executed and the execution order.

6. The centralized storage command line management method according to claim 5, characterized in that: When the execution process of the command line to be executed is unexpectedly interrupted, after determining the interruption atomic operation of the interruption command line, according to the operation log of the interruption command line, starting from the interruption atomic operation, in the reverse order of the execution order of the atomic operations, before rolling back each atomic operation executed by the interruption command line, the centralized stored command line management method further includes: When the interrupt atomic operation is executed, it is determined whether the to-be-executed command line to which the interrupt atomic operation belongs has generated a view change in the user interface; If no view change is generated, the following steps are performed: according to the operation log of the interrupt command line, starting from the interrupt atomic operation, in the reverse order of the execution sequence of the atomic operations, each atomic operation executed by the interrupt command line is rolled back; If the view has been changed, then according to the operation log of the interrupt command line, starting from the interrupt atomic operation, each atomic operation that has not been executed by the interrupt command line is continuously processed.

7. The centralized storage command line management method according to claim 5, characterized in that: According to the operation log of the interrupt command line, starting from the interrupt atomic operation, in the reverse order of the execution order of the atomic operations, rolling back each atomic operation executed by the interrupt command line includes: According to the operation log of the interrupt command line, the atomic operation that has been executed by the interrupt command line is added to the rollback queue; For each atomic operation in the rollback queue, rollback processing is performed in the reverse order of the execution order.

8. The centralized storage command line management method according to claim 6, characterized in that: According to the operation log of the interrupt command line, starting from the interrupt atomic operation, continuing to process each atomic operation that has not been executed by the interrupt command line includes: According to the operation log of the interrupt command line, for any atomic operation that is not executed by the interrupt command line, the atomic operation is added to the operation queue corresponding to the operation type of the atomic operation, so that each atomic operation that is not executed by the interrupt command line is processed by the queue processing thread corresponding to each operation queue.

9. A centralized storage command line management device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the centralized storage command line management method as claimed in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the centralized storage command line management method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Cluster operation and maintenance instruction execution method and device, electronic device and storage medium

    CN120474915A