Input / output information processing method and device, and electronic equipment
By receiving and comparing the storage capacity with the remaining capacity of the circular buffer, the target block device is determined for writing I/O information. This solves the problem of poor storage system performance caused by the inability to specify the block device in the prior art, and realizes effective monitoring and performance improvement of the I/O path.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XSKY TECH CO LTD
- Filing Date
- 2022-10-12
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies cannot specify block devices for writing I/O information, resulting in mixed I/O information in the circular buffer, causing poor storage system performance and data loss.
By receiving I/O information write requests from the target application, comparing the storage capacity with the remaining capacity of the circular buffer, the target block device is determined, and the I/O information is written to the specified circular buffer to avoid data overwriting and loss.
It enables effective monitoring of I/O paths in distributed storage systems, reduces the impact on system performance, and improves the overall performance of the storage system.
Smart Images

Figure CN115617267B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a method, apparatus, and electronic device for processing input / output information. Background Technology
[0002] With the rapid development of computer technology, distributed storage systems are placing increasingly higher demands on storage performance. Performance tuning is an essential step in improving storage performance. Performance tuning involves monitoring and analyzing operational data reflecting system performance, such as system response speed, to identify performance bottlenecks. Among these, the I / O (In / Output) path and its related information implicitly reveal various aspects of the storage device's performance and serve as crucial data for software tuning. Analyzing the I / O path and its associated information can pinpoint potential or existing problems within the storage device.
[0003] Currently, existing technologies for monitoring I / O paths and related information in distributed storage systems cannot specify block devices for tracking. Instead, all block device I / O paths and related information are written to a circular buffer, significantly impacting system performance and resulting in low system performance. Furthermore, because existing technologies cannot detect write activity to the circular buffer, data overwriting is possible, easily leading to the loss of I / O paths and related information.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a method, apparatus, and electronic device for processing input / output information, to at least solve the technical problem in the prior art where the I / O information of all block devices is written into the circular buffer because the I / O information of the block devices that need to be written to the circular buffer cannot be distinguished, resulting in low performance of the storage system.
[0006] According to one aspect of the present invention, a method for processing input / output information is provided, comprising: receiving an input / output (I / O) information write request sent by a target application, wherein the I / O information write request includes at least a target block device name and a first storage capacity, wherein the first storage capacity is the capacity required by the block device to write I / O information into a circular buffer, and the circular buffer is used to store the written I / O information; comparing the first storage capacity with the remaining capacity of the circular buffer; if the first storage capacity is less than or equal to the remaining capacity, determining a target block device corresponding to the target block device name from a plurality of block devices; and writing the I / O information into the circular buffer corresponding to the first storage capacity based on the target block device.
[0007] Furthermore, the method for processing input / output information also includes: setting the tracking position of I / O information in the program script of the target application, and adding a field containing the target block device name to the tracking position.
[0008] Furthermore, the input / output information processing method also includes: obtaining the current value of the target variable, wherein the target variable is used to record the remaining capacity of the circular buffer, and the remaining capacity corresponds to the value of the target variable; calculating the difference between the current value of the target variable and the value corresponding to the first storage capacity to obtain the target difference; determining the target capacity of the circular buffer based on the target difference; updating the target variable based on the target capacity, and using the circular buffer corresponding to the target capacity as the remaining circular buffer.
[0009] Furthermore, the method for processing input / output information also includes: generating a prompt message when the first storage capacity is greater than the remaining capacity, wherein the prompt message is used to indicate that the target object I / O information writing has failed.
[0010] Furthermore, the input / output information processing method also includes: when the I / O information meets preset conditions, exporting the I / O information written by the target block device from the circular buffer corresponding to the first storage capacity.
[0011] Furthermore, the input / output information processing method also includes: obtaining the delay time for the distributed system to process I / O requests, wherein the delay time is the time interval between the time of the last I / O request processing and the time of the current I / O request processing; obtaining the keyword corresponding to the I / O completion time, and parsing the keyword to obtain the I / O completion time, wherein the I / O completion time is the time interval between the time the target block device writes I / O information and the time of exporting I / O information; and generating I / O request processing information based on the delay time and the I / O completion time.
[0012] According to another aspect of the present invention, an input / output information processing apparatus is also provided, comprising: a receiving module, configured to receive an input / output I / O information write request sent by a target application, wherein the I / O information write request includes at least a target block device name and a first storage capacity, wherein the first storage capacity is the capacity required by the block device to write I / O information into a circular buffer, and the circular buffer is used to store the written I / O information; a comparison module, configured to compare the first storage capacity with the remaining capacity of the circular buffer; a determining module, configured to determine a target block device corresponding to the target block device name from a plurality of block devices if the first storage capacity is less than or equal to the remaining capacity; and a processing module, configured to write the I / O information into the circular buffer corresponding to the first storage capacity based on the target block device.
[0013] According to another aspect of the present invention, a computer program product is also provided, including a computer program / instructions that, when executed by a processor, implement the above-described input / output information processing method.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the above-described input / output information processing method at runtime.
[0015] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the one or more processors for running the programs, wherein the programs are configured to execute the above-described input / output information processing method during runtime.
[0016] In this embodiment of the invention, a method is adopted whereby a target block device that is allowed to be written to the circular buffer is specified. First, an input / output (I / O) information write request sent by the target application is received. Then, a first storage capacity is compared with the remaining capacity of the circular buffer. If the first storage capacity is less than or equal to the remaining capacity, a target block device corresponding to the target block device name is determined from multiple block devices. Then, based on the target block device, the I / O information is written to the circular buffer corresponding to the first storage capacity. The I / O information write request includes at least the target block device name and the first storage capacity, where the first storage capacity is the capacity required by the block device to write the I / O information to the circular buffer, and the circular buffer is used to store the written I / O information.
[0017] In the above process, by comparing the first storage capacity with the remaining capacity of the circular buffer, the current usage of the circular buffer can be clearly identified, thereby avoiding data overwriting and the loss of I / O information. By determining the target block device corresponding to the target block device name, the block device to be written to the circular buffer is specified, avoiding the overall system degradation caused by writing a large amount of I / O information to block devices, and reducing the impact on the overall system performance.
[0018] Therefore, the technical solution of this invention achieves the goal of monitoring the I / O path and related information of the distributed storage system through the target block device, thereby reducing the impact on system performance. It also solves the technical problem in the prior art that the I / O information of all block devices is written into the circular buffer because the I / O information of the block device that needs to be written into the circular buffer cannot be distinguished, resulting in low performance of the storage system. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0020] Figure 1 This is a flowchart of an optional input / output information processing method according to an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of an optional processing system interaction for an unspecified target block device according to an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the interaction of an optional processing system for a designated target block device according to an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram illustrating data overwriting in an optional circular buffer according to an embodiment of the present invention;
[0024] Figure 5 This is a flowchart illustrating an optional method for recording the usage of a circular buffer according to an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram of optional I / O path tracing information according to an embodiment of the present invention;
[0026] Figure 7 This is a flowchart of an optional method for drawing an I / O delay frequency histogram according to an embodiment of the present invention;
[0027] Figure 8 This is a schematic diagram of an optional I / O delay frequency histogram according to an embodiment of the present invention;
[0028] Figure 9 This is a schematic diagram of an optional input / output information processing device according to an embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It should be noted that all relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this invention are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with the relevant user or organization. Before obtaining relevant information, it needs to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.
[0032] Example 1
[0033] According to an embodiment of the present invention, a method embodiment for processing input / output information is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0034] Figure 1 This is a flowchart of an optional input / output information processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0035] Step S101: Receive an input / output (I / O) information write request sent by the target application. The I / O information write request includes at least the target block device name and a first storage capacity. The first storage capacity is the capacity required for the block device to write the I / O information into the circular buffer. The circular buffer is used to store the written I / O information.
[0036] In the above steps, the target application can be the application SPDK APPS that comes with the high-performance storage development component SPDK, and the I / O information can be I / O path tracing information of system calls such as I / O name, type, and size. A circular buffer is a computer memory area used to store input information. Its space size is fixed. When the circular buffer is full, it will overwrite the first element stored in the circular buffer.
[0037] Specifically, existing technologies typically use tracing tools like blktrace to trace I / O activities in the kernel space (kernel mode) of a storage system. However, for current high-performance distributed storage systems, since I / O activities occur in user space (user mode), existing technologies cannot meet the I / O path tracing requirements of distributed storage systems. It should be noted that the aforementioned high-performance storage development component SPDK runs in user space (user mode). Therefore, this invention uses the aforementioned high-performance storage development component SPDK to monitor I / O paths and related information in a distributed storage system.
[0038] Step S102: Compare the first storage capacity with the remaining capacity of the circular buffer.
[0039] Step S103: If the first storage capacity is less than or equal to the remaining capacity, determine the target block device corresponding to the target block device name from multiple block devices.
[0040] In the above steps, the target block device is a block device that allows write operations. For example, when writing I / O information to a circular buffer, there are multiple block devices named I / O Device0, I / O Device1, I / O Device2, I / O Device3, etc., which are respectively bound to multiple CPU cores named Core0, Core1, Core2, Core3, etc. Assuming that the target block device name in the I / O information write request in the aforementioned process is I / O Device0, then the block device corresponding to I / O Device0 can be used as the target block device, and the write operation can be performed through Core0.
[0041] Step S104: Based on the target block device, write the I / O information into the circular buffer corresponding to the first storage capacity.
[0042] In the above steps, using a specified target block device to write I / O information to the circular buffer reduces the amount of unnecessary I / O information writing and minimizes the impact on system performance. For example, the first storage capacity can be 1GB. In this case, the circular buffer corresponding to the first storage capacity is 1GB of space within the circular buffer. After determining the block device corresponding to I / O Device0 as the target block device in the aforementioned process, I / O information can be written to the 1GB of space in the circular buffer through Core0, which is bound to the target block device, i.e., the block device corresponding to I / O Device0.
[0043] Based on the scheme defined in steps S101 to S104 above, it can be understood that in this embodiment of the invention, by specifying a target block device that is allowed to be written to the circular buffer, the input / output (I / O) information write request sent by the target application is first received. Then, the first storage capacity is compared with the remaining capacity of the circular buffer. If the first storage capacity is less than or equal to the remaining capacity, the target block device corresponding to the target block device name is determined from multiple block devices. Then, based on the target block device, the I / O information is written to the circular buffer corresponding to the first storage capacity. The I / O information write request includes at least the target block device name and the first storage capacity, where the first storage capacity is the capacity required by the block device to write the I / O information to the circular buffer, and the circular buffer is used to store the written I / O information.
[0044] It is noteworthy that, in the above process, by comparing the first storage capacity with the remaining capacity of the circular buffer, the current usage of the circular buffer can be clearly identified, thereby avoiding data overwriting and the loss of I / O information. By determining the target block device corresponding to the target block device name, the block device to be written to the circular buffer is specified, avoiding the overall system degradation caused by writing a large amount of I / O information to block devices, and reducing the impact on the overall system performance.
[0045] Therefore, the technical solution of this invention achieves the goal of monitoring the I / O path and related information of the distributed storage system through the target block device, thereby reducing the impact on system performance. It also solves the technical problem in the prior art that the I / O information of all block devices is written into the circular buffer because the I / O information of the block device that needs to be written into the circular buffer cannot be distinguished, resulting in low performance of the storage system.
[0046] In one alternative embodiment, before receiving an input / output I / O information write request sent by the target application, the tracking position of the I / O information is set in the program script of the target application, and a field containing the target block device name is added to the tracking position.
[0047] Optionally, based on the high-performance storage development component SPDK running in user space, the selected block devices are filtered to write I / O information to the circular buffer, reducing the impact on system performance. Specifically, SPDK APPS applications limit the CPUs used during program initialization, and each CPU runs a thread bound to it. These threads, called Reactors, are responsible for handling actual business logic within SPDK. Each Reactor is bound not only to a CPU but also to the block device handling I / O. During I / O path tracing, the block device writes I / O information to the circular buffer through the Reactor. However, because it's impossible to distinguish which block devices' I / O information needs to be written to the circular buffer, with a large number of block devices, writing a large amount of I / O information to the circular buffer can lead to a decrease in overall system performance. For example, ... Figure 2 As shown, Core0 is the CPU core bound to the target block device I / O Device0, and Reactor on Core0 is the thread bound to CPU core Core0.
[0048] Optionally, to address the above issues, before receiving the input / output (I / O) information write request from the target application, the I / O information tracking position (i.e., the I / O tracking point) can be set in the SPDK APPS program script. A block device name field can be added to the I / O tracking point, allowing the Reactor to carry the target block device name. This enables writing of I / O information to the circular buffer only to the target block device corresponding to the block device name, filtering out threads for block devices with mismatched names and reducing the impact on overall system performance. For example, ... Figure 3 As shown, if block device I / O Device0 is not added in the program script, Core0 bound to I / O Device0 will not perform write operations. That is, when writing I / O information to the circular buffer, Reactor on Core0 is filtered out and cannot write to the circular buffer.
[0049] In one optional embodiment, after receiving an input / output (I / O) information write request from the target application, the current value of the target variable is obtained. Then, the difference between the current value of the target variable and the value corresponding to the first storage capacity is calculated to obtain the target difference. Based on the target difference, the target capacity of the circular buffer is determined. Then, the target variable is updated based on the target capacity, and the circular buffer corresponding to the target capacity is used as the remaining circular buffer. The target variable is used to record the remaining capacity of the circular buffer, and the remaining capacity corresponds to the value of the target variable.
[0050] Specifically, in SPDK applications, the circular buffer is prone to overwriting when IOPS (Input / Output Operations Per Second) is high. Although the application provides tools to copy data from the buffer to the system disk, the circular buffer resides in memory, resulting in faster write speeds compared to the system disk. When the write speeds of the system disk and the buffer differ significantly, users cannot determine if overwriting has occurred and must check I / O path tracing information to ascertain whether previous information has been overwritten. For example, ... Figure 4 As shown, I / O path tracing information 11 covers I / O path tracing information 01.
[0051] Optionally, to solve the above problems, such as Figure 5 As shown, in the SPDK application's spdk trace initialization script, a global variable `g_trace_size`, the target variable, is created to record the size of the remaining circular buffer, i.e., the total size of the current circular buffer. The size of the circular buffer can be set by the administrator based on different IOPS values. Further, when SPDK writes I / O path trace information using the circular buffer, it allocates a certain size of I / O trace memory space (trace buffer), i.e., the first storage capacity, from the circular buffer for writing new I / O path trace information. Further, the difference between the global variable `g_trace_size` and the allocated I / O trace memory space is calculated to obtain the target difference. Therefore, the current size of the circular buffer, i.e., the target capacity, can be determined from the target difference. Further, the global variable `g_trace_size` is updated, and the value of the global variable `g_trace_size`, i.e., the current size of the circular buffer, is returned through the API function `get_trace_size()`, thus indicating the used circular buffer space.
[0052] In one alternative embodiment, after comparing the first storage capacity with the remaining capacity of the circular buffer, if the first storage capacity is greater than the remaining capacity, a prompt message is generated, wherein the prompt message is used to indicate that the target object I / O information writing has failed.
[0053] Optionally, in this invention, the API function `get_trace_size()` can be used to control whether overwrite is allowed. Specifically, if the requested size of the circular buffer is greater than the remaining size, writing is prohibited until the previously written I / O information is retrieved, and the requested size of the circular buffer is less than or equal to the remaining size. Simultaneously, a prompt message is generated to inform the administrator that the write buffer failed due to the prohibition of overwrite. It should be noted that whether overwrite is allowed can be set by the administrator according to their needs; this invention does not impose any limitations.
[0054] In one optional embodiment, after writing I / O information to a circular buffer corresponding to a first storage capacity based on the target block device, the I / O information written by the target block device is exported from the circular buffer corresponding to the first storage capacity if the I / O information meets preset conditions. Optionally, the preset conditions may be, for example, reaching a target time, which can be set by the administrator according to needs, and this invention is not limited thereto.
[0055] In one optional embodiment, after writing I / O information to a circular buffer corresponding to the first storage capacity based on the target block device, the latency time for the distributed system to process the I / O request is obtained, a keyword corresponding to the I / O completion time is obtained, and the keyword is parsed to obtain the I / O completion time. Then, based on the latency time and the I / O completion time, I / O request processing information is generated. Here, the latency time is the time interval between the time of the previous I / O request processing and the time of the current I / O request processing, and the I / O completion time is the time interval between the time the target block device writes the I / O information and the time the I / O information is exported.
[0056] Optionally, the processed information can be displayed in the form of graphics, tables, etc., which can be set by the administrators according to their needs. This invention does not impose any limitations.
[0057] Optionally, this invention uses an I / O latency frequency histogram as an example. In existing technologies, when using the blktrace tool to trace the path of I / O activities in the kernel space of a storage system, the I / O completion time cannot be directly obtained. That is, in existing technologies, an additional blkparse tool is needed to parse the file generated by blktrace, and then the btt tool is used to draw the I / O latency frequency histogram. blkparse is a tool that obtains the output file of blktrace and converts its information into human-understandable text information, while btt is a tool that obtains data from blkparse and draws the I / O latency frequency histogram by analyzing the data. Furthermore, blkparse depends on the output of blktrace, and btt depends on the output of blkparse, forming a closed dependency relationship, making it impossible to draw a user-space I / O latency frequency histogram.
[0058] Optionally, to address the above issue, the SPDK records the I / O activity time. Specifically, before I / O submission, the I / O trace point registration start time is recorded; after I / O processing is completed, the I / O trace point registration end time is recorded. Then, the completion time is calculated based on the start and end times, directly providing the I / O completion time. Optionally, Figure 6 This is a schematic diagram of optional I / O path tracing information according to an embodiment of the present invention, such as... Figure 6 As shown, the value corresponding to the keyword "time" is the I / O completion time. For example, in "time: 1310.432", 1310.432 is the I / O completion time.
[0059] Furthermore, such as Figure 7 As shown, using latency (delay time) as the horizontal axis, the keyword "time" is read and its corresponding value is parsed and stored in the array `latancy`. Then, the frequency of time elements appearing in the `latancy` array is counted to plot an I / O latency frequency histogram, as shown below. Figure 8 As shown.
[0060] Therefore, the technical solution of this invention achieves the goal of monitoring the I / O path and related information of the distributed storage system through the target block device, thereby reducing the impact on system performance. It also solves the technical problem in the prior art that the I / O information of all block devices is written into the circular buffer because the I / O information of the block device that needs to be written into the circular buffer cannot be distinguished, resulting in low performance of the storage system.
[0061] Example 2
[0062] According to an embodiment of the present invention, an embodiment of an input / output information processing apparatus is provided, wherein, Figure 9 This is a schematic diagram of an optional input / output information processing device according to an embodiment of the present invention, such as... Figure 9 As shown, the device includes: a receiving module 901, configured to receive an input / output (I / O) information write request sent by a target application, wherein the I / O information write request includes at least a target block device name and a first storage capacity, wherein the first storage capacity is the capacity required by the block device to write I / O information into a circular buffer, and the circular buffer is used to store the written I / O information; a comparison module 902, configured to compare the first storage capacity with the remaining capacity of the circular buffer; a determination module 903, configured to determine, from multiple block devices, a target block device corresponding to the target block device name if the first storage capacity is less than or equal to the remaining capacity; and a processing module 904, configured to write the I / O information into the circular buffer corresponding to the first storage capacity based on the target block device.
[0063] It should be noted that the receiving module 901, comparison module 902, determination module 903 and processing module 904 mentioned above correspond to steps S101 to S104 in the above embodiments. The four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the content disclosed in the above embodiment 1.
[0064] Optionally, the input / output information processing device further includes: a tracking module for setting the tracking position of I / O information in the program script of the target application and adding a field containing the target block device name to the tracking position.
[0065] Optionally, the input / output information processing device further includes: a first acquisition module, used to acquire the current value of the target variable, wherein the target variable is used to record the remaining capacity of the circular buffer, and the remaining capacity corresponds to the value of the target variable; a calculation module, used to calculate the difference between the current value of the target variable and the value corresponding to the first storage capacity, to obtain the target difference; a first determination module, used to determine the target capacity of the circular buffer based on the target difference; and an update module, used to update the target variable based on the target capacity, and use the circular buffer corresponding to the target capacity as the remaining circular buffer.
[0066] Optionally, the input / output information processing device further includes: a prompting module, used to generate a prompting message when the first storage capacity is greater than the remaining capacity, wherein the prompting message is used to indicate that the target object I / O information writing has failed.
[0067] Optionally, the input / output information processing device further includes: an export module, used to export the I / O information written by the target block device from the circular buffer corresponding to the first storage capacity when the I / O information meets preset conditions.
[0068] Optionally, the input / output information processing device further includes: a second acquisition module, used to acquire the delay time of the distributed system processing I / O requests, wherein the delay time is the time interval between the time of the last I / O request processing and the time of the current I / O request processing; a third acquisition module, used to acquire a keyword corresponding to the I / O completion time, and parse the keyword to obtain the I / O completion time, wherein the I / O completion time is the time interval between the time of the target block device writing I / O information and the time of exporting I / O information; and a first generation module, used to generate I / O request processing information based on the delay time and the I / O completion time.
[0069] Example 3
[0070] According to another aspect of the present invention, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, implements the above-described input / output information processing method.
[0071] Example 4
[0072] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described input / output information processing method when running.
[0073] Example 5
[0074] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the program for running the program, wherein the program is configured to execute the above-described input / output information processing method during runtime.
[0075] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0076] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0077] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0078] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0079] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0080] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0081] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A processing method of input / output information, characterized by, include: Receive an input / output (I / O) information write request sent by the target application, wherein the I / O information write request includes at least the target block device name and a first storage capacity, wherein the first storage capacity is the capacity required for the block device to write the I / O information to a circular buffer, and the circular buffer is used to store the written I / O information; Specifically, before receiving the input / output I / O information write request sent by the target application, the tracking position of the I / O information is set in the program script of the target application, and a field containing the name of the target block device is added to the tracking position; The first storage capacity is compared with the remaining capacity of the circular buffer; If the first storage capacity is less than or equal to the remaining capacity, a target block device corresponding to the target block device name is determined from among the plurality of block devices; Based on the target block device, the I / O information is written into a circular buffer corresponding to the first storage capacity.
2. The method according to claim 1, characterized in that, After receiving an input / output I / O information write request sent by the target application, the method further includes: Obtain the current value of the target variable, wherein the target variable is used to record the remaining capacity of the circular buffer, and the remaining capacity corresponds to the value of the target variable; Calculate the difference between the current value of the target variable and the value corresponding to the first storage capacity to obtain the target difference; Based on the target difference, determine the target capacity of the circular buffer; The target variable is updated based on the target capacity, and the circular buffer corresponding to the target capacity is used as the remaining circular buffer.
3. The method according to claim 1, characterized in that, After comparing the first storage capacity with the remaining capacity of the circular buffer, the method further includes: If the first storage capacity is greater than the remaining capacity, a prompt message is generated, wherein the prompt message is used to indicate to the target object that the I / O information writing has failed.
4. The method according to claim 1, characterized in that, After writing the I / O information into a circular buffer corresponding to the first storage capacity based on the target block device, the method further includes: When the I / O information meets the preset conditions, the I / O information written by the target block device is exported from the circular buffer corresponding to the first storage capacity.
5. The method according to claim 1, characterized in that, After writing the I / O information into a circular buffer corresponding to the first storage capacity based on the target block device, the method further includes: Obtain the latency of a distributed system in processing an I / O request, wherein the latency is the time interval between the time of the last processing of the I / O request and the time of the current processing of the I / O request; Obtain the keyword corresponding to the I / O completion time, and parse the keyword to obtain the I / O completion time, wherein the I / O completion time is the time interval between the time when the target block device writes the I / O information and the time when it exports the I / O information; Based on the delay time and the I / O completion time, the processing information for the I / O request is generated.
6. An input / output information processing device, characterized in that, include: A receiving module is configured to receive an input / output (I / O) information write request sent by a target application, wherein the I / O information write request includes at least the target block device name and a first storage capacity, wherein the first storage capacity is the capacity required by the block device to write the I / O information into a circular buffer, and the circular buffer is used to store the written I / O information. The tracking module is used to set the tracking position of the I / O information in the program script of the target application, and add a field containing the name of the target block device to the tracking position; The comparison module is used to compare the first storage capacity with the remaining capacity of the circular buffer; The determining module is configured to determine, from a plurality of block devices, a target block device corresponding to the target block device name when the first storage capacity is less than or equal to the remaining capacity; The processing module is used to write the I / O information into a circular buffer corresponding to the first storage capacity based on the target block device.
7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the input / output information processing method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the input / output information processing method according to any one of claims 1 to 6 when it is run.
9. An electronic device, characterized in that, The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to perform the program, wherein the program is configured to execute the input / output information processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Block equipment input and output request dispatching method and device
CN104317656A
Data caching method and device, equipment and medium
CN113138945A