Service command response time control method and device, electronic equipment and storage medium
By upgrading the controller chip and firmware inside the hard drive and combining it with the FPGA chip to dynamically adjust the hard drive queue response time, the problem of traditional mechanical hard drives being unable to adapt to diverse business delay requirements is solved, adaptive business command response time control is achieved, and user experience and resource utilization are improved.
Patent Information
- Application Number
- CN202510624173.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-09-16
AI Technical Summary
The fixed parameter settings of traditional mechanical hard drives cannot dynamically adapt to the latency requirements of diverse businesses in cloud computing scenarios, resulting in response times that cannot meet the requirements of different business types and causing the risk of customer complaints.
By upgrading the controller chip and firmware inside the hard drive and combining it with hardware such as FPGA chips, we can collect and calculate the historical average delay data of each type of command in real time, dynamically adjust the weight and processing priority, and achieve adaptive response time control based on business type and customer needs.
Significantly reduce latency, improve user experience, optimize resource utilization, reduce energy consumption, lower costs, and improve system stability and customer satisfaction.
Smart Images

Figure CN120653382A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for controlling service command response time. Background Art
[0002] Data centers currently face the dual pressures of diverse business types and tiered latency sensitivity. Traditional mechanical hard drive scheduling strategies and fixed queue parameters (queue depth, priority weight, and queue response time) struggle to dynamically adapt to these demands. Existing technologies rely on predefined rules, and fixed parameter settings haven't yet addressed the latency requirements of diverse businesses. In particular, they lack an effective solution for automatically adjusting hard drive queue response times based on different command types, failing to dynamically adjust to real-time load and failing to meet diverse needs.
[0003] Traditional mechanical hard drives use fixed parameter settings to adjust the drive queue response time, which is unable to adapt to the latency requirements of diverse services in cloud computing scenarios, leading to the risk of customer complaints. Existing technologies rely on predefined rules and lack feedback mechanisms for real-time load. Summary of the Invention
[0004] The present application provides a method, device, electronic device and storage medium for controlling the response time of a business command, so as to at least solve the problem in the related art that traditional mechanical hard disks use fixed parameter settings to adjust the hard disk queue response time, cannot be dynamically adjusted according to the real-time load, cannot adapt to the delay requirements of diversified businesses in cloud computing scenarios, and cause customer complaint risks.
[0005] This application provides a service command response time control method, including:
[0006] In response to receiving a service command, identifying a service type corresponding to the service command;
[0007] Performing a delay setting judgment to obtain a delay mode for the service type, wherein the delay mode includes a default mode and a low delay mode;
[0008] In response to the service type being the default mode, using the default queue response time preset value within the hard disk to control the response time of the service command; in response to the service type being the low-latency mode, determining whether there is a customer-specified command response time;
[0009] In response to the existence of a customer-specified command response time, controlling the response time of the service command according to the customer-specified command response; in response to the absence of a customer-specified command response time, calculating a sum of dynamic weights according to a command type of the service command, and calculating the command response time according to the sum of dynamic weights;
[0010] The processing priority of the service command is controlled according to the command response time.
[0011] The present application also provides a service command response time control device, comprising:
[0012] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned service command response time control methods when executing the computer program.
[0013] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned business command response time control methods are implemented.
[0014] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned business command response time control methods when executed by a processor.
[0015] Through this application, the business type corresponding to the business command is first identified, the delay mode of the business type is obtained, and the delay mode of the business type is used to control different delay durations. The default mode and the low-latency mode are distinguished to classify and control different business commands, and the delay is significantly reduced, thereby realizing business adaptive management. Secondly, when the business type is in low-latency mode, it is determined whether there is a customer-specified command response time. If so, the customer-specified command response time is used to control the response time of the business command, thereby improving the user experience. If there is no customer-specified command response time, the command response time is dynamically calculated, and the processing priority of the business command is controlled according to the command response time, thereby improving resource utilization. The response time is automatically adjusted according to the customer's business, thereby improving system stability, reducing energy consumption, reducing manual intervention, greatly saving costs, and improving customer satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0017] Figure 1 This is an application environment diagram of a method for controlling service command response time in one embodiment of the present application;
[0018] Figure 2 This is a flow chart of a method for controlling service command response time in one embodiment of the present application;
[0019] Figure 3This is a logic diagram of a method for controlling service command response time in one embodiment of the present application;
[0020] Figure 4 This is a structural block diagram of a service command response time control device in one embodiment of the present application;
[0021] Figure 5 This is a diagram of the internal structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0023] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0024] As market competition intensifies, customers' business scenarios are becoming increasingly diverse. For example, in the e-commerce industry, in addition to traditional product display and sales, emerging business models such as livestreaming, social e-commerce, and cross-border e-commerce are constantly emerging. This requires e-commerce platforms to not only possess stable transaction processing capabilities, but also support high-definition live video streaming, real-time interactive communication, and complex cross-border logistics and payment settlement functions. In the financial sector, in addition to basic savings and credit services, innovative businesses such as quantitative trading, robo-advisory, and supply chain finance are constantly expanding. These businesses have extremely high requirements for real-time data processing, accurate risk assessment, and rapid business response.
[0025] In this context, cloud computing, with its elastic and scalable resource allocation capabilities, enables enterprises to dynamically adjust computing resources based on real-time business needs, avoiding idle or insufficient resources and effectively reducing operating costs. Its distributed storage and computing architecture ensures the efficient processing and secure storage of massive amounts of data, providing a solid foundation for enterprises to unlock data value, implement precision marketing, and manage risk. Furthermore, cloud computing's rapid deployment and iteration capabilities enable enterprises to quickly launch new products and services, seize market opportunities, and meet evolving customer needs. In short, with the booming internet, cloud computing has become a core enabling technology for enterprises to achieve innovative development and efficient operations in diverse business scenarios.
[0026] With the rapid development of cloud computing and big data applications, customer businesses are becoming increasingly diverse. In current hard drive applications, traditional fixed parameter settings are no longer able to meet the diverse latency requirements of different business scenarios. For example, banking and payment services have extremely high latency requirements; even a slight delay can cause serious transaction problems or a degraded user experience. Cold storage services, on the other hand, have relatively low latency requirements. Using fixed hard drive parameter settings would not guarantee performance for businesses with high latency requirements, while wasting resources for businesses with low latency requirements. Furthermore, most current hard drive configuration methods either use completely fixed parameters or simple manual settings, lacking a mechanism for automatic optimization based on business command types.
[0027] From a customer perspective, some large internet, financial, and telecommunications clients have relatively professional technical teams and capabilities, and are well-aware of their business needs. They can select and purchase servers and customized components that meet these needs based on their business requirements. They can also complete acceptance of business functions and requirements through phased testing before the application is officially released, effectively avoiding most latency-related issues in application scenarios. However, some smaller internet or enterprise clients, such as those in institutions, lack a clear understanding of their underlying business needs and lack clear application scenarios and testing acceptance criteria. Consequently, they can only purchase and use generic servers and components, which inevitably leads to latency-related issues in some application scenarios.
[0028] From the perspective of components, currently, except for a very small number of customers in the industry, there are only a few who will regularly set performance or latency-related parameters at the hard disk firmware level based on their own business. For hard disk vendors, in order to meet the general business needs of the vast majority of customers in the industry, fixed queue scheduling strategies (such as FIFO, elevator algorithm) and parameter configurations (such as queue depth, priority weight, queue response time) are adopted. After weighing the pros and cons of performance and latency parameters, a default optimal value is fixed in the hard disk firmware. The scheduling strategies and fixed queue parameters (queue depth, priority weight, queue response time) of traditional mechanical hard disks are difficult to dynamically adapt to the above requirements. Existing technologies rely on predefined rules, and the fixed parameter setting method has not yet been able to address different business latency requirements, especially the effective solution for automatically adjusting the hard disk queue response time according to different command types. It cannot be dynamically adjusted according to real-time load and cannot meet diverse needs.
[0029] Traditional mechanical hard drives use fixed queue parameter response times, making them unable to adapt to the latency requirements of diverse businesses in cloud computing scenarios (e.g., financial payments require ≤5ms, cold storage can tolerate ≥100ms, and Microsoft Cloud ≤6s). For example, fixed queue depths can cause low-latency businesses in high-concurrency scenarios to be blocked by high-throughput tasks, leading to the risk of customer complaints.
[0030] Existing technologies rely on predefined rules and lack a feedback mechanism for real-time load. For example, when there are sudden random write commands, traditional solutions cannot dynamically increase their weight, resulting in a surge in response time.
[0031] Currently, the industry has not yet found an effective solution for different business delay requirements, especially for automatically adjusting the hard disk queue response time according to different command types. In order to solve the above problems, the business command response time control method provided by this application is a more intelligent and efficient hard disk internal command optimization method, which can be applied to Figure 1 In the application environment shown, the key module architecture within the hard drive is achieved through upgrades to the existing controller chip and firmware, as well as additional hardware support. Mechanical hard drives include the communication interface, hard drive firmware, main control chip, servo control chip, DRAM cache, and FPGA chip.
[0032] Communication interface: connects the host and hard disk, transmits I / O commands; receives key indicators such as command queue response time issued by the host.
[0033] Hard disk firmware: records command types and identifies I / O command service tags; performs periodic load detection and dynamically adjusts the sensitivity coefficient α value; has a built-in command queue optimization function switch to control the activation and disabling of functions; supports customer-defined policies, allowing customers to specify command response times.
[0034] Main control chip: responsible for managing and controlling various functions within the hard drive, coordinating data reading, writing, storage, and transmission, optimizing read and write algorithms and cache management, improving the overall performance and response speed of the hard drive, and collecting and recording command delay data in real time.
[0035] Servo control chip: responsible for the drive control, feedback and adjustment of the hard disk's internal motor, head, etc.; feedback controls the head position deviation and vibration amplitude, and adjusts the head position in real time to ensure read and write stability and accuracy.
[0036] DRAM cache: Caches read and write data to improve read and write performance; parses service tags at high speed to reduce master control access.
[0037] FPGA chip: A new chip is added to accelerate weight calculation and dynamic correction, and dynamically adjust queue response time.
[0038] This application relies on existing firmware (such as basic command parsing and queue management), but the core dynamic weight calculation, real-time feedback control, and service-aware classification require additional hardware support (such as FPGAs and enhanced processors) and firmware upgrades. This hardware-software collaborative design improves performance while ensuring the feasibility of the technology, offering significant advantages over firmware-only solutions.
[0039] Based on the customer's business model and business classification, this application collects and calculates the historical average latency data for each type of command in real time. Using load weight adjustment and load balancing algorithms, it continuously adjusts the weight and processing priority of each type of command, comprehensively evaluating and setting reasonable command response times. It also monitors latency indicators in real time and dynamically adjusts the sensitivity coefficient based on the degree of latency deviation, allowing fine-tuning of response times based on actual business operations and different command types. Furthermore, it provides function selection switches and parameter customization options based on actual customer needs, flexibly meeting diverse customer requirements. This truly implements a dynamic adjustment solution for the hard drive command queue based on business type awareness.
[0040] like Figure 2 、 Figure 3 As shown, an embodiment of the present application provides a service command response time control method, comprising the following steps:
[0041] Step S1, in response to receiving a service command, identifying a service type corresponding to the service command;
[0042] Step S2: Determine the delay setting and obtain the delay mode of the service type, where the delay mode includes a default mode and a low delay mode.
[0043] Step S3, in response to the service type being the default mode, using the default queue response time preset value within the hard disk to control the response time of the service command; in response to the service type being the low latency mode, determining whether there is a customer-specified command response time;
[0044] Step S4: In response to the existence of a customer-specified command response time, controlling the response time of the service command according to the customer-specified command response; in response to the absence of a customer-specified command response time, calculating a sum of dynamic weights according to the command type of the service command, and calculating the command response time based on the sum of the dynamic weights;
[0045] Step S5: Control the processing priority of the service command according to the command response time.
[0046] During use, if the service type is Default Mode, the default hard drive internal queue response time preset is used. If the service type is Low Latency Mode, query the customer's settings to determine whether the customer has specific latency requirements. If so, the hard drive internal queue response time preset is set to the customer-specified value and the hard drive executes commands. If not, dynamic command response optimization is enabled by default, but can be disabled according to the customer's needs.
[0047] First, identify the business type corresponding to the business command, obtain the delay mode of the business type, use the delay mode of the business type to control different delay durations, distinguish between the default mode and the low-latency mode to classify and control different business commands, significantly reduce the delay, and realize business adaptive management. Secondly, when the business type is low-latency mode, determine whether there is a customer-specified command response time. If so, use the customer-specified command response time to control the response time of the business command, which improves the user experience. If there is no customer-specified command response time, dynamically calculate the command response time, control the processing priority of the business command according to the command response time, improve resource utilization, and automatically adjust the response time according to customer business, improve system stability, reduce energy consumption, reduce manual intervention, greatly save costs, and improve customer satisfaction.
[0048] In this embodiment, in response to receiving the service command, identifying the service type corresponding to the service command includes:
[0049] When the hard disk is connected to the customer's business system, if the hard disk receives a business command uploaded by the customer's business system, it identifies whether the business command is sensitive to delay through the business identifier or the preset business type judgment rule;
[0050] In response to the service command being sensitive to delay, determining that the service type of the service command is a delay-sensitive class;
[0051] In response to the service command being insensitive to delay, it is determined that the service type of the service command is a delay-insensitive type.
[0052] For example, judgment can be made by identifying the industry to which the business belongs (banking and payment industries are more likely to be sensitive to delays) or the real-time requirements for business data transmission.
[0053] By identifying the business type corresponding to the business command, the delay sensitivity of the business command can be identified. The command response time can be controlled according to the delay sensitivity of the business command, so that different business commands correspond to different response times, reducing the delay time, avoiding the risk of customer complaints, and improving the user experience.
[0054] This application determines the delay mode based on the business type, controls the command response time in low-latency mode for businesses with low-latency requirements, queries customer setting information, and determines whether the customer has clear delay requirements. If so, the processing priority is controlled according to the customer-specified command response time, thereby reducing business processing time and improving user experience.
[0055] It is understandable that, in addition to identifying whether a service command is delay-sensitive by using a service identifier or a preset service type judgment rule, other embodiments also include:
[0056] Obtain the industry to which the business command belongs and the type of business data processed by the business command;
[0057] Obtain the delay sensitivity score value A of the industry to which the business command belongs and the delay sensitivity score value Bj of each type of business data processed by the business command, where Bj is the delay sensitivity score value of the j-th type of business data;
[0058] Obtain the weight a of the industry to which the business command belongs, obtain the weight bj of the j-th type of business data processed by the business command, and obtain the delay sensitivity score C of the business command through weighted summation, where C = a×A+∑(Bj×bj);
[0059] In response to a delay sensitivity score value of the service command being greater than a first threshold, determining that the service command is delay sensitive;
[0060] When the delay sensitivity score value of the response service command is less than or equal to the first threshold, it is determined that the service command is not delay sensitive.
[0061] Among them, the delay sensitivity score value of the business command is obtained by weighted summing the industry to which the business command belongs and the delay sensitivity score value of the business data processed by the business command. The delay sensitivity score value can be accurately calculated and obtained, and whether the business command is sensitive to delay can be judged based on the threshold size, thereby improving the accuracy of delay sensitivity judgment.
[0062] In this embodiment, before performing the delay setting determination, the following steps are further included:
[0063] Set delay mode for each service type;
[0064] In response to the service type being a delay-sensitive class, setting a default queue response time preset value of the default mode to a first value;
[0065] In response to the service type being the delay-insensitive class, the default queue response time preset value of the default mode is set to a second value, and the first value is smaller than the second value.
[0066] It is understood that the preset queue response time for delay-sensitive services should be smaller than that for delay-insensitive services. Therefore, the first value is set smaller than the second value. The preset queue response time for the default mode of delay-sensitive services is smaller than that for delay-insensitive services, ensuring short processing times for sensitive services.
[0067] In this embodiment, calculating the dynamic weight sum according to the command type of the service command includes:
[0068] Obtain command data of the business command and identify the command type in the command data, which includes sequential read, sequential write, random read, random write, and other commands;
[0069] Obtaining a benchmark weight corresponding to each command type according to the command type in the command data, wherein the benchmark weights of sequential read, sequential write, other commands, random read, and random write are increased in sequence;
[0070] Collect the current command delay in real time, obtain the historical average delay, and obtain the sensitivity coefficient of the business command. Based on the baseline weight, current command delay, historical average delay, and sensitivity coefficient, calculate the dynamic adjustment weight corresponding to each command type;
[0071] The sum of the dynamically adjusted weights of the command types in the command data is obtained as the sum of the dynamic weights of the business commands.
[0072] Specifically, the system collects real-time command data for five different command types from customer applications through hard drive commands or logs: sequential read, sequential write, random read, random write, and other commands. Sequential read, sequential write, random read, random write, and other commands are assigned different baseline weights, allowing for different execution weights for different command types, effectively assessing the weights of business commands.
[0073] The benchmark weights for sequential read, sequential write, random read, random write, and other commands are defined as shown in Table 1.
[0074] Table 1 Benchmark weights
[0075]
[0076]
[0077] In this embodiment, calculating the command response time according to the dynamic weight sum includes:
[0078] Get the default queue response time preset value inside the hard disk as the basic response time;
[0079] Based on the basic response time and the sum of dynamic weights, the command response time is obtained by using a load balancing algorithm and smoothing the influence of the sum of dynamic weights using a logarithmic function.
[0080] The logarithmic function (log) is used to smooth the impact of the sum of weights on the command response time and avoid response time fluctuations under extreme loads.
[0081] In this embodiment, based on the basic response time and the dynamic weight sum, the command response time is obtained by using a load balancing algorithm and smoothing the influence of the dynamic weight sum using a logarithmic function. The method includes:
[0082] The formula for calculating command response time is: Among them, RT represents the command response time, BaseRT represents the basic response time, and W total Represents the sum of dynamic weights, W total =∑(W′ i ×N i ), Ni represents the number of the i-th command type in the command data of the business command, W' i represents the dynamic adjustment weight of the i-th command type in the command data of the business command, Wi represents the reference weight corresponding to the i-th command type in the command data of the business command, α represents the sensitivity coefficient of the business command, T current Indicates the current command delay collected in real time, T avg represents the historical average delay;
[0083] The delay indicator is monitored, and the sensitivity coefficient is dynamically adjusted within a first value range according to a degree of deviation of the delay indicator.
[0084] Specifically, T current and T avg The unit is milliseconds. For example, the historical average latency is the average latency of the same command over 1000 historical executions. The sensitivity coefficient α defaults to 0.5 and controls the weight adjustment range. It can be dynamically adjusted based on customer policies or system feedback. The first value range is 0.2 to 1.0 and supports dynamic customer settings. The first value range is used to fine-tune the response time of different command types based on actual business scenarios and hard disks.
[0085] In this embodiment, the service command response time control method further includes:
[0086] Set the command queue optimization switch, which is enabled by default;
[0087] In response to generating a service command, sending a switch setting request to the customer service system;
[0088] Receive the switch setting command fed back by the customer's business system, and set the command queue optimization switch according to the switch setting command.
[0089] In actual application, the customer scenario is: banking transaction business (less than 5ms). The customer does not specify the delay threshold, and the system automatically enters the dynamic weight calculation mode.
[0090] Implementation steps of the above-mentioned service command response time control method:
[0091] Step 1: Count historical data, the initial weight is W i (Random Write) = 3.0;
[0092] Step 2: Detect the current random write delay T in real time current =15ms, historical average T avg =10ms, calculate the corrected weight according to the real-time load adjustment authority value formula: The random write correction weight can be obtained as 3.75ms.
[0093]
[0094] Step 3: There are 5 random write commands in the queue with a BaseRT of 8ms.
[0095] Total weight W total =∑(W' i ×N i )=3.75×5=18.75ms;
[0096] Calculate the command response time: Use the following formula to calculate the real-time response time to 3.5ms.
[0097]
[0098] The implementation effect is: the response time is reduced from 8ms in the default mode to 3.5ms, meeting customers' low-latency requirements.
[0099] The above-mentioned service command response time control method achieves the following technical effects:
[0100] 1. Significantly reduced latency: Response time is significantly reduced for low-latency services (such as random writes). In high-load scenarios, latency fluctuations are significantly reduced, greatly improving stability.
[0101] 2. Resource utilization optimization: Through dynamic weight allocation, cold storage task throughput is improved while ensuring that payment business resources are not preempted. Queue resources are automatically released during hard drive idle periods, significantly reducing energy consumption.
[0102] 3. Business adaptive management: Supports customer-defined delay thresholds, with a 100% automated adaptation rate and no manual intervention required.
[0103] 4. Automatically adjust response time according to customer business, improve system stability, reduce energy consumption, reduce manual intervention, greatly save costs, improve customer satisfaction, and also enhance product competitiveness.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0105] In one embodiment, Figure 4 As shown, a service command response time control device 10 is provided, comprising: a service identification module 1, a delay setting judgment module 2, a dynamic weight counting module 3 and a queue scheduling module 4.
[0106] The service identification module 1 is configured to, in response to receiving a service command, identify the service type corresponding to the service command;
[0107] The delay setting judgment module 2 is used to perform delay setting judgment and obtain a delay mode of the service type, wherein the delay mode includes a default mode and a low-delay mode; in response to the service type being the default mode, the default queue response time preset value within the hard disk is used to control the response time of the service command; in response to the service type being the low-delay mode, the module determines whether there is a customer-specified command response time;
[0108] The dynamic weight counting module 3 is configured to, in response to the existence of a customer-specified command response time, control the response time of the service command according to the customer-specified command response; and, in response to the absence of a customer-specified command response time, calculate the sum of dynamic weights according to the command type of the service command, and calculate the command response time based on the sum of dynamic weights;
[0109] The queue scheduling module 4 is used to control the processing priority of service commands according to the command response time.
[0110] In this embodiment, in response to receiving the service command, identifying the service type corresponding to the service command includes:
[0111] When the hard disk is connected to the customer's business system, if the hard disk receives a business command uploaded by the customer's business system, it identifies whether the business command is sensitive to delay through the business identifier or the preset business type judgment rule;
[0112] In response to the service command being sensitive to delay, determining that the service type of the service command is a delay-sensitive class;
[0113] In response to the service command being insensitive to delay, it is determined that the service type of the service command is a delay-insensitive type.
[0114] In this embodiment, if Figure 4 As shown, the service command response time control device 10 further includes a delay mode setting module 5 .
[0115] The delay mode setting module 5 is used to, before making a delay setting judgment:
[0116] Set delay mode for each service type;
[0117] In response to the service type being a delay-sensitive class, setting a default queue response time preset value of the default mode to a first value;
[0118] In response to the service type being the delay-insensitive class, the default queue response time preset value of the default mode is set to a second value, and the first value is smaller than the second value.
[0119] In this embodiment, calculating the dynamic weight sum according to the command type of the service command includes:
[0120] Obtain command data of the business command and identify the command type in the command data, which includes sequential read, sequential write, random read, random write, and other commands;
[0121] Obtaining a benchmark weight corresponding to each command type according to the command type in the command data, wherein the benchmark weights of sequential read, sequential write, other commands, random read, and random write are increased in sequence;
[0122] Collect the current command delay in real time, obtain the historical average delay, and obtain the sensitivity coefficient of the business command. Based on the baseline weight, current command delay, historical average delay, and sensitivity coefficient, calculate the dynamic adjustment weight corresponding to each command type;
[0123] The sum of the dynamically adjusted weights of the command types in the command data is obtained as the sum of the dynamic weights of the business commands.
[0124] In this embodiment, calculating the command response time according to the dynamic weight sum includes:
[0125] Get the default queue response time preset value inside the hard disk as the basic response time;
[0126] Based on the basic response time and the sum of dynamic weights, the command response time is obtained by using a load balancing algorithm and smoothing the influence of the sum of dynamic weights using a logarithmic function.
[0127] In this embodiment, based on the basic response time and the dynamic weight sum, the command response time is obtained by using a load balancing algorithm and smoothing the influence of the dynamic weight sum using a logarithmic function. The method includes:
[0128] The formula for calculating command response time is: Among them, RT represents the command response time, BaseRT represents the basic response time, and W total Represents the sum of dynamic weights, W total =∑(W′ i ×Ni), Ni represents the number of the i-th command type in the command data of the business command, W' i represents the dynamic adjustment weight of the i-th command type in the command data of the business command, Wi represents the reference weight corresponding to the i-th command type in the command data of the business command, α represents the sensitivity coefficient of the business command, T current Indicates the current command delay collected in real time, T avg Indicates the historical average latency.
[0129] In this embodiment, if Figure 4 As shown, the service command response time control device 10 further includes a feedback control module 6 .
[0130] The feedback control module 6 is used to monitor the delay index and dynamically adjust the sensitivity coefficient within a first value range according to the deviation degree of the delay index.
[0131] In this embodiment, if Figure 4 As shown, the service command response time control device 10 further includes an optimization switch control module 7 .
[0132] The optimization switch control module 7 is used to: set the command queue optimization switch and set the command queue optimization switch to be on by default; send a switch setting request to the customer business system in response to generating a business command; receive the switch setting command fed back by the customer business system, and set the command queue optimization switch according to the switch setting command.
[0133] In the above-mentioned business command response time control device, the business type corresponding to the business command is first identified, the delay mode of the business type is obtained, and the delay mode of the business type is used to control different delay durations. The default mode and the low-latency mode are distinguished to classify and control different business commands, and the delay is significantly reduced, thereby realizing business adaptive management. Secondly, when the business type is in low-latency mode, it is determined whether there is a customer-specified command response time. If so, the customer-specified command response time is used to control the response time of the business command, thereby improving the user experience. If there is no customer-specified command response time, the command response time is dynamically calculated, and the processing priority of the business command is controlled according to the command response time, thereby improving resource utilization, and automatically adjusting the response time according to the customer's business, thereby improving system stability, reducing energy consumption, reducing manual intervention, greatly saving costs, and improving customer satisfaction.
[0134] For the description of the features in the embodiment corresponding to the service command response time control device, reference can be made to the relevant description of the embodiment corresponding to the service command response time control method, which will not be repeated here.
[0135] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned service command response time control method embodiments.
[0136] In one embodiment, the electronic device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The electronic device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the electronic device is used to store business command response time control data. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a business command response time control method is implemented.
[0137] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned service command response time control method embodiments when running.
[0138] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0139] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned service command response time control method embodiments are implemented.
[0140] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned business command response time control method embodiments.
[0141] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0142] The above is a detailed introduction to a service command response time control method, device, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for controlling service command response time, characterized in that: include: In response to receiving a service command, identifying a service type corresponding to the service command; Performing a delay setting judgment to obtain a delay mode for the service type, wherein the delay mode includes a default mode and a low delay mode; In response to the service type being the default mode, using the default queue response time preset value within the hard disk to control the response time of the service command; in response to the service type being the low-latency mode, determining whether there is a customer-specified command response time; In response to the existence of a customer-specified command response time, controlling the response time of the service command according to the customer-specified command response; in response to the absence of a customer-specified command response time, calculating a sum of dynamic weights according to a command type of the service command, and calculating the command response time according to the sum of dynamic weights; The processing priority of the service command is controlled according to the command response time.
2. The service command response time control method according to claim 1, characterized in that: In response to receiving the service command, identifying the service type corresponding to the service command includes: When the hard disk is connected to the customer business system, if the hard disk receives a business command uploaded by the customer business system, it identifies whether the business command is sensitive to delay through a business identifier or a preset business type judgment rule; In response to the service command being sensitive to delay, determining that the service type of the service command is a delay-sensitive class; In response to the service command being insensitive to delay, it is determined that the service type of the service command is a delay-insensitive type.
3. The service command response time control method according to claim 2, characterized in that: Before performing the delay setting judgment, the method further includes: Set delay mode for each service type; In response to the service type being a delay-sensitive class, setting a default queue response time preset value of the default mode to a first value; In response to the service type being a delay-insensitive type, a default queue response time preset value of the default mode is set to a second value, and the first value is smaller than the second value.
4. The service command response time control method according to claim 1, characterized in that: Calculating the dynamic weight sum according to the command type of the service command includes: Obtaining command data of the service command, and identifying a command type in the command data, where the command type includes sequential read, sequential write, random read, random write, and other commands; Obtaining, according to the command type in the command data, a benchmark weight corresponding to each command type, wherein the benchmark weights of the sequential read, the sequential write, the other commands, the random read, and the random write are increased in sequence; collecting the current command delay in real time, obtaining the historical average delay, obtaining the sensitivity coefficient of the service command, and calculating the dynamic adjustment weight corresponding to each command type based on the benchmark weight, the current command delay, the historical average delay, and the sensitivity coefficient; The sum of the dynamically adjusted weights of the command types in the command data is obtained as the sum of the dynamic weights of the service commands.
5. The service command response time control method according to claim 4, characterized in that: Calculating the command response time according to the dynamic weight sum includes: Get the default queue response time preset value inside the hard disk as the basic response time; According to the basic response time and the dynamic weight sum, a load balancing algorithm is used to smooth the influence of the dynamic weight sum using a logarithmic function to obtain the command response time.
6. The service command response time control method according to claim 5, characterized in that: The obtaining of the command response time by smoothing the influence of the dynamic weight sum using a logarithmic function according to the basic response time and the dynamic weight sum through a load balancing algorithm includes: The calculation formula for the command response time is: Among them, RT represents the command response time, BaseRT represents the basic response time, and W total Represents the sum of dynamic weights, W total =∑(W' i ×N i ), Ni represents the number of the i-th command type in the command data of the business command, W' i represents the dynamic adjustment weight of the i-th command type in the command data of the business command, Wi represents the reference weight corresponding to the i-th command type in the command data of the business command, α represents the sensitivity coefficient of the business command, T current Indicates the current command delay collected in real time, T avg represents the historical average delay; A delay indicator is monitored, and the sensitivity coefficient is dynamically adjusted within a first value range according to a degree of deviation of the delay indicator.
7. The service command response time control method according to claim 1, characterized in that: The method further includes: setting a command queue optimization switch, and setting the command queue optimization switch to be on by default; In response to generating the service command, sending a switch setting request to the customer service system; Receive a switch setting command fed back by the customer business system, and set the command queue optimization switch according to the switch setting command.
8. A service command response time control device, characterized in that: include: A service identification module, configured to, in response to receiving a service command, identify a service type corresponding to the service command; a delay setting determination module, configured to perform a delay setting determination and obtain a delay mode for the service type, the delay mode including a default mode and a low-delay mode; in response to the service type being the default mode, using a default queue response time preset value within the hard disk to control the response time of the service command; and in response to the service type being the low-delay mode, determining whether a customer-specified command response time exists; a dynamic weight counting module, configured to, in response to the existence of a customer-specified command response time, control the response time of the service command according to the customer-specified command response; and, in response to the absence of a customer-specified command response time, calculate a dynamic weight sum according to a command type of the service command, and calculate the command response time based on the dynamic weight sum; The queue scheduling module is used to control the processing priority of the service command according to the command response time.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the service command response time control method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the service command response time control method according to any one of claims 1 to 7 are implemented.