Cross-platform client implementation method based on distributed storage
By designing a cross-platform client implementation method based on distributed storage and using technologies such as React.js and Electron, the problem of mounting, reading and writing inconsistencies in the Ceph file system under different operating systems has been solved, and the NAS layer overhead has been reduced and improved. Improves storage system performance and enables cross-platform file system access and operations.
Patent Information
- Application Number
- CN202110905672.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-06
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-08-06
AI Technical Summary
The existing Ceph file system is provided to different operating systems through the NAS protocol, and cannot achieve consistent mounting, reading and writing of operating systems such as Windows, Mac OS, and Linux. At the same time, the overhead of the NAS layer causes system performance to be improved.
Designed a cross-platform client implementation method based on distributed storage, including presentation layer, business layer and data storage layer, using technologies such as React.js, Electron, Node.js and Chromium to provide a common display interface and interaction specifications. Implement file system mounting, uploading, and read and write operations, reduce NAS layer overhead, and use the CRUSH algorithm for data distribution and disaster recovery management.
It achieves the consistency of mounting and reading and writing of different operating system platforms, reduces the NAS layer overhead, improves the overall performance of the storage system, supports cross-platform client file upload, download, edit and delete operations, and provides performance monitoring and charts. feedback.
Smart Images

Figure CN113535094B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a cross-platform client implementation method based on distributed storage. Background Art
[0002] With the rapid development of cloud computing technology, a huge demand for data storage has been generated. However, the built-in storage space of traditional servers is often insufficient to meet the storage needs, or even if it can meet the requirements, the utilization rate of the disk is greatly reduced due to the independence of each server. Ceph, as a distributed storage system, can better solve the above problems. It abandons the traditional centralized storage metadata addressing solution and adopts the CRUSH algorithm, which has balanced data distribution and high parallelism; at the same time, it considers the isolation of disaster recovery domains and can implement the replica placement rules of various loads. However, the existing Ceph file system is provided to users of different operating systems through the NAS protocol. This technical solution cannot achieve the mounting and reading and writing consistency of different operating systems such as Windows, Mac OS, and Linux. At the same time, the overall performance of the system needs to be improved due to the overhead existing in the NAS layer. Therefore, how to develop a new cross-platform client implementation method based on distributed storage to overcome the above-mentioned defects in the prior art is a direction that technicians in this field need to study. Summary of the invention
[0003] The purpose of the present invention is to provide a cross-platform client implementation method based on distributed storage, which can achieve consistent mounting and reading and writing on different system platforms, reduce the overhead of the NAS layer, and improve the overall performance of the storage system.
[0004] The technical solutions adopted are:
[0005] A cross-platform client implementation method based on distributed storage includes the following steps:
[0006] Step 1: Establishing a client architecture of a distributed storage system, wherein the client architecture of the distributed storage system includes a presentation layer, a business layer, and a data storage layer;
[0007] The presentation layer is used to provide a general display interface and interaction specifications;
[0008] The business layer is used to provide an installation package corresponding to the operating system and implement mounting and uploading of the file system client;
[0009] The data storage layer is used to realize data reading, writing and monitoring;
[0010] Step 2: Complete the mounting of the file system client for different operating systems;
[0011] Step 3: Complete file upload for different operating systems;
[0012] Step 4: Complete the interface processing of the file system; including metadata operations and data operations.
[0013] Step 5: Store file information, upload status and other information in the business layer database to complete client functions such as task control and log display.
[0014] Preferably, in the above-mentioned cross-platform client implementation method based on distributed storage: step 1 comprises:
[0015] Step 11: Design the technical architecture for the presentation layer, use React.js as the R&D framework to implement interactive logic processing, use HTML to implement the web document structure, and use CSS to implement the style rendering of the web document structure;
[0016] Step 12: Embed Node.js and Chromium into Electron used in the business layer; therefore, a JavaScript, HTML, and CSS code repository can be maintained in the presentation layer to create cross-platform applications on Windows, MacOS, and Linux without the need for development experience in each system.
[0017] More preferably, in the above-mentioned cross-platform client implementation method based on distributed storage, step 2 comprises:
[0018] Step 21: Connect and log in to the storage server, select the mount drive letter to mount;
[0019] Step 22: Complete user authentication with the server based on the logged-in user information, and obtain monmap, mdsmap, osdmap and other information based on the monips recorded in the configuration file, create mon client, mds client, osd client, and establish connections with mon, mds and other services. Among them, the main function of mon client, mds client, and osd client is to communicate with mon, mds, and osd on the storage service side to support the completion of file system read and write operations;
[0020] Step 23: The server information, login information, mount information, and file read and write information entered and read by the presentation layer are stored in the database of the presentation layer to provide interactive operations such as server information cache, user information cache, automatic login, automatic mount, and file read and write record query.
[0021] Step 24: Distinguish the operating system. If the operating system is Linux, use the command to mount; if the operating system is MacOS, use AppleScript to mount; if the operating system is Windows, select the drive letter to be mounted;
[0022] Step 25: Determine whether the mounting is successful. If the mounting fails, jump to step 26; otherwise, jump to step 27;
[0023] Step 26: Check for mount errors and jump to step 24;
[0024] Step 27: Complete the mount.
[0025] Further preferably, in the above-mentioned cross-platform client implementation method based on distributed storage, step 3 comprises:
[0026] Step 31: After selecting a file or folder, the path information of the file or folder is transmitted to the business layer;
[0027] Step 32: The business layer obtains the file information based on the file or folder path and then communicates with the storage layer;
[0028] Step 33: Cache multiple files to be uploaded;
[0029] Step 34: Register the file address list as multiple upload tasks;
[0030] Step 35: Distinguish the operating platform;
[0031] Step 36: Initiate a file upload task;
[0032] Step 37: Clear the file cache address;
[0033] Step 38: Refresh the file upload queue and determine whether the current queue is empty. If the current queue is empty, end the process, otherwise jump to step 37;
[0034] Step 39: Upload a task and determine whether it is fragmented. If it is fragmented, jump to step 310, otherwise jump to step 312;
[0035] Step 310: Cut the fragments and upload them, and update the fragment information returned by the request until the fragment cutting is completed;
[0036] Step 311: Verify and assemble all fragmentation information;
[0037] Step 312: Complete the current file upload and jump to step 38.
[0038] Step 313: Store the file information, upload status and other information in the business layer database, and then display it in the presentation layer.
[0039] More preferably, in the above-mentioned cross-platform client implementation method based on distributed storage, step 4 comprises:
[0040] Metadata operation: The client communicates directly with MDS through MDS client. After obtaining the file caps lock, it calls the setxattr and other interfaces provided by the storage metadata service to complete the metadata update.
[0041] Data read and write operations: The crush algorithm is used to calculate the disk to which the data update points, and osdc interacts with osd to complete the reading and writing.
[0042] Compared with the prior art, this application has achieved the following technical effects:
[0043] This application achieves compatibility with system platforms such as Windows, Mac OS, and Linux; provides file system clients under different operating systems, which can directly access the storage service client. Compared with the NAS protocol, it saves the overhead of the NAS protocol layer and has better performance; it can monitor the performance of cross-platform clients and provide feedback in the form of charts; it realizes the client interface display and consistent interactive operations of each platform; it can quickly mount the Ceph distributed file system through various platforms, and can conveniently upload, download, edit, delete and other operations on files. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The present application is further described in detail below with reference to the accompanying drawings and specific implementation methods:
[0045] Figure 1 is a system block diagram of the present invention;
[0046] Figure 2 This is a workflow diagram of the file system client in Example 1;
[0047] Figure 3 This is a workflow diagram for file uploading in Example 1. DETAILED DESCRIPTION
[0048] In order to more clearly illustrate the technical solution of the present application, further description will be given below in conjunction with various embodiments.
[0049] like Figure 1-3 Example 1 is shown:
[0050] A cross-platform client implementation method based on distributed storage includes the following steps:
[0051] Establishing a client architecture of a distributed storage system, wherein the client architecture of the distributed storage system includes a presentation layer, a business layer, and a data storage layer;
[0052] Among them: Electron, which is used in the business layer, embeds Node.js and Chromium, so a JavaScript, HTML, and CSS code repository can be maintained in the presentation layer to create cross-platform applications on Windows, MacOS, and Linux, without the need for development experience in each system;
[0053] The web-based development technology (React.js, HTML, CSS) is used to build the technical architecture of the presentation layer. React.js is used as a JavaScript development framework to complete the interactive logic processing, HTML completes the web document structure, and CSS renders the style of the web document structure.
[0054] The presentation layer provides interactive operations such as connecting to the storage server, logging in, selecting the mount drive letter for mounting (Windows), direct mounting (Mac OS, Linux), and file or folder selection. When mounting, on the one hand, it completes user authentication with the server based on the logged-in user information. On the other hand, according to the monips recorded in the configuration file, it obtains monmap, mdsmap, osdmap and other information. Create mon client, mds client, osd client, and establish connections with mon, mds and other services. The main function of monclient, mds client, and osd client is to communicate with mon, mds, and osd on the storage service side to support the completion of file system reading and writing operations.
[0055] The server information, login information, mount information, and file read and write information entered and read by the presentation layer in the previous step are stored in the presentation layer's database to provide interactive operations such as server information caching, user information caching, automatic login, automatic mount, and file read and write record query.
[0056] After storing the mount information, it will communicate with the storage to perform the file system mount operation, specifically, including: distinguishing the operating system, if the operating system is Linux, use commands to mount; if the operating system is MacOS, use AppleScript to mount; if the operating system is Windows, select the drive letter to be mounted for mounting; determine whether the mount is successful, if the mount fails, check the mount error and return to the previous step; otherwise, complete the mount.
[0057] After selecting a file or folder, the path information of the file or folder is transmitted to the business layer. After the business layer obtains the file information through the file or folder path, it will communicate with the storage layer for uploading. The specific uploading steps include: caching multiple files to be uploaded; registering the file address list as multiple upload tasks; distinguishing the operating platform; initiating a file upload task; clearing the file cache address; refreshing the file upload queue and determining whether the current queue is empty; uploading a task and determining whether to split; cutting the fragments and uploading, and updating the fragment information returned by the request until the fragment cutting is completed; verifying and assembling all fragment information; completing the current file upload. After the upload is completed, the file information, upload status and other information are stored in the business layer database, and then displayed in the presentation layer.
[0058] The specific processing of the file system interface is mainly divided into metadata operation and data operation. When operating metadata, the client communicates directly with mds through mds client, obtains the file caps lock, and calls the setxattr and other interfaces provided by the storage metadata service to complete the metadata update. When reading and writing data, the client uses the crush algorithm to calculate which disks need to be updated, and then osdc interacts with osd to complete the reading and writing.
[0059] It should be noted that Windows, Mac OS, and Linux provide different file system clients.
[0060] By adopting the above technical solution:
[0061] A method for unified access to Ceph distributed storage system on different system platforms is implemented, and a cross-platform client is implemented. When using this client on different system platforms, you can: access files in Ceph distributed file system and read and write these files or write new files; mount Ceph distributed file system locally; share files with other users; control user read and write permissions in fine granularity; automatically restore the connection with the network when disconnected; file names can use any character set, not limited to character sets designed for English or Western European languages.
[0062] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. The protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A cross-platform client implementation method based on distributed storage, characterized in that: The steps include: Step 1: Establishing a client architecture of a distributed storage system, wherein the client architecture of the distributed storage system includes a presentation layer, a business layer, and a data storage layer; The presentation layer is used to provide a general display interface and interaction specifications; The business layer is used to provide an installation package corresponding to the operating system and implement mounting and uploading of the file system client; The data storage layer is used to realize data reading, writing and monitoring; Step 2: Complete the mounting of the file system client for different operating systems; Step 3: Complete file upload for different operating systems; Step 4: Complete the interface processing of the file system; The step 1 comprises: Step 11: Design the technical architecture for the presentation layer, use React.js as the R&D framework to implement interactive logic processing, use HTML to implement the web document structure, and use CSS to implement the style rendering of the web document structure; Step 12: Embed Node.js and Chromium into Electron used in the business layer.
2. The cross-platform client implementation method based on distributed storage as claimed in claim 1, characterized in that: The step 2 comprises: Step 21: Connect and log in to the storage server, select the mount drive letter to mount; Step 22: Complete user authentication with the server based on the logged-in user information, and obtain monmap, mdsmap, and osdmap based on monips recorded in the configuration file, create mon client, mds client, and osd client, and establish connections with mon, mds, and osd services; Step 23: The server information, login information, mount information, and file read and write information entered and read by the presentation layer are stored in the database of the presentation layer to provide interactive operations such as query, display, and editing of server information cache, user information cache, login information, automatic mount, and file read and write record information; Step 24: Distinguish the operating system. If the operating system is Linux, use the command to mount; if the operating system is MacOS, use AppleScript to mount; if the operating system is Windows, select the drive letter to be mounted; Step 25: Determine whether the mounting is successful. If the mounting fails, jump to step 26; otherwise, jump to step 27; Step 26: Check for mount errors and jump to step 24; Step 27: Complete the mount.
3. The cross-platform client implementation method based on distributed storage as claimed in claim 2, characterized in that: The step 3 comprises: Step 31: After selecting a file or folder, the path information of the file or folder is transmitted to the business layer; Step 32: The business layer obtains the file information based on the file or folder path and then communicates with the storage layer; Step 33: Cache multiple files to be uploaded; Step 34: Register the file address list as multiple upload tasks; Step 35: Distinguish the operating platform; Step 36: Initiate a file upload task; Step 37: Clear the file cache address; Step 38: Refresh the file upload queue and determine whether the current queue is empty. If the current queue is empty, end the process, otherwise jump to step 37; Step 39: Upload a task and determine whether it is fragmented. If it is fragmented, jump to step 310, otherwise jump to step 312; Step 310: Cut the fragments and upload them, and update the fragment information returned by the request until the fragment cutting is completed; Step 311: Verify and assemble all fragmentation information; Step 312: Complete the current file upload and jump to step 38; Step 313: Store the file information, upload status and other information in the business layer database, and then display it in the presentation layer and provide editing interaction operations.
4. The cross-platform client implementation method based on distributed storage as claimed in claim 2, characterized in that: The step 4 comprises: Metadata operation: The client communicates directly with MDS through MDS client, obtains the file caps lock, and then calls the file system interface provided by the storage metadata service to complete the metadata update; Data read and write operations: The crush algorithm is used to calculate the disk to which the data update points, and osdc interacts with osd to complete the reading and writing.
Citation Information
Patent Citations
Cross-platform mobile safety comprehensive information aggregation system and method adopting same
CN103577568A
Inventory and distribution management system based on cloud computing
CN104050553A
Real-time webpage synchronization and background distributed data storage system
CN104156465A
Distributed file processing method and device
CN107070972A
Ceph distributed storage system-based multi-client writing method
CN108595109A
