Data processing method and system based on Linux kernel I / O filtering framework
By adding block device filtering method fields for each partition in the Linux kernel, filtering control of block device I/O requests is achieved, which solves the compatibility and complexity of block device I/O request processing in cloud computing, and improves the universality and security of the system.
Patent Information
- Application Number
- CN202411676779.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art has compatibility and complexity problems when processing block device I/O requests in cloud computing, especially in multi-device and multi-user scenarios, and it is difficult to achieve efficient I/O performance and security.
By adding block device filtering method fields for each partition in the Linux kernel, filtering control of block device I/O requests is realized. The general I/O filtering framework is adopted, which is suitable for any block device, simplifying system configuration and user operations.
IO filtering control for each partition is realized, the problems of incompatibility or conflict between block devices are solved, the universality and portability of the system are improved, resource utilization efficiency is optimized, and data security and integrity are enhanced.
Smart Images

Figure CN119806388A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of block device data processing under Linux operating system, and in particular to a data processing method and system based on Linux kernel I / O filtering framework. Background Art
[0002] Cloud computing is a service model that uses the Internet to provide computing resources. Users can flexibly use and expand resources according to their needs without having to worry about the underlying hardware and software configuration. The advantages of cloud computing are reflected in reducing costs, improving efficiency, enhancing flexibility and scalability. However, cloud computing also faces some challenges. For example, the I / O requests of cloud computing are highly dynamic, heterogeneous and distributed. The user's data is stored on remote cloud servers. Users cannot fully control their own data and must rely on the trust of cloud service providers and other relevant parties. This puts severe demands on the IO performance and security of cloud computing.
[0003] Block device I / O filtering is a technology that improves the I / O performance and security of cloud computing. It achieves the following goals by filtering, converting and optimizing each I / O request of the user: First, pre-process local I / O requests, filter out redundant or invalid requests, reduce the amount and frequency of data transmitted over the network, and reduce I / O overhead; second, adapt I / O requests according to the characteristics of storage devices, adopt appropriate storage strategies, and improve the utilization of storage space and data security; third, schedule IO requests according to the user's I / O needs, and implement different types and levels of service guarantees, such as load balancing, service stratification, service differentiation, etc., to improve user experience and satisfaction.
[0004] Filtering, converting and optimizing each I / O request is not a new concept. In Linux 2.6, requests can be processed by replacing the make_request_fn() function in the request_queue structure. The Device-Mapper (DM) in the current kernel tree adopts this solution, but this solution has some disadvantages, such as the need for additional configuration and management tools, which increases the complexity of the system; block devices need to be specified in a specific format, which may be incompatible or conflicting with other device drivers, and have poor portability. Summary of the invention
[0005] In view of this, the present invention provides a data processing method and system based on the Linux kernel I / O filtering framework, which can realize IO filtering control for each partition and solve the problem of incompatibility or conflict between block devices.
[0006] In a first aspect, the present invention provides a data processing method based on a Linux kernel I / O filtering framework, the method comprising:
[0007] Adding a block device filtering method field to the data structure of each partition in the Linux kernel, wherein the block device filtering method field represents a filtering method for the block device;
[0008] Based on the state of the block device filtering method field, the block device I / O request sent by the user is processed.
[0009] The data processing method based on the Linux kernel I / O filtering framework provided by the embodiment of the present invention, by setting a universal I / O filtering framework, is not restricted by hardware types and attributes, data formats and file system types, can be applied to any block device, has strong versatility, overcomes the lack of portability of the DM solution, does not require additional configuration of the system and tool installation, has low system overhead, and simplifies the user operation process.
[0010] In an optional implementation, adding a block device filtering method field to the data structure of each partition in the Linux kernel includes:
[0011] Added block device filter method field to each partition instance of Linux kernel;
[0012] The block device filtering method field is initialized to be empty, indicating that the filtering method of the block device is not used.
[0013] In an optional implementation, based on the state of the block device filtering method field, processing the block device I / O request sent by the user includes:
[0014] Based on the block device I / O request sent by the user, query the state of the block device filter method field in the corresponding partition;
[0015] Determine whether the state of the block device filter method field is empty;
[0016] If the state of the block device filter method field is empty, the corresponding data is sent to the device;
[0017] If the state of the block device filtering method field is not empty, the data of the block device I / O request is filtered based on the filtering method set in the block device filtering method field.
[0018] The embodiment of the present invention determines whether to filter based on the state of the filtering method field, and can allocate system resources more reasonably. For data that needs to be filtered, the system can allocate sufficient resources to perform fine filtering operations to ensure security and data integrity; for data that does not need to be filtered, resources can be used for fast data transmission and processing, thereby optimizing the resource utilization efficiency of the entire system.
[0019] In an optional implementation, querying the state of the block device filter method field in the corresponding partition based on the block device I / O request sent by the user includes:
[0020] Get the block device I / O request sent by the user;
[0021] The block device I / O request is encapsulated into bio after passing through the virtual file layer and the mapping layer;
[0022] Find the partition where the current bio data is saved according to the gendisk field in bio, and query the status of the block device filtering method field.
[0023] The embodiment of the present invention can achieve very accurate positioning by searching for the partition where the current bio data is stored according to the gendisk field in the bio. In a complex storage system environment, there may be multiple partitions, and different partitions have different uses and data storage conditions. The search method based on the gendisk field can ensure that the partition to which the data belongs is accurately determined, avoiding confusion and errors in the data processing process. This standardized processing flow can improve the efficiency of the entire system in processing block device I / O requests, reduce processing delays or errors caused by problems such as inconsistent request formats, and enable the system to process a large number of I / O requests in an orderly manner under the condition of multi-user and multi-task concurrency.
[0024] In an optional implementation, filtering the data of the block device I / O request based on the filtering method set in the block device filtering method field includes:
[0025] Determine whether the data requested by bio meets the filtering conditions in the set filtering method;
[0026] If yes, the filtered data is sent down;
[0027] If not, an error message is returned.
[0028] The embodiment of the present invention can accurately control data access by judging whether the data requested by the bio meets the filtering conditions, ensuring that only data that meets the filtering conditions can be sent, which is helpful to maintain the integrity of the data. The filtering conditions can be used as a means of data quality control. Data that does not meet the conditions will not be sent to the device, thereby ensuring that the data in the storage device are all high-quality data that have been screened and verified.
[0029] In an optional implementation, the state of the block device filtering method field is dynamically adjusted according to a user instruction to determine whether it is enabled, and a corresponding filtering method is set.
[0030] The embodiments of the present invention allow various filtering conditions to be set according to specific business requirements, management strategies and different application scenarios, thereby achieving flexible access control, and the dynamic adjustment mechanism makes the system easier to manage and maintain.
[0031] In a second aspect, the present invention provides a data processing system based on a Linux kernel I / O filtering framework, comprising:
[0032] A filtering method field setting module, used to add a block device filtering method field to the data structure of each partition in the Linux kernel, wherein the block device filtering method field represents a filtering method of the block device;
[0033] The block device I / O request processing module is used to process the block device I / O request sent by the user based on the state of the block device filtering method field.
[0034] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the data processing method based on the Linux kernel I / O filtering framework of the above-mentioned first aspect or any corresponding embodiment thereof.
[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data processing method based on the Linux kernel I / O filtering framework of the above-mentioned first aspect or any corresponding embodiment thereof.
[0036] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the data processing method based on the Linux kernel I / O filtering framework of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A schematic diagram of a flow chart of a data processing method based on a Linux kernel I / O filtering framework according to an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of a flow chart of another data processing method based on the Linux kernel I / O filtering framework according to an embodiment of the present invention;
[0040] Figure 3 A structural block diagram of a data processing system based on a Linux kernel I / O filtering framework according to an embodiment of the present invention;
[0041] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0043] In order to solve the problem of I / O filtering in the Linux kernel, the traditional method is to use the DM module, but this method has many disadvantages, such as the need to specially format the block device LVM and install additional tools to configure the DM module. These operations have an adverse effect on system performance, user experience and portability. DM (Device-Mapper) is a module in the Linux kernel that maps one or more underlying block devices to an advanced virtual block device. It provides a general framework for implementing a variety of storage device management functions, such as logical volume management (LVM), disk encryption, soft RAID, etc.
[0044] According to an embodiment of the present invention, an embodiment of a data processing method based on a Linux kernel I / O filtering framework is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] In this embodiment, a data processing method based on the Linux kernel I / O filtering framework is provided, which can be applied in cloud computing scenarios to improve the performance and security of user IO. Figure 1 is a flow chart of a data processing method based on a Linux kernel I / O filtering framework according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0046] S101, adding a block device filtering method field to the data structure of each partition in the Linux kernel, where the block device filtering method field represents a filtering method for the block device.
[0047] Specifically, each partition data structure hd_struct of the Linux kernel is modified, and a block device filter method field block_filter_ops is added and initialized to NULL, which means that the IO filter method is not in use. In actual applications, the state of the block device filter method field can be dynamically adjusted according to user instructions to determine whether it is enabled without affecting the original IO function, and the IO filter function can be dynamically turned on or off.
[0048] It should be noted that in the Linux kernel, each partition has a corresponding hd_struct instance, which is used to describe the location information of the partition in the device, such as the starting sector number, the number of sectors, the alignment offset, etc.
[0049] The embodiment of the present invention initializes the I / O filter framework including the block device filter method field block, mainly adds an interface to each partition to display the current block filter method, and implements the control of the block device filter framework, such as initialization, registration, enabling, uninstallation and other controls, simplifies user operations, and is responsible for managing the registry of the I / O filter module, recording the I / O filter method used by each partition. Specifically, a variety of filter conditions can be set according to actual business needs, management strategies and different application scenarios to achieve flexible access control, such as content-based filtering, rule-based conversion, key-based encryption and algorithm-based compression.
[0050] The embodiment of the present invention can achieve refined access control for different partitions by adding a block device filtering method field in the data structure of each partition. The block device filtering method field is initialized to empty, indicating that the filtering method is not used, so that the system will not perform unnecessary filtering operations by default. For most normal partition accesses, such as users' daily read and write operations on ordinary data partitions, they can be performed efficiently as usual, and performance will not be degraded due to additional filtering processes. The filtering method is only enabled when access control is required for a specific partition, thereby optimizing the allocation and utilization of system resources and avoiding resource waste caused by excessive filtering.
[0051] S102: Processing a block device I / O request sent by a user based on the state of the block device filtering method field.
[0052] In actual applications, when user applications (such as database management systems, file systems, etc.) need to read or write data on block devices such as disks, they send block device I / O requests to the operating system kernel. These requests contain information such as the type of operation (read or write), the location of the data on the block device (usually the logical block address), and the length of the data. If the state of the block device filter method field is not empty, the filter method set in the field usually checks the state of certain specific fields in the request to decide how to handle the request. These fields may include the requested operation type (read or write), source or target address (such as process ID, user ID, etc., the entity information that initiates the request), the requested data block range, etc. By setting different filtering rules, fine control of I / O requests can be achieved; if the state of the block device filter method field is empty, the data is directly sent according to the request.
[0053] The data processing method based on the Linux kernel I / O filtering framework provided by the embodiment of the present invention, by setting a universal I / O filtering framework, is not restricted by hardware type and attributes, data format and file system type, can be applied to any block device, has strong versatility, overcomes the lack of portability of the DM solution, does not require additional configuration and tool installation of the system, has low system overhead, and simplifies the user operation process.
[0054] In this embodiment, a data processing method based on the Linux kernel I / O filtering framework is provided. Figure 2 As shown, the following steps are included:
[0055] S201, adding a block device filtering method field to the data structure of each partition in the Linux kernel, where the block device filtering method field represents a filtering method for the block device.
[0056] The embodiment of the present invention can achieve refined access control for different partitions by adding a block device filtering method field in the data structure of each partition. The block device filtering method field is initialized to empty, indicating that the filtering method is not used, so that the system will not perform unnecessary filtering operations by default. For most normal partition access, it can be carried out efficiently as usual, and there will be no performance degradation due to additional filtering processes. The filtering method is only enabled when access control is required for a specific partition, thereby optimizing the allocation and utilization of system resources and avoiding resource waste caused by excessive filtering.
[0057] S202, based on the state of the block device filtering method field, processing the block device I / O request sent by the user. Specifically, the following steps are included:
[0058] S2021, obtaining a block device I / O request sent by a user;
[0059] S2022, encapsulate the block device I / O request into bio after passing through the virtual file layer and the mapping layer (it should be noted that bio is a data structure in the Linux kernel, which is used to represent the organization of data in the memory and the IO completion status, and also contains a lot of basic information, such as whether it is reading or writing or some special operation commands, etc.);
[0060] S2023, find the partition where the current bio data is stored according to the gendisk field in the bio, and query the status of the block device filtering method field;
[0061] S2024, determining whether the state of the block device filtering method field is empty;
[0062] S2025A, if the state of the block device filtering method field is empty, the corresponding data is sent down;
[0063] S2025B, if the status of the block device filtering method field is not empty, the data of the block device I / O request is filtered based on the filtering method set in the block device filtering method field; the specific implementation process is: determine whether the data requested by bio meets the filtering conditions in the set filtering method; if yes, send the filtered data; if not, return an error prompt.
[0064] The method provided by the embodiment of the present invention can achieve detailed differentiation and control of different types of I / O requests by querying the status of the block device filtering method field and performing subsequent processing based on it. For example, for requests involving partitions where critical system data is located, unauthorized or non-compliant access can be strictly restricted according to pre-set filtering conditions, thereby effectively protecting important data from misoperation, malicious tampering or illegal acquisition. In the face of potential security threats, such as malware attempting to write a large amount of critical areas of the disk or illegally read sensitive data, this processing flow can respond quickly based on the status of the filtering method field and the filtering conditions. When it is detected that an abnormal request does not meet the filtering conditions, an error prompt is returned in a timely manner to prevent further implementation of malicious behavior, reduce the risk of the system being attacked, and maintain the security and stability of the entire system environment.
[0065] If the state of the block device filtering method field is empty, it means that no additional filtering operations are required and the corresponding data can be directly sent to the device. This avoids unnecessary complex filtering of data, reduces processing time and system resource consumption, and improves data transmission efficiency. For example, when ordinary users perform routine read and write operations on non-sensitive data partitions, data can be sent quickly, improving user experience.
[0066] The entire processing flow provided by the embodiment of the present invention forms an orderly and efficient mechanism from obtaining I / O requests to judging and processing according to different situations. The block device I / O request is first encapsulated into BIO through the virtual file layer and the mapping layer. This process makes the format of the request more standardized and unified, which is convenient for subsequent processing at the system kernel level. The virtual file layer and the mapping layer play a good transition and integration role in it, converting I / O requests from different applications and in different forms into BIO forms that the kernel can better understand and process, accurately finding the corresponding partition and querying the filtering status based on the gendisk field in BIO, making the data processing path clear and unambiguous, which helps the system to process a large number of block device I / O requests in an orderly manner in a complex environment with multiple users and multiple tasks concurrently, reasonably allocate system resources, avoid performance bottlenecks caused by processing confusion, and ensure the optimization of the overall performance of the system.
[0067] Since the existing processing flow is based on clear steps and queryable filter method field status, this processing mechanism based on partition query filter method field status is easier to adjust and adapt during system upgrades or expansions. New storage devices, partition structure changes, or filter method updates can all be implemented within the existing processing framework by modifying and adjusting the block device filter method field of the corresponding partition. This allows the system to adapt to various changes more smoothly, reduces the difficulty of system upgrades and expansions, and ensures the continuous and stable operation of the system.
[0068] The method provided by the embodiment of the present invention provides a registration mechanism for an IO filter module, so that users can select different IO filter methods according to their needs, and can achieve unified management and access to block devices of different types and specifications, thereby improving data portability and reducing the complexity of data processing such as storage filtering, conversion and encryption. There is no need for additional configuration of the system and installation of tools, the system overhead is small, and the user operation process is simplified.
[0069] In the present embodiment, a data processing system based on the Linux kernel I / O filtering framework is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0070] This embodiment provides a data processing system based on the Linux kernel I / O filtering framework. Figure 3 As shown, including:
[0071] A filtering method field setting module 301 adds a block device filtering method field to the data structure of each partition in the Linux kernel, wherein the block device filtering method field represents a filtering method of the block device;
[0072] The block device I / O request processing module 302 processes the block device I / O request sent by the user based on the state of the block device filtering method field.
[0073] In some optional implementations, the filtering method field setting module 301 adds a block device filtering method field to the data structure of each partition in the Linux kernel, including:
[0074] A method field setting unit, used to add a block device filtering method field to each partition instance of the Linux kernel;
[0075] The initialization unit is used to initialize the block device filtering method field to be empty, indicating that the filtering method of the block device is not used.
[0076] In some optional implementations, the block device I / O request processing module 302 includes:
[0077] A method field query unit, used to query the state of the block device filter method field in the corresponding partition based on the block device I / O request sent by the user;
[0078] A method field determination unit, used to determine whether the state of the block device filtering method field is empty;
[0079] The data processing unit is used to send the corresponding data to the device if the state of the block device filtering method field is empty; if the state of the block device filtering method field is not empty, filter the data of the block device I / O request based on the filtering method set in the block device filtering method field.
[0080] In some optional implementations, the method field query unit includes:
[0081] The request response subunit is used to obtain the block device I / O request sent by the user;
[0082] The bio encapsulation subunit is used to encapsulate the block device I / O request into bio after passing through the virtual file layer and mapping layer;
[0083] The query subunit is used to find the partition where the current bio data is saved according to the gendisk field in the bio, and to query the status of the block device filter method field.
[0084] In some optional implementations, the data processing unit includes:
[0085] The filtering condition judgment subunit is used to judge whether the data requested by the bio meets the filtering conditions in the set filtering method;
[0086] The data processing subunit is used to send the filtered data if yes; if not, return an error prompt.
[0087] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0088] The embodiment of the present invention also provides a computer device having the above Figure 3 The data processing system based on the Linux kernel I / O filtering framework is shown.
[0089] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0090] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0091] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0092] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0093] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory. The computer device also includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0094] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor central control system or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0095] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0096] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data processing method based on the Linux kernel I / O filtering framework, characterized in that: include: Adding a block device filtering method field to the data structure of each partition in the Linux kernel, wherein the block device filtering method field represents a filtering method for the block device; Based on the state of the block device filtering method field, the block device I / O request sent by the user is processed.
2. The method according to claim 1, characterized in that: The step of adding a block device filtering method field to the data structure of each partition in the Linux kernel includes: Added block device filter method field to each partition instance of Linux kernel; The block device filtering method field is initialized to be empty, indicating that the filtering method of the block device is not used.
3. The method according to claim 2, characterized in that Based on the state of the block device filtering method field, the block device I / O request sent by the user is processed, including: Based on the block device I / O request sent by the user, query the state of the block device filter method field in the corresponding partition; Determine whether the state of the block device filter method field is empty; If the state of the block device filter method field is empty, the corresponding data is sent to the device; If the state of the block device filtering method field is not empty, the data of the block device I / O request is filtered based on the filtering method set in the block device filtering method field.
4. The method according to claim 3, characterized in that Based on the block device I / O request sent by the user, query the state of the block device filter method field in the corresponding partition, including: Get the block device I / O request sent by the user; The block device I / O request is encapsulated into bio after passing through the virtual file layer and the mapping layer; Find the partition where the current bio data is saved according to the gendisk field in bio, and query the status of the block device filtering method field.
5. The method according to claim 4, characterized in that The filtering of the data of the block device I / O request based on the filtering method set in the block device filtering method field includes: Determine whether the data requested by bio meets the filtering conditions in the set filtering method; If yes, the filtered data is sent down; If not, an error message is returned.
6. The method according to any one of claims 1 to 5, characterized in that: The state of the block device filtering method field is dynamically adjusted according to the user's instructions to determine whether it is enabled, and the corresponding filtering method is set.
7. A data processing system based on the Linux kernel I / O filtering framework, characterized in that: include: A filtering method field setting module, used to add a block device filtering method field to the data structure of each partition in the Linux kernel, wherein the block device filtering method field represents a filtering method of the block device; The block device I / O request processing module is used to process the block device I / O request sent by the user based on the state of the block device filtering method field.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data processing method based on the Linux kernel I / O filtering framework according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data processing method based on the Linux kernel I / O filtering framework according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the data processing method based on the Linux kernel I / O filtering framework according to any one of claims 1 to 6.
Citation Information
Patent Citations
Systems and methods for multi-level intercept processing in a virtual machine environment
CA2535184A1
Continuous data protection method and system for disk apparatus
CN101464820A
Data packet filtering method and device, gateway equipment and storage medium
CN108881328A
Backup set file recovery method and device and computer equipment
CN115686932A
Modifiable volume snapshots
US10303556B1