A method for sharing network-attached storage files on the public network

By generating JWT permission tokens and OAuth2.0 authorization mechanism, combining access passwords and file MD5 values, and using SSL encryption technology, the security issues of NAS storage devices sharing files on the public network are solved, achieving safe and fast file sharing and improving user experience.

CN116527657BActive Publication Date: 2025-09-05SHENZHEN C-DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310487124.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2025-09-05
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing NAS storage devices have low security issues when sharing files on the public network. In particular, the FTP protocol's plain text transmission and the DLNA protocol do not support encrypted transmission, resulting in a high risk of data leakage. Existing encrypted transmission solutions such as the WebDAV protocol are slow or complex to configure, resulting in a poor user experience.

Method used

By generating JWT permission tokens and OAuth2.0 authorization mechanism, combining file configuration data such as access passwords and file MD5 values, generating secure URL addresses, and using SSL encryption technology for transmission, the security and integrity of files are ensured.

Benefits of technology

It enables safe and fast file sharing on the public network, improves the security of data transmission and user experience, avoids the risk of data leakage, and simplifies the sharing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116527657B_ABST
    Figure CN116527657B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of network-attached storage (NAS), and specifically to a method for sharing NAS files over the public network. The method comprises: a terminal user triggering a request to create a shared file link by accessing a Web API on a NAS storage device; upon receiving the request, the NAS storage device generates a JWT authorization token containing the path to the accessed file and the accessibility information; the terminal user reports the obtained JWT authorization token and other file configuration data to the server; the server binds the obtained data to at least one transit server that can access the public network through OAuth2.0 authorization; after the server and the transit server are bound, the transit server obtains the JWT authorization token authorized by the server and the file information to be accessed, and generates a URL address by splicing the file information to be accessed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network attached storage, and in particular to a method for sharing network attached storage files on a public network. Background Art

[0002] Network Attached Storage (NAS) is the process of connecting storage devices to terminal devices through a standard network topology (such as Ethernet). NAS is a component-level storage method that focuses on helping to solve the need for rapidly increasing storage capacity. Simply put, it is a device connected to the network with data storage capabilities, so it is also called "network storage." NAS is a dedicated data storage server. NAS is data-centric, completely separating storage devices from servers and centrally managing data, thereby freeing up bandwidth, improving performance, reducing total cost of ownership, and protecting investments. Its cost is much lower than using server storage, while its efficiency is much higher than the latter;

[0003] NAS is a data storage device that connects to computers, servers, or other devices over a network, providing file sharing, backup, and data storage. It is typically a standalone hardware device with its own operating system and management interface, which can be configured and managed via a webpage or specialized software. Its advantages include ease of expansion, high reliability, remote access, and support for multi-user sharing, making it suitable for use in homes, small offices, and small and medium-sized businesses.

[0004] There are five types of files currently shared on the public network by NAS devices:

[0005] 1. FTP Server: Most NAS devices support the FTP protocol, allowing you to share files on the public internet. Users can use an FTP client to connect to the NAS device and download or upload files. However, FTP uses plain text transmission, making it less secure and susceptible to hacker attacks and data leaks.

[0006] 2. WebDAV Server: WebDAV is a file sharing protocol based on HTTP. It allows you to share files on the public internet through a WebDAV server. Users can connect to the NAS device using a WebDAV-compatible application or browser to download or upload files. WebDAV supports SSL encrypted transmission, which offers high security, but also slows down transmission speeds.

[0007] 3. Cloud Station: NAS manufacturers such as Synology and QNAP offer their own file syncing and sharing services, such as Synology's Cloud Station and QNAP's Qsync. These services offer client and mobile applications for file syncing and sharing, supporting SSL encrypted transmission for enhanced security. However, Cloud Station only works with Synology hardware; users without Synology hardware will not be able to use the service.

[0008] 4. Samba / CIFS Server: Samba / CIFS is a cross-platform file sharing protocol that allows you to share files on Windows, Linux, Mac, and other systems. Users can connect to the NAS device using a Samba / CIFS client to download or upload files. The Samba / CIFS protocol supports encrypted transmission, providing high security, but configuration is complex.

[0009] 5. DLNA Server: DLNA is a standard developed by the Digital Media Device Alliance that allows multimedia files to be shared with DLNA-compatible devices, such as smart TVs and speakers. Users can connect to NAS devices through a DLNA client to play multimedia files. The DLNA protocol does not support encrypted transmission and is less secure, making it suitable only for multimedia file sharing.

[0010] Therefore, the present invention aims to provide a simple, safe and efficient solution for sharing files on a NAS storage device over a public network to meet the needs of users for sharing files on a public network. Summary of the Invention

[0011] The object of the present invention is to provide a method for sharing files on a network-attached storage (NAS) over a public network, so as to solve the problem in the above-mentioned background art that NAS storage devices cannot directly share files securely over a public network.

[0012] To achieve the above objectives, the present invention widely applies a network-attached storage file sharing technical solution, and in particular provides the following technical solution: a method for sharing network-attached storage files on a public network, comprising:

[0013] The terminal user triggers a request to create a shared file link by accessing the Web API of the NAS storage device;

[0014] When the NAS storage device receives the request, it generates a JWT permission token containing the path to the access file and the access rights.

[0015] The terminal user reports the obtained JWT authorization token and other file configuration data to the server, and the server binds the obtained data to at least one server that can access the transit server through the public network through OAuth2.0 authorization;

[0016] After the server is bound to the transit server, the transit server obtains the JWT permission token authorized by the server and the file information that needs to be accessed, and generates a URL address by splicing the file information that needs to be accessed, and returns the URL address to the terminal user. The terminal user can access the corresponding shared files in the NAS storage device through the URL address.

[0017] Preferably, generating the URL address includes using String concatenation to generate the URL address by concatenating various parts of the URL using character strings.

[0018] Preferably, generating the URL address further comprises using Java to provide a URL class, generating a URL object through a constructor or a static method, and then calling its toString() method to obtain the generated URL address.

[0019] Preferably, the generated URL address includes: HTTP protocol header, relay server address, port number, file path and file name.

[0020] Preferably, the file configuration data includes an access password, and the access password is used to provide additional security protection for the shared file;

[0021] The terminal user can set an access password. After setting the access password, other terminal users can access the file by entering the correct access password.

[0022] Preferably, the file configuration data further includes a file MD5 value, which is used to verify the integrity of the file when the terminal user reports the file information to the server for authorization binding;

[0023] When generating a JWT authorization token, the file MD5 value is added to the Payload.

[0024] Preferably, when the public network accesses the transit server for binding association, an MD5 check is also performed on the file to ensure the integrity of the file. If the check fails, it means that the file may have been tampered with and the transit server will deny access.

[0025] Preferably, when the public network accesses the transit server for binding association, it also includes using SSL encryption technology for encrypted transmission.

[0026] Preferably, the OAuth2.0 is an authorization framework for authorizing third-party applications to access user resources.

[0027] Preferably, the transit server obtains the authority token authorized by the server and the file information to be accessed including the path and name of the file.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] (1) The present invention uses OAuth2.0 authorization to enable end users to authorize third-party applications to access their resources while protecting the end users' passwords and other sensitive information; and through file configuration data including token validity period, access password, and file MD5 value, wherein the access password is used to provide additional security protection for shared files. End users can set an access password. For other users, only after entering the correct access password can they access the shared files; at the same time, the file D5 value is used to verify the integrity of the file when the end user reports the file information to the server for authorization binding; if the verification fails, it means that the file may have been tampered with, and the transit server will deny access; this ensures the security and reliability of the file and effectively avoids risks such as file leakage;

[0030] (2) The present invention generates a URL address. After the terminal user receives the URL address that can be used to transfer and access the file, it can be shared to the public network. Other terminal users who do not have access rights to the storage device can use the URL address to point to the NAS storage device to browse the shared files. The URL address can also be shared through social media and other methods. This design makes it convenient for users to choose their favorite way to share, which improves the user experience. At the same time, the user sharing method is simple, which can greatly save time and energy. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION

[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0033] See also Figure 1 , an embodiment provided by the present invention:

[0034] A method for sharing network-attached storage files on a public network, comprising:

[0035] The terminal user triggers a request to create a shared file link by accessing the Web API of the NAS storage device;

[0036] When the NAS storage device receives the request, it generates a JWT permission token containing the path to the access file and the accessible file. JWT (JSON Web Token) is an open standard for authentication and authorization (RFC7519). It is a lightweight security token based on the JSON format and consists of three parts: Header, Payload, and Signature.

[0037] The terminal user reports the obtained JWT authorization token and other file configuration data to the server, and the server binds the obtained data to at least one server that can access the transit server through the public network through OAuth2.0 authorization;

[0038] After the server is bound to the transit server, the transit server obtains the JWT permission token authorized by the server and the file information that needs to be accessed, and generates a URL address by splicing the file information that needs to be accessed, and returns the URL address to the terminal user. The terminal user can access the corresponding shared files in the NAS storage device through the URL address.

[0039] In this embodiment, generating the URL address includes using string concatenation to concatenate various parts of the URL using strings to generate the URL address, wherein the strings used for each part include a transfer server address, a port number, an authorization token, a file path, and a file name;

[0040] Specifically, a URL address is generated through String url = "https: / / <transit server address>:<port number> / <authorization token> / <file path> / <file name>".

[0041] In this embodiment, generating the URL address further includes using a URL class provided by Java and generating a URL object through a constructor or a static method, and then calling its toString() method to obtain the generated URL address, which includes the transfer server address, port number, authorization token, file path, and file name;

[0042] Specifically, through URL url = new URL ("https: / / <transit server address>:<port number> / <authority token> / <file path> / <file name>");

[0043] String urlString=url.toString().

[0044] In this embodiment, the generated URL address includes: HTTP protocol header, relay server address, port number, file path and file name;

[0045] Specifically, when the transit server generates the access URL address, it obtains the server-authorized permission token and the file information to be accessed, including the file path and file name. This information is then used to assemble a complete URL address, including the HTTP protocol header, transit server address, port number, file path and name, and finally the generated URL address is returned to the end user. The end user can use this address to access the corresponding shared file on the storage device. This is done using the HTTP protocol and URL address generation technology.

[0046] In this embodiment, the file configuration data includes an access password, which is used to provide additional security protection for the shared file;

[0047] Among them, the terminal user can set an access password. After setting the access password, other terminal users can access the file by entering the correct access password. HTTP protocol and JSON format data exchange can be used here.

[0048] In this embodiment, the file configuration data also includes a file MD5 value, which is used to verify the integrity of the file when the terminal user reports the file information to the server for authorization binding;

[0049] Among them, when generating the JWT permission token, the file MD5 value is added to the Payload. When the public network accesses the transit server for binding, the file will also be checked by MD5 to ensure the integrity of the file. If the check fails, it means that the file may have been tampered with and the transit server will deny access.

[0050] In this embodiment, when the public network accesses the transit server for binding association, it also includes using SSL encryption technology for encrypted transmission;

[0051] Specifically, in order to ensure the security of data transmission, SSL (Secure Sockets Layer) encryption technology is used for encrypted transmission. SSL encrypts data and protects data integrity by creating a secure channel between the server and the end user when the transit server bridges access files, preventing man-in-the-middle attacks and data leakage. The specific implementation method is to set the protocol header to HTTPS when generating the access URL address, so that the transit server will communicate with the end user through the HTTPS protocol to ensure the security of data transmission.

[0052] In this embodiment, the OAuth2.0 is an authorization framework used to authorize third-party applications to access user resources;

[0053] Among them, end users' photos, videos, contact lists, etc. The design of OAuth2.0 is to enable users to authorize third-party applications to access their resources while protecting users' passwords and other sensitive information.

[0054] In this embodiment, the transit server obtains the authority token authorized by the server and the file information to be accessed including the file path and file name.

[0055] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.

Claims

1. A method for sharing network-attached storage files on a public network, characterized by: include: The end user triggers a request to create a shared file link by accessing the Web API of the NAS storage device; When the NAS storage device receives the request, it generates a JWT permission token containing the path to the access file and the access rights. The terminal user reports the obtained JWT authorization token and other file configuration data to the server, and the server binds the obtained data to at least one transit server that can be accessed from the public network through OAuth2.0 authorization; After the server is bound to the transit server, the transit server obtains the JWT authorization token authorized by the server and the file information to be accessed, generates a URL address by splicing the file information to be accessed, and returns the URL address to the terminal user. The terminal user can access the corresponding shared files in the NAS storage device through the URL address; Generating the URL address includes using string concatenation to generate the URL address by concatenating the various parts of the URL using strings; Generating the URL address also includes using a Java provided URL class and generating a URL object through a constructor or static method, and then calling its toString() method to obtain the generated URL address; The generated URL address includes: HTTP protocol header, transfer server address, port number, file path and file name; The file configuration data includes an access password, which is used to provide additional security protection for the shared files; The terminal user can set an access password. After setting the access password, other terminal users can access the file by entering the correct access password.

2. The method for sharing network-attached storage files on the public network according to claim 1, characterized in that: The file configuration data also includes a file MD5 value, which is used to verify the integrity of the file when the terminal user reports the file information to the server for authorization binding; When generating a JWT authorization token, the file MD5 value is added to the Payload.

3. The method for sharing network-attached storage files on a public network according to claim 2, characterized in that: When the public network accesses the transit server for binding association, an MD5 check is also performed on the file to ensure the integrity of the file. If the check fails, it means that the file may have been tampered with and the transit server will deny access.

4. The method for sharing network-attached storage files on a public network according to claim 1, characterized in that: When the public network accesses the transit server for binding association, it also includes using SSL encryption technology for encrypted transmission.

5. The method for sharing network-attached storage files on a public network according to claim 1, characterized in that: OAuth 2.0 is an authorization framework used to authorize third-party applications to access user resources.

6. The method for sharing network-attached storage files on a public network according to claim 1, characterized in that: The transfer server obtains the permission token authorized by the server and the file information that needs to be accessed, including the file path and file name.

Citation Information

Patent Citations

  • Inter-network segment file transmission system and method

    CN106101267A