File storage and sharing method, device, equipment and system based on WeChat applet

By leveraging the collaboration between WeChat Mini Programs, the main server, and business servers, and utilizing WeChat's official authentication mechanism and temporary tokens, convenient file storage, downloading, previewing, and sharing within the enterprise intranet are achieved. This resolves the conflict between data security and convenient collaboration in existing technologies, and provides refined permission management and a seamless access experience.

CN121509422APending Publication Date: 2026-02-10HUNAN KYLIN XINAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511759715.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve convenient file storage, efficient online collaboration, and granular permission control while ensuring the security of enterprise data storage within the intranet, especially lacking seamless integration and granular permission management within the WeChat ecosystem.

Method used

By working collaboratively with the main server and business servers through WeChat mini programs, the system verifies user identity using WeChat's official authentication mechanism, generates temporary tokens, updates the network request base address, and communicates directly with the business servers on the enterprise's intranet to enable file storage, download, preview, and sharing.

Benefits of technology

While ensuring the security of data storage within the intranet, it enables convenient file storage, efficient online collaboration, and granular permission management, providing a seamless WeChat ecosystem access experience and efficient permission control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509422A_ABST
    Figure CN121509422A_ABST
Patent Text Reader

Abstract

The invention discloses a file storage and sharing method, device, equipment and system based on a WeChat applet, and relates to the technical field of computer information and data security, and the method comprises the steps that a user obtains a temporary login credential through the WeChat applet and sends the temporary login credential to a main server, the main server verifies a forwarding WeChat server to obtain a unique identifier of the user, inquires a routing database to obtain routing information, generates a temporary token with a signature, and returns the temporary token to the applet; the base address of the applet update request is the routing information, and caching the temporary token; a subsequent file operation instruction is combined with the token to generate an operation request, and the operation request is sent to the business server for execution; and after the server feeds back a result, the applet stores and shares the file according to the result. According to the invention, on the premise of ensuring the safety of enterprise data intranet storage, convenient file storage, efficient online collaboration and refined permission management and control can be realized by means of WeChat ecology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer information and data security technology, and in particular to file storage and sharing methods, apparatuses, devices and systems based on WeChat mini programs. Background Technology

[0002] With the widespread adoption of mobile internet and the acceleration of enterprise digital transformation, businesses and organizations have an increasingly urgent need for secure file storage, efficient sharing, and collaborative work. Especially in sectors with extremely high data security requirements, such as finance, improving employee convenience and collaboration efficiency on mobile devices while ensuring core business data is not leaked has become a key business need. WeChat, as a national-level application, offers an ideal platform for building a lightweight and efficient office portal due to its mini-program ecosystem, which requires no installation and is ready to use immediately.

[0003] Currently, the mainstream file storage and sharing solutions on the market mainly include public cloud storage and traditional enterprise self-built cloud storage or FTP (File Transfer Protocol) systems. Public cloud services rely on third-party servers to store data, posing a risk of leakage of sensitive enterprise information. Furthermore, their sharing mechanisms have loose access control, typically only supporting password-protected links, failing to achieve fine-grained management such as departmental or role-based authorization or setting expiration dates, thus failing to meet enterprise security management requirements. While traditional enterprise cloud storage can achieve localized deployment and ensure data security, it often requires a separate client or a complex web login process, disconnecting from commonly used office tools like WeChat, resulting in a poor mobile user experience and difficulties in promotion. In addition, traditional methods such as email attachments are prone to version inconsistencies, and most files must be downloaded before viewing, lacking online preview functionality, severely hindering real-time collaboration efficiency. Therefore, how to achieve convenient file storage, efficient online collaboration, and fine-grained access control within the WeChat ecosystem while ensuring the security of enterprise data intranet storage has become an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this application is to provide a file storage and sharing method, device, equipment and system based on WeChat Mini Programs, aiming to solve the technical problem of how to achieve convenient file storage, efficient online collaboration and fine-grained permission control with the help of the WeChat ecosystem while ensuring the security of enterprise data intranet storage.

[0005] To achieve the above objectives, this application proposes a file storage and sharing method based on WeChat Mini Programs. The method is applied to a WeChat Mini Program within a file storage and sharing system. The file storage and sharing system further includes a main server, a business server, and a WeChat server. The method includes: The system sends the user's temporary login credentials to the main server, which then sends the temporary login credentials to the WeChat server and provides feedback on the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server by querying the routing database based on the user's unique identifier, and the temporary token is generated based on the routing information. The user's unique identifier is provided by the WeChat server after verifying the temporary login credentials. The network request base address is updated according to the routing information, and the temporary token is stored in the local cache; Receive the user's file operation instructions, and generate an operation request based on the file operation instructions and the temporary token; The operation request is sent to the business server according to the network request base address, so that the business server can provide the operation result. Files are stored and shared based on the results of the operation.

[0006] In one embodiment, the operation request includes an upload request and a download request; The step of receiving the user's file operation instruction and generating an operation request based on the file operation instruction and the temporary token includes: Receive the user's file operation instructions and construct a request header based on the file operation instructions and the temporary token; When the file operation instruction is a file upload instruction, a request body is constructed based on the file to be uploaded selected by the user, and an upload request is generated based on the request header and the request body; When the file operation instruction is a file download instruction, a request body is constructed based on the file identifier of the file to be downloaded specified by the user, and a download request is generated based on the request header and the request body.

[0007] In one embodiment, the operation request includes a preview request and a share request; The step of receiving the user's file operation instruction and generating an operation request based on the file operation instruction and the temporary token includes: Receive the user's file operation instructions and construct a request header based on the file operation instructions and the temporary token; When the file operation instruction is a file preview instruction, a request body is constructed based on the file identifier of the file to be previewed specified by the user, and a preview request is generated based on the request header and the request body; When the file operation instruction is a file sharing instruction, a request body is constructed based on the file identifier of the file to be shared and preset sharing parameters specified by the user, and a sharing request is generated based on the request header and the request body.

[0008] In one embodiment, the step of storing and sharing files based on the operation result includes: If the operation results in a successful file storage message, a success message will be displayed, and the file list in the personal space or shared space will be updated. If the operation results in a file storage failure message, a reason for the storage failure will be displayed, including insufficient storage space and unsupported file format. If the result of the operation is file sharing link information, then the file sharing link information is displayed; If the result of the operation is a file preview link, then the file preview link is loaded and the file content is displayed through the built-in preview component; If the result of the operation is a file download address, then the file download address information will be displayed.

[0009] Furthermore, to achieve the above objectives, this application also proposes a file storage and sharing method based on a WeChat mini-program. The method is applied to the business server of a file storage and sharing system, which further includes a WeChat mini-program, a main server, and a WeChat server. The method includes: Receive an operation request sent by a WeChat mini program, and extract file operation instructions and a temporary token from the operation request; The temporary token is verified to obtain the verification result; When the verification result indicates that the token is invalid, a preset error code will be sent to the WeChat mini program; When the verification result indicates that the token is valid, the temporary token is decoded to obtain the user's unique identifier; The file operation instruction is executed according to the user's unique identifier, the operation result is obtained, and the operation result is sent to the WeChat mini program to complete the file storage and sharing.

[0010] In one embodiment, the step of executing the file operation instruction based on the user's unique identifier and obtaining the operation result includes: When the file operation instruction is a file upload instruction, the permission database is queried according to the user's unique identifier. After confirming that the user has file upload permission, the file to be uploaded in the operation request is encrypted and stored, and a file storage success message is generated as the operation result. When the file operation instruction is a file download instruction, the permission database is queried based on the user's unique identifier. After confirming that the user has file download permissions, the file storage path is queried based on the file identifier of the file to be downloaded in the operation request, and the corresponding file download address information is generated as the operation result based on the file storage path.

[0011] In one embodiment, the step of executing the file operation instruction based on the user's unique identifier and obtaining the operation result includes: When the file operation instruction is a file preview instruction, the permission database is queried according to the user's unique identifier. After confirming that the user has file preview permissions, the corresponding target preview file is read according to the file identifier of the file to be previewed in the operation request. The target preview file is converted into a preset preview format and file preview link information is generated as the operation result. When the file operation instruction is a file sharing instruction, the permission database is queried based on the user's unique identifier. After confirming that the user has file sharing permissions, the file to be shared is copied from the personal space to the shared space according to the file identifier of the file to be shared in the operation request. File sharing link information is generated as the operation result according to preset sharing parameters.

[0012] Furthermore, to achieve the above objectives, this application also proposes a file storage and sharing device based on WeChat Mini Programs, the device comprising: The credential transmission module is used to send the user's temporary login credentials to the main server, so that the main server sends the temporary login credentials to the WeChat server and feeds back the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server by querying the routing database based on the user's unique identifier. The temporary token is generated based on the routing information. The user's unique identifier is fed back by the WeChat server after verifying the temporary login credentials. The address update module is used to update the network request base address according to the routing information and store the temporary token in a local cache; The request generation module is used to receive the user's file operation instructions and generate an operation request based on the file operation instructions and the temporary token; The request sending module is used to send the operation request to the business server according to the network request base address, so that the business server can provide the operation result; The result processing module is used to store and share files based on the operation results.

[0013] In addition, to achieve the above objectives, this application also proposes a file storage and sharing device based on WeChat Mini Programs. The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is configured to implement the steps of the file storage and sharing method based on WeChat Mini Programs as described above.

[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the file storage and sharing method based on WeChat mini-programs as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a file storage and sharing system based on WeChat Mini Programs, the system including the WeChat Mini Programs and / or the business servers described above.

[0016] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the file storage and sharing method based on WeChat Mini Programs as described above.

[0017] One or more technical solutions proposed in this application have at least the following technical effects: First, the user initiates login within the WeChat mini-program. The mini-program obtains a temporary login credential and sends it to the main server. The main server forwards the temporary login credential to the WeChat server for verification to confirm the user's identity. This step utilizes WeChat's official authentication mechanism to ensure the legitimacy and uniqueness of the user's identity. Second, after successful verification by the WeChat server, a unique user identifier is returned. The main server queries the routing database based on this identifier to determine the routing information of the user's company and generates a temporary token signed using a shared key. The routing information and the temporary token are then returned to the mini-program. Upon receiving this, the mini-program updates its network request base address to the address of the business server and stores the temporary token in its local cache. This process dynamically binds the user to the enterprise server, providing a foundation for subsequent direct communication. Then, when the user performs a file operation, the mini-program generates a request carrying the temporary token based on the operation type and sends it directly to the business server on the enterprise's intranet via the updated base address. The business server verifies the token and processes the request after passing permission checks, returning the operation result. The mini-program then stores and shares the file based on the operation result, completing the interaction. This application utilizes a "cloud-based control + local deployment" architecture to complete authentication and routing without accessing business data, ensuring that core data remains within the enterprise's intranet. Therefore, it leverages the WeChat ecosystem to achieve convenient file storage, efficient online collaboration, and granular access control while guaranteeing the security of enterprise data storage within the intranet. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an embodiment of the file storage and sharing method based on WeChat Mini Programs in this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the file storage and sharing method based on WeChat Mini Programs in this application; Figure 3 This is a schematic diagram of the system architecture of the file storage and sharing method based on WeChat Mini Program provided in Embodiment 2 of this application; Figure 4 A schematic diagram of the module structure of the business server for the file storage and sharing method based on WeChat Mini Programs provided in Embodiment 2 of this application; Figure 5 This is a schematic diagram illustrating the authentication interaction of the file storage and sharing method based on WeChat Mini Programs provided in Embodiment 2 of this application. Figure 6 This is a schematic diagram of the module structure of the file storage and sharing device based on WeChat Mini Program according to an embodiment of this application; Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the file storage and sharing method based on WeChat Mini Program in the embodiments of this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0024] It should be noted that the executing entity of this application embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or file storage and sharing system capable of realizing the above functions. The following description uses a file storage and sharing system as an example to illustrate this embodiment and the subsequent embodiments.

[0025] Based on this, this application provides a file storage and sharing method based on WeChat Mini Programs, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the file storage and sharing method based on WeChat Mini Programs in this application.

[0026] In this embodiment, the file storage and sharing system includes a WeChat mini-program, a main server, a business server, and a WeChat server. The file storage and sharing method based on the WeChat mini-program applied to the file storage and sharing system includes steps S10 to S40: Step S10: Send the user's temporary login credentials to the main server, so that the main server sends the temporary login credentials to the WeChat server and feeds back the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server by querying the routing database based on the user's unique identifier. The temporary token is generated based on the routing information. The user's unique identifier is fed back by the WeChat server after verifying the temporary login credentials.

[0027] It's important to note that a WeChat Mini Program is a front-end application for users to perform file operations, providing interactive interfaces for uploading, downloading, previewing, and sharing files. The main server is a lightweight routing and authentication relay server deployed on a public cloud. Its primary function is to receive requests from WeChat Mini Programs, query and bind the user's business server, and distribute and route requests. The business server is a localized server deployed within an enterprise or organization's intranet environment. It stores actual business data, including file content, metadata, and permission information, and handles specific file management business logic. The WeChat server is the official server provided by Tencent, used to verify user identity and provide standard authentication interfaces to ensure the security and uniqueness of user logins. The temporary login credential (code) is a one-time authorization code obtained by the WeChat Mini Program after calling the wx.login() interface, used to exchange for the user's unique identifier and session key from the WeChat server. Routing information refers to the target business server access address returned by the main server to the WeChat Mini Program, i.e., the file server domain name or IP path of the user's enterprise, used for subsequent direct communication. A temporary token (access_token) is a short-term valid identity credential generated by the main server. It uses JWT (JSON Web Token) format and is signed with a key shared by the main server and the business server. The payload (the part of the JWT token containing actual information) includes the user's unique identifier, company ID, and expiration time, used by the business server to authenticate user requests. The user's unique identifier (openid) is a unique string returned by the WeChat server after verifying the validity of the temporary login credential, representing the user's unique identity within the current mini-program or WeChat Open Platform. The routing database refers to the data tables or storage structure maintained on the main server, recording the mapping relationship between user identifiers (such as mobile phone numbers or openid ranges) of all registered enterprises and their corresponding business server domain names.

[0028] As is understandable, firstly, when a user launches the WeChat Mini Program, the `wx.login()` interface is called to obtain a temporary login credential `code`, and this `code` is sent to the main server via a network request. Secondly, after receiving the `code`, the main server forwards it to the WeChat server for verification. Once the WeChat server confirms the `code` is valid, it returns the corresponding user's unique identifier, `openid`. The main server then uses `openid` as an index to query the routing database for the business server address of the user's company, obtains routing information, and generates a temporary token containing the user's identity and validity period based on this information. This temporary token is then returned to the WeChat Mini Program along with the routing information. Finally, upon receiving the response, the WeChat Mini Program uses the business server address as the target domain for subsequent requests and stores the temporary token in its local cache for use as authentication credentials for future access. This approach achieves secure user authentication and dynamic location of service addresses: by handing the code over to the main server for verification by the WeChat server, the legitimacy of the login source is ensured; the main server only participates in route discovery without accessing business data, reducing the risk of core data exposure; and by returning the generated temporary token and routing information to the mini-program, all subsequent file operations can directly communicate with the business server on the enterprise's intranet, ensuring data storage security and achieving a seamless access experience based on the WeChat ecosystem.

[0029] Step S20: Update the network request base address according to the routing information and store the temporary token in the local cache.

[0030] It's important to note that the network request base address refers to the unified root path used by the WeChat Mini Program during runtime to construct all subsequent business interface requests (i.e., the domain name or IP address of the target server plus its port; the target server refers to the final receiving server to which the WeChat Mini Program sends specific business requests after completing route discovery). This address determines the target server to which the Mini Program sends HTTP requests. In this embodiment, the base address initially configured for the Mini Program is the address of the main server; after obtaining routing information, the network request base address is updated to the address of the business server of the user's enterprise, thereby ensuring that all subsequent file operation requests are directly sent to the business server deployed on the enterprise's intranet.

[0031] Step S30: Receive the user's file operation instruction and generate an operation request based on the file operation instruction and the temporary token.

[0032] It's important to note that file operation instructions refer to specific actions performed by the user within the WeChat Mini Program interface, such as clicking the "Upload File" button, long-pressing a file and selecting "Download," clicking a document to trigger "Preview," or clicking "Share" to generate an external link. These are business intent instructions generated by user interaction. An operation request, on the other hand, is an HTTP network request constructed by the WeChat Mini Program based on the user's file operation instructions. The target address of this request is the updated business server base address. The request header carries a locally cached temporary token for authentication, and the request body contains information such as the operation type, target file ID, and parameter configurations (e.g., sharing settings), used to initiate a specific file processing task to the business server.

[0033] As an example, the operation request includes an upload request and a download request; the step of receiving the user's file operation instruction and generating an operation request based on the file operation instruction and the temporary token includes: receiving the user's file operation instruction and constructing a request header based on the file operation instruction and the temporary token; when the file operation instruction is a file upload instruction, constructing a request body based on the file to be uploaded selected by the user, and generating an upload request based on the request header and the request body; when the file operation instruction is a file download instruction, constructing a request body based on the file identifier of the file to be downloaded specified by the user, and generating a download request based on the request header and the request body.

[0034] As an example, the operation request includes a preview request and a share request; the step of receiving the user's file operation instruction and generating an operation request based on the file operation instruction and the temporary token includes: receiving the user's file operation instruction and constructing a request header based on the file operation instruction and the temporary token; when the file operation instruction is a file preview instruction, constructing a request body based on the file identifier of the file to be previewed specified by the user, and generating a preview request based on the request header and the request body; when the file operation instruction is a file sharing instruction, constructing a request body based on the file identifier of the file to be shared specified by the user and preset sharing parameters, and generating a share request based on the request header and the request body.

[0035] An upload request is an HTTP network request sent by a WeChat Mini Program to a business server to submit new file data. This request includes the content of the file to be uploaded selected by the user and authentication information, used to store the file in the user's personal space or knowledge base. A download request is an HTTP network request sent by a WeChat Mini Program to a business server to retrieve the complete data of a stored file. This request includes the unique identifier of the target file and the user's authentication credentials, triggering the server to return the binary stream of the corresponding file for local storage. A preview request is an HTTP network request sent by a WeChat Mini Program to a business server to view file content online without downloading it. This request carries the unique identifier of the file to be viewed and an authentication token, requesting the server to return a temporary preview link that can be directly rendered within the Mini Program. A share request is an HTTP network request sent by a WeChat Mini Program to a business server to initiate an external file sharing operation. This request includes the unique identifier of the file to be shared and the access control parameters set by the user, used to generate a protected external access link. The request header is the part of the HTTP request used to transmit metadata, mainly including authentication fields (such as Authorization: Bearer + temporary token), used by the business server to verify the legitimacy of the request and the user's identity. File upload commands refer to business commands generated when a user performs the "select and upload file" operation in the WeChat Mini Program interface. This is typically triggered by clicking the "upload" button and selecting a file from the phone's photo album or file system. The request body refers to the portion of an HTTP request that carries specific business data; it's located in the request body and is used to transmit detailed parameters required for the operation or the file content itself. File download commands refer to operations triggered when a user clicks the "download" button on a listed file in the WeChat Mini Program, indicating a need to retrieve the file from the server to the local device. A file identifier is a unique number or string (e.g., 12345) representing a file in the business server database, used to accurately distinguish and locate each file resource in the system. File preview commands refer to operations triggered when a user clicks on a file in a supported format (e.g., .docx, .pdf) in the WeChat Mini Program, intending to view its content without leaving the application. File sharing commands refer to operations issued when a user performs the "share" action on a file in the WeChat Mini Program, aiming to generate a shareable link for others to access. Preset sharing parameters refer to the security control conditions that users actively set when initiating file sharing, including preset validity period (such as expiring after 7 days) and preset download count (such as allowing a maximum of 3 downloads), which are used to limit the scope and timeliness of external links.

[0036] First, upon receiving a user's file operation instruction, the WeChat Mini Program constructs a unified request header containing authentication information. This header carries a temporary token retrieved from the local cache and places it in the Authorization field for the business server to verify the user's identity. Second, it differentiates its processing based on the specific operation type: for file uploads, the Mini Program encapsulates the file data selected by the user from the phone's photo album or file system into a binary stream as the request body; for file downloads, previews, or shares, it constructs the request body based on the file identifier corresponding to the target file clicked by the user; for file sharing operations, the user-set preset sharing parameters are also written into the request body. Finally, the Mini Program combines the constructed request header with the corresponding request body to form a complete HTTP request, generating upload, download, preview, or share requests, and prepares to send them to the currently updated business server address.

[0037] Step S40: Send the operation request to the service server according to the network request base address, so that the service server can provide feedback on the operation result.

[0038] It should be noted that the operation result refers to the response data returned by the business server to the WeChat Mini Program after receiving the upload, download, preview, or share request, and after identity verification, permission verification, and business processing. This result varies depending on the operation type: for upload requests, the operation result includes a status code indicating whether the file upload was successful and a file identifier generated by the server; for download requests, the operation result is a response containing the file's binary stream, which the Mini Program can save locally; for preview requests, the operation result is a temporary preview link with a short validity period, used to display the file content in embedded components within the Mini Program; for share requests, the operation result is the generated external link address and corresponding access parameters (such as password, validity period, etc.). All operation results are returned after verifying the validity of the request and completing the processing, ensuring the security and reliability of the system.

[0039] Step S50: Store and share files based on the operation results.

[0040] As an example, the steps of storing and sharing files based on the operation result include: if the operation result is a file storage success message, a storage success prompt is displayed, and the file list in the personal space or shared space is updated; if the operation result is a file storage failure message, a reason for the storage failure is displayed, including insufficient storage space and unsupported file format; if the operation result is a file sharing link information, the file sharing link information is displayed; if the operation result is a file preview link information, the file preview link information is loaded and the file content is displayed through a built-in preview component; if the operation result is a file download address information, the file download address information is displayed.

[0041] File storage success information refers to the response data returned by the business server to the WeChat Mini Program after completing a user's file upload request, indicating that the operation has been successfully executed. This includes a status code (e.g., 200), file identifier, upload time, and other confirmation information. Personal Space refers to a private file storage area allocated by the business server to each registered user. Files in this space can only be accessed and managed by the user, used to store personal documents, and supports basic operations such as uploading, downloading, and previewing. Personal Space files support previewing common office file formats, including: .doc, .docx, .pdf, .xls, .xlsx, .ppt, .pptx, .jpg, and .png. Personal Space allows viewing file attributes, including file modification time and file size; it also allows viewing the storage capacity of the user's encrypted storage space. Shared Space refers to a temporary storage area on the business server used to store shared files. When a user initiates a file sharing operation, the system copies the original file to this space and generates an externally accessible link for other authorized users to access. File storage failure information refers to the error response returned by the business server when it fails to save a file due to a specific reason during the processing of a file upload request. It clearly identifies the failure type and the specific reason. File sharing link information refers to the data returned to the mini-program by the business server after successfully creating a file external link, including the complete URL address and associated access control parameters (such as password, validity period, and download limit). File preview link information refers to a temporary access address with a short validity period generated by the business server after completing document format conversion, pointing to a PDF or HTML version of the file that can be directly rendered and displayed in a browser or mini-program component. File download address information refers to the HTTP link generated by the business server for an uploaded or selected target file, which can be used to directly obtain the file's binary stream. It usually has a certain validity period and is used by the mini-program to trigger a local download.

[0042] First, after receiving the operation result from the business server, the WeChat Mini Program immediately parses and judges the response content. Second, it performs corresponding processing based on the specific type of the operation result: when the result is a successful file storage message, a "Upload Successful" prompt pops up on the interface, and the file list in the personal space or shared space is refreshed to display the latest uploaded file; when the result is a failed file storage message, the error code or message is parsed, and if it is identified as insufficient storage space or an unsupported file format, the corresponding failure reason prompt is displayed on the front end to help the user understand the problem; when the result is a file sharing link, a sharing card containing information such as the external link address, access password (if any), and expiration date is displayed to the user, making it easy for them to copy or forward to the WeChat chat window; when the result is a file preview link, the built-in document preview component of the Mini Program (such as wx.openDocument) is called to load the link, directly presenting the file content within the application for the user to view; when the result is a file download address, the download link is displayed as a button or prompt, which the user can click to start the local download process and save the file to the device. Finally, all feedback is presented through intuitive UI changes, ensuring that users can clearly understand the operation status and proceed with the next step.

[0043] This embodiment provides a file storage and sharing method based on WeChat Mini Programs. First, a user logs in to the WeChat Mini Program, which obtains a temporary login credential and sends it to the main server. The main server forwards the temporary login credential to the WeChat server for verification to confirm the user's identity. This step utilizes WeChat's official authentication mechanism to ensure the legitimacy and uniqueness of the user's identity. Second, after successful verification by the WeChat server, a unique user identifier is returned. The main server queries the routing database based on this identifier to determine the routing information of the user's company and generates a temporary token signed using a shared key. The routing information and the temporary token are then returned to the Mini Program. Upon receiving this, the Mini Program updates its network request base address to the address of the business server and stores the temporary token in its local cache. This process enables dynamic binding between the user and the company's server, providing a foundation for subsequent direct communication. Then, when a user performs a file operation, the mini-program generates a request carrying a temporary token based on the operation type and sends it directly to the business server on the enterprise intranet via the updated base address. The business server verifies the token and processes the request after passing the permission check, returning the operation result. The mini-program then displays a success message, failure reason, preview content, download address, or sharing link based on the operation result, completing the interaction. This embodiment, through a "cloud-based main control + local deployment" architecture, completes authentication and routing without accessing business data, ensuring that core data remains within the enterprise intranet. Therefore, it can leverage the WeChat ecosystem to achieve convenient file storage, efficient online collaboration, and granular permission control while ensuring the security of enterprise data storage within the intranet.

[0044] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the file storage and sharing method based on WeChat Mini Programs in this application. The file storage and sharing method based on WeChat Mini Programs, applied to the business server of the file storage and sharing system, includes steps S60 to S100: Step S60: Receive an operation request sent by the WeChat mini program, and extract file operation instructions and a temporary token from the operation request.

[0045] Understandably, after receiving an operation request from a WeChat mini program, the business server extracts a temporary token from the request header and parses the specific file operation instructions from the request body or request path for subsequent authentication and business processing.

[0046] Step S70: Verify the temporary token to obtain the verification result.

[0047] It should be noted that the signature verification result refers to the judgment obtained by the business server after digitally verifying the temporary token using the key shared with the main server. The result is either "valid" or "invalid"—if the token has not been tampered with, the signature matches, and it has not expired, the signature verification result is valid; otherwise, it is invalid.

[0048] Step S80: When the verification result indicates that the token is invalid, a preset error code is sent to the WeChat mini program.

[0049] It should be noted that the preset error code refers to the standardized response code that the business server uses to identify the specific error condition of "invalid token" when the verification of the temporary token fails. This code is used to notify the WeChat mini program that the current request has been rejected due to the failure of identity authentication, so that the mini program can perform subsequent processing such as logging out, re-authentication, or prompting the user.

[0050] Step S90: When the verification result indicates that the token is valid, the temporary token is decoded to obtain the user's unique identifier.

[0051] Understandably, firstly, after verifying the validity of the temporary token, the business server uses a key pre-shared with the main server to call the JWT parsing library to decode the temporary token. Secondly, the decoding process verifies the integrity of the token's signature and extracts the plaintext data from its payload, including fields such as the user's unique identifier, company ID, and expiration time.

[0052] Step S100: Execute the file operation instruction according to the user's unique identifier, obtain the operation result, and send the operation result to the WeChat mini program to complete file storage and sharing.

[0053] As an example, the step of executing the file operation instruction based on the user's unique identifier to obtain the operation result includes: when the file operation instruction is a file preview instruction, querying the permission database based on the user's unique identifier, confirming that the user has file preview permissions, reading the corresponding target preview file based on the file identifier of the file to be previewed in the operation request, converting the target preview file into a preset preview format, and generating file preview link information as the operation result; when the file operation instruction is a file sharing instruction, querying the permission database based on the user's unique identifier, confirming that the user has file sharing permissions, copying the file to be shared from the personal space to the shared space based on the file identifier of the file to be shared in the operation request, and generating file sharing link information based on preset sharing parameters as the operation result.

[0054] The permissions database refers to a data table or database module in the business server used to store the access permission relationships between users and files (or knowledge bases). It records information unique to each user, indicating whether they have permissions to preview, download, share, or edit specific files. The target preview file refers to the original file that the user requests to preview; that is, the source file (e.g., original document in .docx, .xlsx, or .pdf formats) located and read from the file storage engine based on the file identifier provided in the operation request. The preset preview format refers to a standardized format that the business server converts the target preview file into before online document preview. This format can be directly rendered by built-in components of web pages or mini-programs, typically PDF or HTML, to ensure cross-platform compatibility and a secure reading experience. The file to be shared refers to the original file that the user selects and prepares to share in the WeChat mini-program.

[0055] First, when the business server receives a file preview instruction and the permission verification is successful, it locates the physical storage path of the file in the file storage engine based on the file identifier carried in the operation request, and reads the binary data of the original target preview file (such as .docx or .xlsx) from the disk or object storage. Then, it calls the document conversion service integrated into the backend (such as the conversion module based on LibreOffice) to convert the original file into a unified preset preview format, and temporarily stores the converted file in the preview cache. Next, the server generates a unique URL path consisting of a timestamp and a random string, binds it to the converted file, and sets the link to be valid for a preset duration (such as 5 minutes), forming the file preview link information. Secondly, when a file-sharing instruction is received and the user has sharing permissions, the business server reads the complete data of the file to be shared from the storage path of the user's personal space based on the file identifier in the operation request, and copies it completely to the system's preset shared space directory, retaining the original filename and metadata. Then, combined with the preset sharing parameters submitted by the user in the request, an external link record is created in the database, including fields such as file path, access password (if any), expiration date, and remaining download count. Finally, based on the unique ID of this external link record, the complete external link address is constructed and returned to the WeChat mini program as the file-sharing link information. This ensures that the preview and sharing operations are secure and controllable—the preview file is formatted to avoid direct exposure of the original document, and the temporary link prevents long-term access; the shared file, through copy isolation and parameter control, effectively limits the scope of dissemination and usage of the external link, preventing the misuse or secondary dissemination of enterprise files.

[0056] As an example, the step of executing the file operation instruction based on the user's unique identifier to obtain the operation result includes: when the file operation instruction is a file upload instruction, querying the permission database based on the user's unique identifier, confirming that the user has file upload permissions, encrypting and storing the file to be uploaded in the operation request, and generating file storage success information as the operation result; when the file operation instruction is a file download instruction, querying the permission database based on the user's unique identifier, confirming that the user has file download permissions, querying the file storage path based on the file identifier of the file to be downloaded in the operation request, and generating corresponding file download address information based on the file storage path as the operation result.

[0057] The file to be downloaded refers to the target file that the user selects and requests to download in the WeChat mini program. This file is stored on the business server (located in personal space or shared space) and is uniquely identified by a file identifier. The file storage path refers to the complete path information on the business server used to locate the physical location of the file to be downloaded. This path is recorded in the database and corresponds one-to-one with the file identifier. It is used to accurately read the file content and generate a download address when the user has download permissions.

[0058] First, when the business server receives a file upload command and the permission verification is successful, the system extracts the original binary data of the file to be uploaded from the operation request, calls the security and encryption module, and uses a national cryptographic algorithm (such as SM4) managed by the enterprise to transparently encrypt the file content. The encryption key is not stored with the file but is maintained uniformly by the key management service. After encryption, the file is written to the physical directory corresponding to the user's personal space, and a file record is inserted into the database, containing metadata such as file identifier, original file name, encryption status, file size, and upload time. This file identifier is then bound to the user's unique identifier. Second, when processing a file download command and confirming that the user has download permissions, the business server queries the database for the corresponding file storage path and encryption status based on the file identifier of the file to be downloaded in the operation request. If the file is stored encrypted, the decryption module is called in real time to temporarily restore it to plaintext. Then, the server generates a unique temporary path based on the current timestamp and a random string, sets this path to be valid for 5 minutes, and then uses this path to construct a complete accessible URL by concatenating it with the business server's base address. Finally, for upload operations, the system combines the file identifier and a standard success status code (such as 200) to generate structured file storage success information; for download operations, the generated temporary URL is encapsulated as the file download address information, and both are returned to the WeChat mini program as operation results. This approach ensures the confidentiality of static data during storage (preventing unauthorized reading of files on the internal network) while also preventing the malicious use of long-term accessible download addresses through the temporary link mechanism, effectively balancing security and availability.

[0059] This embodiment first receives an operation request sent by a WeChat mini program and extracts file operation instructions and a temporary token from it to identify the user's intent and identity. Next, the temporary token is verified. If the token is invalid, a preset error code is returned to prevent unauthorized requests and ensure system security. If the verification result is valid, the temporary token is decoded to obtain the user's unique identifier, which is then used to execute the corresponding file operation instructions—including querying the permission database, reading or writing files, generating previews or sharing links, etc.—and the operation results are returned to the WeChat mini program. This process ensures the legitimacy of the request and the authenticity of the user's identity through token verification and decoding mechanisms. The close integration of permission verification and operation execution ensures the security and controllability of file operations, thereby achieving efficient and secure file storage and sharing based on WeChat mini programs in an enterprise intranet environment.

[0060] For example, to help understand the file storage and sharing method based on WeChat Mini Programs obtained by combining this embodiment with the above embodiment one, please refer to... Figure 3 , Figure 3 A system architecture diagram for a file storage and sharing method based on WeChat Mini Programs is provided, specifically: This diagram illustrates the overall architecture of a file storage and sharing system, whose core consists of a main server, a WeChat server, and multiple business servers. The top area represents the "business servers," which are independent file service instances deployed in different company or organization intranets, labeled "Company A," "Company B," "Company C," "Company D," and "Trial." Each business server is equipped with a mobile phone icon, representing the end user using the service (e.g., "User a," "User b," "Trial User s"). The middle area represents the "main server," serving as the system's core routing center. It contains a server icon and a mapping list that explicitly records the company to which each user belongs and its corresponding business server domain name (e.g., "https: / / test1.com.cn → Company A → User a"), used to dynamically bind user identities to target business servers. The bottom area represents the "WeChat server," containing a server icon and responsible for providing unified user authentication services. The diagram connects the various parts with bidirectional arrows: the main server is connected to the WeChat server for user authentication; the main server is connected to all business servers for querying and distributing routing information; simultaneously, two paths are drawn from each user's phone icon: one points to the main server, labeled "A1. Obtain the corresponding business domain name," indicating that the user requests a route from the main server upon first login; the other points to their respective business server, labeled "A2. Access the server directly using the corresponding business domain name," indicating that all subsequent file operation requests are sent directly to the enterprise's local business server, thus achieving the security goal of data not leaving the internal network.

[0061] Please refer to Figure 4 , Figure 4 This diagram illustrates the module structure of the business server for the file storage and sharing method based on WeChat Mini Programs provided in Embodiment 2 of this application. The upper layer of the diagram shows three functional modules arranged side-by-side: the left side is the "Personal Space Module," which provides each user with an independent private storage area, supporting personalized operations such as file upload, download, and preview; the middle side is the "File Sharing Module," responsible for copying user-selected files from the personal space to the shared space and generating a link that can be distributed externally, while also supporting the setting of access passwords, validity periods, and download limit settings; the right side is the "Authentication Module," used to receive requests from WeChat Mini Programs, verify the validity of temporary tokens, and verify user identity. Below the "File Sharing Module" is a larger dashed box containing the "Knowledge Base Module," used to manage enterprise or departmental-level public file libraries, supporting administrator creation, authorization, and approval; this module also contains a smaller dashed box labeled "Fine-grained Permission Control Submodule," specifically responsible for assigning fine-grained permissions (such as read-only, read-write, and manageable) to files or directories within the knowledge base based on department, role, or user. At the bottom layer is the security and encryption module, which runs through all the upper-layer functions. This module is responsible for transparently encrypting and storing all files uploaded to the server, ensuring data security at the physical level. The modules work together logically to achieve secure file storage, flexible sharing, and fine-grained control.

[0062] Please refer to Figure 5 , Figure 5This is a schematic diagram of the authentication interaction of the file storage and sharing method based on WeChat Mini Program provided in Embodiment 2 of this application. It consists of three layers: the top layer is the "business server", which contains an "authentication module" responsible for receiving requests from WeChat Mini Program and verifying the validity of temporary tokens to confirm user identity and access permissions; the middle layer is the "main server", which serves as the core relay node of the system and integrates three functional modules: a "company management module" for maintaining the basic information of all registered companies, a "user and company domain name binding module" for storing and querying the mapping relationship between the user's unique identifier and their company and corresponding business server domain name, and an "authentication module" for initiating an identity verification request to the WeChat server when the user logs in for the first time; the bottom layer is the "WeChat server", which also contains an "authentication module" responsible for providing official identity authentication services, verifying the temporary login credentials transmitted by the Mini Program and returning the user's unique identifier. The diagram connects the various levels with bidirectional arrows, indicating that after receiving a request from a mini-program, the main server first communicates with the WeChat server to complete user authentication. Then, based on the authentication result, it queries the business server to which the user belongs and returns the routing information and temporary token to the mini-program. Ultimately, this enables the mini-program to directly interact with the target business server for subsequent file operations, thereby decoupling authentication from business processing.

[0063] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the file storage and sharing method based on WeChat Mini Programs. Any simple modifications based on this technical concept are within the protection scope of this application.

[0064] This application also provides a file storage and sharing device based on WeChat Mini Programs. Please refer to [link / reference]. Figure 6 The file storage and sharing device based on WeChat mini-programs includes: The credential transmission module 10 is used to send the user's temporary login credentials to the main server, so that the main server sends the temporary login credentials to the WeChat server and feeds back the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server by querying the routing database based on the user's unique identifier. The temporary token is generated based on the routing information. The user's unique identifier is fed back by the WeChat server after verifying the temporary login credentials. Address update module 20 is used to update the network request base address according to the routing information and store the temporary token in a local cache; The request generation module 30 is used to receive the user's file operation instructions and generate an operation request based on the file operation instructions and the temporary token; The request sending module 40 is used to send the operation request to the service server according to the network request base address, so that the service server can provide the operation result. The result processing module 50 is used to store and share files based on the operation results.

[0065] The file storage and sharing device based on WeChat mini-programs provided in this application, employing the file storage and sharing method based on WeChat mini-programs in the above embodiments, can solve the technical problem of how to achieve convenient file storage, efficient online collaboration, and fine-grained permission control by leveraging the WeChat ecosystem while ensuring the security of enterprise data intranet storage. Compared with the prior art, the beneficial effects of the file storage and sharing device based on WeChat mini-programs provided in this application are the same as those of the file storage and sharing method based on WeChat mini-programs provided in the above embodiments, and other technical features in the file storage and sharing device based on WeChat mini-programs are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0066] This application provides a file storage and sharing device based on WeChat Mini Programs. The file storage and sharing device based on WeChat Mini Programs includes: at least one processor; and a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable at least one processor to execute the file storage and sharing method based on WeChat Mini Programs in the above embodiment 1.

[0067] The following is for reference. Figure 7 This document illustrates a structural diagram of a file storage and sharing device based on a WeChat mini-program suitable for implementing embodiments of this application. The file storage and sharing device based on a WeChat mini-program in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The file storage and sharing device based on WeChat Mini Program shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0068] like Figure 7As shown, a file storage and sharing device based on WeChat Mini Programs may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to programs stored in ROM (Read Only Memory) 1002 or programs loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the file storage and sharing device based on WeChat Mini Programs. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard drives, etc.; and communication devices 1009. Communication device 1009 allows the WeChat Mini Program-based file storage and sharing device to exchange data wirelessly or via wired communication with other devices. Although the figure shows a WeChat Mini Program-based file storage and sharing device with various systems, it should be understood that implementing or having all the systems shown is not required. More or fewer systems can be implemented alternatively.

[0069] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0070] The file storage and sharing device based on WeChat mini-programs provided in this application, employing the file storage and sharing method based on WeChat mini-programs in the above embodiments, can solve the technical problem of how to achieve convenient file storage, efficient online collaboration, and fine-grained permission control with the help of the WeChat ecosystem while ensuring the security of enterprise data intranet storage. Compared with the prior art, the beneficial effects of the file storage and sharing device based on WeChat mini-programs provided in this application are the same as those of the file storage and sharing method based on WeChat mini-programs provided in the above embodiments, and other technical features of this file storage and sharing device based on WeChat mini-programs are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0071] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0072] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0073] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the file storage and sharing method based on WeChat mini-programs in the above embodiments.

[0074] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0075] The aforementioned computer-readable storage medium may be included in a file storage and sharing device based on a WeChat mini program; or it may exist independently and not be assembled into a file storage and sharing device based on a WeChat mini program.

[0076] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a WeChat Mini Program-based file storage and sharing device, the WeChat Mini Program-based file storage and sharing device causes the following to occur: The device sends a user's temporary login credentials to a main server, causing the main server to send the temporary login credentials to a WeChat server and provide feedback on the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server from a routing database based on the user's unique identifier, and the temporary token is generated based on the routing information. The user's unique identifier is provided by the WeChat server after verifying the temporary login credentials. The device updates the network request base address based on the routing information and stores the temporary token in a local cache. The device receives the user's file operation instructions and generates an operation request based on the file operation instructions and the temporary token. The device sends the operation request to the business server based on the network request base address, causing the business server to provide feedback on the operation result. The device then performs file storage and sharing based on the operation result.

[0077] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

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

[0079] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0080] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described file storage and sharing method based on WeChat Mini Programs. This solves the technical problem of how to achieve convenient file storage, efficient online collaboration, and fine-grained permission control through the WeChat ecosystem while ensuring the security of enterprise data intranet storage. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the file storage and sharing method based on WeChat Mini Programs provided in the above embodiments, and will not be repeated here.

[0081] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the file storage and sharing method based on WeChat Mini Programs as described above.

[0082] The computer program product provided in this application solves the technical problem of how to achieve convenient file storage, efficient online collaboration, and fine-grained permission control by leveraging the WeChat ecosystem while ensuring the security of enterprise data intranet storage. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the file storage and sharing method based on WeChat mini-programs provided in the above embodiments, and will not be repeated here.

[0083] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A file storage and sharing method based on WeChat Mini Programs, characterized in that, The method is applied to a WeChat mini-program of a file storage and sharing system, which further includes a main server, a business server, and a WeChat server. The method includes: The system sends the user's temporary login credentials to the main server, which then sends the temporary login credentials to the WeChat server and provides feedback on the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server by querying the routing database based on the user's unique identifier, and the temporary token is generated based on the routing information. The user's unique identifier is provided by the WeChat server after verifying the temporary login credentials. The network request base address is updated according to the routing information, and the temporary token is stored in the local cache; Receive the user's file operation instructions, and generate an operation request based on the file operation instructions and the temporary token; The operation request is sent to the business server according to the network request base address, so that the business server can provide the operation result. Files are stored and shared based on the results of the operation.

2. The method as described in claim 1, characterized in that, The operation request includes upload requests and download requests; The step of receiving the user's file operation instruction and generating an operation request based on the file operation instruction and the temporary token includes: Receive the user's file operation instructions and construct a request header based on the file operation instructions and the temporary token; When the file operation instruction is a file upload instruction, a request body is constructed based on the file to be uploaded selected by the user, and an upload request is generated based on the request header and the request body; When the file operation instruction is a file download instruction, a request body is constructed based on the file identifier of the file to be downloaded specified by the user, and a download request is generated based on the request header and the request body.

3. The method as described in claim 1, characterized in that, The operation requests include preview requests and share requests; The step of receiving the user's file operation instruction and generating an operation request based on the file operation instruction and the temporary token includes: Receive the user's file operation instructions and construct a request header based on the file operation instructions and the temporary token; When the file operation instruction is a file preview instruction, a request body is constructed based on the file identifier of the file to be previewed specified by the user, and a preview request is generated based on the request header and the request body; When the file operation instruction is a file sharing instruction, a request body is constructed based on the file identifier of the file to be shared and preset sharing parameters specified by the user, and a sharing request is generated based on the request header and the request body.

4. The method as described in claim 1, characterized in that, The steps for storing and sharing files based on the operation results include: If the operation results in a successful file storage message, a success message will be displayed, and the file list in the personal space or shared space will be updated. If the operation results in a file storage failure message, a reason for the storage failure will be displayed, including insufficient storage space and unsupported file format. If the result of the operation is file sharing link information, then the file sharing link information is displayed; If the result of the operation is a file preview link, then the file preview link is loaded and the file content is displayed through the built-in preview component; If the result of the operation is a file download address, then the file download address information will be displayed.

5. A file storage and sharing method based on WeChat Mini Programs, characterized in that, The method is applied to the business server of a file storage and sharing system, which further includes a WeChat mini-program, a main server, and a WeChat server. The method includes: Receive an operation request sent by a WeChat mini program, and extract file operation instructions and a temporary token from the operation request; The temporary token is verified to obtain the verification result; When the verification result indicates that the token is invalid, a preset error code will be sent to the WeChat mini program; When the verification result indicates that the token is valid, the temporary token is decoded to obtain the user's unique identifier; The file operation instruction is executed according to the user's unique identifier, the operation result is obtained, and the operation result is sent to the WeChat mini program to complete the file storage and sharing.

6. The method as described in claim 5, characterized in that, The step of executing the file operation instruction based on the user's unique identifier and obtaining the operation result includes: When the file operation instruction is a file upload instruction, the permission database is queried according to the user's unique identifier. After confirming that the user has file upload permission, the file to be uploaded in the operation request is encrypted and stored, and a file storage success message is generated as the operation result. When the file operation instruction is a file download instruction, the permission database is queried based on the user's unique identifier. After confirming that the user has file download permissions, the file storage path is queried based on the file identifier of the file to be downloaded in the operation request, and the corresponding file download address information is generated as the operation result based on the file storage path.

7. The method as described in claim 5, characterized in that, The step of executing the file operation instruction based on the user's unique identifier and obtaining the operation result includes: When the file operation instruction is a file preview instruction, the permission database is queried according to the user's unique identifier. After confirming that the user has file preview permissions, the corresponding target preview file is read according to the file identifier of the file to be previewed in the operation request. The target preview file is converted into a preset preview format and file preview link information is generated as the operation result. When the file operation instruction is a file sharing instruction, the permission database is queried based on the user's unique identifier. After confirming that the user has file sharing permissions, the file to be shared is copied from the personal space to the shared space according to the file identifier of the file to be shared in the operation request. File sharing link information is generated as the operation result according to preset sharing parameters.

8. A file storage and sharing device based on WeChat Mini Programs, characterized in that, The device includes: The credential transmission module is used to send the user's temporary login credentials to the main server, so that the main server sends the temporary login credentials to the WeChat server and feeds back the routing information of the business server corresponding to the user and the user's temporary token. The routing information is obtained by the main server by querying the routing database based on the user's unique identifier. The temporary token is generated based on the routing information. The user's unique identifier is fed back by the WeChat server after verifying the temporary login credentials. The address update module is used to update the network request base address according to the routing information and store the temporary token in a local cache; The request generation module is used to receive the user's file operation instructions and generate an operation request based on the file operation instructions and the temporary token; The request sending module is used to send the operation request to the business server according to the network request base address, so that the business server can provide the operation result; The result processing module is used to store and share files based on the operation results.

9. A file storage and sharing device based on WeChat Mini Programs, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program on the WeChat mini-program is configured to implement the steps of the file storage and sharing method based on the WeChat mini-program as described in any one of claims 1 to 4, and the computer program on the business server is configured to implement the steps of the file storage and sharing method based on the WeChat mini-program as described in any one of claims 5 to 7.

10. A file storage and sharing system based on WeChat Mini Programs, characterized in that, The system includes a WeChat mini-program as described in any one of claims 1 to 4 or a business server as described in any one of claims 5 to 7.