Priority-based data processing method and device, equipment and storage medium
By using the eBPF program in the Linux system to identify and prioritize business data, the problem of critical data not being processed in a timely manner was solved, and the read and write performance of critical data was improved.
Patent Information
- Application Number
- CN202411717590.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2026-05-26
AI Technical Summary
In Linux systems, when critical data and non-critical data coexist and are simultaneously read/write operations triggered, the critical data cannot be processed in a timely manner, leading to increased read/write latency and throughput.
By acquiring the Extended Berkeley Packet Filter (eBPF) program and loading it into the kernel space, priority configuration information is obtained. The execution order of I/O operations is determined based on the priority of business data, with priority given to I/O operations on critical data.
It enables timely processing of critical data, improving the timeliness and read/write performance of critical data.
Smart Images

Figure CN122086534A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a priority-based data processing method, apparatus, device, and storage medium. Background Technology
[0002] Linux is an operating system widely used on various platforms such as servers, desktop computers, embedded systems, and mobile devices. The Linux system's running space is divided into kernel space and user space. Kernel space is the running space of the system kernel, which is responsible for managing the system's hardware resources, while user space is the space where applications run.
[0003] In the existing technology, in the I / O (input / output) implementation process of the Linux system, when an application needs to read or write data, it sends a read / write request to the kernel. This read / write request is transferred from user space to kernel space so that the kernel can interact with the hardware to perform read and write operations on the data.
[0004] However, the Linux kernel typically advocates a design philosophy of "providing mechanisms rather than policies," and does not differentiate the importance of received read and write requests at the business level. This will result in critical and non-critical business operations existing simultaneously and triggering read and write operations at the same time, with critical and non-critical data being interspersed in the kernel's I / O read and write queue. If the amount of non-critical data is large at a certain time, the critical data will not be processed in a timely manner, thereby increasing the read and write latency and throughput of critical data. Summary of the Invention
[0005] To address the aforementioned technical problems, this disclosure provides a priority-based data processing method, apparatus, device, and storage medium.
[0006] In a first aspect, embodiments of this disclosure provide a priority-based data processing method, the method comprising:
[0007] Obtain the Extended Berkeley Packet Filter (eBPF) program and load the eBPF program;
[0008] Obtain priority configuration information, which is used to indicate the priority of business data;
[0009] Upon receiving an input / output I / O operation for any of the aforementioned service data, the eBPF program is triggered, and the eBPF program determines the execution order of the corresponding I / O operations based on the priority of the service data.
[0010] The I / O operations are performed in the order described.
[0011] Optionally, loading the eBPF program includes:
[0012] The eBPF program is loaded into the kernel space, and the block device input / output (BIO) queue in the kernel space is associated with the eBPF program.
[0013] The step of triggering the eBPF program upon receiving an input / output I / O operation on any of the aforementioned service data includes:
[0014] The eBPF program is triggered after the BIO queue receives an input / output I / O operation for any of the service data.
[0015] Optionally, obtaining priority configuration information includes:
[0016] Obtain priority configuration information from user-space applications;
[0017] The priority configuration information is sent to the mapping file in the kernel space;
[0018] Before the eBPF program determines the execution order of the corresponding IO operations based on the priority of the service data, it also includes:
[0019] The eBPF program accesses the mapping file to obtain the priority of the business data.
[0020] Optionally, the step of distributing the priority configuration information to the mapping file in the kernel space includes:
[0021] The priority configuration information is sent to the kernel space through the target interface, which is provided by the Berkeley Packet Filter (BPF) file system.
[0022] In the kernel space, the priority configuration information is stored in the form of key-value pairs to obtain a mapping file.
[0023] Optionally, triggering the eBPF program after the BIO queue receives an input / output I / O operation for any of the service data includes:
[0024] Through the block file system, I / O operations on any of the aforementioned business data are received from user-space applications.
[0025] Based on the page caching mechanism, the IO operation is written to the BIO queue and the eBPF program is triggered.
[0026] Optionally, the priority is used to indicate whether the business data is critical or non-critical data, and the eBPF program determines the execution order of the corresponding IO operations based on the priority of the business data, including:
[0027] The eBPF program arranges the execution order of the IO operations corresponding to the critical data before the execution order of the IO operations corresponding to the non-critical data.
[0028] In a second aspect, embodiments of this disclosure provide a priority-based data processing apparatus, comprising:
[0029] A loading module is used to obtain the Extended Berkeley Packet Filter (eBPF) program and load the eBPF program;
[0030] The acquisition module is used to acquire priority configuration information, which is used to indicate the priority of business data;
[0031] The determination module is used to trigger the eBPF program after receiving an input / output IO operation on any of the service data, and the eBPF program determines the execution order of the corresponding IO operations based on the priority of the service data;
[0032] An execution module is used to execute the I / O operations according to the execution order.
[0033] Thirdly, embodiments of this disclosure provide an electronic device, including:
[0034] Memory;
[0035] Processor; and
[0036] Computer programs;
[0037] The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first, second, or third aspect.
[0038] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the methods described in the first, second, or third aspects.
[0039] Fifthly, embodiments of this disclosure also provide a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the priority-based data processing method described above.
[0040] In the priority-based data processing method provided in this embodiment, the extended Berkeley Packet Filter (eBPF) program is obtained and loaded; priority configuration information is obtained, which is used to indicate the priority of service data; after receiving an input / output (IO) operation on any service data, the eBPF program is triggered, and the eBPF program determines the execution order of the corresponding IO operations based on the priority of the service data; the IO operations are executed according to the execution order.
[0041] Compared to existing technologies, the solution provided in this application utilizes an eBPF program to identify the priority of business data and sorts the execution order of IO operations corresponding to different business data based on the priority of the business data. In this way, IO operations of business data with higher priority will be executed first, while IO operations of business data with lower priority will be executed later. By simply setting critical data to high priority, critical data can be submitted to the storage medium first, thereby improving the timeliness and read / write performance of critical data. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0043] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0044] Figure 1 A flowchart of a priority-based data processing method provided in an embodiment of this disclosure;
[0045] Figure 2 A system architecture diagram of the priority-based data processing method provided in the embodiments of this disclosure;
[0046] Figure 3 A structural diagram of a priority-based data processing apparatus provided in an embodiment of this disclosure;
[0047] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0048] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0049] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0050] This disclosure provides a priority-based data processing method, which will be described below with reference to specific embodiments.
[0051] Figure 1 A flowchart of a priority-based data processing method provided in this disclosure embodiment is shown below. Figure 1 The priority-based data processing method shown below will be introduced. The specific steps of this method are as follows:
[0052] S101. Obtain the Extended Berkeley Packet Filter (eBPF) program and load the eBPF program.
[0053] In the related technologies, in the I / O implementation process of the Linux system, when an application needs to read or write data, it sends a read / write request to the kernel. This read / write request is transferred from user space to kernel space so that the kernel can interact with the hardware to perform read and write operations on the data.
[0054] However, the Linux kernel typically advocates a design philosophy of "providing mechanisms rather than policies," and does not differentiate the importance of received read and write requests at the business level. This will result in critical and non-critical business operations existing simultaneously and triggering read and write operations at the same time, with critical and non-critical data being interspersed in the kernel's I / O read and write queue. If the amount of non-critical data is large at a certain time, the critical data will not be processed in a timely manner, thereby increasing the read and write latency and throughput of critical data.
[0055] Based on this, this application proposes a priority-based data processing method to solve the above problems.
[0056] In this step, the first step is to obtain and load the eBPF (extended Berkeley Packet Filter) program. The eBPF program allows custom code to be dynamically inserted into the kernel space to monitor and modify kernel behavior.
[0057] eBPF programs are event-driven, meaning they do not run continuously but are triggered only when specific events occur. These events can be kernel-level events, such as the arrival of network packets, the execution of system calls, and process context switching, or user-level events, such as the call of a specific function or a change in the value of a variable. This event-driven approach allows eBPF programs to handle various events efficiently without consuming excessive system resources.
[0058] Specifically, first, developers need to write eBPF programs according to requirements. These eBPF programs are usually developed in C language. Then, with the help of a compiler, the eBPF programs can be compiled into BPF bytecode. Finally, the BPF bytecode is loaded into the kernel space through system calls.
[0059] In kernel space, loaded eBPF programs undergo rigorous verification to ensure their security, including checking for unreachable instructions and illegal kernel function calls. The kernel then attaches the verified eBPF program to a designated hook point. When the event corresponding to that hook point occurs, the eBPF program is triggered and executed.
[0060] In this application, the triggering event of the eBPF program can be determined according to the developer's settings. For example, it can be the update of input / output IO operation on any business data. That is, in subsequent steps, whenever an input / output IO operation on any business data is received, the eBPF program can be triggered.
[0061] In one implementation, loading an eBPF application includes:
[0062] Load the eBPF program into kernel space and associate the block device input / output (BIO) queues in kernel space with the eBPF program;
[0063] Upon receiving an input / output I / O operation for any service data, the eBPF procedure is triggered, including:
[0064] The eBPF program is triggered after the BIO queue receives an input / output I / O operation for any business data.
[0065] In other words, an eBPF program can be mounted to a BIO (Block I / O) queue in the kernel space. In subsequent steps, when the BIO queue is updated, the relevant hook point is triggered, and the eBPF program mounted on that hook point will be executed to implement the logic set in the eBPF program.
[0066] The BIO layer is a key component of the Linux kernel, responsible for handling input / output requests from block devices. It is part of the kernel space and can receive I / O requests from the upper layers and pass them to the lower device driver layer for processing.
[0067] S102. Obtain priority configuration information. Priority configuration information is used to indicate the priority of business data.
[0068] The priority configuration information can directly indicate the priority of each service data item. For example, if service data A has the first priority and service data B has the second priority, then service data A has a higher priority than service data B. Alternatively, the priority configuration information can also include information such as the access frequency, latency requirements, and required bandwidth for each service data item. Based on this information, the eBPF program can determine the priority of each service data item.
[0069] In one implementation, obtaining priority configuration information includes:
[0070] Obtain priority configuration information from user-space applications;
[0071] Priority configuration information is sent to the mapping file in kernel space;
[0072] Before determining the execution order of corresponding IO operations based on the priority of business data, the following steps are also included:
[0073] Access the mapping file to obtain the priority of business data.
[0074] In other words, priority configuration information can be obtained from applications in user space. When an application writes priority configuration information through the bpffs (BPF File System) interface, the eBPF subsystem in the kernel will capture the priority configuration information and store it in a mapping file as needed.
[0075] User space is the space where applications run, containing the application's code, data, and runtime stack. When an application needs to access a file or perform other I / O operations, it sends a request to kernel space through system call interfaces.
[0076] In one implementation, priority configuration information is distributed to a mapping file in kernel space, including:
[0077] Priority configuration information is sent to the kernel space through the target interface, which is provided by the Berkeley Packet Filter (BPF) file system.
[0078] In kernel space, priority configuration information is stored in the form of key-value pairs to obtain a mapping file.
[0079] bpffs is an instance of a pseudo-filesystem that provides a target interface for user-space applications. This interface retrieves priority configuration information from the user-space application and passes it to kernel space. The kernel can then store the priority configuration information as key-value pairs, creating a mapping file. Thus, when the BIO layer receives an I / O request for any business data, the eBPF program can access the mapping file to determine the priority of the business data.
[0080] The mapping file, also known as the eBPF map, is a key component of eBPF technology. It is used to store key-value pairs and enables the sharing of priority configuration information between eBPF programs, thereby facilitating efficient data exchange.
[0081] S103. Upon receiving an input / output IO operation for any service data, the eBPF program is triggered. The eBPF program determines the execution order of the corresponding IO operations based on the priority of the service data.
[0082] Specifically, I / O operations on any business data are typically initiated by user-space applications. First, these I / O operation requests are sent from user space to kernel space, and then forwarded by the kernel space's file system layer to the BIO layer. The file system layer is a crucial layer in kernel space, responsible for managing and manipulating files. When the file system layer receives an I / O operation request from user space, it converts these requests into I / O operation requests for block devices and passes them to the BIO layer for processing.
[0083] In one implementation, priority is used to indicate whether business data is critical or non-critical. The eBPF program determines the execution order of corresponding I / O operations based on the priority of the business data, including:
[0084] eBPF programs prioritize the execution order of I / O operations for critical data over those for non-critical data.
[0085] In other words, eBPF programs can be configured to identify critical data based on priority. When critical data is identified, I / O operations are reordered, placing I / O operations for non-critical data at the back of the execution queue and I / O operations for critical data at the front. The execution queue then becomes the sequential queue for subsequent I / O operations, thus prioritizing the submission of critical data to the storage medium and improving the read / write performance of critical data.
[0086] Specifically, each identified key data point can be placed at the beginning of the execution queue, or it can be placed at the end of the identified key data points. The specific settings can be configured according to requirements and are not limited.
[0087] In one implementation, after the BIO queue receives an input / output I / O operation for any business data, an eBPF program is triggered, including:
[0088] Through the block file system, I / O operations on any business data can be received from user-space applications.
[0089] Based on the page caching mechanism, IO operations are written to the BIO queue and the eBPF program is triggered.
[0090] In other words, when an application needs to perform I / O operations on business data, it can send the I / O operations to the kernel space through system calls. The block-based file system in the kernel space can be used to receive I / O operation requests from the application and convert the I / O operations into operations on the underlying block devices.
[0091] In this process, the page cache mechanism can cache business data that needs to be written to or read from the underlying block device. The page caching process can be asynchronous, meaning the application can continue performing other tasks without waiting for the I / O operations on the business data to complete. This mechanism avoids repeated accesses to the underlying block device, thereby significantly improving the read and write speed of business data.
[0092] Specifically, when an application writes business data, the data is first written to dirty pages in the Page Cache. Then, at an appropriate time, the dirty pages in the Page Cache are written back to the underlying block device. When an application needs to read business data from the underlying block device, if this business data has already been cached in the Page Cache, the kernel can read the business data directly from the Page Cache without accessing the underlying block device again.
[0093] In addition, in this application, the unbuffered I / O operations on any business data sent by the application can be directly written into the BIO queue through a special file system, without using caching mechanisms such as page caching, and the eBPF program can be directly triggered.
[0094] S104. Perform I / O operations in the order of execution.
[0095] In this step, IO operations corresponding to different business data are executed sequentially according to the determined execution order. Therefore, by simply setting the critical data as high priority, the critical data can be submitted to the storage medium first, thereby improving the timeliness and read / write performance of the critical data.
[0096] like Figure 2 The diagram shown is a system architecture diagram of a specific embodiment of this application, wherein the system includes the following hierarchical structure:
[0097] Programmable Storage: This is usually the lowest level of a storage system, providing basic storage functions to store and execute executable code to meet the needs of different application scenarios.
[0098] The eBPF Core is a subsystem in the Linux kernel space that provides the infrastructure required to run eBPF programs. It is responsible for loading, validating, and executing eBPF programs, ensuring that eBPF programs can run safely in kernel space.
[0099] Virtual File System (VFS): VFS is an abstraction layer in the operating system kernel space that provides a unified interface to access different types of file systems, including but not limited to pseudo file systems, block file systems, network file systems, and special file systems.
[0100] Pseudofile system: A pseudofile system is a special type of file system that does not directly correspond to data blocks on physical storage devices. Instead, it is dynamically created and managed in memory by the operating system kernel to provide access to system information.
[0101] Block file system: Allows direct manipulation of business data at the physical block level.
[0102] Network File System: A network file system allows users to access files on remote storage devices over a network.
[0103] Special File System: A special file system is a file system that provides special functions or access to special resources.
[0104] Block I / O Layer: The block I / O layer is a component in the operating system kernel space that is responsible for handling input / output operations related to block devices. It can receive I / O requests from the file system and translate them into requests to the underlying block devices.
[0105] I / O Scheduler: Used to manage I / O operations on underlying block devices. It can schedule I / O operations according to their priority to improve the overall performance of the system.
[0106] SCSI Layer (Small Computer System Interface Layer): A standard interface used to connect multiple computer devices, typically responsible for handling communication and data transfer related to SCSI storage devices.
[0107] Block device: This is the underlying hardware interface of a storage system, providing the ability to directly access storage media, such as hard drives, SSDs, and USB flash drives.
[0108] Specifically, the process includes the following steps:
[0109] Process 0: The programmable storage module attaches the eBPF program that implements the key data identification logic to the hook point of the BIO queue through the eBPF core;
[0110] Process 1: The application provides priority configuration information to the programmable storage module;
[0111] Process 2: The programmable storage module passes priority configuration information to the kernel space through the target interface provided by bpffs;
[0112] Process 3: In kernel space, the priority configuration information is stored in the form of key-value pairs to obtain a mapping file for use by eBPF programs;
[0113] Process 4: The application sends IO operations on any business data to the BIO layer through the block file system based on the page caching mechanism, including but not limited to read, write and synchronize operations on business data; after the BIO queue is updated, the eBPF program reads the priority configuration information in the mapping file and adjusts the priority of the execution order of IO operations; then, the execution order of IO operations can be fed back to the I / O scheduler.
[0114] As can be seen from the above, the technical solution provided in this application uses an eBPF program to identify the priority of business data and sorts the execution order of IO operations corresponding to different business data based on the priority of the business data. In this way, IO operations of business data with higher priority will be executed first, while IO operations of business data with lower priority will be executed later. By simply setting the key data to high priority, the key data can be submitted to the storage medium first, thereby improving the timeliness and read / write performance of the key data.
[0115] Figure 3 A schematic diagram of the structure of a priority-based data processing apparatus provided in this disclosure embodiment includes:
[0116] Loading module 201 is used to obtain the Extended Berkeley Packet Filter (eBPF) program and load the eBPF program;
[0117] The acquisition module 202 is used to acquire priority configuration information, which is used to indicate the priority of business data;
[0118] The determination module 203 is used to trigger the eBPF program after receiving an input / output IO operation on any of the service data, and the eBPF program determines the execution order of the corresponding IO operations based on the priority of the service data.
[0119] The execution module 204 is used to execute the IO operations according to the execution order.
[0120] As can be seen from the above, the technical solution provided in this application uses an eBPF program to identify the priority of business data and sorts the execution order of IO operations corresponding to different business data based on the priority of the business data. In this way, IO operations of business data with higher priority will be executed first, while IO operations of business data with lower priority will be executed later. By simply setting the key data to high priority, the key data can be submitted to the storage medium first, thereby improving the timeliness and read / write performance of the key data.
[0121] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. See below for details. Figure 4 It shows a schematic diagram of the structure suitable for implementing the electronic device 700 in the embodiments of this disclosure. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0122] like Figure 4 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703 to implement a priority-based data processing method as described in the embodiments of this disclosure. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing device 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0123] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 700 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0124] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts, thereby implementing the priority-based data processing method as described above. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.
[0125] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0126] Additionally, this disclosure also provides a vehicle, including: a memory; a processor; and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the priority-based data processing method described above.
[0127] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0128] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0129] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the aforementioned embodiments.
[0130] Optionally, when one or more of the above-described procedures are executed by the electronic device, the electronic device may also perform other steps described in the above embodiments.
[0131] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0132] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0133] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0134] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0135] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0136] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0137] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0138] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A priority-based data processing method, characterized by, The method comprises: obtaining an extended Berkeley packet filter eBPF program, and loading the eBPF program; obtaining priority configuration information, the priority configuration information being used to indicate the priority of service data; after receiving an input / output IO operation on any of the service data, triggering the eBPF program, the eBPF program determining the execution order of the corresponding IO operation based on the priority of the service data; performing the IO operation according to the execution order.
2. The method of claim 1, wherein, The loading of the eBPF program comprises: loading the eBPF program to a kernel space, and associating a block device input / output BIO queue in the kernel space with the eBPF program; after the BIO queue receives an input / output IO operation on any of the service data, triggering the eBPF program. The obtaining of the priority configuration information comprises:
3. The method of claim 2, wherein, obtaining priority configuration information from an application program in a user space; issuing the priority configuration information to a mapping file in the kernel space; before the eBPF program determines the execution order of the corresponding IO operation based on the priority of the service data, the eBPF program further accesses the mapping file to obtain the priority of the service data. The issuing of the priority configuration information to the mapping file in the kernel space comprises: issuing the priority configuration information to the kernel space through a target interface, the target interface being provided by a Berkeley packet filter BPF file system; 4. The method of claim 3, wherein, in the kernel space, storing the priority configuration information in the form of a key-value pair to obtain a mapping file. The triggering of the eBPF program after the BIO queue receives an input / output IO operation on any of the service data comprises: receiving an IO operation on any of the service data from an application program in a user space through a block file system; 5. The method of claim 2, wherein, based on a page cache mechanism, writing the IO operation to the BIO queue and triggering the eBPF program. The priority is used to indicate that the service data is critical data or non-critical data, and the eBPF program determines the execution order of the corresponding IO operation based on the priority of the service data, which comprises: The eBPF program arranges the execution order of the IO operation corresponding to the critical data before the execution order of the IO operation corresponding to the non-critical data.
6. The method of claim 1, wherein, The method comprises: a loading module, configured to obtain an extended Berkeley packet filter eBPF program, and load the eBPF program; 7. A priority-based data processing apparatus, characterized by comprising: an obtaining module, configured to obtain priority configuration information, the priority configuration information being used to indicate the priority of service data; a determining module, configured to, after receiving an input / output IO operation on any of the service data, trigger the eBPF program, the eBPF program determining the execution order of the corresponding IO operation based on the priority of the service data; an execution module, configured to perform the IO operation according to the execution order. The method comprises: 8. An electronic device, comprising: memory; a processor; and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the method of any one of claims 1-6.
10. A computer program product, characterised in that, The computer program product comprises a computer program or instructions, which, when executed by the processor, implement the method of any one of claims 1-6.
