Method, device and storage medium for determining command response duration
By reading the command from the network queue and recording the start time, executing and writing the end time, and determining the command response time, the problem of inaccurate command processing time in the existing technology is solved and the accuracy of data analysis is improved.
Patent Information
- Application Number
- CN202110640206.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-08
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-06-08
AI Technical Summary
In the existing technology, it is difficult to accurately determine the entire processing time of a command, which affects the accuracy of data analysis.
Read the command from the network queue to the input buffer, record the start time information, execute the command, write the execution result to the output buffer, and use the end time information of the output buffer as the end time information of the processing command to determine the command response time.
The accuracy of the command response time is improved, thereby improving the accuracy of data analysis based on the command response time.
Smart Images

Figure CN113377434B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device and storage medium for determining a command response duration. Background Art
[0002] In the related art, data analysis is usually performed based on the execution time of the command given in the data buffer redis server, for example, to analyze the average load of the processor CPU (central processing unit). Accurately determining the execution time of the command is very important for accurate data analysis. Therefore, how to accurately determine the execution time of the command is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present disclosure provides a method, apparatus, device and storage medium for determining a command response duration.
[0004] According to one aspect of the present disclosure, a method for determining a command response duration is provided, comprising: reading a command from a network queue to an input buffer, and recording start time information of receiving the command; reading the command from the input buffer, and executing the command to obtain an execution result of the command; writing the execution result into an output buffer; using the time information corresponding to when the execution result of the output buffer is written into the network queue as end time information of processing the command; and determining the response duration of the command based on the end time information and the start time information.
[0005] According to another aspect of the present disclosure, a device for determining a command response duration is provided, comprising: a reading module, configured to read a command from a network queue to an input buffer, and record start time information of receiving the command; an execution module, configured to read the command from the input buffer, and execute the command to obtain an execution result of the command; a writing module, configured to write the execution result to an output buffer; an acquisition module, configured to use the time information corresponding to the time when the execution result of the output buffer is written to the network queue as end time information for processing the command; and a determination module, configured to determine the response duration of the command based on the end time information and the start time information.
[0006] According to another aspect of the present disclosure, a data cache server is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect.
[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.
[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0009] The technical solution provided in this embodiment can have the following beneficial effects:
[0010] Read the command from the network queue to the input buffer, record the start time information of the received command, read the command from the input buffer, execute the command to obtain the execution result of the command, write the execution result to the output buffer, and use the time information corresponding to when the execution result of the output buffer is written to the network queue as the end time information of processing the command, and determine the response time of the command according to the end time information and the start time information. Thus, the response time of the command is determined according to the start time information of the command and the end time information of processing the command, which improves the accuracy of the response time of the command, and further improves the accuracy of the subsequent data analysis based on the response time of the command.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0013] Figure 1 A flowchart of a method for determining a command response duration provided by an embodiment of the present disclosure;
[0014] Figure 2 A flowchart of another method for determining command response duration provided by an embodiment of the present disclosure;
[0015] Figure 3 A flowchart of another method for determining command response duration provided by an embodiment of the present disclosure;
[0016] Figure 4 A flowchart of another method for determining command response duration provided by an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of the structure of a device for determining a command response duration provided by an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of the structure of another device for determining command response duration provided by an embodiment of the present disclosure;
[0019] Figure 7 A schematic block diagram of a data cache server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] In the related art, when determining the execution time of a command, usually only the time consumed in the specific execution processing stage of the command is counted, which cannot accurately reflect the entire time of processing the instruction, thus affecting the accuracy of subsequent data analysis. Therefore, how to accurately determine the entire processing time of a command is a technical problem that needs to be solved urgently.
[0022] In order to solve this technical problem, the present disclosure proposes a method for determining the command response time. The method reads the command from the network queue to the input buffer, records the start time information of the received command, reads the command from the input buffer, executes the command to obtain the execution result of the command, writes the execution result to the output buffer, and uses the time information corresponding to when the execution result of the output buffer is written to the network queue as the end time information of processing the command, and determines the command response time according to the end time information and the start time information. Thus, the response time of the command is determined according to the start time information of the command and the end time information of processing the command, which improves the accuracy of the command response time, and further improves the accuracy of the subsequent data analysis based on the command response time.
[0023] The following describes a method, device, and storage medium for determining a command response duration according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0024] Figure 1 A flowchart of a method for determining a command response duration provided in an embodiment of the present disclosure.
[0025] Among them, it should be noted that the method for determining the command response time provided in this embodiment is executed by a device for determining the command response time. The device for determining the command response time can be configured on a data cache server. The command response time can be accurately determined through the device for determining the command response time.
[0026] like Figure 1 As shown, the method for determining the command response time may include the following steps:
[0027] Step 101, read the command from the network queue to the input buffer, and record the start time information of receiving the command.
[0028] In an exemplary embodiment, in the process of reading a command from a network queue to an input buffer, the start time information of receiving the command may be obtained and the start time information of the command may be recorded.
[0029] Step 102, read the command from the input buffer, and execute the command to obtain the execution result of the command.
[0030] Specifically, the commands in the input buffer may be read in sequence, and the read commands may be executed to obtain the execution results of the commands.
[0031] It can be understood that different commands perform different processing and correspondingly have different execution results. This embodiment does not specifically limit the commands and the execution results corresponding to the commands, and executable commands can be set according to actual application requirements.
[0032] Step 103, writing the execution result into the output buffer.
[0033] In an exemplary embodiment, in order to reduce processing pressure, the execution result of the command may be written into an output buffer.
[0034] Step 104: The time information corresponding to when the execution result of the output buffer is written into the network queue is used as the end time information of the processing command.
[0035] Step 105: Determine the response time of the command according to the end time information and the start time information.
[0036] In an exemplary embodiment, the time difference obtained by subtracting the start time information from the end time information can be obtained, and the obtained time difference can be used as the response duration of the command. In other words, the obtained time difference can be used as the time consumed by the data cache server to process the command.
[0037] In the method for determining the command response time of the present embodiment, the method reads the command from the network queue to the input buffer, records the start time information of the received command, reads the command from the input buffer, executes the command to obtain the execution result of the command, writes the execution result to the output buffer, and uses the time information corresponding to when the execution result of the output buffer is written to the network queue as the end time information of processing the command, and determines the response time of the command based on the end time information and the start time information. Thus, the response time of the command is determined based on the start time information of the command and the end time information of processing the command, which improves the accuracy of the response time of the command, and further improves the accuracy of the subsequent data analysis based on the response time of the command.
[0038] Based on the above embodiment, in order to accurately determine the end time information of the command, the following is combined with Figure 2 , an exemplary implementation of using the time information corresponding to when the execution result of the output buffer is written into the network queue as the end time information of the processing command is described exemplarily, such as Figure 2 As shown, it may include:
[0039] Step 201, obtaining the end position of the execution result in the output buffer.
[0040] In some embodiments, a possible implementation method of obtaining the end position of the execution result in the output buffer is: obtaining the structure information corresponding to the command, and obtaining the end position of the execution result in the output buffer from the structure information.
[0041] The structure information includes the end position of the execution result of the command in the output buffer.
[0042] In other embodiments, the start time information of the command can be determined through the structure information. That is, the above structure information can also include the start time information of the command.
[0043] In an exemplary implementation, an example of the structure information CommandDelayStat of the above command is as follows:
[0044] CommandDelayStat
[0045] typedefsturctCommandDelayStat{
[0046] int begin; the end position of the command execution result in the output buffer.
[0047] sdscmd; / / command name to be executed
[0048] intcreatetime; / / The start time of receiving commands from the network queue.
[0049] };
[0050] Step 202: Write the content in the output buffer into the network queue.
[0051] In some embodiments, the content in the output buffer may be written to the network queue via a write event handler.
[0052] In some possible embodiments, in order to write the content in the output buffer into the network queue through the write event handler, the write event handler can be registered in advance. That is, before writing the content in the output buffer into the network queue through the write event handler, the write event handler can also be registered.
[0053] Step 203, when it is detected that the content at the end position is written into the network queue, it is determined that the execution result is written into the network queue, and the time information corresponding to when the content at the end position is written into the network queue is obtained, and the obtained time information is used as the end time information for processing the command.
[0054] In this embodiment, the content in the output buffer is written into the network queue, and when it is detected that the content at the end position of the execution result in the output buffer is written into the network queue, the current time information is obtained, and the current time information is used as the end time information for processing the command, thereby facilitating the subsequent accurate determination of the response time of the command based on the end time information and the start time information.
[0055] Figure 3 A flowchart of another method for determining command response duration provided in an embodiment of the present disclosure.
[0056] like Figure 3 As shown, the method for determining the command response time includes the following steps:
[0057] Step 301, controlling the read event processor to read a command from a network queue and save the command to an input buffer.
[0058] In some embodiments, in order to read commands from the network queue through the read event handler, the read event handler may be registered in advance, that is, before controlling the read event handler to read commands from the network queue, the read event handler may also be registered.
[0059] Step 302, read the command from the input buffer, and execute the command to obtain the execution result of the command.
[0060] Step 303: Write the execution result into the output buffer.
[0061] Step 304, obtaining the end position of the execution result in the output buffer.
[0062] Step 305: Write the content in the output buffer into the network queue.
[0063] Step 306, when it is detected that the content at the end position is written into the network queue, determine that the execution result is written into the network queue, obtain the time information corresponding to when the content at the end position is written into the network queue, and use the obtained time information as the end time information for processing the command.
[0064] Step 307: Determine the response time of the command according to the end time information and the start time information.
[0065] The method for determining the command response duration of the present embodiment controls the reading of commands from the network queue of the event processor to the input buffer, records the start time information of the received command, reads the command from the input buffer, and executes the command to obtain the execution result of the command, writes the execution result into the output buffer, and obtains the end position of the execution result in the output buffer; writes the content in the output buffer into the network queue; when it is detected that the content at the end position is written into the network queue, determines that the execution result is written into the network queue, obtains the time information corresponding to when the content at the end position is written into the network queue, and determines the response duration of the command based on the end time information and the start time information. Thus, the response duration of the command is determined based on the start time information of the command and the end time information of processing the command, which improves the accuracy of the response duration of the command, and further improves the accuracy of the subsequent data analysis based on the response duration of the command.
[0066] In order to enable those skilled in the art to clearly understand the present invention, Figure 4 The method for determining the command response time of this embodiment is described. Figure 4 As shown, it may include:
[0067] Step 401, start the data cache server.
[0068] Step 402, registering a socket connection event handler.
[0069] Step 403: Establish a socket connection between the data cache server and the client Client through the socket connection event processor.
[0070] Step 404, register the socket read event handler.
[0071] In this embodiment, in order to enable the data cache server to read commands sent by the client through the socket connection from the socket network queue, a socket read event handler may be pre-registered.
[0072] Step 405: read the command sent by the client through the socket connection from the socket network queue through the socket read event processor, save the read command into the input buffer, and record the start time information of receiving the command.
[0073] Step 406, parse the key data in the input buffer to obtain the command.
[0074] Step 407, execute the command to obtain the execution result of the command and transmit the start time information.
[0075] Step 408, write the execution result into the output buffer, and generate the command time-consuming statistics structure information of the command based on the end position information of the execution result in the output buffer and the above-mentioned start time information.
[0076] As an exemplary implementation, an example of the command time statistics structure information CommandDelayStat of the above command is as follows:
[0077] CommandDelayStat
[0078] typedefsturctCommandDelayStat{
[0079] intbegin; the end position of the command execution result in the output buffer.
[0080] sdscmd; / / command name to be executed
[0081] intcreatetime; / / The start time of receiving commands from the network queue.
[0082] };
[0083] Step 409, adding the command time-consuming statistics structure information to the statistics list.
[0084] Step 410, registering a socket write event handler.
[0085] Step 411, based on the socket write event processor, write the content of the output buffer into the socket network queue, and based on the statistical list, obtain the command time statistics structure information of the command, and determine the response time of the command based on the command time statistics structure information.
[0086] In some exemplary embodiments, the method of obtaining the command time consuming statistical structure information of the command based on the statistical list may be: querying the statistical table according to the command name of the command to obtain the command time consuming statistical structure information of the command.
[0087] In some exemplary embodiments, the specific implementation method of determining the response time of the command based on the command time statistics structure information is as follows: the start time information of receiving the command and the end position information of the execution result in the output buffer can be obtained from the command time statistics structure information, and then, the end position information, the time information corresponding to when the content on the end position information is sent to the socket network queue, and the obtained time information is used as the end time information for processing the command; and the response time of the command is determined according to the start time information and the end time information. Thus, the entire processing time data of the command is accurately determined in combination with the start time of receiving the command and the end time information of processing the command, and the response time of the instruction can be accurately reflected through the entire processing time data.
[0088] Step 412, closing the client Client.
[0089] Based on the above embodiment, the method provided in this embodiment can be used to determine the response time of each command processed by the data cache server, and perform data analysis or problem analysis based on the response time of each command. As an example, the processor load in the data cache server can be determined based on the response time of each command.
[0090] In order to implement the above embodiment, this embodiment provides a device for determining a command response duration.
[0091] Figure 5 A schematic diagram of a structure of a device for determining a command response duration provided by an embodiment of the present disclosure, such as Figure 5 As shown, the device includes: a reading module 501, an execution module 502, a writing module 503, an acquisition module 504 and a determination module 505, wherein:
[0092] The reading module 501 is used to read commands from the network queue into the input buffer and record the start time information of receiving the commands.
[0093] The execution module 502 is used to read commands from the input buffer and execute the commands to obtain execution results of the commands.
[0094] The writing module 503 is used to write the execution result into the output buffer.
[0095] The acquisition module 504 is used to use the time information corresponding to when the execution result of the output buffer is written into the network queue as the end time information of the processing command.
[0096] The determination module 505 is used to determine the response time of the command according to the end time information and the start time information.
[0097] In some embodiments of the present disclosure, reference Figure 6 , the acquisition module 504 includes:
[0098] The first acquisition unit 5041 is used to acquire the end position of the execution result in the output buffer;
[0099] The writing unit 5042 is used to write the content in the output buffer into the network queue;
[0100] The second acquisition unit 5043 is used to determine that the execution result is written into the network queue when it is detected that the content at the end position is written into the network queue, and to acquire the time information corresponding to when the content at the end position is written into the network queue, and to use the acquired time information as the end time information.
[0101] In a possible implementation, the first acquisition unit 5041 is specifically used to: acquire structure information corresponding to the command; and acquire the end position of the execution result in the output buffer from the structure information.
[0102] In some exemplary implementations of the present disclosure, the reading module 501 is specifically used to control the reading event processor to read commands from the network queue and save the commands to the input buffer.
[0103] like Figure 6 As shown, the device may also include:
[0104] The first registration module 506 is used to register a read event handler.
[0105] In some embodiments, the above-mentioned writing unit 5042 is specifically used to write the content in the output buffer into the network queue through the writing event handler.
[0106] like Figure 6 As shown, the device may further include: a second registration module 507, used to register a write event handler.
[0107] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principles are the same, so they will not be repeated in this embodiment.
[0108] The command response time determination device of this embodiment reads the command from the network queue to the input buffer, records the start time information of the received command, reads the command from the input buffer, executes the command to obtain the execution result of the command, writes the execution result to the output buffer, and uses the time information corresponding to when the execution result of the output buffer is written to the network queue as the end time information of processing the command, and determines the response time of the command based on the end time information and the start time information. Thus, the response time of the command is determined based on the start time information of the command and the end time information of processing the command, which improves the accuracy of the response time of the command, and further improves the accuracy of the subsequent data analysis based on the response time of the command.
[0109] In order to implement the above embodiment, this embodiment provides a data cache server, including:
[0110] at least one processor; and
[0111] a memory communicatively connected to at least one processor; wherein,
[0112] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can perform the method of the aforementioned method embodiment.
[0113] In order to implement the above embodiment, this embodiment provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method of the above method embodiment.
[0114] In order to implement the above embodiment, this embodiment provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method of the above method embodiment is implemented.
[0115] Figure 7 A schematic block diagram of a data cache server provided for an embodiment of the present disclosure. The data cache server is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0116] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 702 or a computer program loaded from a storage unit 708 to a RAM (Random Access Memory) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An I / O (Input / Output) interface 705 is also connected to the bus 704.
[0117] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0118] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, CPU (Central Processing Unit), GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a method for determining the command response duration. For example, in some embodiments, the method for determining the command response duration may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the method for determining the command response duration described above may be executed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the method for determining the command response duration in any other appropriate manner (eg, by means of firmware).
[0119] Various embodiments of the systems and techniques described above in this article can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0120] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0121] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory, Erasable Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory, Portable Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data server), or a computing system that includes a middleware component (e.g., an application server), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0124] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0125] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0126] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for determining a command response duration, characterized in that: The method comprises: Read the command from the socket network queue to the input buffer, and record the start time information of receiving the command; Reading the command from the input buffer and executing the command to obtain an execution result of the command; Writing the execution result into an output buffer; The time information corresponding to when the execution result of the output buffer is written into the socket network queue is used as the end time information of processing the command; Determining a response duration of the command according to the end time information and the start time information; The time information corresponding to when the execution result of the output buffer is written into the socket network queue is used as the end time information of processing the command, including: Obtaining the end position of the execution result in the output buffer; Writing the content in the output buffer into the socket network queue; When it is detected that the content at the end position is written into the socket network queue, it is determined that the execution result is written into the socket network queue, and the time information corresponding to when the content at the end position is written into the socket network queue is obtained, and the obtained time information is used as the end time information.
2. The method according to claim 1, characterized in that The obtaining of the execution result at the end position of the output buffer includes: Obtaining the structure information corresponding to the command; The end position of the execution result in the output buffer is obtained from the structure information.
3. The method according to claim 1, characterized in that The step of reading commands from the socket network queue to the input buffer includes: The control read event processor reads the command from the socket network queue and saves the command to the input buffer.
4. The method according to claim 1, characterized in that Writing the content in the output buffer into the socket network queue comprises: The content in the output buffer is written into the socket network queue through a write event handler.
5. A device for determining command response duration, characterized in that: The device comprises: A reading module, used for reading commands from the socket network queue into an input buffer, and recording the start time information of receiving the commands; An execution module, used for reading the command from the input buffer and executing the command to obtain an execution result of the command; A writing module, used for writing the execution result into an output buffer; An acquisition module, used for writing the time information corresponding to the execution result of the output buffer into the socket network queue as the end time information of processing the command; A determination module, used to determine the response time of the command according to the end time information and the start time information; The acquisition module comprises: A first acquisition unit, configured to acquire an end position of the execution result in the output buffer; A writing unit, used for writing the content in the output buffer into the socket network queue; The second acquisition unit is used to determine that the execution result is written into the socket network queue when it is detected that the content at the end position is written into the socket network queue, and to acquire the time information corresponding to the time when the content at the end position is written into the socket network queue, and to use the acquired time information as the end time information.
6. The device according to claim 5, characterized in that The reading module is specifically used for: Obtaining the structure information corresponding to the command; The end position of the execution result in the output buffer is obtained from the structure information.
7. The device according to claim 5, characterized in that The first acquisition unit is specifically used to: The control read event processor reads the command from the socket network queue and saves the command to the input buffer.
8. The device according to claim 5, characterized in that The writing unit is specifically used for: The content in the output buffer is written into the socket network queue through a write event handler.
9. A data cache server, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
