Data Processing Method, Apparatus, Device, and Storage Medium

By comparing the data modification time information of the kernel module and file server in the user-state process, the data inconsistency problem in the user-state file system is solved, real-time synchronization and effectiveness of data are achieved, and system performance is improved.

CN116954948BActive Publication Date: 2025-07-11BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310953296.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-07-11
Estimated Expiration
2043-07-31

AI Technical Summary

Technical Problem

In the prior art, data in the kernel module in the user-state file system is prone to inconsistency with data in the file server, resulting in poor data validity and improper synchronization period duration setting will affect system performance.

Method used

The user-state process obtains the data modification time information of the kernel module and the file server for comparison. If it is inconsistent, the verification invalid result will be returned and invalidated processing will be performed to synchronize the data of the file server to the kernel module.

Benefits of technology

Ensure that the data in the kernel module is consistent with the data in the file server, improve the effectiveness of the data and the real-time system, and improve the operation efficiency of the user-state file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116954948B_ABST
    Figure CN116954948B_ABST
Patent Text Reader

Abstract

An embodiment of the present disclosure provides a data processing method, apparatus, device, and storage medium. The method includes: in response to a data call request sent by a kernel module to a user-mode process, obtaining, through the user-mode process, first modification time information and second modification time information of data corresponding to the data call request, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server; comparing, through the user-mode process, the first modification time information and the second modification time information, and if the first modification time information and the second modification time information are inconsistent, returning a verification invalid result to the kernel module; and the kernel module, according to the verification invalid result, invalidating the data in the kernel module and synchronizing the data in the file server to the kernel module through the user-mode process. It can verify the consistency of data in real time and improve the validity of data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the technical field of user-space file systems, and in particular, to a data processing method, apparatus, device, and storage medium. Background Art

[0002] Currently, FUSE (Filesystem in Userspace) is widely used due to its low latency, high performance, and strong compatibility. Among them, the user-space file system can obtain data from the file server or from the kernel module, which requires ensuring that the data in the kernel module is consistent with the data in the file server.

[0003] In the prior art, data can be synchronized periodically. The specific steps are as follows: First, set a synchronization period duration. If the current time is greater than the set synchronization period duration since the last synchronization time, then synchronize the data.

[0004] However, the inventors found that the prior art has at least the following technical problems: If the synchronization period duration is set short, frequent data synchronization will affect the system performance. If the synchronization period duration is set long, it is possible that due to untimely data synchronization, the data in the kernel module is inconsistent with the data in the file server, so the validity of the data in the kernel module is poor. Summary of the Invention

[0005] Embodiments of the present disclosure provide a data processing method, apparatus, device, and storage medium, which can synchronize data in real time and improve the validity of the data in the kernel module.

[0006] In a first aspect, embodiments of the present disclosure provide a data processing method applied to a user-space file system. The user-space file system includes a kernel module and a user-space process, where the kernel module is used to forward a data request from an application end to the user-space process, and the user-space process is used to process the data request. The method includes:

[0007] In response to the kernel module sending a data call request to the user-space process, obtain first modification time information and second modification time information of the data corresponding to the data call request through the user-space process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server;

[0008] Compare the first modification time information and the second modification time information through the user-space process. If the first modification time information and the second modification time information are inconsistent, return a verification invalid result to the kernel module;

[0009] Based on the verification invalid result, the kernel module invalidates the data within the kernel module, and the user-space process synchronizes the data in the file server to the kernel module.

[0010] In a second aspect, an embodiment of the present disclosure provides a data processing apparatus applied to a user-space file system. The user-space file system includes a kernel module and a user-space process. The kernel module is configured to forward a data request from an application side to the user-space process, and the user-space process is configured to process the data request. The apparatus includes:

[0011] An acquisition module, configured to, in response to a data call request sent by the kernel module to the user-space process, obtain first modification time information and second modification time information of data corresponding to the data call request through the user-space process. The first modification time information is used to represent the modification time information of the data within the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server.

[0012] A verification module, configured to compare the first modification time information and the second modification time information through the user-space process. If the first modification time information and the second modification time information are inconsistent, a verification invalid result is returned to the kernel module.

[0013] A processing module, configured to, based on the verification invalid result, the kernel module invalidates the data within the kernel module, and the user-space process synchronizes the data in the file server to the kernel module.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0015] A processor, and a memory communicatively connected to the processor;

[0016] The memory stores computer-executable instructions;

[0017] The processor executes the computer-executable instructions stored in the memory to implement the data processing method as described in the first aspect above.

[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, and when the processor executes the computer-executable instructions, the data processing method as described in the first aspect above is implemented.

[0019] Fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which when executed by a processor implements the data processing method described in the first aspect above.

[0020] The data processing method, apparatus, device, and storage medium provided in this embodiment, the method includes: in response to a data call request sent by a kernel module to a user-mode process, obtaining first modification time information and second modification time information of the data corresponding to the data call request through the user-mode process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server; comparing the first modification time information and the second modification time information through the user-mode process, and if the first modification time information and the second modification time information are inconsistent, returning a verification invalid result to the kernel module; invalidating the data in the kernel module by the kernel module according to the verification invalid result, and synchronizing the data in the file server to the kernel module through the user-mode process. In the embodiment of the present application, since the validity of the data in the kernel module is verified when a data call request is received, it can be ensured that the data in the kernel module is consistent with the data in the file server, and moreover, the data call request is real-time, that is, the consistency of the data can be verified in real time, so that the data in the kernel module can be kept consistent with the data in the file server in real time, thereby improving the validity of the data in the kernel module. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0022] Figure 1 A schematic diagram of an application scenario of a data processing method provided by an embodiment of the present disclosure;

[0023] Figure 2 A flowchart of a data processing method provided by an embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram of a data processing method provided by an embodiment of the present disclosure;

[0025] Figure 4 A flowchart of another data processing method provided by an embodiment of the present disclosure;

[0026] Figure 5Schematic diagram of another data processing method provided by an embodiment of the present disclosure;

[0027] Figure 6 Block diagram of the structure of a data processing device provided by an embodiment of the present disclosure;

[0028] Figure 7 Schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0030] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for the user to select authorization or rejection.

[0031] Currently, FUSE (Filesystem in Userspace) is widely used due to its low latency, high performance, and strong compatibility. Among them, the userspace file system can obtain data from the file server or from the kernel module, which requires ensuring the consistency of the data in the kernel module and the data in the file server.

[0032] In the prior art, data can be synchronized periodically. The specific steps are as follows: First, set a synchronization period duration. If the current time is greater than the set synchronization period duration since the last synchronization time, then synchronize the data. However, if the synchronization period duration is set short and data is synchronized frequently, it will affect the system performance. If the synchronization period duration is set long, it is possible that due to untimely data synchronization, the data in the kernel module is inconsistent with the data in the file server, so the validity of the data in the kernel module is poor.

[0033] Therefore, it can be seen that how to keep the data in the kernel module consistent with the data in the file server to improve the validity of the data in the kernel module is an urgent problem to be solved currently.

[0034] To solve the above problems, the present embodiment provides the following technical concept: First, in response to a data call request sent by the kernel module to the user-space process, the user-space process obtains the first modification time information and the second modification time information of the data corresponding to the data call request, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server; Then, the user-space process compares the first modification time information and the second modification time information. If the first modification time information and the second modification time information are inconsistent, a verification invalid result is returned to the kernel module; Finally, the kernel module invalidates the data in the kernel module according to the verification invalid result. Since the validity of the data in the kernel module is verified when the data call request is received, it is possible to ensure that the data in the kernel module is consistent with the data in the file server. Moreover, the data call request is real-time, that is, the consistency of the data can be verified in real time, so that invalid data in the user-space file system can be deleted in time, thereby improving the operating efficiency of the user-space file system.

[0035] The application scenario of the present disclosure embodiment is explained below:

[0036] The data processing method provided by the present disclosure embodiment can be applied to the scenario of data consistency processing. Figure 1 The following is a schematic diagram of the application scenario of a data processing method provided by the present disclosure embodiment. As Figure 1 shown, the data processing method can be applied to the user-space file system. The user-space file system includes a kernel module and a user-space process (which can be represented as FUSE Daemon). The kernel module is used to forward the data request of the application end to the user-space process, and the user-space process is used to process the data request. Among them, the user-space process can obtain data from the file server or from the kernel module. This method can synchronize the data in the kernel module and the data in the file server, so that it can be ensured that the data obtained by the user-space process from the kernel module and the data obtained from the file server are consistent. The data processing method provided by the present disclosure embodiment is described in detail below with a detailed embodiment.

[0037] Figure 2 The following is a flowchart of a data processing method provided by the present disclosure embodiment. This method can also be applied to the user-space file system. The user-space file system includes a kernel module and a user-space process. The kernel module is used to forward the data request of the application end to the user-space process, and the user-space process is used to process the data request. As Figure 2 shown, the method includes:

[0038] S201. In response to a data call request sent by a kernel module to a user-space process, obtain first modification time information and second modification time information of the data corresponding to the data call request through the user-space process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server.

[0039] In an embodiment of the present disclosure, when receiving an open call instruction from a client, the kernel module sends a data call request to the user-space process. Exemplarily, as Figure 3 shown, the client sends an open system call instruction to the kernel module, and the kernel module sends a data call request to the user-space process. Among them, the data call request may be a FUSE_OPEN protocol request.

[0040] Optionally, the first modification time information is in the first metadata information in the kernel module, and the second modification time information is in the second metadata information in the file server; correspondingly, this step includes: in response to the kernel module sending a data call request to the user-space process, obtaining the first modification time information of the data corresponding to the data call request from the first metadata information stored locally by the user-space process, and obtaining the second modification time information of the data corresponding to the data call request from the second metadata information stored by the file server through the user-space process. Optionally, the first modification time information may be represented by mtime1; the second modification time information may be represented by mtime2.

[0041] In some embodiments, the user-space process may obtain the second modification time information by sending a metadata information request to the file server. Correspondingly, as Figure 3 shown, obtaining the second modification time information of the data corresponding to the data call request from the second metadata information stored by the file server through the user-space process includes: sending a metadata information request of the data to the file server through the user-space process, so that the file server returns the second metadata information of the data corresponding to the data call request to the user-space process according to the metadata information request; the user-space process obtains the second modification time information of the data corresponding to the data call request from the second metadata information.

[0042] S202. Compare the first modification time information and the second modification time information through the user-space process. If the first modification time information and the second modification time information are inconsistent, return a verification invalid result to the kernel module.

[0043] In an embodiment of the present disclosure, if the first modification time information and the second modification time information are consistent, return a verification valid result to the kernel module.

[0044] S203. According to the verification invalid result, the kernel module invalidates the data in the kernel module, and the user-mode process synchronizes the data in the file server to the kernel module.

[0045] In some embodiments, this step is: according to the verification invalid result, the kernel module invalidates the data in the kernel module, the user-mode process obtains data from the file server, and the user-mode process synchronizes the data in the file server to the kernel module.

[0046] In the embodiments of the present disclosure, there are various ways to invalidate the data in the kernel module. In some embodiments, according to the verification invalid result, the kernel module invalidates the data in the kernel module, including: according to the verification invalid result, the kernel module determines the invalid data in the kernel module and deletes the invalid data in the kernel module.

[0047] It should be noted that if the user-mode process returns a verification valid result to the kernel module, in this case, according to the verification valid result, the kernel module determines that the data in the kernel module is valid, and the user-mode process calls the data from the kernel module.

[0048] In the data processing method provided in this embodiment, since the validity of the data in the kernel module is verified when a data call request is received, it can ensure that the data in the kernel module is consistent with the data in the file server. Moreover, the data call request is real-time, that is, the consistency of the data can be verified in real time, so that the data in the kernel module can be kept consistent with the data in the file server in real time, thereby improving the validity of the data in the kernel module.

[0049] Figure 4 It is a flowchart of another data processing method provided in the embodiments of the present disclosure. On the basis of Figure 2 the embodiment, the present application also synchronizes the data when the data is closed. As Figure 4 shown, the method includes:

[0050] S401. In response to the kernel module sending a data close request to the user-mode process, the user-mode process caches the dirty data in the kernel module to obtain cached data.

[0051] In the embodiments of the present disclosure, when the kernel module receives a close call instruction from the client, it sends a data close request to the user-mode process. Exemplarily, such as Figure 5As shown, the shutdown call instruction sent by the client to the kernel module can be a system shutdown call. The data shutdown request sent by the kernel module to the user-mode process can be a FUSE_WRITE request. The user-mode process caches the dirty data in the kernel module according to the FUSE_WRITE request. In some embodiments, the dirty data is the new data after modifying the data corresponding to the data call request.

[0052] It should be noted that after the caching of the dirty data in the kernel module is completed, the kernel module can send a cache end request to the user-mode process to stop caching. The corresponding specific steps are as follows: In response to the kernel module sending a cache end request to the user-mode process, the user-mode process determines that the dirty data in the kernel module has been written back and ends the caching.

[0053] Exemplarily, as Figure 5 shown, the cache end request can be a FUSE_FLUSH request.

[0054] S402. Write the cached data back to the file server through the user-mode process.

[0055] It should be noted that after writing the cached data back to the file server, the modification time information in the metadata information of the written data can also be updated. Accordingly, it further includes:

[0056] S403. After writing the cached data back to the file server, update the modification time information of the cached data in the file server.

[0057] In the embodiments of the present disclosure, when the kernel module sends a data shutdown request to the user-mode process, the user-mode process caches the dirty data in the kernel module and writes it back to the file server, thereby ensuring that the data in the kernel module is consistent with the data in the file server. Moreover, the data shutdown request has real-time performance, that is, it can verify the consistency of the data in real time, thereby improving the validity of the data in the file server.

[0058] Figure 6 The block diagram of a data processing device provided by the embodiments of the present disclosure is applied to a user-mode file system. The user-mode file system includes a kernel module and a user-mode process, where the kernel module is used to forward the data request of the application end to the user-mode process, and the user-mode process is used to process the data request. Refer to Figure 6 As shown, the data processing device includes: an acquisition module 601, a verification module 602, and a processing module 603.

[0059] An acquisition module 601, configured to, in response to a data call request sent by a kernel module to a user-mode process, obtain first modification time information and second modification time information of data corresponding to the data call request through the user-mode process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in a file server;

[0060] A verification module 602, configured to compare the first modification time information and the second modification time information through the user-mode process, and if the first modification time information and the second modification time information are inconsistent, return a verification invalid result to the kernel module;

[0061] A processing module 603, configured to, according to the verification invalid result through the kernel module, invalidate the data in the kernel module, and synchronize the data in the file server to the kernel module through the user-mode process.

[0062] According to one or more embodiments of the present disclosure, the acquisition module 601, in response to a data call request sent by a kernel module to a user-mode process, obtains first modification time information and second modification time information of data corresponding to the data call request through the user-mode process, specifically including: in response to a data call request sent by a kernel module to a user-mode process, obtaining the first modification time information of the data corresponding to the data call request from first metadata information stored locally through the user-mode process, and obtaining the second modification time information of the data corresponding to the data call request from second metadata information stored in the file server through the user-mode process.

[0063] According to one or more embodiments of the present disclosure, the acquisition module 601, obtaining the second modification time information of the data corresponding to the data call request from second metadata information stored in the file server through the user-mode process, specifically including: sending a metadata information request of the data to the file server through the user-mode process, so that the file server returns the second metadata information of the data corresponding to the data call request to the user-mode process according to the metadata information request; the user-mode process obtains the second modification time information of the data corresponding to the data call request from the second metadata information.

[0064] According to one or more embodiments of the present disclosure, the verification module 602 is further configured to return a verification valid result to the kernel module if the first modification time information and the second modification time information are consistent; and determine, by the kernel module according to the verification valid result, that the data in the kernel module is valid, and call the data from the kernel module by the user-mode process.

[0065] According to one or more embodiments of the present disclosure, it further includes: a write-back module; the write-back module is configured to, in response to a data close request sent by the kernel module to the user-mode process, cache the dirty data in the kernel module through the user-mode process to obtain cached data; and write back the cached data to the file server through the user-mode process.

[0066] According to one or more embodiments of the present disclosure, it further includes: an update module; the update module is configured to update the modification time information of the cached data in the file server after writing back the cached data to the file server.

[0067] According to one or more embodiments of the present disclosure, the write-back module is further configured to: in response to a cache end request sent by the kernel module to the user-mode process, the user-mode process determines that the dirty data in the kernel module has been written back, and ends the caching.

[0068] According to one or more embodiments of the present disclosure, the dirty data is new data obtained by modifying the data corresponding to the data call request.

[0069] Among them, the acquisition module 601, the verification module 602, and the processing module 603 are connected in sequence. The data processing device provided in this embodiment can execute the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which will not be elaborated here.

[0070] Figure 7 This is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present disclosure. Refer to Figure 7 and the electronic device 700 may be a terminal device or a server. Among them, the terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs and desktop computers. Figure 7The electronic device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.

[0071] As Figure 7 shown, the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 701, which may perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 702 or the programs loaded from the storage device 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.

[0072] Generally, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or wirelesly to exchange data. Although Figure 7 the electronic device 700 with various devices is shown, it should be understood that it is not required to implement or include all the shown devices. More or fewer devices may be implemented or included alternatively.

[0073] Particularly, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.

[0074] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. 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 of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0075] The above computer-readable medium can be included in the above electronic device; or it can exist separately and not be assembled into the electronic device.

[0076] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to execute the method shown in the above embodiments.

[0077] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0079] The units involved in the embodiments described in this disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation on the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".

[0080] The functions described above in this document may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.

[0081] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, 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 the machine-readable storage medium would 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 fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0082] In a first aspect, according to one or more embodiments of the present disclosure, a data processing method is provided, which is applied to a user-mode file system. The user-mode file system includes a kernel module and a user-mode process. The kernel module is configured to forward a data request from an application end to the user-mode process, and the user-mode process is configured to process the data request. The method includes:

[0083] In response to the kernel module sending a data call request to the user-mode process, obtaining, by the user-mode process, first modification time information and second modification time information of data corresponding to the data call request, where the first modification time information is used to represent the modification time information of the data within the kernel module, and the second modification time information is used to represent the modification time information of the data within the file server end;

[0084] Comparing, by the user-mode process, the first modification time information and the second modification time information. If the first modification time information and the second modification time information are inconsistent, returning a verification invalid result to the kernel module;

[0085] Invalidating, by the kernel module according to the verification invalid result, the data within the kernel module, and synchronizing, by the user-mode process, the data within the file server end to the kernel module.

[0086] According to one or more embodiments of the present disclosure, the obtaining of the first modification time information and the second modification time information of the data corresponding to the data call request by the user-mode process in response to the kernel module sending a data call request to the user-mode process includes: in response to the kernel module sending a data call request to the user-mode process, obtaining, by the user-mode process, the first modification time information of the data corresponding to the data call request from the first metadata information stored locally, and obtaining, by the user-mode process, the second modification time information of the data corresponding to the data call request from the second metadata information stored in the file server.

[0087] According to one or more embodiments of the present disclosure, the obtaining, by the user-mode process, the second modification time information of the data corresponding to the data call request from the second metadata information stored in the file server includes: sending, by the user-mode process, a metadata information request for the data to the file server, so that the file server returns the second metadata information of the data corresponding to the data call request to the user-mode process according to the metadata information request; and the user-mode process obtaining the second modification time information of the data corresponding to the data call request from the second metadata information.

[0088] According to one or more embodiments of the present disclosure, it further includes: if the first modification time information and the second modification time information are consistent, returning a verification valid result to the kernel module; and determining, by the kernel module according to the verification valid result, that the data in the kernel module is valid, and calling the data from the kernel module by the user-mode process.

[0089] According to one or more embodiments of the present disclosure, it further includes: in response to the kernel module sending a data close request to the user-mode process, caching, by the user-mode process, the dirty data in the kernel module to obtain cached data; and writing back, by the user-mode process, the cached data to the file server.

[0090] According to one or more embodiments of the present disclosure, it further includes: after writing back the cached data to the file server, updating the modification time information of the cached data in the file server.

[0091] According to one or more embodiments of the present disclosure, it further includes: in response to the kernel module sending a cache end request to the user-mode process, the user-mode process determines that the writing back of the dirty data in the kernel module is completed, and ends the caching.

[0092] According to one or more embodiments of the present disclosure, the dirty data is new data obtained after modifying the data corresponding to the data call request.

[0093] Second aspect, according to one or more embodiments of the present disclosure, there is provided a data processing device, which is applied to a user-mode file system. The user-mode file system includes a kernel module and a user-mode process. The kernel module is configured to forward a data request from an application side to the user-mode process, and the user-mode process is configured to process the data request. The device includes:

[0094] An acquisition module, configured to, in response to a data call request sent by the kernel module to the user-mode process, obtain first modification time information and second modification time information of data corresponding to the data call request through the user-mode process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server;

[0095] A verification module, configured to compare the first modification time information and the second modification time information through the user-mode process. If the first modification time information and the second modification time information are inconsistent, a verification invalid result is returned to the kernel module;

[0096] A processing module, configured to, according to the verification invalid result through the kernel module, invalidate the data in the kernel module, and synchronize the data in the file server to the kernel module through the user-mode process.

[0097] According to one or more embodiments of the present disclosure, the acquisition module, in response to a data call request sent by the kernel module to the user-mode process, obtains first modification time information and second modification time information of data corresponding to the data call request through the user-mode process, specifically including: in response to a data call request sent by the kernel module to the user-mode process, obtaining the first modification time information of the data corresponding to the data call request from first metadata information stored locally through the user-mode process, and obtaining the second modification time information of the data corresponding to the data call request from second metadata information stored in the file server through the user-mode process.

[0098] According to one or more embodiments of the present disclosure, the acquisition module obtains the second modification time information of the data corresponding to the data call request from the second metadata information stored in the file server through the user-mode process, specifically including: sending a metadata information request of the data to the file server through the user-mode process, so that the file server returns the second metadata information of the data corresponding to the data call request to the user-mode process according to the metadata information request; the user-mode process obtains the second modification time information of the data corresponding to the data call request from the second metadata information.

[0099] According to one or more embodiments of the present disclosure, the verification module is further configured to, if the first modification time information is consistent with the second modification time information, return a verification valid result to the kernel module; and the kernel module determines that the data in the kernel module is valid according to the verification valid result, and the user-mode process calls the data from the kernel module.

[0100] According to one or more embodiments of the present disclosure, it further includes: a write-back module; the write-back module is configured to, in response to a data close request sent by the kernel module to the user-mode process, cache the dirty data in the kernel module through the user-mode process to obtain cached data; and write the cached data back to the file server through the user-mode process.

[0101] According to one or more embodiments of the present disclosure, it further includes: an update module; the update module is configured to update the modification time information of the cached data in the file server after writing the cached data back to the file server.

[0102] According to one or more embodiments of the present disclosure, the write-back module is further configured to: in response to a cache end request sent by the kernel module to the user-mode process, the user-mode process determines that the dirty data in the kernel module has been written back and ends the caching.

[0103] According to one or more embodiments of the present disclosure, the dirty data is new data obtained by modifying the data corresponding to the data call request.

[0104] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including: a processor, and a memory communicatively connected to the processor;

[0105] The memory stores computer-executable instructions;

[0106] The processor executes the computer-executable instructions stored in the memory to implement the data processing method as described in the first aspect above and various possible designs of the first aspect.

[0107] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the data processing method as described in the first aspect above and various possible designs of the first aspect is implemented.

[0108] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the data processing method as described in the first aspect above and various possible designs of the first aspect is implemented.

[0109] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0110] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0111] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.

Claims

1. A data processing method, characterized in that Applied to the user-space file system, the user-space file system includes a kernel module and a user-space process, where the kernel module is used to forward data requests from the application side to the user-space process, and the user-space process is used to process the data requests; the method includes: In response to the kernel module sending a data call request to the user-space process, obtain the first modification time information and the second modification time information of the data corresponding to the data call request through the user-space process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server; Compare the first modification time information and the second modification time information through the user-space process. If the first modification time information and the second modification time information are inconsistent, return a verification invalid result to the kernel module; According to the verification invalid result, invalidate the data in the kernel module through the kernel module, and synchronize the data in the file server to the kernel module through the user-space process.

2. The method according to claim 1, characterized in that, The step of, in response to the kernel module sending a data call request to the user-space process, obtaining the first modification time information and the second modification time information of the data corresponding to the data call request through the user-space process, includes: In response to the kernel module sending a data call request to the user-space process, obtain the first modification time information of the data corresponding to the data call request from the first metadata information stored locally through the user-space process, and obtain the second modification time information of the data corresponding to the data call request from the second metadata information stored in the file server through the user-space process.

3. The method according to claim 2, wherein The step of obtaining the second modification time information of the data corresponding to the data call request from the second metadata information stored in the file server through the user-space process includes: Send a metadata information request for the data to the file server through the user-space process, so that the file server returns the second metadata information of the data corresponding to the data call request to the user-space process according to the metadata information request; The user-space process obtains the second modification time information of the data corresponding to the data call request from the second metadata information.

4. The method according to claim 1, wherein It further includes: If the first modification time information and the second modification time information are consistent, return a verification valid result to the kernel module; According to the verification valid result, determine that the data in the kernel module is valid through the kernel module, and call the data from the kernel module through the user-space process.

5. The method according to claim 1, characterized in that, It further includes: In response to the kernel module sending a data close request to the user-space process, cache the dirty data in the kernel module through the user-space process to obtain cached data; Write the cached data back to the file server through the user-space process.

6. The method according to claim 5, wherein It further includes: After writing the cached data back to the file server, update the modification time information of the cached data in the file server.

7. The method according to claim 5, characterized in that, It further includes: In response to the kernel module sending a cache end request to the user-space process, the user-space process determines that the dirty data in the kernel module has been written back, and ends the cache.

8. The method according to any one of claims 5 to 7, characterized in that The dirty data is the new data after modifying the data corresponding to the data call request.

9. A data processing device, characterized in that, Applied to the user-space file system, the user-space file system includes a kernel module and a user-space process, where the kernel module is used to forward the data request from the application side to the user-space process, and the user-space process is used to process the data request; the device includes: An acquisition module, configured to, in response to the kernel module sending a data call request to the user-space process, obtain the first modification time information and the second modification time information of the data corresponding to the data call request through the user-space process, where the first modification time information is used to represent the modification time information of the data in the kernel module, and the second modification time information is used to represent the modification time information of the data in the file server; A verification module, configured to compare the first modification time information and the second modification time information through the user-space process, and if the first modification time information and the second modification time information are inconsistent, return a verification invalid result to the kernel module; A processing module, configured to, according to the verification invalid result through the kernel module, invalidate the data in the kernel module, and synchronize the data in the file server to the kernel module through the user-space process.

10. An electronic device, characterized in that, Comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the data processing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the data processing method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that, Including a computer program, which implements the data processing method according to any one of claims 1 to 8 when executed by a processor.

Citation Information

Patent Citations

  • Cloud storage service client high-efficiency fine-granularity data caching system and method

    CN102014158A

  • Realtime kernel

    US20140136726A1