Data processing method, apparatus and electronic device
By pre-mounting data access interfaces in a distributed storage system and combining a virtual file system and the C standard library, the problem of data invisibility in the object storage engine Bluestore was solved, achieving data accuracy and processability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
- Filing Date
- 2021-03-31
- Publication Date
- 2026-04-28
AI Technical Summary
In distributed storage systems, when using the Bluestore object storage engine, technicians cannot directly see the data on the raw devices, making it impossible to modify or recover erroneous data and affecting data accuracy.
By pre-mounting a data access interface in the target storage area of the device, and combining a virtual file system and the C standard library, it is possible to export and update data files and storage structures in the target storage area.
It facilitates technical personnel in viewing and processing data in the target storage area, ensures data accuracy, improves data access efficiency and convenience, and supports data modification and recovery.
Smart Images

Figure CN115145998B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a data processing method, apparatus, and electronic device. Background Technology
[0002] Distributed storage systems typically support multiple storage engines in their backend. Different storage engines offer different storage mechanisms, indexing techniques, and other functionalities. In one related technology, the Bluestore storage engine can be used in the backend of a distributed storage system. Bluestore directly manages the raw devices, meaning it stores all data directly on them. However, technicians cannot directly see the data stored on the raw devices. When data on the raw devices becomes corrupted and needs to be modified or recovered by technicians, the inability to view the data prevents them from modifying or recovering the erroneous data, thus compromising the accuracy of the data stored on the raw devices. Summary of the Invention
[0003] The purpose of this invention is to provide a data processing method, apparatus, and electronic device to ensure the accuracy of data stored in a bare device.
[0004] This invention provides a data processing method applied to a device running a data access interface of the BlueStore object storage engine. The data access interface is pre-mounted on a target storage area of the device. The data access interface is used to export data files in the target storage area and the storage structure of the data files. The method includes: receiving a data access request for the target storage area; and invoking the data access interface to export data files in the target storage area and the storage structure of the data files.
[0005] Furthermore, the data access interface is connected to a virtual file system in the kernel; the step of calling the data access interface to export the data file in the target storage area and the storage structure of the data file includes: calling the data access interface through the virtual file system to export the data file in the target storage area and the storage structure of the data file.
[0006] Furthermore, a read function interface is provided in the default C standard library, and the read function interface is connected to the virtual file system; the step of calling the data access interface through the virtual file system includes: calling the read function interface to communicate with the virtual file system, so as to call the data access interface through the virtual file system.
[0007] Furthermore, the read function interface is connected to at least one application; the step of exporting the data file in the target storage area and the storage structure of the data file includes: calling the read function interface through the virtual file system to send the data file and the storage structure of the data file to a specified application; and displaying the data file and the storage structure of the data file through the specified application.
[0008] Furthermore, the method also includes: if a data update request for the target storage area is received, updating the data file in the target storage area and / or the storage structure of the data file.
[0009] Furthermore, before receiving a data access request for the target storage area, the method further includes: saving the name of the data access interface and the size of the target storage area to the target storage area; and mounting the data access interface to the target storage area.
[0010] The present invention provides a data processing apparatus, wherein the apparatus is installed on a device running a data access interface of the object storage engine BlueStore, the data access interface being pre-mounted on a target storage area of the device; the data access interface is used to export data files in the target storage area and the storage structure of the data files; the apparatus includes: a receiving module for receiving data access requests for the target storage area; and an exporting module for invoking the data access interface to export data files in the target storage area and the storage structure of the data files.
[0011] Furthermore, the data access interface is connected to a virtual file system in the kernel; the export module is also used to: call the data access interface through the virtual file system to export the data file in the target storage area, as well as the storage structure of the data file.
[0012] The present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the data processing method described in any of the preceding claims.
[0013] The present invention provides a machine-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement any of the data processing methods described above.
[0014] This invention provides a data processing method, apparatus, and electronic device. The method is applied to a device running a data access interface of the BlueStore object storage engine. The data access interface is pre-mounted on a target storage area of the device. The data access interface is used to export data files from the target storage area, as well as the storage structure of the data files. The method includes: first, receiving a data access request for the target storage area; then, invoking the data access interface to export the data files from the target storage area, as well as the storage structure of the data files. This method, by setting up a BlueStore object storage engine data access interface and pre-mounting it on the target storage area, enables access to data in the target storage area through the object storage engine, facilitating data processing by technicians and ensuring the accuracy of the data in the target storage area. Attached Figure Description
[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 A flowchart of a data processing method provided in an embodiment of the present invention;
[0017] Figure 2 A flowchart of another data processing method provided in an embodiment of the present invention;
[0018] Figure 3 A flowchart of another data processing method provided in an embodiment of the present invention;
[0019] Figure 4 A flowchart of another data processing method provided in an embodiment of the present invention;
[0020] Figure 5 A schematic diagram of a system architecture provided for an embodiment of the present invention;
[0021] Figure 6 This is a schematic diagram of data display provided in an embodiment of the present invention;
[0022] Figure 7 A schematic diagram illustrating another data display method provided in an embodiment of the present invention;
[0023] Figure 8 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present invention;
[0024] Figure 9This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0025] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Distributed storage systems typically support multiple storage engines in their backend. Taking the CITE distributed storage system as an example, with the gradual development of the Ceph community, the default object storage engine Filestore, based on the XFS file system, is gradually being replaced by the next-generation object storage engine Bluestore due to issues such as write amplification. Bluestore writes all data directly to the raw device, meaning technicians cannot directly see the data stored on it. When data misalignment or other failures occur on the raw device, technicians cannot modify or recover the erroneous data, thus compromising the accuracy of the data stored on the raw device. Therefore, this invention provides a data processing method, apparatus, and electronic device. This technology can be applied to applications that require processing data stored using the Bluestore object storage engine.
[0027] To facilitate understanding of this embodiment, a data processing method disclosed in this invention will first be described in detail. The method is applied to a device running a data access interface of the object storage engine Bluestore. The data access interface is pre-mounted in the target storage area of the device. The data access interface is used to export data files from the target storage area, as well as the storage structure of the data files. Through the aforementioned object storage engine Bluestore, data can be directly stored in the target storage area, and the performance of storage devices such as SSDs (Solid State Disks) can be optimized. The aforementioned data access interface can be used to access data from various data sources, such as data stored in the target storage area. The target storage area can be a storage area in a disk or a raw device. The aforementioned data file can be used to store data; the data file can be in the form of a plain text file or an encoded file. The aforementioned storage structure can be understood as the storage method of the data files, such as storing multiple data files row-wise or column-wise. In actual implementation, the data access interface of the object storage engine Bluestore is usually pre-mounted in the target storage area. This can also be understood as the mounting path of the data access interface being the same as the path of the target storage area. Mounting enables the association between the data access interface and the target storage area. Figure 1 As shown, the method includes the following steps:
[0028] Step S102: Receive a data access request for the target storage area.
[0029] The aforementioned data access request can be understood as a request issued by a user through an application or other means to access relevant data in a target storage area. This user can be a technician or maintenance personnel, etc. In actual implementation, when a user needs to view data files or the storage structure of data files in the target storage area, they can send a corresponding data access request through an application or other means, and the device running the BlueStore object storage engine's data access interface will receive the data access request.
[0030] Step S104: Call the data access interface to export the data file in the target storage area, as well as the storage structure of the data file.
[0031] In actual implementation, since the data access interface is pre-mounted on the target storage area of the device, that is, the data access interface is associated with the target storage area, when the above data access request is received, the data file in the target storage area and the storage structure of the data file can be queried by calling the data access interface, and the queried data file and the storage structure of the data file can be exported for the user to view.
[0032] The aforementioned data processing method is applied to devices running the BlueStore object storage engine's data access interface, which is pre-mounted in the device's target storage area. The data access interface is used to export data files and their storage structure from the target storage area. The method includes: first, receiving a data access request for the target storage area; then, invoking the data access interface to export the data files and their storage structure from the target storage area. This approach, by setting up the BlueStore object storage engine's data access interface and pre-mounting it in the target storage area, enables access to data in the target storage area via the object storage engine. This facilitates data processing by technical personnel and ensures the accuracy of the data in the target storage area.
[0033] This invention also provides another data processing method, which is implemented based on the method in the above embodiments. This method focuses on describing the specific process of calling the data access interface, exporting the data file in the target storage area, and the storage structure of the data file, specifically corresponding to step S204 below. In this method, the data access interface is connected to the virtual file system in the kernel. The kernel is the core of the operating system, which can be used to manage the system's processes, memory, device drivers, files, and network systems, and determines the system's performance and stability. The virtual file system can also be called VFS (Virtual File System). Its function is to use standard Unix system calls to read and write different file systems located on different physical media, that is, to provide a unified operation interface and application programming interface for various file systems. The virtual file system is a glue layer that allows system calls such as open(), read(), and write() to work without caring about the underlying storage media and file system type.
[0034] The default C standard library includes a read function interface that connects to the virtual file system. The default C standard library can be understood as a collection of macros, types, and functions used to perform tasks such as input / output processing, string manipulation, memory management, mathematical calculations, and other operating system services. This C standard library includes a read function interface that communicates with the virtual file system, which in turn communicates with a data access interface. This read function interface also connects to at least one application; this application can also be called an APP (Application), and there can be one or more applications, meaning the read function interface can connect to one or more applications. Figure 2 As shown, the method includes the following steps:
[0035] Step S202: Receive a data access request for the target storage area.
[0036] Step S204: Use the virtual file system to call the data access interface to export the data file in the target storage area, as well as the storage structure of the data file.
[0037] Upon receiving the aforementioned data access request, the unified application programming interface provided by the virtual file system can be used to call the data access interface to query the data files in the target storage area and their storage structure. The retrieved data files and their storage structure can then be exported for technical personnel to review. In practice, the virtual file system may connect to other file systems besides the Bluestore object storage engine's data access interface, such as the XFS file system and the ext4 file system. XFS is a high-performance journaling file system; ext4 (Fourth extended filesystem) is a journaling file system in Linux. Journaling file systems can maintain file system consistency in the event of power failure or operating system crashes, and can manage and control data storage and access when not in use. When the virtual file system receives a data access request, it can obtain the target storage area from the request. Since the Bluestore object storage engine's data access interface is pre-mounted on this target storage area, the virtual file system can select the corresponding Bluestore object storage engine data access interface from among the multiple connected file systems or data access interfaces. Then, through the selected data access interface, it can export the data files and their storage structure from the target storage area.
[0038] Specifically, the steps described above for calling the data access interface through the virtual file system may include: calling the read function interface to communicate with the virtual file system in order to call the data access interface through the virtual file system.
[0039] In actual implementation, upon receiving the aforementioned data access request, the read function interface in the C standard library can be called first to read the relevant data files through the corresponding read function. This read function interface communicates with the connected virtual file system, which can then receive the access request and call the data access interface through the virtual file system.
[0040] The steps described above for exporting data files from the target storage area, as well as the storage structure of those data files, can be achieved through the following steps one and two:
[0041] Step 1: Use the virtual file system to call the read function interface to send the data file and its storage structure to the specified application.
[0042] The specified application mentioned above can be a specific application within at least one application connected to the read function interface. In actual implementation, after the data file and its storage structure in the target storage area are queried through the data access interface called by the virtual file system, the virtual file system can then call the connected read function interface to send the queried data file and its storage structure to the read function interface, and then send the queried data file and its storage structure to the specified application through the read function interface.
[0043] Step two: Display the data file and its storage structure by specifying the application.
[0044] In practical implementation, since there may be multiple applications—for example, applications 1 and 2—the exported data files and their storage structure can be customized using different applications. For instance, if the acquired data includes multiple directories, each typically containing an index and the corresponding actual data files, application 1 can view only the index, while application 2 can view only the corresponding data files. In other words, different display functions can be customized for different applications. Specifically, this customization can be achieved by writing code to tailor the design of different applications according to actual needs. In practical implementation, after sending the data files and their storage structure to the specified application, the received data files and their storage structure can be customized according to the display method specified by that application.
[0045] The aforementioned data processing method first receives data access requests for the target storage area, then uses a virtual file system to call the data access interface to export the data files and their storage structure from the target storage area. This approach sets up a data access interface for the BlueStore object storage engine and pre-mounts this interface on the target storage area. When data in the target storage area needs to be accessed, calling this interface allows technicians to view the relevant data, facilitating data processing and ensuring the accuracy of the data in the target storage area. Furthermore, the virtual file system provides a unified, abstract, and universal access interface. This universal interface shields the differences between the underlying file systems, data access interfaces, and physical storage media, improving the efficiency and convenience of data access.
[0046] This invention also provides another data processing method, which is implemented based on the methods of the above embodiments; such as Figure 3As shown, the method includes the following steps:
[0047] Step S302: Receive a data access request for the target storage area.
[0048] Step S304: Call the data access interface to export the data file in the target storage area, as well as the storage structure of the data file.
[0049] Step S306: If a data update request for the target storage area is received, update the data file in the target storage area and / or the storage structure of the data file.
[0050] The aforementioned data update request can be understood as a request issued by a user when they need to update relevant data in the target storage area. This data update request typically carries the data to be updated. As can be seen from the above embodiments, a data file and its storage structure can be displayed to the user through a specified application. In actual implementation, the relevant data in the target storage area can be further updated through this specified application. This application can be understood as an operation and maintenance tool that can operate on the exported data file or its storage structure. If there are multiple applications, different applications can be used to solve different problems existing in the data in the target storage area.
[0051] For example, when data in a specified data file in the target storage area is corrupted and needs to be modified or restored by the user, the user can locate the specified data file from multiple data files displayed through a specified application, modify or restore the data in the specified data file, and then issue a data update request. This data update request carries the data to be updated after the user's modification or restoration. The specified application is usually connected to a preset C standard library, which has a write function interface. This write function interface is connected to a virtual file system. When the device receives the data update request, it can call the write function interface to communicate with the virtual file system, so as to call the data access interface through the virtual file system to store the data to be updated in the data update request to the target storage area, thereby updating the corrupted data in the specified data file in the target storage area.
[0052] The aforementioned data processing method first receives a data access request for the target storage area; then, it calls the data access interface to export the data file and its storage structure from the target storage area; if a data update request for the target storage area is received, it updates the data file and / or its storage structure. This approach, by setting up a data access interface for the object storage engine BlueStore and pre-mounting this interface on the target storage area, allows technicians to view relevant data when needed by calling the data access interface. If data needs modification or restoration, technicians can directly modify or restore the data and update the target storage area, ensuring the accuracy of the data in the target storage area.
[0053] This invention also provides another data processing method, which is implemented based on the methods of the above embodiments; such as Figure 4 As shown, the method includes the following steps:
[0054] Step S402: Save the name of the data access interface and the size of the target storage area to the target storage area.
[0055] In actual implementation, a data access interface for the Bluestore object storage engine can be set in the kernel. By calling this data access interface, the Bluestore object storage engine file system in kernel mode can be implemented. The superblock of the data access interface can be written to the target storage area. For example, if the target storage area is a storage area on a disk, the superblock of the data access interface can be written to the disk header. The superblock is equivalent to the metadata of the file system, storing a general information about the file system. For example, if the Bluestore object storage engine file system is implemented by calling the data access interface, the name of the data access interface can be saved to the target storage area. In addition, the size of the target storage area can also be saved to the target storage area. For example, if the target storage area is a storage area on a disk, the disk size can be saved to the disk.
[0056] Step S404: Mount the data access interface to the target storage area.
[0057] Step S406: Receive a data access request for the target storage area.
[0058] Step S408: Call the data access interface to export the data file in the target storage area, as well as the storage structure of the data file.
[0059] The aforementioned data processing method saves the name of the data access interface and the size of the target storage area to the target storage area; mounts the data access interface to the target storage area; receives data access requests for the target storage area; calls the data access interface to export the data file and its storage structure from the target storage area. This method stores the name of the data access interface in the target storage area, thus determining the necessary interface for accessing that area. By mounting the data access interface to the target storage area, technicians can access the relevant data by calling the interface when needed, facilitating data processing and ensuring the accuracy of the data in the target storage area.
[0060] To further understand the above embodiments, the following provides... Figure 5 The diagram shown is a schematic of a system architecture. Figure 5 This includes APP1, APP2, the C standard library, the virtual file system VFS, the xfs file system, the ext4 file system, and the bluestore export module (corresponding to the data access interface of the aforementioned object storage engine bluestore). Among them, APP1, APP2, and the C standard library run in user space, while the virtual file system VFS, xfs file system, ext4 file system, and bluestore export module run in kernel space. Both APP1 and APP2 communicate with the function interfaces in the C standard library, such as the read and write function interfaces set in the C standard library. The function interfaces in the C standard library also communicate with the virtual file system VFS, calling the xfs file system, ext4 file system, or bluestore export module through the virtual file system VFS to access their respective storage areas, such as disks. The Virtual File System (VFS) can be understood as an abstraction or unification layer. Different file systems in the kernel, such as xfs or ext4, need to adhere to the same protocol and be presented to user space through a unified interface. For example, the VFS provides a unified open function interface. Different file systems implement different open functions. This approach involves setting up a bluestore export module in the kernel. By calling this bluestore export module, a generic open function can be implemented.
[0061] Specifically, taking a disk as an example, if the Bluestore object storage engine is used to store data on the disk, when you need to view, modify, or restore the data on the disk, you must first mount the Bluestore export module to the path of the disk to be accessed; otherwise, you cannot access the data on the disk. After mounting the Bluestore export module, you can associate the Bluestore export module with the disk. By calling the Bluestore export module, you can export the directories and data files in the directories on the disk, as well as the storage structure of the data files, etc., so that users can view the data files stored on the disk and directly operate on the data files. The exported data usually also includes relevant information explaining the function of the data files.
[0062] The aforementioned APP1 and APP2 can be understood as different operation and maintenance tools. Users can select the corresponding APP based on the problems that occur in the stored data files, and use different APPs to modify or restore the erroneous data in the exported data files. Of course, users can also manually modify the erroneous data. For different APPs, the data exported through the bluestore export module is the same. It's just that when modifying or restoring the exported data through different APPs such as APP1 or APP2, the modified locations may be different.
[0063] Taking the distributed storage system Crit as an example, when using the object storage engine Bluestore, the related technologies can only perform simple operations and maintenance through the operation and maintenance commands provided by Ceph, and can only handle simple problems. When encountering more complex problems, the existing operation and maintenance commands cannot solve the problem. For example, when data corruption occurs due to a cluster power outage, the existing operation and maintenance commands cannot solve the problem, and manual detailed analysis is required to recover the relevant data. Furthermore, because the object storage engine Bluestore directly stores data in the storage area without using a file system, it is impossible to export data in the storage area by manipulating the file system, unlike the object storage engine Filestore which can export data in the storage area by directly manipulating the XFS file system.
[0064] The above method adds a bluestore export module to the kernel. By analyzing the data structure of the bluestore export module, cept_bluestore can implement interfaces such as open, mkdir, create, chmod, read, write, truncate, and statfs in the kernel and make them visible to user space. The kernel provides POSIX semantic file interfaces to user space. Through the bluestore export module, users can enter the system to view various data files in the system and perform operations on the data files.
[0065] See Figure 6 The diagram shown is a schematic representation of data display. Figure 6 Before adding the bluestore export module, the content displayed to the user shows that they can only see the block device and cannot see the directory or data files within it; see [link to relevant documentation]. Figure 7 The diagram shown illustrates another type of data display. Figure 7 After adding the bluestore export module, the content displayed to users clearly shows the data file directory and file structure, and also includes an explanation of the exported file structure.
[0066] This invention provides a data processing apparatus. The apparatus is installed on a device running the BlueStore object storage engine with a data access interface. The data access interface is pre-mounted on the target storage area of the device. The data access interface is used to export data files from the target storage area, as well as the storage structure of the data files. Figure 8 As shown, the device includes: a receiving module 80 for receiving data access requests for a target storage area; and an exporting module 81 for calling a data access interface to export data files in the target storage area, as well as the storage structure of the data files.
[0067] The aforementioned data processing device is installed on a device running the BlueStore object storage engine with a data access interface. This data access interface is pre-mounted on the target storage area of the device. The data access interface is used to export data files and their storage structure from the target storage area. First, it receives data access requests for the target storage area. Then, it invokes the data access interface to export the data files and their storage structure from the target storage area. By setting up the BlueStore object storage engine's data access interface and pre-mounting it on the target storage area, this device enables access to data in the target storage area via the object storage engine, facilitating data processing by technicians and ensuring the accuracy of the data in the target storage area.
[0068] Furthermore, the data access interface is connected to the virtual file system in the kernel; the export module 81 is also used to: call the data access interface through the virtual file system to export the data file in the target storage area, as well as the storage structure of the data file.
[0069] Furthermore, the default C standard library includes a read function interface that connects to the virtual file system; the exported module 81 is also used to: call the read function interface to communicate with the virtual file system, so as to call the data access interface through the virtual file system.
[0070] Furthermore, the read function interface is connected to at least one application; the export module 81 is also used to: call the read function interface through the virtual file system to send the data file and the storage structure of the data file to the specified application; and display the data file and the storage structure of the data file through the specified application.
[0071] Furthermore, the device is also used to: if a data update request for a target storage area is received, update the data file in the target storage area, and / or the storage structure of the data file.
[0072] Furthermore, the device is also used to: save the name of the data access interface and the size of the target storage area to the target storage area; and mount the data access interface to the target storage area.
[0073] The data processing apparatus provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned data processing method embodiment. For the sake of brevity, any parts not mentioned in the data processing apparatus embodiment can be referred to the corresponding content in the aforementioned data processing method embodiment.
[0074] This invention also provides an electronic device, see [link to relevant documentation]. Figure 9 As shown, the electronic device includes a processor 130 and a memory 131. The memory 131 stores machine-executable instructions that can be executed by the processor 130. The processor 130 executes the machine-executable instructions to implement the above-described data processing method.
[0075] Furthermore, Figure 9 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.
[0076] The memory 131 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0077] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131. The processor 130 reads the information from memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0078] This invention also provides a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are called and executed by a processor, they cause the processor to implement the aforementioned data processing method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0079] The computer program products of the data processing methods, apparatus, and electronic devices provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0080] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data processing method, characterized in that, The method is applied to a device running a data access interface with the BlueStore object storage engine, the data access interface being pre-mounted in the target storage area of the device; The data access interface is used to export data files in the target storage area, as well as the storage structure of the data files; the method includes: Receive a data access request for the target storage area; Call the data access interface to export the data file in the target storage area, as well as the storage structure of the data file; The data access interface is connected to the virtual file system in the kernel; a write function interface is provided in the default C standard library, and the write function interface is connected to the virtual file system; the method further includes: If a data update request for the target storage area is received, the write function interface is invoked to communicate with the virtual file system, so as to call the data access interface through the virtual file system to store the data to be updated in the data update request to the target storage area, so as to update the data file in the target storage area and / or the storage structure of the data file; The virtual file system is also connected to other file systems; wherein, the other file systems include: xfs file system, ext4 file system; the step of calling the data access interface to export the data file in the target storage area, and the storage structure of the data file, includes: The target storage area is obtained from the data access request through the virtual file system. From the multiple different file systems or data access interfaces connected, the data access interface of the object storage engine Bluestore corresponding to the target storage area is selected. The selected data access interface is called to export the data file in the target storage area and the storage structure of the data file.
2. The method according to claim 1, characterized in that, The C standard library is configured with a read function interface, which is connected to the virtual file system. The steps of obtaining the target storage area from the data access request through the virtual file system, selecting the BlueStore object storage engine data access interface corresponding to the target storage area from multiple different connected file systems or data access interfaces, and calling the selected data access interface include: The read function interface is invoked to communicate with the virtual file system to obtain the target storage area from the data access request through the virtual file system. From multiple different file systems or data access interfaces connected, the data access interface of the object storage engine Bluestore corresponding to the target storage area is selected and the selected data access interface is invoked.
3. The method according to claim 2, characterized in that, The read function interface is connected to at least one application. The step of exporting the data file in the target storage area and the storage structure of the data file includes: The data file and its storage structure are sent to the specified application by calling the read function interface through the virtual file system. The data file and its storage structure are displayed through the specified application.
4. The method according to claim 1, characterized in that, Before the step of receiving a data access request for the target storage area, the method further includes: Save the name of the data access interface and the size of the target storage area to the target storage area; The data access interface is mounted to the target storage area.
5. A data processing apparatus, characterized in that, The device is installed on a device running a data access interface of the object storage engine BlueStore, and the data access interface is pre-mounted in the target storage area of the device. The data access interface is used to export data files in the target storage area, as well as the storage structure of the data files; the device includes: The receiving module is used to receive data access requests for the target storage area; The export module is used to call the data access interface to export the data file in the target storage area, as well as the storage structure of the data file; The data access interface is connected to the virtual file system in the kernel; a write function interface is provided in the default C standard library, and the write function interface is connected to the virtual file system; the device is also used for: If a data update request for the target storage area is received, the write function interface is invoked to communicate with the virtual file system, so as to call the data access interface through the virtual file system to store the data to be updated in the data update request to the target storage area, so as to update the data file in the target storage area and / or the storage structure of the data file; The virtual file system is also connected to other file systems; wherein, the other file systems include: xfs file system, ext4 file system; the export module is also used for: The target storage area is obtained from the data access request through the virtual file system. From the multiple different file systems or data access interfaces connected, the data access interface of the object storage engine Bluestore corresponding to the target storage area is selected. The selected data access interface is called to export the data file in the target storage area and the storage structure of the data file.
6. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the data processing method according to any one of claims 1-4.
7. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the data processing method according to any one of claims 1-4.
Citation Information
Patent Citations
Performance improving method and device for distributed storage equipment and distributed storage equipment
CN111209253A