Data processing method, device, product, equipment and medium for storage cluster system
By detecting the transmission queue depth and migrating tasks in the storage cluster system, combined with processor thread adjustment, the problems of low communication efficiency and low data consistency in the storage cluster system are solved, and higher system performance and reliability are achieved.
Patent Information
- Application Number
- CN202411367296.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-29
AI Technical Summary
The low communication efficiency and low data consistency of the storage cluster system affect system performance and reliability.
By obtaining the pending business tasks and the transmission queue in which they are located, the queue depth is detected and when the threshold is reached, the task is migrated to a transmission queue with a smaller queue depth, and the processor thread is adjusted to optimize task processing.
It improves the communication efficiency and data consistency of the storage cluster system, optimizes processor resource utilization, and enhances system reliability.
Smart Images

Figure CN118885282B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of centralized storage technology, and in particular to a data processing method, device, product, equipment and medium for a storage cluster system. Background Art
[0002] The storage cluster system consists of multiple controllers, which work in coordination with each other to serve the host business, so communication between controllers is inevitable. In addition, there are multiple business modules in the entire storage cluster system, and communication between controllers is also required during the storage business process.
[0003] The communication efficiency between controllers in the storage cluster system will directly affect the operating efficiency of these business modules, thereby affecting the performance of the entire system; in addition, the storage cluster system must ensure data consistency, otherwise it will cause business data confusion and loss, resulting in business interruption of the entire system and affecting the reliability of the storage system.
[0004] It can be seen that how to achieve efficient communication of the storage cluster system and ensure data consistency to improve the performance of the storage cluster system is a technical problem that people in this field need to solve urgently. Summary of the invention
[0005] The purpose of the present invention is to provide a data processing method, device, product, equipment and medium for a storage cluster system to solve the technical problems of low communication efficiency and low data consistency of the storage cluster system.
[0006] In order to solve the above technical problems, the present invention provides a data processing method of a storage cluster system, comprising:
[0007] Obtaining a pending business task and a first transmission queue where the pending business task is located;
[0008] In the case of detecting that the queue depth of the first transmission queue is greater than the queue switching threshold, obtaining a second transmission queue, and migrating the service task to be processed from the first transmission queue to the second transmission queue; wherein the queue depth of the second transmission queue is less than the queue depth of the first transmission queue, and the second transmission queue is a transmission queue in the remaining transmission queues, and the remaining transmission queues are transmission queues in all transmission queues except the first transmission queue whose queue depth is greater than the queue switching threshold;
[0009] In the case where it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, if it is detected that the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is less than a second threshold, a target thread is acquired, and the thread used to process the business tasks on the second transmission queue is switched to the target thread; wherein the target thread is a thread corresponding to the processor core whose thread utilization is less than the first threshold;
[0010] If it is detected that the target business task located on the first transmission queue has been processed, the target thread is used to process the pending business task located on the second transmission queue; wherein the target business task is the business task that is located before the pending business task in the first transmission queue before the pending business task is migrated.
[0011] On the one hand, after obtaining the service task to be processed and before obtaining the first transmission queue where the service task to be processed is located, the method further includes:
[0012] Pre-set the priority order of pending business tasks;
[0013] Each pending business task whose priority is greater than or equal to a first preset value is respectively assigned to a transmission queue, a first number of pending business tasks whose priority is greater than or equal to a second preset value and less than the first preset value are assigned to a transmission queue, and a second number of pending business tasks whose priority is less than the second preset value are assigned to a transmission queue; wherein the first number is less than the second number; and the association strength value of the business tasks on the same transmission queue is less than a preset strength threshold.
[0014] On the other hand, obtaining the second transmission queue includes:
[0015] Acquire a first target remaining transmission queue from the remaining transmission queue; wherein the first target remaining transmission queue is a transmission queue whose queue depth is less than the queue depth of the first transmission queue;
[0016] Acquire a second target remaining transmission queue in the first target remaining transmission queue whose queue depth is less than a first depth threshold;
[0017] A transmission queue is randomly selected from the second target remaining transmission queues as the second transmission queue.
[0018] On the other hand, obtaining the second transmission queue includes:
[0019] If it is detected that there are multiple transmission queues with queue depths less than the queue switching threshold in the remaining transmission queues, a third target remaining transmission queue with a queue depth less than a second depth threshold is obtained from the multiple transmission queues with queue depths less than the queue switching threshold;
[0020] A transmission queue is randomly selected from the third target remaining transmission queues as the second transmission queue.
[0021] On the other hand, obtaining the second transmission queue includes:
[0022] If it is detected that there are multiple transmission queues whose queue depths are less than the queue switching threshold in the remaining transmission queues, then obtaining an average queue depth of each transmission queue and / or an idle time of each transmission queue within a first preset time length;
[0023] Determine the queue depth of each transmission queue according to the average queue depth of each transmission queue and / or the idle time of each transmission queue within the first preset time period, and sort the transmission queues in ascending order of queue depth;
[0024] Determine whether the data volume of the business task to be processed is greater than the preset data volume;
[0025] If not, selecting the transmission queue with the smallest queue depth as the second transmission queue;
[0026] If so, multiple transmission queues are selected in order from small to large queue depth as the second transmission queue.
[0027] On the other hand, obtaining the second transmission queue includes:
[0028] If it is detected that there are multiple transmission queues whose queue depth is less than the queue switching threshold in the remaining transmission queues, then obtaining the average queue depth of each transmission queue and / or the idle time of each transmission queue within a first preset time length, and obtaining the number of first transmission queues whose queue depth is greater than the queue switching threshold;
[0029] The second transmission queue is selected from all transmission queues whose queue depth is less than the queue switching threshold according to the number of first transmission queues whose queue depth is greater than the queue switching threshold and the average queue depth of each transmission queue within the first preset time period and / or the idle time of each transmission queue.
[0030] On the other hand, selecting the second transmission queue from all transmission queues having queue depths less than the queue switching threshold according to the number of first transmission queues having queue depths greater than the queue switching threshold and the average queue depth of each transmission queue within the first preset time period and / or the idle time of each transmission queue includes:
[0031] If the number of first transmission queues detected only with queue depths greater than the queue switching threshold is 1, then the transmission queue with the smallest average queue depth is obtained, and the transmission queue with the smallest average queue depth is used as the second transmission queue; or, the transmission queue with the longest idle time is obtained, and the transmission queue with the longest idle time is used as the second transmission queue; or, the final queue depth of each transmission queue is determined based on the average queue depth and idle time of each transmission queue within a first preset time period; the minimum final queue depth among all the final queue depths is obtained, and the transmission queue corresponding to the minimum final queue depth is used as the second transmission queue.
[0032] On the other hand, selecting the second transmission queue from all transmission queues having queue depths less than the queue switching threshold according to the number of first transmission queues having queue depths greater than the queue switching threshold and the average queue depth of each transmission queue within the first preset time period and / or the idle time of each transmission queue includes:
[0033] If the number of first transmission queues detected only with queue depths greater than the queue switching threshold is greater than 1, the transmission queues are sorted in ascending order according to the average queue depths, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queues; or, the transmission queues are sorted in descending order according to the idle time, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queues; or, the final queue depth of each transmission queue is determined based on the average queue depth and idle time of each transmission queue within a first preset time length; the transmission queues are sorted in ascending order according to the final queue depths, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queues.
[0034] On the other hand, obtaining the second transmission queue includes:
[0035] If it is detected that there is no transmission queue whose queue depth is less than the queue switching threshold in the remaining transmission queues, a target transmission queue is obtained from the remaining transmission queues; wherein the target transmission queue is a transmission queue whose service task priority in the remaining transmission queues is less than the service task priority on the first transmission queue whose queue depth is greater than the queue switching threshold;
[0036] sorting the queue depths of the target transmission queues;
[0037] Obtaining a transmission queue with the smallest queue depth among all the target transmission queues;
[0038] The transmission queue with the smallest queue depth among all the target transmission queues is used as the second transmission queue.
[0039] On the other hand, before migrating the to-be-processed service task from the first transmission queue to the second transmission queue, the method further includes:
[0040] Obtain a second transmission queue to be formed, use the second transmission queue to be formed as the new first transmission queue, return to the step of detecting whether the queue depth of the first transmission queue is greater than the queue switching threshold, stop returning until it is detected that the queue depth of the new first transmission queue is less than or equal to the queue switching threshold, and enter the step of migrating the pending business tasks from the first transmission queue to the second transmission queue; wherein the second transmission queue to be formed is a transmission queue formed after migrating the pending business tasks to be processed to the second transmission queue.
[0041] On the other hand, migrating the to-be-processed service task from the first transmission queue to the second transmission queue includes:
[0042] Migrating the pending business tasks from the first transmission queue to the head of the second transmission queue; wherein the priorities of the business tasks from the head position to the tail position of the transmission queue decrease in sequence;
[0043] The processing of the pending business tasks located on the second transmission queue by using the target thread includes:
[0044] After detecting that the task currently being processed by the target thread is completed, the target thread is used to process the pending service task located at the head of the second transmission queue.
[0045] On the other hand, after migrating the to-be-processed service task from the first transmission queue to the second transmission queue, the method further includes:
[0046] Recording the location of the pending business tasks migrated to the second transmission queue;
[0047] Before using the target thread to process the pending business tasks located on the second transmission queue, the method further includes:
[0048] If it is detected that a new service task to be processed is to be migrated to the second transmission queue, the new service task to be processed is migrated to the second transmission queue starting from the recorded position.
[0049] On the other hand, after migrating the pending business task from the first transmission queue to the second transmission queue and before using the target thread to process the pending business task on the second transmission queue, the method further includes:
[0050] Obtaining a third number of service tasks on the second transmission queue before the service tasks to be processed are migrated from the first transmission queue to the second transmission queue;
[0051] Starting from migrating the to-be-processed business tasks from the first transmission queue to the second transmission queue, obtaining a fourth number of business tasks on the second transmission queue within a second preset time period;
[0052] determining whether the fourth number is greater than the third number;
[0053] If so, the step of using the target thread to process the pending business tasks on the second transmission queue is entered.
[0054] On the other hand, the processing of the pending business tasks located on the second transmission queue by using the target thread includes:
[0055] After detecting that the business task being processed on the target thread is completed, the target thread is used to process the to-be-processed business task on the second transmission queue.
[0056] On the other hand, after using the target thread to process the pending business tasks located on the second transmission queue, the method further includes:
[0057] The target thread is used to process the service tasks on the second transmission queue in the order of their priorities.
[0058] In another aspect, the method further comprises:
[0059] When it is detected that the processor core used to process the second transmission queue is a different core from the processor core used to process other business modules, or when it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, and the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is greater than or equal to a second threshold, the thread corresponding to the processor core used to process the second transmission queue is kept used to process the pending business tasks on the second transmission queue.
[0060] In another aspect, the method further comprises:
[0061] When it is detected that the queue depth of the first transmission queue is less than or equal to the queue switching threshold, obtaining a thread utilization rate of a processor core used to process the first transmission queue;
[0062] If it is detected that the thread utilization of the processor core used to process the first transmission queue is less than the first threshold, the threads of the processor core used to process the first transmission queue are used to process the pending business tasks on the first transmission queue in accordance with the priority order of the business tasks in the first transmission queue.
[0063] In another aspect, the method further comprises:
[0064] If it is detected that the thread utilization rate of the processor core used to process the first transmission queue is greater than or equal to the first threshold, determining the thread to be used;
[0065] Switching a thread for processing business tasks on the first transmission queue to the thread to be used;
[0066] The to-be-used thread is used to process the to-be-processed service tasks in the first transmission queue in accordance with the priority order of the service tasks in the first transmission queue.
[0067] On the other hand, determining the thread to be used includes:
[0068] If it is detected that the processor core used to process the first transmission queue is the same core as the processor core used to process other business modules, and the thread occupancy rate of processing the transmission queue is less than the second threshold, then the thread to be used is determined to be the thread corresponding to the processor core whose thread utilization rate is less than the first threshold.
[0069] On the other hand, determining the thread to be used includes:
[0070] When it is detected that the processor core used to process the first transmission queue is a different core from the processor core used to process other business modules, or when it is detected that the processor core used to process the first transmission queue is the same core as the processor core used to process other business modules, and the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is greater than or equal to a second threshold, the thread corresponding to the processor core used to process the first transmission queue is kept used to process the pending business tasks on the first transmission queue.
[0071] In order to solve the above technical problems, the present invention further provides a data processing device for a storage cluster system, comprising:
[0072] An acquisition module, used for acquiring a pending business task and a first transmission queue where the pending business task is located;
[0073] an acquisition and migration module, configured to acquire a second transmission queue and migrate the to-be-processed service task from the first transmission queue to the second transmission queue when detecting that the queue depth of the first transmission queue is greater than a queue switching threshold; wherein the queue depth of the second transmission queue is less than the queue depth of the first transmission queue, the second transmission queue is a transmission queue in the remaining transmission queues, and the remaining transmission queues are transmission queues in all transmission queues except the first transmission queue whose queue depth is greater than the queue switching threshold;
[0074] an acquisition and switching module, for acquiring a target thread and switching the thread for processing the business tasks on the second transmission queue to the target thread if it is detected that the processor core for processing the second transmission queue is the same core as the processor core for processing other business modules, and if it is detected that the thread utilization of the current processor core is greater than a first threshold and the thread occupancy of processing the transmission queue is less than a second threshold; wherein the target thread is a thread corresponding to the processor core whose thread utilization is less than the first threshold;
[0075] A processing module is used to use the target thread to process the pending business task located on the second transmission queue if it is detected that the processing of the target business task located on the first transmission queue is completed; wherein the target business task is the business task that is located before the pending business task in the first transmission queue before the pending business task is migrated.
[0076] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the data processing method of the above storage cluster system when executed by a processor.
[0077] In order to solve the above technical problems, the present invention further provides a data processing device for a storage cluster system, comprising:
[0078] Memory for storing computer programs;
[0079] The processor is used to implement the steps of the data processing method of the storage cluster system when executing the computer program.
[0080] In order to solve the above technical problem, the present invention further provides a non-volatile storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data processing method of the storage cluster system are implemented.
[0081] The beneficial effect of the present invention lies in that, in the method, when it is detected that the queue depth of the first transmission queue where the business task to be processed is located is greater than the queue switching threshold, a second transmission queue whose queue depth is less than the queue depth of the first transmission queue is selected from the remaining transmission queues, and the task to be processed is switched from the first transmission queue to the second transmission queue, thereby realizing flexible adjustment of the transmission queue of the task to be processed; and when it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, and the thread utilization rate of the current processor core is greater than the first threshold, and the thread occupancy rate of processing the transmission queue is less than the second threshold, the thread used to process the business task on the second transmission queue is switched to the target thread, and finally the target thread processes the business task to be processed on the second transmission queue, thereby realizing the thread occupancy rate of the task to be processed. Flexible adjustment; secondly, the target thread is the thread corresponding to the processor core whose thread utilization is less than the first threshold, that is, the target thread is a relatively idle thread. Therefore, compared with the method of using the original thread of the second transmission queue to process the pending business tasks, the method provided by the present invention avoids the situation where other business modules and the transmission queue occupy the processor core, improves the transmission efficiency of the pending tasks, improves the communication efficiency between the controllers of the storage cluster system, and makes full use of the processor resources, thereby improving the utilization rate of the processor resources; thirdly, after it is detected that the business task before the pending business task in the first transmission queue has been processed, the target thread is used to process the pending business task on the second transmission queue, thereby ensuring the sequential transmission of data, that is, following the order preservation mechanism, ensuring data consistency, and improving the reliability of the storage cluster system.
[0082] In addition, for the priority order of the business tasks to be processed, a transmission queue is allocated to each business task to be processed according to the priority of the business tasks to be processed. A high-priority business task uses a separate transmission queue, and a low-priority business task shares a transmission queue, that is, the transmission queues of high-priority business tasks are relatively scattered, while the transmission queues of low-priority business tasks are relatively concentrated; and the correlation of business tasks on the same transmission queue is relatively small, ensuring that high-priority business tasks can be processed first.
[0083] When determining the second transmission queue, firstly, a second target remaining transmission queue less than the first depth threshold is selected from the transmission queues with a queue depth less than the first transmission queue, and then a transmission queue is randomly selected from the second target remaining transmission queue as the second transmission queue. It can be seen that the second transmission queue is determined by taking the first depth threshold as the judgment basis.
[0084] When determining the second transmission queue, a third target remaining transmission queue with a queue depth less than the second depth threshold is obtained from multiple transmission queues with queue depths less than the queue switching threshold, and then a transmission queue is randomly selected from the third target remaining transmission queue as the second transmission queue. It can be seen that the second transmission queue is determined based on the queue switching threshold and the second depth threshold. When determining the second transmission queue, the amount of data of the business task to be processed is taken into consideration, and a second transmission queue is selected or multiple transmission queues are selected in order from small to large queue depths as the second transmission queue, so that the selected second transmission queue is more appropriate.
[0085] When determining the transmission queue to be switched to (i.e., the second transmission queue), if there are multiple transmission queues in the remaining transmission queues whose queue depth is less than the queue switching threshold, then when only one first transmission queue whose queue depth is greater than the queue switching threshold is detected, since the transmission queue with the smallest queue depth (including a value determined only by the queue depth as a parameter, or a queue depth determined comprehensively by the queue depth and the idle time) or the transmission queue with the longest idle time is used as the transmission queue to which the pending business task is switched, the pending business task is switched to the second transmission queue, thereby improving the processing efficiency of the pending business task.
[0086] When determining the transmission queue to be switched to (i.e., the second transmission queue), if there are multiple transmission queues with queue depths less than the queue switching threshold in the remaining transmission queues, then when multiple first transmission queues with queue depths greater than the queue switching threshold are detected, the corresponding second transmission queues are determined for each first transmission queue with a queue depth greater than the queue switching threshold in order of queue depth from small to large or idle time from large to small; since transmission queues with small queue depths or transmission queues with large idle time are selected as each second transmission queue, the business tasks to be processed are switched to the second transmission queues, which can improve the processing efficiency of the business tasks to be processed.
[0087] When determining the second transmission queue, if it is detected that there is no transmission queue with a queue depth less than the queue switching threshold in the remaining transmission queues, the transmission queues in the remaining transmission queues whose business task priority is less than the business task priority on the first transmission queue with a queue depth greater than the queue switching threshold are sorted, and the transmission queue with the smallest queue depth is found as the second transmission queue. Since the transmission queue with the smallest queue depth is used as the second transmission queue, the business task to be processed is switched to the second transmission queue, which can improve the processing efficiency of the business task to be processed.
[0088] Before migrating the business task to be processed from the first transmission queue to the second transmission queue, first obtain the second transmission queue to be formed, then use the second transmission queue to be formed as the new first transmission queue, return to the step of detecting whether the queue depth of the first transmission queue is greater than the queue switching threshold, and stop returning until it is detected that the queue depth of the new first transmission queue is less than or equal to the queue switching threshold, and enter the step of migrating the business task to be processed from the first transmission queue to the second transmission queue. This ensures that after migrating the business task to be processed to the second transmission queue, the second transmission queue does not reach the queue switching threshold, thereby improving the processing efficiency of the business task.
[0089] During migration, the pending service tasks located on the first transmission queue are migrated to the head of the second transmission queue, so that the pending service tasks migrated to the second transmission queue can be processed preferentially.
[0090] After migrating the pending business tasks on the first transmission queue to the second transmission queue, the positions of the pending business tasks migrated to the second transmission queue are recorded so that when new pending business tasks are migrated to the second transmission queue, the positions where the new pending business tasks are to be placed can be quickly found.
[0091] By comparing the number of pending business tasks on the second transmission queue before migration with the number of pending business tasks on the second transmission queue after migration, it is possible to determine whether the business tasks have been successfully migrated based on the change in the number of pending business tasks on the second transmission queue.
[0092] The target thread is used to process the business tasks on the second transmission queue in the order of their priority, or the thread to be used is used to process the business tasks on the first transmission queue in the order of their priority, so that high-priority business tasks are processed first, which can effectively reduce the waiting time of public transactions in the storage system.
[0093] In addition, the present invention also provides a data processing device, a computer program product, a data processing equipment of a storage cluster system, and a non-volatile storage medium, which have the same or corresponding technical features as the data processing method of the storage cluster system described above, and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. 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 paying creative work.
[0095] Figure 1 A schematic diagram of a storage cluster system provided by an embodiment of the present invention;
[0096] Figure 2 A schematic diagram of a method of not following the order-preserving mechanism provided by an embodiment of the present invention;
[0097] Figure 3 A flowchart of a data processing method for a storage cluster system provided by an embodiment of the present invention;
[0098] Figure 4 A schematic diagram of a single-thread single-queue provided in an embodiment of the present invention;
[0099] Figure 5 A schematic diagram of a multi-threaded multi-queue system provided by an embodiment of the present invention;
[0100] Figure 6 A schematic diagram of the distribution of service tasks in various transmission queues provided by an embodiment of the present invention;
[0101] Figure 7 A schematic diagram of the interaction between a service module and a communication module in a storage cluster system provided by an embodiment of the present invention;
[0102] Figure 8 A structural diagram of a data processing device of a storage cluster system provided in another embodiment of the present invention. DETAILED DESCRIPTION
[0103] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0104] The core of the present invention is to provide a data processing method, device, product, equipment and medium for a storage cluster system to solve the technical problems of low communication efficiency and low data consistency of the storage cluster system.
[0105] Figure 1 A schematic diagram of a storage cluster system provided by an embodiment of the present invention is shown in FIG. Figure 1As shown in the figure, the storage cluster system consists of multiple controllers, and multiple controllers can communicate with each other. Multiple controllers coordinate with each other to serve the host business, so communication between controllers is inevitable. In addition, the entire storage system includes a series of value-added features such as Redundant Array of Independent Disks (RAID) fault tolerance, virtualized resource pool, deduplication / compression, metadata cache, data cache, snapshot fault tolerance, remote replication disaster recovery, etc. These value-added features exist as independent business modules within the storage software system. During the storage business process, these business modules will communicate with each other between controllers. Therefore, the efficiency of communication between controllers will directly affect the operating efficiency of these business modules, thereby affecting the performance of the entire system. At the same time, the storage system must ensure data consistency, that is, the data that the host has responded to can be correctly read by any controller in the storage cluster system. If the content read on different controllers is different, it means that the data is inconsistent, which will cause serious consequences such as business data confusion and loss, leading to business interruption and data loss of the entire system, with immeasurable impact. Therefore, in addition to the demand for efficiency, communication between controllers must also meet the requirements of consistency, that is, data transmission order guarantee, usually called order preservation mechanism. The order preservation mechanism will ensure that when the sending controller sends multiple transmission requests in succession, the data sent first arrives at the other end first. If the data sent later arrives first, and the data sent earlier arrives later, such as Figure 2 As shown, Figure 2 A schematic diagram of an embodiment of the present invention that does not follow the order preservation mechanism is provided. Taking the example of controller 1 sending task 1, task 2 and task 3 to controller 2 in sequence, if controller 2 receives task 1, task 2 and task 3 in sequence, the order preservation mechanism is followed and data consistency is guaranteed. Figure 2 Controller 2 receives Task 2, Task 3, and Task 1 in sequence, causing the data written first on this end to become data written later on the other end, resulting in inconsistent data between controllers communicating with each other in the cluster.
[0106] The most direct way to improve communication efficiency is to increase concurrency, but blindly increasing concurrency can easily destroy the communication order-preserving mechanism. Therefore, in the storage cluster system, efficient communication between controllers must be achieved while also taking into account the communication order-preserving mechanism.
[0107] Therefore, an embodiment of the present invention provides a data processing method for a storage cluster system to improve the communication efficiency between controllers in the storage cluster system and ensure data consistency.
[0108] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 3A flowchart of a data processing method for a storage cluster system provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the method includes:
[0109] S10: Acquire the business task to be processed and the first transmission queue where the business task to be processed is located;
[0110] S11: when it is detected that the queue depth of the first transmission queue is greater than the queue switching threshold, obtaining the second transmission queue, and migrating the service tasks to be processed from the first transmission queue to the second transmission queue;
[0111] S12: when it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, if it is detected that the thread utilization rate of the current processor core is greater than the first threshold, and the thread occupancy rate of processing the transmission queue is less than the second threshold, a target thread is acquired, and the thread used to process the business tasks on the second transmission queue is switched to the target thread;
[0112] S13: If it is detected that the target business task located in the first transmission queue is processed, the target thread is used to process the pending business task located in the second transmission queue;
[0113] The target business task is a business task that is located before the business task to be processed in the first transmission queue before the business task to be processed is migrated.
[0114] The entire storage system includes a series of value-added features such as RAID fault tolerance, virtualized resource pool, deduplication / compression, metadata cache, data cache, snapshot fault tolerance, remote replication disaster recovery, etc. These value-added features exist as independent business modules within the storage software system. The business module includes the business tasks to be processed. There is no limit on the business tasks to be processed, which are determined according to the actual situation. In order to realize the transmission of business tasks, the sending queue and receiving queue are set.
[0115] In order to ensure communication order, the communication component directly adopts a single-thread single-queue mechanism. The sending queue is processed by one thread, and the receiving queue is processed by another thread. All data to be sent will be sent strictly according to the first-in-first-out strategy. The receiving end also uses a similar mechanism to ensure order. Figure 4 As shown, Figure 4 A schematic diagram of a single-threaded single-queue provided in an embodiment of the present invention. A sending end and a receiving end interact with each other, and each of the sending end and the receiving end has a corresponding service module, a sending queue and a receiving queue, wherein the sending queue is processed by processor core 1, and the receiving queue is processed by processor core 2.
[0116] In view of the efficiency problem of single-queue communication, the sending and receiving queues will be expanded to multi-threaded multi-queues, and different task queues will be allocated to multiple business module applications, but the queue allocation method is relatively fixed. Figure 5 A schematic diagram of a multi-threaded multi-queue provided for an embodiment of the present invention, in which a sending end and a receiving end interact with each other, and four business modules are included at both the sending end and the receiving end, namely business module one, business module two, business module three and business module four, and multiple sending queues and multiple receiving queues are included at both the sending end and the receiving end. Processor core one processes business tasks on sending queue one, processor core two processes business tasks on sending queue two; processor core three processes business tasks on receiving queue one; processor core four processes business tasks on receiving queue two. Business module one and business module two share sending queue one, and business module three and business module four share sending queue two. When there is a task that needs to be sent for processing, a pre-specified queue is used for data communication.
[0117] Due to the low efficiency of single-threaded single-queue communication, it is easy for a single processor core responsible for processing the message queue to become the performance bottleneck of the entire system; in multi-threaded multi-queue communication, the relatively fixed multi-queue allocation method can achieve order preservation and efficient transmission by placing services with low correlation into fixed queues, but the allocation method is relatively fixed. In scenarios where some business modules are relatively idle and other business modules are relatively busy, it is easy to cause some queues to be vacant while other queues are congested. The problem of communication efficiency becoming a performance bottleneck is not fundamentally solved. In addition, the relatively fixed multi-queues lack a queue priority management mechanism and only mechanically divide the multiple queues without solving the relevant mechanism for efficient application of multiple queues. At the same time, the processor core responsible for the queue is relatively fixed and lacks an automatic adjustment mechanism. On a hardware platform with relatively limited processor cores, it is easy for the business module and the communication module to compete for the core, affecting communication efficiency.
[0118] Therefore, in the embodiment of the present invention, queue thread adjustment and queue selection of business tasks can be implemented on the basis of multi-core and multi-queue.
[0119] Specifically, when processing pending business tasks, each pending business task is first placed on a transmission queue. There is no limitation on the transmission queue where the pending business task is placed. In implementation, in order to improve the efficiency of business task processing, after obtaining the pending business task and before obtaining the first transmission queue where the pending business task is located, the following is also included:
[0120] Pre-set the priority order of pending business tasks;
[0121] Each pending business task whose priority is greater than or equal to a first preset value is respectively assigned to a transmission queue, a first number of pending business tasks whose priority is greater than or equal to a second preset value and less than the first preset value is assigned to a transmission queue, and a second number of pending business tasks whose priority is less than the second preset value is assigned to a transmission queue; wherein the first number is less than the second number; and the association strength value of the business tasks on the same transmission queue is less than the preset strength threshold.
[0122] The priority, first preset value, second preset value, and preset strength threshold set for the business task to be processed are not limited and are determined according to actual conditions. It should be noted that if the association strength value of the business tasks on the same transmission queue is less than the preset strength threshold, it indicates that the association strength of the business tasks on the same transmission queue is weak.
[0123] During implementation, when the system is initialized, each business module registers its own business task priority and pre-allocates the required transmission queues. In order to ensure that the data order preservation mechanism is not destroyed, business modules with strong business correlation are not allowed to share the same transmission queue. They can be distinguished by priority segments. Business modules or business tasks with the same priority or the same priority segment are not allowed to have strongly related business processing logic.
[0124] After completing the priority registration and queue pre-allocation, due to the limited number of processor cores, the number of cores allocated for transmission queues will be less than the number of business modules or transmission business tasks of business modules. At this time, multiple business tasks will share a single transmission queue. The transmission queues allocated to high-priority business tasks are relatively scattered, and the transmission queues allocated to low-priority business tasks are relatively concentrated. Figure 6 A schematic diagram of the distribution of service tasks in each transmission queue provided by an embodiment of the present invention. Figure 6 As shown, it includes transmission queue 1, transmission queue 2, transmission queue 3, transmission queue 4 and transmission queue 5. Starting from priority 1, the priority gradually decreases. Business task 1 corresponds to priority 1, which occupies transmission queue 1 alone; business task 2 corresponds to priority 2, which occupies transmission queue 2 alone; business task 3 corresponds to priority 3, which occupies transmission queue 3 alone; business task 4 (corresponding to priority 4) and business task 5 (corresponding to priority 5) share transmission queue 4; business task 6 (corresponding to priority 6), business task 7 (corresponding to priority 7) and business task 8 (corresponding to priority 8) share transmission queue 5.
[0125] It is worth noting that if the pending business tasks are just being processed, the first transmission queue corresponds to the transmission queue initially allocated to each business task. If the transmission queue where the business task is located has been adjusted for the first time, but before the business task is processed, the transmission queue where the business task is located needs to be adjusted, then at this time, the first transmission queue is the queue where the business task is located after the first adjustment.
[0126] After determining the first transmission queue where the business task to be processed is located, the queue depth of the first transmission queue is obtained. If the queue depth of the first transmission queue is greater than the queue switching threshold, a second transmission queue whose queue depth is less than the queue depth of the first transmission queue is obtained, and the business task to be processed is migrated from the first transmission queue to the second transmission queue. There is no limitation on the queue switching threshold, but the value of the queue switching threshold is generally greater than half of the capacity of the entire queue. The second transmission queue here is a transmission queue in the remaining transmission queues, and the remaining transmission queues are all transmission queues except the first transmission queue whose queue depth is greater than the queue switching threshold. It should be noted that after migrating the business task to be processed from the first transmission queue to the second transmission queue, it is possible to continue to judge whether the queue depth of the second transmission queue is less than the queue switching threshold. If it is not less than, continue to obtain a new second transmission queue.
[0127] When determining the second transmission queue (ie, the transmission queue to which the pending service task is to be switched, ie, the idle queue), the embodiment of the present invention generally provides a plurality of ways to determine the second transmission queue.
[0128] A first method of determining the second transmission queue is: obtaining a first target remaining transmission queue from the remaining transmission queues; wherein the first target remaining transmission queue is a transmission queue whose queue depth is less than the queue depth of the first transmission queue;
[0129] Acquire a second target remaining transmission queue whose queue depth is less than a first depth threshold in the first target remaining transmission queue;
[0130] A transmission queue is randomly selected from the second target remaining transmission queues as the second transmission queue.
[0131] In the first mode, the first depth threshold is not limited and is determined according to actual conditions. The second transmission queue is determined based on the first depth threshold as a judgment reference.
[0132] A first method of determining the second transmission queue is: if it is detected that there are multiple transmission queues with queue depths less than the queue switching threshold in the remaining transmission queues, a third target remaining transmission queue with a queue depth less than the second depth threshold is obtained from the multiple transmission queues with queue depths less than the queue switching threshold;
[0133] A transmission queue is randomly selected from the third target remaining transmission queues as the second transmission queue.
[0134] In the second mode, the second depth threshold is not limited and is determined according to actual conditions. The second transmission queue is determined based on the queue switching threshold and the second depth threshold.
[0135] A third method for determining the second transmission queue is: if it is detected that there are multiple transmission queues with queue depths less than the queue switching threshold in the remaining transmission queues, then obtaining an average queue depth of each transmission queue and / or an idle time of each transmission queue within a first preset time length;
[0136] Determine the queue depth of each transmission queue according to the average queue depth of each transmission queue and / or the idle time of each transmission queue within the first preset time period, and sort the transmission queues in ascending order of queue depth;
[0137] Determine whether the data volume of the business task to be processed is greater than the preset data volume;
[0138] If not, then select the transmission queue with the smallest queue depth as the second transmission queue;
[0139] If so, multiple transmission queues are selected in order from small to large queue depth as the second transmission queue.
[0140] In the third mode, the preset data volume is not limited and is determined according to actual conditions. When determining the second transmission queue, the data volume of the service task to be processed is taken into consideration, and a second transmission queue is selected or multiple transmission queues are selected in order of queue depth from small to large as the second transmission queue, so that the selected second transmission queue is more appropriate.
[0141] A fourth method for determining the second transmission queue is to determine the second transmission queue when it is detected that there are multiple transmission queues in the remaining transmission queues whose queue depth is less than or equal to the queue switching threshold. A fifth method for determining the second transmission queue is to determine the second transmission queue when it is detected that there is no transmission queue in the remaining transmission queues whose queue depth is less than or equal to the queue switching threshold.
[0142] In implementation, when the second transmission queue is determined by the fourth manner (i.e., a scenario in which it is detected that there are multiple transmission queues in the remaining transmission queues whose queue depths are less than the queue switching threshold), the method includes:
[0143] Obtaining an average queue depth of each transmission queue and / or an idle time of each transmission queue within a first preset time period, and obtaining the number of first transmission queues whose queue depth is greater than a queue switching threshold;
[0144] A second transmission queue is selected from all transmission queues whose queue depth is less than the queue switching threshold according to the number of first transmission queues whose queue depth is greater than the queue switching threshold and the average queue depth of each transmission queue within a first preset time period and / or the idle time of each transmission queue.
[0145] There is no limitation on the first preset time length, which is determined according to actual conditions. When the second transmission queue is selected from all transmission queues whose queue depths are less than the queue switching threshold according to the average queue depths of each transmission queue and the idle time of each transmission queue within the first preset time length, the average queue depth and the idle time of each transmission queue can be weighted averaged to obtain the final queue depth, and finally the transmission queue with the smallest queue depth is found as the second transmission queue.
[0146] Specifically, selecting the second transmission queue from all transmission queues whose queue depths are less than the queue switching threshold according to the number of first transmission queues whose queue depths are greater than the queue switching threshold and the average queue depth of each transmission queue within the first preset time period and / or the idle time of each transmission queue includes:
[0147] If the number of the first transmission queues whose queue depth is greater than the queue switching threshold detected is 1, then the transmission queue with the smallest average queue depth is obtained, and the transmission queue with the smallest average queue depth is used as the second transmission queue; or, the transmission queue with the longest idle time is obtained, and the transmission queue with the longest idle time is used as the second transmission queue; or, the final queue depth of each transmission queue is determined according to the average queue depth and idle time of each transmission queue within the first preset time period; the minimum final queue depth among all final queue depths is obtained, and the transmission queue corresponding to the minimum final queue depth is used as the second transmission queue.
[0148] If the number of the first transmission queues whose queue depth is greater than the queue switching threshold is detected to be greater than 1, the transmission queues are sorted in order of average queue depth from small to large, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queue; or, the transmission queues are sorted in order of idle time from large to small, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queue; or, the final queue depth of each transmission queue is determined according to the average queue depth and idle time of each transmission queue within the first preset time; the transmission queues are sorted in order of final queue depth from small to large, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queue.
[0149] The above process describes the method of determining the second transmission queue through the fourth method, that is, there may be multiple idle queues, in which case they are sorted according to the average queue depth and / or idle time, and the queue with the lower average depth is preferentially selected as the second transmission queue. When the second transmission queue is determined through the fifth method (that is, it is detected that there is no transmission queue with a queue depth less than the queue switching threshold in the remaining transmission queues), it includes:
[0150] Acquire a target transmission queue from the remaining transmission queues; wherein the target transmission queue is a transmission queue in which the priority of the service task in the remaining transmission queue is less than the priority of the service task on the first transmission queue whose queue depth is greater than the queue switching threshold;
[0151] Sort the queue depth of the target transmission queue;
[0152] Get the transmission queue with the smallest queue depth among all target transmission queues;
[0153] The transmission queue with the smallest queue depth among all target transmission queues is used as the second transmission queue.
[0154] After the second transmission queue is determined, the pending business tasks are migrated from the first transmission queue to the second transmission queue. It is worth noting that the order preservation mechanism cannot be destroyed during the migration process, such as Figure 6 When the queue depth of the queue where business task 4 and business task 5 are located exceeds the switching threshold, when business task 4 needs to be switched to another queue, after screening the objects queued by business task 4 in the original queue, migrate them to the idle queue. The idle queue needs to wait until the last task processed in the original queue is completed before starting.
[0155] That is, when determining the second transmission queue by the fifth method, no idle queue is identified. In this case, the queues processing low-priority tasks need to be sorted according to the average queue depth, and tasks are preferentially migrated to queues with smaller queue depths as the second transmission queue.
[0156] To ensure successful migration of the business task, after migrating the pending business task from the first transmission queue to the second transmission queue and before using the target thread to process the pending business task on the second transmission queue, the method further includes:
[0157] Obtaining a third number of service tasks on the second transmission queue before the service tasks to be processed are migrated from the first transmission queue to the second transmission queue;
[0158] Starting from migrating the to-be-processed service tasks from the first transmission queue to the second transmission queue, obtaining a fourth number of service tasks on the second transmission queue within a second preset time period;
[0159] determining whether the fourth quantity is greater than the third quantity;
[0160] If so, the process proceeds to the step of utilizing the target thread to process the pending business tasks on the second transmission queue.
[0161] There is no limitation on the third quantity and the fourth quantity, as long as the fourth quantity is greater than the third quantity.
[0162] By switching the to-be-processed business tasks from the first transmission queue to the second transmission queue and the above scheduling, it is possible to avoid a state where some processor cores are overly busy while other cores are completely idle.
[0163] In order to ensure that after the pending service task is migrated to the second transmission queue, the second transmission queue does not reach the queue switching threshold, in implementation, before the pending service task is migrated from the first transmission queue to the second transmission queue, the method further includes:
[0164] The second transmission queue to be formed is obtained, and the second transmission queue to be formed is used as the new first transmission queue. The process returns to the step of detecting whether the queue depth of the first transmission queue is greater than the queue switching threshold, and stops returning until the queue depth of the new first transmission queue is detected to be less than or equal to the queue switching threshold, and enters the step of migrating the business task to be processed from the first transmission queue to the second transmission queue; wherein the second transmission queue to be formed is the transmission queue formed after the business task to be processed is migrated to the second transmission queue. By judging the queue depth of the second transmission queue again, it is ensured that after the business task to be processed is migrated to the second transmission queue, the second transmission queue does not reach the queue switching threshold, thereby improving the processing efficiency of the business task.
[0165] In order to improve the processing efficiency of the business task to be processed, migrating the business task to be processed from the first transmission queue to the second transmission queue includes:
[0166] Migrate the pending business tasks from the first transmission queue to the head of the second transmission queue; wherein the priorities of the business tasks from the head position to the tail position of the transmission queue decrease in sequence.
[0167] It should be noted that after the high-priority task is migrated to the idle queue or the queue processing low-priority tasks and starts execution, there may be tasks of different priority orders in the queue. At this time, the high-priority task needs to be processed first in the queue.
[0168] In practice, there may be multiple business tasks that are switched to the same second transmission queue in batches. In order to quickly and conveniently find the location where the new business tasks to be processed are to be placed, in implementation, after the business tasks to be processed are migrated from the first transmission queue to the second transmission queue, the following steps are also included:
[0169] Record the location of the pending business tasks migrated to the second transmission queue;
[0170] Before using the target thread to process the pending business tasks located on the second transmission queue, the method further includes:
[0171] If it is detected that a new service task to be processed is to be migrated to the second transmission queue, the new service task to be processed is migrated to the second transmission queue starting from the recorded position.
[0172] In this method, when migrating business tasks in the same queue, they are placed at the head of the queue first. When waiting for migration, the business tasks that are already being processed will be processed after they are completed, which improves the processing efficiency of the business tasks. The location of the last high-priority business task after migration is recorded, and the newly initiated high-priority business tasks will also be assigned to the queue after migration, so that the newly initiated high-priority tasks can be placed behind the last high-priority business task according to the recorded location. In addition, after the newly initiated high-priority business task is placed behind the last high-priority business task, the position of the recorded high-priority business task is updated.
[0173] On a hardware platform with a relatively limited number of processor cores, if it is necessary to improve the communication concurrency between controllers in a cluster system, relatively more cores need to be allocated. However, due to the limited number of processor cores, the core used for communication between controllers cannot be separated out. In this case, the communication core will be shared with the processor core used by other task threads of the business module. In order to make full use of the processor cores, when it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, if it is detected that the thread utilization of the current processor core (i.e., the core shared by processing the second transmission queue and processing other business modules) is greater than the first threshold, and the thread occupancy of processing the transmission queue is less than the second threshold, the target thread is obtained, and the thread used to process the business tasks on the second transmission queue is switched to the target thread; wherein the target thread is the thread corresponding to the processor core whose thread utilization is less than the first threshold (i.e., a relatively idle thread).
[0174] Using the target thread to process the pending business tasks on the second transmission queue includes:
[0175] After it is detected that the task currently being processed by the target thread is completed, the target thread is used to process the to-be-processed service task located at the head of the second transmission queue.
[0176] In addition, in order to reduce the waiting time of public transactions in the storage system, using the target thread to process the pending business tasks located on the second transmission queue includes:
[0177] After it is detected that the business task being processed on the target thread is completed, the target thread is used to process the pending business task on the second transmission queue.
[0178] Similarly, in order to reduce the waiting time of the public transaction in the storage system, after using the target thread to process the pending business tasks located on the second transmission queue, the method further includes:
[0179] The target thread is used to process the business tasks on the second transmission queue in the order of priority of the business tasks to be processed on the second transmission queue. That is, after a business task is processed, the next business task to be processed is the first task with the highest priority received.
[0180] In implementation, the above-mentioned determination of the target thread and processing the business task using the target thread specifically include the following steps:
[0181] 1. When the business module and the communication module are configured with the same core, the system will identify them through global information;
[0182] 2. If the flag is found to be True, the utilization monitoring of the transmit queue processing thread will be started, and the utilization of the processor cores pre-allocated for communication module transmit queue processing will also be monitored;
[0183] 3. If it is found that the thread utilization rate of a certain transmission queue has reached the switching threshold, and it is confirmed through analysis that the communication task processor occupancy rate is far below the switching threshold, then a relatively idle thread among the threads marked as available for the communication module is selected for core switching;
[0184] 4. The switching process needs to wait until the task being processed is completed before it can proceed. The switching process will hand over all processing rights of the queue to the selected idle process.
[0185] In the method provided by the embodiment of the present invention, a queue thread adjustment mechanism, a queue priority and a business module queue selection mechanism are proposed for efficient communication between storage cluster system controllers, and algorithm optimization is performed from several aspects such as the processor core selection of queue threads, the priority of queue processing transmission business tasks and the queue allocation of business modules, and a transmission queue thread adjustment mechanism is proposed for hardware platforms with limited processor cores. The above related mechanisms not only follow the order preservation mechanism of controller communication and ensure data consistency, but also make full use of processor resources. Among them, the task dynamic allocation mechanism can effectively avoid the transmission load imbalance caused by some transmission queues being too busy while other transmission queues are idle, which can effectively improve the balance of the system and make full use of processor computing resources and hardware transmission bandwidth. The priority mechanism not only provides assistance for the dynamic allocation mechanism, but also ensures that high-priority tasks in the queue can be processed first, avoiding public event waiting in the system, and has benefits for improving the controller fault switching speed of the cluster system and the performance improvement of the storage system. The transmission queue thread adjustment mechanism provides a solution for the rational allocation of processor computing resources on platforms with fewer processor cores.
[0186] The scenario described above (queue switching is required, the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, the thread utilization of the current processor core is greater than the first threshold, and the thread occupancy of processing the transmission queue is less than the second threshold) is referred to as scenario one. In practice, the storage cluster system may also need to process data in other scenarios. For example, if it is detected that the processor core used to process the second transmission queue is different from the processor core used to process other business modules, or it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, the thread utilization of the current processor core is greater than the first threshold, and the thread occupancy of processing the transmission queue is greater than or equal to the second threshold (this scenario is referred to as scenario two). Under scenario two, the data processing method of the storage cluster system includes:
[0187] The thread corresponding to the processor core used to process the second transmission queue is kept used to process the pending service tasks on the second transmission queue.
[0188] In addition to the above-mentioned scenarios 1 and 2, in practice, there may also be a situation where the queue depth of the first transmission queue is detected to be less than or equal to the queue switching threshold (i.e., a scenario where queue switching is not required), and this scenario is referred to as scenario 3. In scenario 3, the data processing method of the storage cluster system includes:
[0189] Obtaining thread utilization of a processor core for processing a first transmission queue;
[0190] If it is detected that the thread utilization of the processor core used to process the first transmission queue is less than the first threshold, the threads of the processor core used to process the first transmission queue are used to process the pending business tasks on the first transmission queue according to the priority order of the business tasks in the first transmission queue.
[0191] If it is detected that the thread utilization rate of the processor core used to process the first transmission queue is greater than or equal to a first threshold, determining a thread to be used;
[0192] Switching the thread used to process the service tasks on the first transmission queue to the thread to be used;
[0193] The to-be-processed service tasks in the first transmission queue are processed by using the to-be-used thread and in the order of priority of the service tasks in the first transmission queue.
[0194] When determining the thread to be used, if it is detected that the processor core used to process the first transmission queue is the same core as the processor core used to process other business modules, and the thread occupancy rate of processing the transmission queue is less than the second threshold, then the thread to be used is determined to be the thread corresponding to the processor core whose thread utilization rate is less than the first threshold.
[0195] When it is detected that the processor core used to process the first transmission queue is a different core from the processor core used to process other business modules, or when it is detected that the processor core used to process the first transmission queue is the same core as the processor core used to process other business modules, and the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is greater than or equal to a second threshold, the thread corresponding to the processor core used to process the first transmission queue is kept used to process the pending business tasks on the first transmission queue.
[0196] In the method provided in this embodiment, in a scenario where queue switching is not required, the thread of the processor core used to process the first transmission queue is determined based on the relationship between the thread utilization of the processor core used to process the first transmission queue and the first threshold, thereby ensuring the processing efficiency of business tasks on the first transmission queue, and processing business tasks on the first transmission queue on the thread of the processor core determined to process the first transmission queue in accordance with the priority order of the business tasks on the first transmission queue, thereby effectively reducing the waiting time of public transactions in the storage system.
[0197] In order to make those skilled in the art better understand the scheme of the present invention, Figure 7 A schematic diagram of the interaction between a service module and a communication module in a storage cluster system provided by an embodiment of the present invention. Figure 7As shown, the business module interacts with the communication module, the solid arrows are control flows, and the dotted arrows are data flows. The communication module includes processing queues, queue information monitoring, queue allocation management, and queue priority management.
[0198] In the method provided by the embodiment of the present invention, the system supports the business module to pre-register the task priority and pre-allocate the transmission queue. In the data processing process, the pre-allocated queue is used preferentially for data transmission. At the same time, by real-time monitoring the queue depth of the transmission queue and the thread utilization rate of the processing queue task, if it is found that the queue depth of a certain transmission queue is already very long, it will be dynamically adjusted in combination with the task priority and the busyness of all queues, so as to achieve higher transmission efficiency while ensuring data consistency; and the controller processor computing resources can be fully utilized for efficient communication, avoiding the controller processor computing resources becoming a communication performance bottleneck.
[0199] In the above embodiments, the data processing method of the storage cluster system is described in detail, and the present invention also provides embodiments of the data processing device of the storage cluster system and the data processing equipment of the storage cluster system. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the perspective of the functional module, and the other is based on the perspective of the hardware.
[0200] A data processing device of a storage cluster system provided by an embodiment of the present invention includes, based on the perspective of functional modules, the following:
[0201] An acquisition module, used for acquiring a pending business task and a first transmission queue where the pending business task is located;
[0202] an acquisition and migration module, for acquiring a second transmission queue and migrating the to-be-processed service task from the first transmission queue to the second transmission queue when it is detected that the queue depth of the first transmission queue is greater than the queue switching threshold; wherein the queue depth of the second transmission queue is less than the queue depth of the first transmission queue, the second transmission queue is a transmission queue in the remaining transmission queues, and the remaining transmission queues are transmission queues in all transmission queues except the first transmission queue whose queue depth is greater than the queue switching threshold;
[0203] an acquisition and switching module, for acquiring a target thread and switching the thread for processing the business tasks on the second transmission queue to the target thread, if it is detected that the processor core for processing the second transmission queue is the same core as the processor core for processing other business modules, and if it is detected that the thread utilization of the current processor core is greater than a first threshold and the thread occupancy of processing the transmission queue is less than a second threshold; wherein the target thread is a thread corresponding to the processor core whose thread utilization is less than the first threshold;
[0204] A processing module is used to use a target thread to process a pending business task on a second transmission queue if it is detected that the processing of a target business task on a first transmission queue is completed; wherein the target business task is a business task that is located before the pending business task in the first transmission queue before the pending business task is migrated.
[0205] In some embodiments, the data processing device of the storage cluster system further includes:
[0206] A setting module is used to pre-set the priority order of business tasks to be processed;
[0207] An allocation module is used to allocate each pending business task whose priority is greater than or equal to a first preset value to a transmission queue, allocate a first number of pending business tasks whose priority is greater than or equal to a second preset value and less than the first preset value to a transmission queue, and allocate a second number of pending business tasks whose priority is less than the second preset value to a transmission queue; wherein the first number is less than the second number; and the association strength value of the business tasks on the same transmission queue is less than a preset strength threshold.
[0208] In some embodiments, the data processing device of the storage cluster system further includes: an acquisition and serving module, which is used to acquire the second transmission queue to be formed, and use the second transmission queue to be formed as the new first transmission queue, and return to the step of detecting whether the queue depth of the first transmission queue is greater than the queue switching threshold by the detection module, and stop returning until it is detected that the queue depth of the new first transmission queue is less than or equal to the queue switching threshold, and trigger the switching module in the acquisition and switching module; wherein the switching module is used to migrate the service task to be processed from the first transmission queue to the second transmission queue. In some embodiments, the data processing device of the storage cluster system further includes:
[0209] A recording module, used for recording the location of the pending service task migrated to the second transmission queue;
[0210] In some embodiments, the data processing device of the storage cluster system further includes:
[0211] The migration module is used to migrate the new pending business task to the second transmission queue starting from the recorded position if it is detected that a new pending business task is to be migrated to the second transmission queue.
[0212] In some embodiments, the data processing device of the storage cluster system further includes:
[0213] A first acquisition module, used to acquire a third number of business tasks on the second transmission queue before the to-be-processed business tasks are migrated from the first transmission queue to the second transmission queue;
[0214] A second acquisition module, configured to acquire a fourth number of business tasks on the second transmission queue within a second preset time period starting from the migration of the to-be-processed business tasks from the first transmission queue to the second transmission queue;
[0215] The judging module is used to judge whether the fourth number is greater than the third number; if so, triggering the processing module.
[0216] In some embodiments, the data processing device of the storage cluster system further includes:
[0217] A third acquisition module is used to acquire the thread utilization of the processor core used to process the first transmission queue when it is detected that the queue depth of the first transmission queue is less than or equal to the queue switching threshold;
[0218] The first processing module is used to process the pending business tasks on the first transmission queue using the threads of the processor core used to process the first transmission queue and in the order of priority of the business tasks in the first transmission queue if it is detected that the thread utilization of the processor core used to process the first transmission queue is less than a first threshold.
[0219] In some embodiments, the data processing device of the storage cluster system further includes:
[0220] a determination module, configured to determine a thread to be used if it is detected that the thread utilization rate of the processor core used to process the first transmission queue is greater than or equal to a first threshold;
[0221] A switching module, used to switch the thread used to process the service task on the first transmission queue to the thread to be used;
[0222] The second processing module is used to process the to-be-processed business tasks in the first transmission queue by using the to-be-used threads and according to the priority order of the business tasks in the first transmission queue.
[0223] Since the embodiments of the device part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the device part, and they will not be repeated here. The effects are the same as above.
[0224] Figure 8 This is a structural diagram of a data processing device of a storage cluster system provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 8 As shown, the data processing device of the storage cluster system includes:
[0225] A memory 20, for storing computer programs;
[0226] The processor 21 is used to implement the steps of the data processing method of the storage cluster system mentioned in the above embodiment when executing the computer program.
[0227] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0228] The memory 20 may include one or more non-volatile storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the data processing method of the storage cluster system disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the data processing method of the storage cluster system mentioned above.
[0229] In some embodiments, the data processing device of the storage cluster system may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0230] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the data processing device of the storage cluster system, and may include more or fewer components than those shown in the figure.
[0231] The data processing device of the storage cluster system provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the data processing method of the storage cluster system, the effect is the same as above.
[0232] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the data processing method of the storage cluster system when executed by a processor.
[0233] Finally, the present invention also provides an embodiment corresponding to a non-volatile storage medium. The non-volatile storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0234] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0235] The non-volatile storage medium provided by the present invention includes the data processing method of the storage cluster system mentioned above, and the effect is the same as above.
[0236] The data processing method, device, product, equipment and medium of the storage cluster system provided by the present invention are introduced in detail above. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
[0237] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" 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 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 statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A data processing method for a storage cluster system, characterized in that: include: Obtaining a pending business task and a first transmission queue where the pending business task is located; In the case of detecting that the queue depth of the first transmission queue is greater than the queue switching threshold, obtaining a second transmission queue, and migrating the service task to be processed from the first transmission queue to the second transmission queue; wherein the queue depth of the second transmission queue is less than the queue depth of the first transmission queue, and the second transmission queue is a transmission queue in the remaining transmission queues, and the remaining transmission queues are transmission queues in all transmission queues except the first transmission queue whose queue depth is greater than the queue switching threshold; In the case where it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, if it is detected that the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is less than a second threshold, a target thread is acquired, and the thread used to process the business tasks on the second transmission queue is switched to the target thread; wherein the target thread is a thread corresponding to the processor core whose thread utilization is less than the first threshold; If it is detected that the target business task located on the first transmission queue has been processed, the target thread is used to process the pending business task located on the second transmission queue; wherein the target business task is the business task that is located before the pending business task in the first transmission queue before the pending business task is migrated.
2. The data processing method of the storage cluster system according to claim 1, characterized in that: After obtaining the business task to be processed and before obtaining the first transmission queue where the business task to be processed is located, the method further includes: Pre-set the priority order of pending business tasks; Each pending business task whose priority is greater than or equal to a first preset value is respectively assigned to a transmission queue, a first number of pending business tasks whose priority is greater than or equal to a second preset value and less than the first preset value are assigned to a transmission queue, and a second number of pending business tasks whose priority is less than the second preset value are assigned to a transmission queue; wherein the first number is less than the second number; and the association strength value of the business tasks on the same transmission queue is less than a preset strength threshold.
3. The data processing method of the storage cluster system according to claim 2, characterized in that: Acquiring the second transmission queue includes: Acquire a first target remaining transmission queue from the remaining transmission queue; wherein the first target remaining transmission queue is a transmission queue whose queue depth is less than the queue depth of the first transmission queue; Acquire a second target remaining transmission queue in the first target remaining transmission queue whose queue depth is less than a first depth threshold; A transmission queue is randomly selected from the second target remaining transmission queues as the second transmission queue.
4. The data processing method of the storage cluster system according to claim 2, characterized in that: Acquiring the second transmission queue includes: If it is detected that there are multiple transmission queues with queue depths less than the queue switching threshold in the remaining transmission queues, a third target remaining transmission queue with a queue depth less than a second depth threshold is obtained from the multiple transmission queues with queue depths less than the queue switching threshold; A transmission queue is randomly selected from the third target remaining transmission queues as the second transmission queue.
5. The data processing method of the storage cluster system according to claim 2, characterized in that: Acquiring the second transmission queue includes: If it is detected that there are multiple transmission queues whose queue depths are less than the queue switching threshold in the remaining transmission queues, then obtaining an average queue depth of each transmission queue and / or an idle time of each transmission queue within a first preset time length; Determine the queue depth of each transmission queue according to the average queue depth of each transmission queue and / or the idle time of each transmission queue within the first preset time period, and sort the transmission queues in ascending order of queue depth; Determine whether the data volume of the business task to be processed is greater than the preset data volume; If not, selecting the transmission queue with the smallest queue depth as the second transmission queue; If so, multiple transmission queues are selected in order from small to large queue depth as the second transmission queue.
6. The data processing method of the storage cluster system according to claim 2, characterized in that: Acquiring the second transmission queue includes: If it is detected that there are multiple transmission queues whose queue depth is less than the queue switching threshold in the remaining transmission queues, then obtaining the average queue depth of each transmission queue and / or the idle time of each transmission queue within a first preset time length, and obtaining the number of first transmission queues whose queue depth is greater than the queue switching threshold; The second transmission queue is selected from all transmission queues whose queue depth is less than the queue switching threshold according to the number of first transmission queues whose queue depth is greater than the queue switching threshold and the average queue depth of each transmission queue within the first preset time period and / or the idle time of each transmission queue.
7. The data processing method of the storage cluster system according to claim 6, characterized in that: The selecting the second transmission queue from all transmission queues whose queue depths are less than the queue switching threshold according to the number of first transmission queues whose queue depths are greater than the queue switching threshold and the average queue depths of each transmission queue within the first preset time period and / or the idle time of each transmission queue comprises: If the number of first transmission queues detected only with queue depths greater than the queue switching threshold is 1, then the transmission queue with the smallest average queue depth is obtained, and the transmission queue with the smallest average queue depth is used as the second transmission queue; or, the transmission queue with the longest idle time is obtained, and the transmission queue with the longest idle time is used as the second transmission queue; or, the final queue depth of each transmission queue is determined based on the average queue depth and idle time of each transmission queue within a first preset time period; the minimum final queue depth among all the final queue depths is obtained, and the transmission queue corresponding to the minimum final queue depth is used as the second transmission queue.
8. The data processing method of the storage cluster system according to claim 6, characterized in that: The selecting the second transmission queue from all transmission queues whose queue depths are less than the queue switching threshold according to the number of first transmission queues whose queue depths are greater than the queue switching threshold and the average queue depths of each transmission queue within the first preset time period and / or the idle time of each transmission queue comprises: If the number of first transmission queues detected only with queue depths greater than the queue switching threshold is greater than 1, the transmission queues are sorted in ascending order according to the average queue depths, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queues; or, the transmission queues are sorted in descending order according to the idle time, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queues; or, the final queue depth of each transmission queue is determined based on the average queue depth and idle time of each transmission queue within a first preset time length; the transmission queues are sorted in ascending order according to the final queue depths, and the transmission queues are selected in sequence according to the order of the transmission queues as the second transmission queues.
9. The data processing method of the storage cluster system according to claim 2, characterized in that: The acquiring of the second transmission queue comprises: If it is detected that there is no transmission queue whose queue depth is less than the queue switching threshold in the remaining transmission queues, a target transmission queue is obtained from the remaining transmission queues; wherein the target transmission queue is a transmission queue whose service task priority in the remaining transmission queues is less than the service task priority on the first transmission queue whose queue depth is greater than the queue switching threshold; sorting the queue depths of the target transmission queues; Obtaining a transmission queue with the smallest queue depth among all the target transmission queues; The transmission queue with the smallest queue depth among all the target transmission queues is used as the second transmission queue.
10. The data processing method of the storage cluster system according to claim 1, characterized in that: Before migrating the to-be-processed service task from the first transmission queue to the second transmission queue, the method further includes: Obtain a second transmission queue to be formed, use the second transmission queue to be formed as the new first transmission queue, return to the step of detecting whether the queue depth of the first transmission queue is greater than the queue switching threshold, stop returning until it is detected that the queue depth of the new first transmission queue is less than or equal to the queue switching threshold, and enter the step of migrating the pending business tasks from the first transmission queue to the second transmission queue; wherein the second transmission queue to be formed is a transmission queue formed after migrating the pending business tasks to be processed to the second transmission queue.
11. The data processing method of the storage cluster system according to any one of claims 2 to 10, characterized in that: The migrating the pending service task from the first transmission queue to the second transmission queue comprises: Migrating the pending business tasks from the first transmission queue to the head of the second transmission queue; wherein the priorities of the business tasks from the head position to the tail position of the transmission queue decrease in sequence; The processing of the pending business tasks located on the second transmission queue by using the target thread includes: After detecting that the task currently being processed by the target thread is completed, the target thread is used to process the pending service task located at the head of the second transmission queue.
12. The data processing method of the storage cluster system according to claim 11, characterized in that: After migrating the to-be-processed service task from the first transmission queue to the second transmission queue, the method further includes: Recording the location of the pending business task migrated to the second transmission queue; Before using the target thread to process the pending business tasks located on the second transmission queue, the method further includes: If it is detected that a new service task to be processed is to be migrated to the second transmission queue, the new service task to be processed is migrated to the second transmission queue starting from the recorded position.
13. The data processing method of the storage cluster system according to claim 12, characterized in that: After migrating the pending business task from the first transmission queue to the second transmission queue and before using the target thread to process the pending business task on the second transmission queue, the method further includes: Obtaining a third number of service tasks on the second transmission queue before the service tasks to be processed are migrated from the first transmission queue to the second transmission queue; Starting from migrating the to-be-processed business tasks from the first transmission queue to the second transmission queue, obtaining a fourth number of business tasks on the second transmission queue within a second preset time period; determining whether the fourth number is greater than the third number; If so, the step of using the target thread to process the pending business tasks on the second transmission queue is entered.
14. The data processing method of the storage cluster system according to claim 11, characterized in that: The processing of the pending business tasks located on the second transmission queue by using the target thread includes: After detecting that the business task being processed on the target thread is completed, the target thread is used to process the to-be-processed business task on the second transmission queue.
15. The data processing method of the storage cluster system according to claim 11, characterized in that: After using the target thread to process the pending service tasks on the second transmission queue, the method further includes: The target thread is used to process the service tasks on the second transmission queue in the order of their priorities.
16. The data processing method of the storage cluster system according to claim 1, characterized in that: The method further comprises: When it is detected that the processor core used to process the second transmission queue is a different core from the processor core used to process other business modules, or when it is detected that the processor core used to process the second transmission queue is the same core as the processor core used to process other business modules, and the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is greater than or equal to a second threshold, the thread corresponding to the processor core used to process the second transmission queue is kept used to process the pending business tasks on the second transmission queue.
17. The data processing method of the storage cluster system according to claim 1, characterized in that: The method further comprises: When it is detected that the queue depth of the first transmission queue is less than or equal to the queue switching threshold, obtaining a thread utilization rate of a processor core used to process the first transmission queue; If it is detected that the thread utilization of the processor core used to process the first transmission queue is less than the first threshold, the threads of the processor core used to process the first transmission queue are used to process the pending business tasks on the first transmission queue in accordance with the priority order of the business tasks in the first transmission queue.
18. The data processing method of the storage cluster system according to claim 17, characterized in that: The method further comprises: If it is detected that the thread utilization rate of the processor core used to process the first transmission queue is greater than or equal to the first threshold, determining the thread to be used; Switching a thread for processing business tasks on the first transmission queue to the thread to be used; The to-be-used thread is used to process the to-be-processed service tasks in the first transmission queue in accordance with the priority order of the service tasks in the first transmission queue.
19. The data processing method of the storage cluster system according to claim 18, characterized in that: Determining the thread to be used includes: If it is detected that the processor core used to process the first transmission queue is the same core as the processor core used to process other business modules, and the thread occupancy rate of processing the transmission queue is less than the second threshold, then the thread to be used is determined to be the thread corresponding to the processor core whose thread utilization rate is less than the first threshold.
20. The data processing method of the storage cluster system according to claim 19, characterized in that: Determining the thread to be used includes: When it is detected that the processor core used to process the first transmission queue is a different core from the processor core used to process other business modules, or when it is detected that the processor core used to process the first transmission queue is the same core as the processor core used to process other business modules, and the thread utilization of the current processor core is greater than a first threshold, and the thread occupancy of processing the transmission queue is greater than or equal to a second threshold, the thread corresponding to the processor core used to process the first transmission queue is kept used to process the pending business tasks on the first transmission queue.
21. A data processing device for a storage cluster system, characterized in that: include: An acquisition module, used for acquiring a pending business task and a first transmission queue where the pending business task is located; an acquisition and migration module, configured to acquire a second transmission queue and migrate the to-be-processed service task from the first transmission queue to the second transmission queue when detecting that the queue depth of the first transmission queue is greater than a queue switching threshold; wherein the queue depth of the second transmission queue is less than the queue depth of the first transmission queue, the second transmission queue is a transmission queue in the remaining transmission queues, and the remaining transmission queues are transmission queues in all transmission queues except the first transmission queue whose queue depth is greater than the queue switching threshold; an acquisition and switching module, for acquiring a target thread and switching the thread for processing the business tasks on the second transmission queue to the target thread if it is detected that the processor core for processing the second transmission queue is the same core as the processor core for processing other business modules, and if it is detected that the thread utilization of the current processor core is greater than a first threshold and the thread occupancy of processing the transmission queue is less than a second threshold; wherein the target thread is a thread corresponding to the processor core whose thread utilization is less than the first threshold; A processing module is used to use the target thread to process the pending business task located on the second transmission queue if it is detected that the processing of the target business task located on the first transmission queue is completed; wherein the target business task is the business task that is located before the pending business task in the first transmission queue before the pending business task is migrated.
22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the data processing method of the storage cluster system described in any one of claims 1 to 20 are implemented.
23. A data processing device for a storage cluster system, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method of the storage cluster system according to any one of claims 1 to 20 when executing the computer program.
24. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the data processing method of the storage cluster system according to any one of claims 1 to 20 are implemented.
Citation Information
Patent Citations
Business request adjusting method and device
CN106470169A
Batch data processing method and device, computer equipment and storage medium
CN110297711A