File processing methods, devices, equipment, and media for blockchain file systems

By using virtual drive letters as the entry point and leveraging blockchain file system callback functions to interact with blockchain nodes, the problem of users having difficulty operating the blockchain file system is solved, enabling user-friendly blockchain file system operations and improving the usability and user experience of the blockchain file system.

CN114417413BActive Publication Date: 2026-05-26SHANGHAI JIANSU NETWORK TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI JIANSU NETWORK TECH CO LTD
Filing Date
2022-01-20
Publication Date
2026-05-26

Smart Images

  • Figure CN114417413B_ABST
    Figure CN114417413B_ABST
Patent Text Reader

Abstract

This invention provides a file processing method, apparatus, device, and medium for a blockchain file system. The method includes: in response to a user's file processing operation on a virtual drive, generating a file processing request corresponding to the file processing operation, wherein the virtual drive is the entry point of the blockchain file system; in response to a thread pool of the blockchain file system listening for the file processing request, generating a blockchain file system callback function corresponding to the file processing request; and interacting with a remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data, thereby performing file processing by the blockchain file system. This application can process blockchain data using existing file system file operation methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of file systems, and more specifically, to file processing methods, apparatus, devices, and media for blockchain file systems. Background Technology

[0002] A file system is a mechanism for organizing data and metadata on a storage device. Existing local storage technologies mainly include cache storage and object storage. To achieve storage expansion and flexibility, network file systems have emerged.

[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] In view of the problems in the prior art, the purpose of this invention is to provide a file processing method, apparatus, device and medium for a blockchain file system, which overcomes the difficulties of the prior art and processes the blockchain in the form of file operation of existing file systems.

[0005] An embodiment of the present invention provides a file processing method for a blockchain file system, comprising: in response to a user's file processing operation on a virtual drive, generating a file processing request corresponding to the file processing operation, wherein the virtual drive is the entry point of the blockchain file system; in response to a thread pool of the blockchain file system listening for the file processing request, generating a blockchain file system callback function corresponding to the file processing request; and interacting with a remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data in order to execute the file processing of the blockchain file system.

[0006] In some embodiments of this application, the next level directory of the virtual drive letter includes a user file directory, a transaction template file directory, and a contract file directory.

[0007] In some embodiments of this application, when the file processing operation is to access the virtual drive, the file processing request includes a file system directory read request. The blockchain file system callback function corresponding to the file system directory read request is a blockchain file system directory read function. The step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data and execute the file processing of the blockchain file system includes: interacting with the remote blockchain node connected to the virtual drive to perform on-chain authentication on the user to determine whether the user is an on-chain authorized user; in response to the user not being an on-chain authorized user, interacting with the remote blockchain node to construct an on-chain authorized user corresponding to the user; in response to the user being an on-chain authorized user, saving the user information of the on-chain authorized user as an on-chain authorized user file to the user file directory; performing public key verification of the on-chain authorized user based on the on-chain authorized user file; and in response to the successful public key verification, opening the next level directory of the virtual drive.

[0008] In some embodiments of this application, when the file processing operation is the first access to the virtual drive, the file processing of the blockchain file system further includes: in response to the user's folder creation operation on the virtual drive, generating a folder creation request corresponding to the folder creation operation; in response to the thread pool of the blockchain file system listening to the folder creation request, generating a blockchain folder creation function corresponding to the folder creation request; and according to the blockchain folder creation function, creating one or more folders in the virtual drive, including the user file directory, the transaction template file directory, and the contract file directory, as the next-level directory of the virtual drive.

[0009] In some embodiments of this application, when the file processing operation is to access the virtual drive or any directory under the virtual drive, the file processing request includes a file system directory tree creation request. The blockchain file system callback function corresponding to the file system directory tree creation request is a blockchain file system directory tree creation function. The step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data in order to execute the file processing of the blockchain file system includes: interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain the object paths and object information of all files in the currently accessed directory; and constructing a directory tree of the currently accessed directory according to the object paths and object information of all files in the currently accessed directory.

[0010] In some embodiments of this application, when the currently accessed directory is a transaction template file directory, the step of constructing a directory tree of the currently accessed directory based on the object paths and object information of all files in the currently accessed directory includes: determining whether the transaction template file directory includes a transaction default template file; if not, creating the transaction default template file in the transaction template file directory; if yes, constructing a directory tree of the currently accessed directory based on the transaction default template file, wherein the transaction template file directory includes one or more transaction template files among user-created template files, transaction template files, latest transaction query template files, and latest block query template files, and the transaction template files are edited and saved by the user to send the transaction corresponding to the transaction template to the blockchain connected to the virtual drive.

[0011] In some embodiments of this application, when the file processing operation is to open or refresh the latest block query template file, the step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data, in order to execute the file processing of the blockchain file system, includes: obtaining the latest block information of multiple blocks from the remote blockchain node connected to the virtual drive according to the blockchain file system callback function; triggering a file write request; responding to the thread pool of the blockchain file system listening to the file write request, generating a blockchain file write function corresponding to the file write request; and writing the obtained block information into the latest block query template file according to the blockchain file write function.

[0012] In some embodiments of this application, when the file processing operation is to open or refresh the latest transaction query template file, the step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data, in order to execute the file processing of the blockchain file system, includes: obtaining the latest transaction information of multiple blocks from the remote blockchain node connected to the virtual drive according to the blockchain file system callback function; triggering a file write request; responding to the thread pool of the blockchain file system listening for the file write request, generating a blockchain file write function corresponding to the file write request; and writing the obtained transaction information into the latest transaction query template file according to the blockchain file write function.

[0013] In some embodiments of this application, when the file processing operation is to copy and edit the user-created template file, the step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data to execute the file processing of the blockchain file system includes: obtaining the user information of the user to be created based on the text information of the edited user-created template file; interacting with the remote blockchain node connected to the virtual drive according to the user information of the user to be created to obtain the serialization information and signature information of the user to be created; sending a transaction to create a new user to the remote blockchain node connected to the virtual drive; triggering a file creation request; responding to the thread pool of the blockchain file system listening to the file creation request, generating a blockchain file creation function corresponding to the file creation request; creating an on-chain authorized user file in the user file directory according to the blockchain file creation function; triggering a file write request; responding to the thread pool of the blockchain file system listening to the file write request, generating a blockchain file write function corresponding to the file write request; and writing the user information to be created into the newly created on-chain authorized user file according to the blockchain file write function.

[0014] In some embodiments of this application, when the file processing operation is to copy and edit the transaction template file, the step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data to execute the file processing of the blockchain file system includes: obtaining transaction information based on the text information of the edited transaction template file; sending the transaction information to the remote blockchain node connected to the virtual drive; triggering a file creation request; responding to the thread pool of the blockchain file system listening to the file creation request, generating a blockchain file creation function corresponding to the file creation request; creating a transaction file in the user file directory according to the blockchain file creation function; triggering a file write request; responding to the thread pool of the blockchain file system listening to the file write request, generating a blockchain file write function corresponding to the file write request; and writing the transaction information into the newly created transaction file according to the blockchain file write function.

[0015] According to another aspect of this application, a file processing apparatus for a blockchain file system is also provided, comprising: a file processing request generation module configured to generate a file processing request corresponding to a user's file processing operation on a virtual drive, wherein the virtual drive is the entry point of the blockchain file system; a callback function generation module configured to generate a blockchain file system callback function corresponding to the file processing request in response to the thread pool of the blockchain file system listening for the file processing request; and a file processing execution module configured to interact with a remote blockchain node connected to the virtual drive according to the blockchain file system callback function, obtain blockchain file processing data, and execute the file processing of the blockchain file system.

[0016] Embodiments of the present invention also provide a file processing device for a blockchain file system, comprising: a processor; a memory storing executable instructions of the processor; wherein the processor is configured to perform the steps of the above-described file processing method for the blockchain file system by executing the executable instructions.

[0017] Embodiments of the present invention also provide a computer-readable storage medium for storing a program that, when executed, implements the steps of the above-described blockchain file system file processing method.

[0018] The purpose of this invention is to provide a file processing method, apparatus, device, and medium for a blockchain file system. This invention uses a virtual drive as the entry point, and through file operations on the virtual drive, it converts the interaction with the blockchain node through a blockchain file system callback function. Through the operation with the blockchain node, relevant information is fed back and displayed in the file system, thereby realizing file processing of the blockchain file system. This allows users to perform blockchain processing in a familiar file system operation manner. Attached Figure Description

[0019] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0020] Figure 1 This is a flowchart of one embodiment of the file processing method of the blockchain file system provided by the present invention;

[0021] Figure 2 This is a schematic diagram of the directory tree of the virtual drive provided by the present invention;

[0022] Figure 3 This is a flowchart of the user authentication process for the file processing method of the blockchain file system provided by the present invention;

[0023] Figure 4This is a flowchart illustrating the creation of a folder in the blockchain file system provided by this invention;

[0024] Figure 5 This is a schematic diagram of the directory tree for constructing the blockchain file system provided by the present invention;

[0025] Figure 6 This is a flowchart of the directory tree for constructing the transaction template file directory of the blockchain file system provided by the present invention;

[0026] Figure 7 This is a flowchart of the latest block query in the blockchain file system provided by the present invention;

[0027] Figure 8 This is a flowchart of the latest transaction query in the blockchain file system provided by the present invention;

[0028] Figure 9 This is a flowchart of user creation in the blockchain file system provided by the present invention;

[0029] Figure 10 This is a flowchart of the transaction creation process in the blockchain file system provided by the present invention;

[0030] Figure 11 This is a schematic diagram of the architecture of the blockchain file system provided by the present invention;

[0031] Figure 12 This is a schematic diagram of a module of one embodiment of the file processing device of the blockchain file system provided by the present invention;

[0032] Figure 13 This is a schematic diagram of the operation of the file processing device of the blockchain file system of the present invention. Detailed Implementation

[0033] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to fully and completely convey the concept of the exemplary embodiments to those skilled in the art.

[0034] The accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware forwarding modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0035] Furthermore, the processes shown in the accompanying drawings are merely illustrative and do not necessarily include all steps. For example, some steps can be broken down, some steps can be combined or partially combined, and the actual execution order may change depending on the actual situation. The terms "first," "second," and similar terms used in the specific description do not indicate any order, quantity, or importance, but are only used to distinguish different components. It should be noted that, unless otherwise specified, embodiments of the present invention and features in different embodiments can be combined with each other.

[0036] In practice, the inventors have discovered that existing blockchains are primarily implemented as distributed file systems, emphasizing decentralized operation. However, how to facilitate blockchain operations for users remains a critical technical problem that needs to be solved by those skilled in the art.

[0037] The inventors considered combining file systems with blockchain technology to solve the aforementioned technical problems.

[0038] Blockchain technology is a decentralized distributed data management framework that has been applied to many distributed system scenarios. Through its decentralized and unforgeable computing model, blockchain can efficiently and cost-effectively achieve distributed trusted computing and transactions. Currently, it is widely used in finance, logistics, industrial manufacturing, healthcare, and the Internet of Things.

[0039] Blockchain is decentralized, with each blockchain node operating independently. Meanwhile, smart contracts define the contractual rights to access information, subject to mutual agreement. Smart contracts primarily provide the verification and execution of the conditions stipulated within the contract, allowing for trusted transactions without a third party. These transactions are traceable and irreversible.

[0040] This invention provides a file processing method, apparatus, device, and medium for a blockchain file system. The inventive concept is to use a virtual drive as an entry point, perform file operations on the virtual drive, and then convert these operations into interactions with blockchain nodes through a blockchain file system callback function. By interacting with the blockchain nodes, relevant information is fed back and displayed in the file system, thereby realizing file processing within the blockchain file system. This allows users to perform blockchain processing using familiar file system operation methods.

[0041] Reference Figure 1 The diagram illustrates a flowchart of one embodiment of the file processing method for the blockchain file system provided by the present invention. Figure 1 The following steps are shown:

[0042] Step S110: In response to the user's file processing operation on the virtual drive, generate a file processing request corresponding to the file processing operation, wherein the virtual drive is the entry point of the blockchain file system.

[0043] Specifically, a virtual drive can be mounted to serve as the entry point for the blockchain file system. Specifically, the next-level directories of the virtual drive can include user file directories, transaction template file directories, and contract file directories.

[0044] Step S120: In response to the thread pool of the blockchain file system listening for the file processing request, a blockchain file system callback function corresponding to the file processing request is generated.

[0045] Specifically, once the blockchain is mounted to the local system via a virtual drive, a thread pool for the blockchain file system can be started to listen for designated file processing requests. File processing requests can include, but are not limited to, creating new objects, clearing objects, closing objects, modifying object attributes, reading objects, writing objects, querying object information, querying object storage information, locking objects, setting object description information, refreshing cached content to objects, querying object security information, and setting object security information. The aforementioned objects can include, but are not limited to, folders and files.

[0046] Specifically, a blockchain file system can be implemented, for example, through a file system callback framework, to provide users with blockchain-based interactive operation logic. This allows users to access and operate remote blockchain nodes through the local file system, thereby enabling interactive operations such as transaction on-chaining, information (user, transaction, block) querying, and contract writing.

[0047] Based on the file processing requests monitored by the thread pool of the blockchain file system, the blockchain file system can provide corresponding blockchain file system callback functions, as shown in the table below:

[0048] File processing request Corresponding blockchain file system callback function Create new object BeviosCreate Clean up objects BeviosCleanup Close object BeviosClose Object property construction, querying, etc. BeviosDirectoryInformation Read object BeviosRead Write object BeviosWrite Query object information BeviosQueryInformation Query object storage information BeviosQueryVolumeInformation Locked object BeviosLock Set object description information BeviosSetInformation Refresh cached content to the object BeviosFlush Query object security information BeviosQuerySecurity Set object security information BeviosSetSecurity

[0049] The aforementioned blockchain file system callback function is merely illustrative; other naming conventions are also within the scope of protection of this application.

[0050] Illustrative functional descriptions of callback functions for various blockchain file systems:

[0051] BeviosCreate can be used for on-chain user authentication, creating new local folders, creating new files, etc.

[0052] BeviosCleanup can be used for local file cleanup, releasing the blockchain session connection to which the current file belongs, and freeing up occupied memory, etc.

[0053] BeviosClose can be used to close local files and release occupied memory.

[0054] BeviosDirectoryInformation can be used to modify file system directory tree information, such as folder size limits, file buffers, and file dates.

[0055] BeviosRead can be used for object reading. Specifically, the functionality of BeviosRead varies slightly depending on the object being operated on:

[0056] If the current object is a virtual drive letter, BeviosRead can be used to construct a query request to check whether the current user is an on-chain authenticated user; if not, a request to create a new user is sent to the blockchain.

[0057] If the object is one of the following under a virtual drive: a user file directory, a transaction template file directory, or a contract file directory, BeviosRead can be used for the following purposes, depending on the directory information:

[0058] When the object is a user file directory, it can retrieve the most recent users on the chain and store them in the recent user query file in the local transaction template file directory;

[0059] When the object is a transaction template file directory, it can retrieve the most recent transactions on the chain and store them in the recent transaction query file of the local transaction template file directory;

[0060] When the object is a contract file directory, it can retrieve the most recent contract accounts and contract information on the chain and store them in the most recent contract query file in the local contract file directory.

[0061] BeviosWrite can be used to write objects. If the object is one of the following directories under a virtual drive: user file directory, transaction template file directory, or contract file directory, BeviosWrite can be used for:

[0062] When the object is a user file directory, BeviosWrite is triggered when a user creates a new user file. This function constructs a new user request to the blockchain and retrieves the new user information, which is then stored locally in the user information file. If the user already exists, the function retrieves the user information stored locally in the user information file.

[0063] When the object is a directory of transaction template files, since the directory provides some transaction template files, when a user refers to and creates or edits a new transaction file, BeviosWrite is triggered. The function will check the content of the transaction file, determine whether the text is valid, and construct the transaction and send it to the blockchain after the check is passed.

[0064] When the object is a contract file directory, since the directory provides some contract template files, BeviosWrite is triggered when the user refers to and creates and edits a new contract file. BeviosWrite will scan whether the text content is valid. If the check passes, it will build a new contract for deployment or build a contract call request to the blockchain.

[0065] BeviosQueryInformation can be used to query file or folder information, such as the file object's creation date, last update date, operation attributes, read / write permissions, hidden attributes, etc. This callback function is triggered when a user opens a directory or views the option properties of a file directory or file object (e.g., by right-clicking the object and selecting an attribute from the options list).

[0066] BeviosQueryVolumeInformation can be used to query disk information, such as the creation date, last update date, operation attributes, read / write permissions, and hidden attributes of file objects. This callback function is triggered when a user views the option properties of a mounted virtual disk object (e.g., by right-clicking the object and selecting an attribute from the options list).

[0067] BeviosLock can be used for file object file locking, which is triggered when a user performs an object write operation.

[0068] BeviosSetInformation can be used to set file object properties.

[0069] BeviosFlush can be used to refresh cached content to a file object, triggered when the user saves and refreshes the file object.

[0070] BeviosQuerySecurity can be used to query file security information, and a callback function is triggered when a user views a file object and selects a security attribute.

[0071] BeviosSetSecurity can be used to set file system security attributes, triggering a callback function when the user selects a security attribute for a file object.

[0072] The above is merely illustrative of the functions of each blockchain callback function described in this application, and this application is not intended to limit the scope of the application.

[0073] Step S130: Based on the blockchain file system callback function, interact with the remote blockchain node connected to the virtual drive to obtain blockchain file processing data, so as to execute the file processing of the blockchain file system.

[0074] The file processing method of the blockchain file system provided by this invention uses a virtual drive as the entry point. By operating on files in the virtual drive, the interaction with the blockchain node is converted through the blockchain file system callback function. Through the operation with the blockchain node, relevant information is fed back and displayed in the file system, thereby realizing the file processing of the blockchain file system. This allows users to perform blockchain processing in a familiar file system operation mode.

[0075] Figure 2 This is a schematic diagram of the directory tree of the virtual drive provided by the present invention. Figure 2 This is merely illustrative; the directory tree of the virtual drive letter in this application is not limited to this. Figure 2 The virtual drive letter can be, for example, M:. The next level directory of the virtual drive M: can include a user file directory, a transaction template file directory, and a contract file directory. The user file directory can include folders named after different usernames, which can contain the user's blockchain resource information and transaction history. The contract file directory can include contract files (such as contract template files) and contract query files. The transaction template file directory can include user-created template files, transaction template files, latest transaction query template files, latest block query template files, and default transaction template files, etc. All of the above files can be in TXT format, but this application is not limited to this. Each folder and file can be displayed using existing Windows system folder and file icons, and can also be operated using existing Windows system file operation methods.

[0076] Specifically, the blockchain file system provides a folder creation function: users create new folders (user file directory, transaction template file directory, and contract file directory), fill in the information according to the settings, and save. This step triggers file processing requests (object creation, object reading, and object writing). The object creation request triggers the BeVioSCreate callback function, which checks the new directory name under the virtual drive. If the directory name is not one of the three (user file directory, transaction template file directory, or contract file directory), an error is returned. The object reading function opens the existing set of file directories under the virtual drive and displays them in the current file system interface, triggering the BeviosRead callback function. For the object writing request, when the user opens the virtual drive and attempts to modify any directory name or create a new directory, the BeviosWrite callback function is triggered.

[0077] In each file directory, when a user creates a new file in that directory, a request to create an object and the BeviosCreate callback function will be triggered; when a user saves a file, a request to write an object and the BeviosWrite callback function will be triggered; when a user closes the directory, a request to close an object and the BeviosClose callback function will be triggered; when a user deletes a file, a request to delete an object and the BeviosCleanup callback function will be triggered.

[0078] The user file directory provides a built-in user query function. For example, after a user creates a new user folder using a transaction template, a file named user_file_directory\username.txt will be added to the local virtual drive. This file can contain the user's on-chain storage information and on-chain resources (such as CPU resources, network resources, and random access memory resources). When the user actively refreshes the file, the user information can be synchronously updated and written back to the current file.

[0079] In the transaction template file directory, when a user opens this directory, it will trigger requests to read objects, query object information, and query object storage information, along with corresponding callback functions. When a user creates a new file named <user>.txt, BeviosCreate is triggered, and this callback performs a self-check. <user>Check if the file exists on the chain; if it does not exist, file creation fails.

[0080] In the contract file directory, users create a new file called User-Contract, fill it in according to the format, and save it, which triggers object creation requests, object reading requests, object writing requests, and corresponding callback functions.

[0081] See below. Figure 3 , Figure 3 This is a flowchart illustrating user authentication for the file processing method of the blockchain file system provided by the present invention. In this embodiment, when the file processing operation is accessing the virtual drive, the file processing request includes a file system directory read request, and the blockchain file system callback function corresponding to the file system directory read request is a blockchain file system directory read function. Therefore, Figure 3 The following steps are shown:

[0082] Step S101: Interact with the remote blockchain node connected to the virtual disk to perform on-chain authentication of the user to determine whether the user is an authorized on-chain user.

[0083] Step S102: In response to the user not being an on-chain authorized user, interact with the remote blockchain node to construct the on-chain authorized user corresponding to the user.

[0084] Specifically, the on-chain authorized user can be constructed through transactions. For example, one can interact with a remote blockchain node to request transaction serialization. After obtaining the serialization result, one can request transaction signature data from the blockchain. After obtaining the signature data, one can initiate a transaction request to create an on-chain authorized user. If the transaction is successful, a transaction success certificate is returned.

[0085] Step S103: In response to the user being an on-chain authorized user, save the user information of the on-chain authorized user as an on-chain authorized user file to the user file directory.

[0086] Step S104: Perform public key verification of the on-chain authorized user based on the on-chain authorized user file.

[0087] Step S105: In response to the successful verification of the public key, open the next level directory of the virtual drive letter.

[0088] Therefore, through Figure 3 The steps shown enable user authentication in the blockchain file system. In this embodiment, user identity can be authenticated on-chain. If the user is not an authorized on-chain user, user creation is required. This step involves creating a file system request object and a blockchain-side smart contract, including calling contract methods (user authentication). When a user opens a virtual drive, the blockchain file system self-checks whether it has a remote blockchain user authentication. If not, it attempts to create an on-chain user for authentication. After successful on-chain user authentication, the user can access the virtual drive and perform operations. Otherwise, authentication failure prevents access to the file system workspace of the virtual drive.

[0089] See below. Figure 4 , Figure 4 This is a flowchart illustrating the creation of a folder in the blockchain file system provided by this invention. When the file processing operation is the initial access to the virtual drive letter, the file processing of the blockchain file system further includes the following steps:

[0090] Step S111: In response to the user's folder creation operation on the virtual drive, generate a folder creation request corresponding to the folder creation operation.

[0091] Step S112: In response to the thread pool of the blockchain file system listening for the folder creation request, generate a blockchain folder creation function corresponding to the folder creation request.

[0092] Step S113: Based on the blockchain folder creation function, create one or more folders in the virtual drive, including the user file directory, transaction template file directory, and contract file directory, as the next level directory of the virtual drive.

[0093] Specifically, when a user first accesses a virtual drive, they can actively create subdirectories for that virtual drive. This application can allow the creation of only user file directories, transaction template file directories, and contract file directories as subdirectories of the virtual drive. When a user attempts to create folders with other names, this can be detected by the blockchain file system's thread pool, and an exception will be returned to the blockchain file system driver, thus preventing the creation.

[0094] See below. Figure 5 , Figure 5 This is a schematic diagram of the directory tree construction of the blockchain file system provided by the present invention. When the file processing operation is to access the virtual drive letter or any directory under the virtual drive letter, the file processing request includes a file system directory tree creation request, and the blockchain file system callback function corresponding to the file system directory tree creation request is the blockchain file system directory tree creation function. Therefore, Figure 5 The following steps are shown:

[0095] Step S121: Based on the blockchain file system callback function, interact with the remote blockchain node connected to the virtual drive to obtain the object paths and object information of all files in the currently accessed directory.

[0096] Object information may include, for example, the object name, the size of the buffer occupied by the object, and other object information.

[0097] Step S122: Construct a directory tree for the currently accessed directory based on the object paths and object information of all files in the currently accessed directory.

[0098] Therefore, when a user accesses a virtual drive or any directory (folder) within a virtual drive, a directory tree can be created for display in the file system interface, allowing the user to perform related file operations.

[0099] See below. Figure 6 , Figure 6 This is a flowchart illustrating the directory tree of the blockchain file system provided by this invention, which constructs the transaction template file directory. When the currently accessed directory is the transaction template file directory... Figure 5 Step S122 may also include:

[0100] Step S131: Determine whether the transaction template file directory includes a default transaction template file.

[0101] If not, proceed to step S132: Create the default transaction template file in the transaction template file directory.

[0102] If so, proceed to step S133: construct the directory tree of the currently accessed directory based on the transaction default template file.

[0103] The transaction template file directory includes one or more of the following transaction template files: user-created template file, transaction template file, latest transaction query template file, and latest block query template file. The transaction template file is edited and saved by the user to send the transaction corresponding to the transaction template to the blockchain connected to the virtual disk.

[0104] Specifically, user-created template files, transaction template files, latest transaction query template files, and latest block query template files are all default transaction template files, which contain relevant transaction information for use as templates. Users can edit and save the default information in the template files to send transactions to the blockchain connected to the virtual drive. This application can also provide more different transaction template files, which will not be elaborated here. Specifically, all template files will have their file attributes modified through the BeviosDirectoryInformation callback function to set write operations to be performed only by super administrators.

[0105] See below. Figure 7 , Figure 7 This is a flowchart of the latest block query process provided by the blockchain file system of the present invention. When the file processing operation involves opening or refreshing the latest block query template file, the following steps are performed:

[0106] Step S141: Obtain the latest block information of multiple blocks from the remote blockchain node connected to the virtual disk according to the blockchain file system callback function.

[0107] Specifically, step S141 can obtain the latest block number information by obtaining the latest block height, and then request the latest block information of multiple blocks based on the latest block number information.

[0108] Step S142: Trigger a file write request.

[0109] Step S143: In response to the thread pool of the blockchain file system listening for the file write request, generate a blockchain file write function corresponding to the file write request.

[0110] Step S144: Write the obtained block information into the latest block query template file according to the blockchain file writing function.

[0111] Specifically, the write operation can be completed by writing block information into project information and sending it to the blockchain file system block, which will then be driven by the blockchain file system.

[0112] See below. Figure 8 , Figure 8 This is a flowchart of the latest transaction query process provided by the blockchain file system of this invention. When the file processing operation involves opening or refreshing the latest transaction query template file, the following steps are performed:

[0113] Step S151: According to the blockchain file system callback function, obtain the latest transaction information of multiple blocks from the remote blockchain node connected to the virtual disk.

[0114] Specifically, transaction information can be obtained by retrieving and capturing valid transaction information.

[0115] Step S152: Trigger a file write request.

[0116] Step S153: In response to the thread pool of the blockchain file system listening for the file write request, generate a blockchain file write function corresponding to the file write request.

[0117] Step S154: Write the obtained transaction information into the latest transaction query template file according to the blockchain file writing function.

[0118] Specifically, the write operation can be completed by writing transaction information into project information and sending it to the blockchain file system block, which will then be driven by the blockchain file system.

[0119] See below. Figure 9 , Figure 9 This is a flowchart illustrating the creation of a user in the blockchain file system provided by this invention. When copying and editing the user creation template file, the file processing operation involves the following steps:

[0120] Step S161: Obtain the user information of the user to be created based on the text information of the edited user creation template file.

[0121] Specifically, the user information to be created can be, for example, user A, public key A, resource A; user B, public key B, resource B.

[0122] Step S162: Based on the user information of the user to be created, interact with the remote blockchain node connected to the virtual disk to obtain the serialization information and signature information of the user to be created.

[0123] Step S163: Send a transaction to create a new user to the remote blockchain node connected to the virtual disk.

[0124] Step S164: Trigger a file creation request.

[0125] Step S165: In response to the thread pool of the blockchain file system listening for the file creation request, generate a blockchain file creation function corresponding to the file creation request.

[0126] Step S166: Create an on-chain authorized user file in the user file directory according to the blockchain file creation function.

[0127] For example, you can create user_A.txt and user_B.txt.

[0128] Step S167: Trigger a file write request.

[0129] Step S168: In response to the thread pool of the blockchain file system listening for the file write request, generate a blockchain file write function corresponding to the file write request.

[0130] Step S169: Write the user information to be created into the newly created on-chain authorized user files (user_A.txt and user_B.txt) according to the blockchain file writing function.

[0131] Specifically, the write operation can be completed by writing user information into project information and sending it to the blockchain file system block, which will then be driven by the blockchain file system.

[0132] See below. Figure 10 , Figure 10 This is a flowchart of the transaction creation process in the blockchain file system provided by the present invention. When the file processing operation involves copying and editing the transaction template file, the following steps are performed:

[0133] Step S171: Obtain transaction information based on the text information in the edited transaction template file;

[0134] Step S172: Send the transaction information to the remote blockchain node connected to the virtual disk;

[0135] Step S173: Trigger a file creation request;

[0136] Step S174: In response to the thread pool of the blockchain file system listening for the file creation request, generate a blockchain file creation function corresponding to the file creation request;

[0137] Step S175: Create a transaction file in the user file directory according to the blockchain file creation function;

[0138] Step S176: Trigger a file write request;

[0139] Step S177: In response to the thread pool of the blockchain file system listening for the file write request, generate a blockchain file write function corresponding to the file write request.

[0140] Step S178: Write the transaction information into the newly created transaction file according to the blockchain file writing function.

[0141] The above are merely illustrative representations of several document processing methods in this application, and this application is not intended to limit the scope of the application.

[0142] See below. Figure 11 , Figure 11 This is a schematic diagram of the architecture of the blockchain file system provided by the present invention. The blockchain file system may include a blockchain file system architecture 200 and a blockchain system architecture 240. The blockchain file system architecture 200 may include a user-mode file system layer 210, a blockchain file system management module 220, and a blockchain interface callback layer 230. The user-mode file system layer 210 and the blockchain file system management module 220 can interact with the Windows driver layer 240 and the Windows kernel layer 250 to implement the driving and storage of the blockchain file system. The blockchain system architecture 240 includes a blockchain A chain node 241, a heterogeneous blockchain B chain node 242, and a heterogeneous blockchain C chain node 243 (illustrated for illustrative purposes only, and not intended to be limiting). The blockchain interface callback layer 230 interacts with the blockchain A chain node 241, the heterogeneous blockchain B chain node 242, and the heterogeneous blockchain C chain node 243 in the blockchain system architecture 240 to use the local virtual disk as the entry point for accessing the blockchain.

[0143] The above is merely an illustrative description of the specific implementation of the present invention, and the present invention is not intended to be limited thereto. The splitting, merging, and execution order of steps, the splitting and merging of modules, and the changes in information transmission are all within the protection scope of the present invention.

[0144] Figure 12 This is a schematic diagram of a module of an embodiment of the file processing device of the blockchain file system of the present invention. Figure 12 As shown, including but not limited to:

[0145] The file processing request generation module 310 is configured to generate a file processing request corresponding to a user's file processing operation on a virtual drive, wherein the virtual drive is the entry point of the blockchain file system.

[0146] The callback function generation module 320 is configured to respond to the thread pool of the blockchain file system listening for the file processing request and generate a corresponding blockchain file system callback function based on the file processing request.

[0147] The file processing execution module 330 is configured to interact with the remote blockchain node connected to the virtual drive letter according to the blockchain file system callback function, obtain blockchain file processing data, and execute the file processing of the blockchain file system.

[0148] The implementation principle of the above modules can be found in [link to documentation]. Figure 1 The relevant descriptions of the file processing methods in the blockchain file system shown are not repeated here.

[0149] Figure 12 The illustrations of the file processing device 300 for the blockchain file system provided by this invention are merely schematic. Without departing from the inventive concept, the splitting, merging, and addition of modules are all within the scope of protection of this invention. The file processing device 300 for the blockchain file system provided by this invention can be implemented by software, hardware, firmware, plugins, and any combination thereof; this invention is not limited thereto.

[0150] This invention also provides a file processing device for a blockchain file system, including a processor and a memory storing executable instructions for the processor. The processor is configured to execute steps of a file processing method for the blockchain file system by executing the executable instructions.

[0151] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "platform."

[0152] Figure 13 This is a schematic diagram of the file processing device of the blockchain file system of the present invention. See below for reference. Figure 13 To describe an electronic device 1300 according to this embodiment of the present invention. Figure 13 The electronic device 1300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0153] like Figure 13 As shown, the electronic device 1300 is presented in the form of a general-purpose computing device. The components of the electronic device 1300 may include, but are not limited to: at least one processing unit 1310, at least one storage unit 1320, a bus 1330 connecting different platform components (including storage unit 1320 and processing unit 1310), a display unit 1340, etc.

[0154] The storage unit stores program code, which can be executed by the processing unit 1310, causing the processing unit 1310 to perform the steps described in the above-described section on the file processing methods of the blockchain file system according to various exemplary embodiments of the present invention. For example, the processing unit 1310 can perform, for example... Figure 1 The steps are shown in the figure.

[0155] Storage unit 1320 may include readable media in the form of volatile storage units, such as random access memory (RAM) 120 and / or cache memory 1322, and may further include read-only memory (ROM) 1323.

[0156] Storage unit 1320 may also include a program / utility 1324 having a set (at least one) of program modules 1325, such program modules 1325 including but not limited to: processing system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0157] Bus 1330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0158] Electronic device 1300 can also communicate with one or more external devices 1370 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 1300, and / or with any device that enables electronic device 1300 to communicate with one or more other computing devices (e.g., router, modem, etc.). Such communication can be performed through input / output (I / O) interface 1350.

[0159] Furthermore, electronic device 1300 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 1360. Network adapter 1360 can communicate with other modules of electronic device 1300 via bus 1330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0160] This invention also provides a computer-readable storage medium for storing a program, which, when executed, implements the steps of a file processing method for a blockchain file system. In some possible implementations, various aspects of this invention can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to execute the steps described in the above-described section of this specification regarding the file processing method for a blockchain file system, according to various exemplary embodiments of the invention.

[0161] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0162] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0163] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0164] Program code for performing the processing of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0165] In summary, the purpose of this invention is to provide a file processing method, apparatus, device, and medium for a blockchain file system. This invention uses a virtual drive as the entry point, operates on files in the virtual drive, and converts these operations into interactions with blockchain nodes through a blockchain file system callback function. Through these interactions with the blockchain nodes, relevant information is fed back and displayed in the file system, thereby realizing file processing within the blockchain file system. This allows users to perform blockchain processing using familiar file system operation methods.

[0166] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.< / user>

Claims

1. A file processing method of a blockchain file system, characterized by, include: In response to a user's file processing operation on a virtual drive, a file processing request corresponding to the file processing operation is generated. The virtual drive is the entry point of the blockchain file system, and the next level directory of the virtual drive includes the user file directory, the transaction template file directory, and the contract file directory. In response to the thread pool of the blockchain file system listening for the file processing request, a corresponding blockchain file system callback function is generated based on the file processing request. According to the blockchain file system callback function, interact with the remote blockchain node connected to the virtual drive to obtain blockchain file processing data in order to perform file processing of the blockchain file system. 2.The file processing method of the blockchain file system according to claim 1, characterized in that, When the file processing operation involves accessing the virtual drive, the file processing request includes a file system directory read request. The corresponding blockchain file system callback function for the file system directory read request is a blockchain file system directory read function. The step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data, and then performing file processing on the blockchain file system, includes: Interact with the remote blockchain node connected to the virtual disk to perform on-chain authentication of the user to determine whether the user is an authorized on-chain user. If the user is not an on-chain authorized user, then interact with the remote blockchain node to construct the on-chain authorized user corresponding to the user; In response to the user being an on-chain authorized user, the user information of the on-chain authorized user is saved as an on-chain authorized user file to the user file directory; Perform public key verification of the authorized user on the chain based on the authorized user file; In response to successful public key verification, the next level directory of the virtual drive is opened.

3. The file processing method of the blockchain file system according to claim 2, characterized in that, The file processing operation, when the virtual drive is accessed for the first time, also includes the following: In response to the user's folder creation operation on the virtual drive, a folder creation request corresponding to the folder creation operation is generated; In response to the thread pool of the blockchain file system listening for the folder creation request, a blockchain folder creation function corresponding to the folder creation request is generated. According to the blockchain folder creation function, one or more folders, including the user file directory, transaction template file directory, and contract file directory, are created in the virtual drive as the next level directory of the virtual drive.

4. The file processing method of the blockchain file system according to claim 1, characterized in that, When the file processing operation involves accessing the virtual drive or any directory under the virtual drive, the file processing request includes a file system directory tree creation request. The corresponding blockchain file system callback function for the file system directory tree creation request is a blockchain file system directory tree creation function. The step of interacting with the remote blockchain node connected to the virtual drive according to the blockchain file system callback function to obtain blockchain file processing data, and then performing file processing in the blockchain file system, includes: Based on the blockchain file system callback function, interact with the remote blockchain node connected to the virtual drive letter to obtain the object path and object information of all files in the currently accessed directory; Construct a directory tree for the currently accessed directory based on the object paths and object information of all files in the currently accessed directory.

5. The file processing method of the blockchain file system according to claim 4, characterized in that, When the currently accessed directory is the transaction template file directory, the step of constructing the directory tree of the currently accessed directory based on the object paths and object information of all files in the currently accessed directory includes: Determine whether the transaction template file directory includes a default transaction template file; If not, then create the default transaction template file in the transaction template file directory; If so, then construct the directory tree of the currently accessed directory based on the transaction default template file. The transaction template file directory includes one or more of the following transaction template files: user-created template file, transaction template file, latest transaction query template file, and latest block query template file. The transaction template file is edited and saved by the user to send the transaction corresponding to the transaction template to the blockchain connected to the virtual disk.

6. The file processing method of the blockchain file system according to claim 5, characterized in that, When the file processing operation involves opening or refreshing the latest block query template file, the step of interacting with the remote blockchain node connected to the virtual drive letter according to the blockchain file system callback function to obtain blockchain file processing data, in order to execute the file processing of the blockchain file system, includes: According to the blockchain file system callback function, the latest block information of multiple blocks is obtained from the remote blockchain node connected to the virtual drive. Trigger a file write request; In response to the thread pool of the blockchain file system listening for the file write request, a blockchain file write function corresponding to the file write request is generated. The obtained block information is written into the latest block query template file according to the blockchain file writing function.

7. The file processing method of the blockchain file system according to claim 5, characterized in that, When the file processing operation involves opening or refreshing the latest transaction query template file, the step of interacting with the remote blockchain node connected to the virtual drive letter according to the blockchain file system callback function to obtain blockchain file processing data, in order to execute the file processing of the blockchain file system, includes: According to the blockchain file system callback function, the latest transaction information of multiple blocks is obtained from the remote blockchain node connected to the virtual drive. Trigger a file write request; In response to the thread pool of the blockchain file system listening for the file write request, a blockchain file write function corresponding to the file write request is generated. The obtained transaction information is written into the latest transaction query template file according to the blockchain file writing function.

8. The file processing method of the blockchain file system according to claim 5, characterized in that, When the file processing operation involves copying and editing the user-created template file, the step of interacting with the remote blockchain node connected to the virtual drive letter according to the blockchain file system callback function to obtain blockchain file processing data, and then performing file processing in accordance with the blockchain file system, includes: Based on the text information in the edited user-created template file, obtain the user information of the user to be created; Based on the user information of the user to be created, interact with the remote blockchain node connected to the virtual drive to obtain the serialization information and signature information of the user to be created; Send a transaction to create a new user to a remote blockchain node connected to the virtual disk; Trigger a file creation request; In response to the thread pool of the blockchain file system listening for the file creation request, a blockchain file creation function corresponding to the file creation request is generated. The blockchain file creation function creates an on-chain authorized user file in the user file directory; Trigger a file write request; In response to the thread pool of the blockchain file system listening for the file write request, a blockchain file write function corresponding to the file write request is generated. The user information to be created is written into the newly created on-chain authorized user file according to the blockchain file writing function.

9. The file processing method of the blockchain file system according to claim 5, characterized in that, When the file processing operation involves copying and editing the transaction template file, the step of interacting with the remote blockchain node connected to the virtual drive letter according to the blockchain file system callback function to obtain blockchain file processing data, in order to execute the file processing of the blockchain file system, includes: Obtain transaction information based on the text information in the edited transaction template file; The transaction information is sent to a remote blockchain node connected to the virtual disk. Trigger a file creation request; In response to the thread pool of the blockchain file system listening for the file creation request, a blockchain file creation function corresponding to the file creation request is generated. A transaction file is created in the user file directory according to the blockchain file creation function; Trigger a file write request; In response to the thread pool of the blockchain file system listening for the file write request, a blockchain file write function corresponding to the file write request is generated. The transaction information is written to the newly created transaction file according to the blockchain file writing function.

10. A file processing device for a blockchain file system, characterized in that, include: The file processing request generation module is configured to generate a file processing request corresponding to a user's file processing operation on a virtual drive, wherein the virtual drive is the entry point of the blockchain file system. The callback function generation module is configured to respond to the thread pool of the blockchain file system listening for the file processing request and generate a corresponding blockchain file system callback function based on the file processing request. The file processing execution module is configured to interact with the remote blockchain node connected to the virtual drive letter according to the blockchain file system callback function, obtain blockchain file processing data, and execute file processing of the blockchain file system.

11. A file processing device for a blockchain file system, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the file processing method of any one of claims 1 to 10 of the blockchain file system by executing the executable instructions.

12. A computer-readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the file processing method of the blockchain file system according to any one of claims 1 to 9.