CN111813742A - File management method, device, equipment and medium - Google Patents

File management method, device, equipment and medium Download PDF

Info

Publication number
CN111813742A
CN111813742A CN202010607649.5A CN202010607649A CN111813742A CN 111813742 A CN111813742 A CN 111813742A CN 202010607649 A CN202010607649 A CN 202010607649A CN 111813742 A CN111813742 A CN 111813742A
Authority
CN
China
Prior art keywords
file
directory
current version
request
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010607649.5A
Other languages
Chinese (zh)
Other versions
CN111813742B (en
Inventor
韩超
马如悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010607649.5A priority Critical patent/CN111813742B/en
Publication of CN111813742A publication Critical patent/CN111813742A/en
Application granted granted Critical
Publication of CN111813742B publication Critical patent/CN111813742B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1865Transactional file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a file management method, a file management device, file management equipment and a file management medium, and relates to the cloud storage technology. Wherein, the method comprises the following steps: generating snapshot information of the current version file according to the submission request of the current version file, and sending the snapshot information to a database; if an operation request of a user for the current version file is received in the process of sending the snapshot information to the database, executing an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request. The file version management method and the file version management device can achieve management of different file versions, and meanwhile operability of a file system in a file version storage process is improved.

Description

File management method, device, equipment and medium
Technical Field
The present application relates to computer technologies, and in particular, to a cloud storage technology, and in particular, to a method, an apparatus, a device, and a medium for file management.
Background
In the context of the data age, file system tools can provide great convenience for implementing large file project management. At present, most file systems, such as an open source distributed version control system (Git), a container definition storage system (CDS), a Cluster File System (CFS), and the like, adopt a real-time write mechanism in order to ensure data write consistency, that is, only a current file version is stored in a local cache and a database; in addition, in the process of storing the file into the database, in order to ensure the consistency of the stored data, the operation of revising the current stored version by the user is not supported.
Disclosure of Invention
The application provides a file management method, a file management device, file management equipment and a file management medium, so that management of different file versions is achieved, and meanwhile operability of a file system in a file version storage process is improved.
According to an aspect of an embodiment of the present application, there is provided a file management method, including:
generating snapshot information of the current version file according to the submission request of the current version file, and sending the snapshot information to a database;
if an operation request of a user for the current version file is received in the process of sending the snapshot information to the database, executing an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request.
According to another aspect of the embodiments of the present application, there is provided a file management apparatus including:
the snapshot generating module is used for generating snapshot information of the current version file according to the submission request of the current version file and sending the snapshot information to a database;
an operation executing module, configured to, if an operation request of a user for the current version file is received in a process of sending the snapshot information to the database, execute an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request. .
According to another aspect of embodiments of the present application, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a document management method according to any of the embodiments of the present application.
According to another aspect of embodiments of the present application, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the file management method according to any one of the embodiments of the present application.
In the embodiment of the application, the snapshot information of the current version file is generated according to the submission request of the current version file, so that on one hand, the snapshot information of the current version file can be stored in the database, and on the other hand, the continuous read-write operation of the user on the current version file can be supported based on the snapshot information, so that the management of different file versions is realized, and the operability of a file system in the file version storage process is improved.
It should be understood that the statements herein reciting not intended to identify key or critical features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic diagram of a document management architecture according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another document management architecture disclosed in accordance with an embodiment of the present application;
FIG. 3 is a schematic diagram of a file directory merge disclosed in an embodiment of the present application;
FIG. 4 is a flow chart of a file management method disclosed in accordance with an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating an effect of storing files classified according to version directories in a database according to an embodiment of the present application;
FIG. 6 is a flow chart of another document management method disclosed in accordance with an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a document management apparatus according to an embodiment of the present application;
fig. 8 is a block diagram of an electronic device disclosed according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a file management architecture disclosed in an embodiment of the present application, which is used for illustrating the embodiment of the present application and should not be construed as a specific limitation to the embodiment of the present application. The file management architecture may be deployed on any electronic device having computing capabilities. The File management architecture disclosed in the embodiment of the present application may also be referred to as a new Virtual Transaction File System (VTFS), and is implemented based on a File stacking technology (Overlayfs) and a File Snapshot technology (Snapshot).
As shown in fig. 1, the virtual transaction file system disclosed in the embodiment of the present application includes two parts: a local file system portion and a remote file system portion. The local file system part supports the read-write operation of the local file; the remote file system realizes the storage of files of different versions based on a remote database (or called a remote warehouse), and supports the read-only operation of files of historical versions. The local file system part and the remote file system part adopt a pull/push mechanism, namely, only after a submission request submitted to a remote database is triggered, the file version in the local file system is pushed to the remote database, so that the non-real-time writing of the remote file version is realized, namely, the affairs of file operation are introduced, and the strong consistency of real-time writing is sacrificed, thereby realizing the effective control and management of the file version. In addition, the local file system part and the remote file system part support different file reading and writing states, so that the separation of reading (history) and writing (at present) is realized, the history version files in the remote database can be effectively protected, and the files are prevented from being modified arbitrarily. The remote file system part supports simultaneous access of multiple persons, and file sharing can be achieved.
Under the condition that a remote database is not required to be relied on, for example, when a local database inventory space can meet storage requirements, file versions in the local file system can also be stored in the local database (not shown in fig. 1) after a submission request submitted to the local database is triggered, and non-real-time writing of different file versions can also be realized, so that effective file version control and management are realized.
The virtual transaction file system provided by the embodiment of the application can be suitable for simultaneous management of file items of any types and any sizes, such as code files (usually small files), data files (usually large files and extra large files), environment files (such as python files), model files (usually large files), and the like, and has wide applicability. In addition, the virtual transaction file system provided by the embodiment of the application is developed and designed by using a fuse technology (which belongs to an open source project on a source and can provide an interface for writing a user-mode file system for a user), and a developer can customize the functions of the file system. By calling the API interface, all control logics can be realized at the terminal side, and the requirement on the server side is low or the operation can be realized without depending on the server side. In addition, in the development and design process, the system is compatible with posix semantics, so that the system performance is consistent with the local performance.
FIG. 2 is a diagram of another document management architecture disclosed in an embodiment of the present application, further detailing the document management architecture in the embodiment of the present application. As shown in FIG. 2, a virtual transaction file system is deployed on an electronic device, and a fuse-Overlayfs framework is used for merge management (i.e., directory stacking) of file directories, so that a comprehensive directory is finally presented to a user. Specifically, the directory read-write layer corresponds to a directory of a file in the local file system portion, and the at least one directory read-only layer corresponds to a directory (remote-overlay) of a file in the remote database. And, on the local-fs layer, supporting creating snapshot layer (snapshot-fs) for generating file snapshot information. The local file system layer belongs to a completely transparent native local file system, that is, accessing the local file system layer is the same as directly accessing the local, for example, operations such as reading, writing, deleting and the like are all completely equivalent, and the embodiment of the application further supports a developer to customize the functions of the virtual transaction file system as required by using fuse technology. Further, since it is necessary to send an instruction from outside the virtual transaction file system to inside the file system when an operation such as snapshot is generated, the instruction can be sent by calling a control port (control port) configured in advance and hooking (hook) a specific parameter by a setxattr operation.
Fig. 3 is a schematic diagram of a file directory merging principle disclosed in an embodiment of the present application, which is used to exemplarily illustrate the merging of file directories in the embodiment of the present application. Based on the file stacking technology (Overlayfs), the read-write directory layer is the upperdir layer, and the read-only directory layer is the lowerdir layer. By way of example in fig. 3, the read-only directory layer includes two layers: read-only directory layer A (lowerdira) and read-only directory layer B (lowerdirB).
Document a (filea): only the FileA exists in the upperdir layer, and the FineA in the upperdir layer is seen by an end user on a device interface;
document b (fileb): because both the upperdir layer and the lowerdirA layer have FileB, an end user still sees the FileB in the upperdir layer in the equipment interface, and the file with the same name in the lowerdir layer is covered by the file with the same name in the upperdir layer;
document c (filec): only in the lowerdirA layer and not in the upperdir layer, so the end user sees the FileC in the lowerdirA layer at the device interface. The file C and the file D in the read-only directory layer B are consistent with the above principle, and are not described in detail. Operations such as file reading, writing, deleting and the like realized based on the Overlayfs technology need to follow the technical principle of the Overlayfs.
The file directory is merged and managed by utilizing the fuse-Overlayfs frame, so that the file version control and the version merging are favorably realized, wherein the version merging specifically can be incremental version merging. The incremental version refers to that for each version information, only newly added files and directories, modified files and directories and deleted files and directories under the version information can be stored. The deleted file cannot be actually stored, and is recorded only in the file meta information (meta information).
Fig. 4 is a flowchart of a file management method disclosed in an embodiment of the present application, which may be applied to a case where different file versions are effectively managed. The method disclosed in the embodiment of the present application may be executed by a file management apparatus or the above virtual transaction file system, and the apparatus may be implemented by software and/or hardware, and may be integrated on any electronic device with computing capability, such as a terminal.
As shown in fig. 4, the file management method disclosed in the embodiment of the present application may include:
s101, generating snapshot information of the current version file according to the submission request of the current version file, and sending the snapshot information to a database.
In the embodiment of the application, after a current version file is generated in a local file system according to new operation or write operation of a user on the file, the current version file is not synchronously updated to a storage database in real time, but the operation of submitting the current version file to the database for storage is triggered only after a submission request for the current version file, which is triggered by the user, is detected, the submission request is used for instructing the electronic device to submit the current version file to the database, and the database is used for storing files of different versions according to version information, so that the effective control on the file version is realized.
Specifically, after a submission request of the current version file is detected, a snapshot interface can be called, and snapshot information of the current version file is generated by using a file snapshot technology, wherein the snapshot information comprises the current version file, file attributes and other information, and the file attributes comprise file meta information, such as file name, file access time, file size, file type, file authority and the like; then sending the snapshot information to a database, wherein a remote database can be optimized to avoid the limitation of storage space, and the type of the database can be any available database; finally, the snapshot information of the files with different versions is counted, so that the files in the database can be classified and stored according to the version information. The file information which can be stored in the database comprises version information and snapshot information of the file, wherein the version information of the file can comprise current version information and historical version information of the file, and the version information comprises a version serial number and a version ID; the snapshot information may include the version file at the time of the snapshot as well as file attributes. The snapshot information may further include directory structure information corresponding to the version file at the snapshot time in the electronic device, and therefore, the snapshot information may be used to subsequently restore the version file and the file directory structure at the snapshot time.
For example, in the database, different files may be stored in a classified manner according to a version directory, and files belonging to the same version are stored in the same version directory. Each version directory may be represented by a version number and a version ID, each version directory stores a specific file corresponding to the version, for example, a newly added or modified file, and may be selected not to be stored for a file that is not changed. The files generated at the same time correspond to the same version information. The version number may be successively incremented. Fig. 5 is a schematic diagram illustrating an effect of storing files classified according to version directories in a database by way of example, but should not be construed as a specific limitation to the embodiment of the present application.
S102, if an operation request of a user for a current version file is received in the process of sending snapshot information to a database, executing an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request.
The factors such as data transmission, file size and the like are considered, and the occupied time and the occupied magnitude of sending the snapshot information of the current version file to the database are different. If the user triggers an operation request for the current version file during sending the snapshot information, for example, the current version file is read or rewritten, the operation requirement of the user can be met based on the current version file in the snapshot information. In consideration of that a new file version is generated when rewriting is performed, it is necessary to copy a file of a current version in snapshot information and then perform rewriting. And for the reading operation, the current version file in the snapshot information can be read normally.
In the embodiment of the application, the snapshot information of the current version file is generated according to the submission request of the current version file, so that the snapshot information of the current version file can be stored in the database on one hand, and the continuous read-write operation of the current version file by a user can be supported on the basis of the snapshot information on the other hand, thereby realizing the management of different file versions, supporting the tracing of the user to different file versions, meanwhile, the phenomenon that the user can not execute the reading and writing operation of the file in the process of storing the file into the database is avoided, the time delay of the user operation request in the process is avoided, the operability of the file system in the file version storage process is improved, and the problems that the existing file system does not support file version management due to the limitation of a real-time writing mechanism and the user writing operation is not supported in the process of storing the file in the database are solved.
On the basis of the above technical solution, optionally, generating snapshot information of the current version file according to the submission request of the current version file, and sending the snapshot information to the database, includes:
creating a snapshot layer on a local file system according to a submission request of a current version file;
generating snapshot information of the current version file on a snapshot layer, and deleting the current version file from a local file system;
and sending the snapshot information to a database.
Specifically, after detecting a submission request for a current version file triggered by a user, the electronic device calls a snapshot interface, and creates a snapshot layer on the local file system layer, so that the local file system supports snapshot operation and generates snapshot information of the current version file, and even after the user triggers the submission request for the current version file, all files on the local file system are frozen (i.e., the file state suddenly changes to read-only), and based on the snapshot information in the snapshot layer, the electronic device can still support the write operation of the user on the current version file. After the snapshot information of the current version file is generated, the current version file on the local file system can be deleted, and the occupation of local storage resources is reduced. Moreover, because the snapshot layer is established on the local file system, the superposition of the two logic layers does not affect the file directory displayed on the interface of the electronic device, and therefore, a user does not perceive the logic change generated inside the file system from the use perspective of the file system and does not adversely affect the file project management of the user.
Further, if an operation request of a user for a current version file is received in the process of sending the snapshot information to the database, based on the current version file in the snapshot information, an operation corresponding to the operation request is executed, including:
if a write request of a user for a current version file is received in the process of sending the snapshot information to the database, copying the current version file in the snapshot information to a local file system;
and according to the received write request, executing write operation on the current version file copied to the local file system.
Because a new file version is generated by performing the write operation on the current version file, the rewrite operation needs to be performed after copying the current version file in the snapshot information, so that the normal storage of the current version file is ensured, and meanwhile, the normal generation of the new version file based on the current version file is ensured. After the new version file is generated, the user can also trigger a submission request for the new version file, and after the electronic device detects the submission request, the operations of creating a snapshot layer, generating snapshot information and the like are executed again, so that different file versions can be effectively stored in the database after being generated, and the effective control of the file versions is realized.
Fig. 6 is a flowchart of another file management method disclosed in an embodiment of the present application, which is further optimized and expanded based on the above technical solution, and can be combined with the above optional embodiments. Specifically, the embodiment of the present application is exemplarily described by taking a database as a remote database as an example. As shown in fig. 6, the method may include:
s201, generating snapshot information of the current version file according to the submission request of the current version file, and sending the snapshot information to a remote database.
S202, storing the directory of the current version file sent to the remote database to a read-only directory layer of the file directory.
The file directory in the electronic device is a directory of each file to be managed, namely, a directory effect which can be seen by a user is obtained by combining a read-only directory layer and a read-write directory layer, and the read-write directory layer is used for storing a directory of a local file. That is, in the embodiment of the present application, the files in the file management process may be divided into two types: the version file corresponding to the read-only directory layer only supports read operation, or is called as a history version file supporting read operation, and the file corresponding to the read-write directory layer supports read operation and write operation. By means of directory distinguishing, effective protection of the historical version files can be achieved, and the historical version files are prevented from being arbitrarily modified or deleted; meanwhile, effective file version combination is realized through directory combination, and a combined directory view is presented to a user. In addition, after the directory of the current version file sent to the remote database is stored in the read-only directory layer of the file directory, the existing directory of the file in the read-write directory layer can be deleted selectively according to actual application, and directory redundancy is reduced.
S203, if an operation request of a user for the current version file is received in the process of sending the snapshot information to the remote database, executing an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request.
And S204, receiving a target writing request of a user to the target storage file.
The target storage file refers to a file with a completed file storage operation, and comprises a local storage operation completion and a remote database storage operation completion. Operation S204 may be executed at any time during the file management process, and the execution sequence of operations shown in fig. 6 is only an example and should not be construed as a specific limitation to the embodiment of the present application.
S205, if the file directory which the user requests to access currently is only stored in the read-only directory layer, the file which the user requests to access currently is obtained from the remote database and stored in the local file system.
The method comprises the steps that a user can trigger a target writing request aiming at a target storage file according to a file writing requirement, wherein the target writing request can comprise the name of the target storage file and file directory information, therefore, after the electronic equipment receives the target writing request, the position of the file directory which is currently requested to be accessed by the user can be determined by analyzing the target writing request, if the file directory which is currently requested to be accessed by the user is only in a directory reading and writing layer, namely the target storage file is stored in a remote database, the writing operation is executed after the target storage file needs to be downloaded to a local file system again, and therefore the situation that the target storage file version is covered by a new version file can be avoided.
S206, based on the file stored in the local file system, executing the write operation corresponding to the target write request.
Aiming at a target reading request of a target storage file, even if a file directory only exists in a directory reading and writing layer, the embodiment of the application also supports remote online reading operation of the file, and only meta information (meta information) of a file requested by a user is downloaded to a local cache in the reading process, so that the file reading and accessing efficiency is improved, and the file requested by the user does not need to be completely cached to the local and then is supported to be read.
In the embodiment of the application, in the process of storing the current version file to the remote database based on the snapshot information of the current version file, the directory of the current version file is stored to the read-only directory layer of the file directory, so that the effective protection of the historical version file is realized through directory distinguishing, the phenomenon that the historical version file is arbitrarily modified or deleted is avoided, and the effective file version merging is realized through directory merging; aiming at the file of the read-only directory layer, when the write operation is executed, the file needs to be downloaded from the remote database to the local file system, so that the coverage of the new version file on the target storage file version is avoided, namely the embodiment of the application comprehensively realizes the effective management and control on the file version.
On the basis of the above technical solution, optionally, the method disclosed in the embodiment of the present application may further include:
receiving an access request of a user for the link file; the link file refers to a file preset for the file mounting and directory mounting conditions in the file management process, and access to the mounted file and/or the mounted directory can be realized by accessing the link file;
if the access request is determined to carry the tag file information, acquiring access data corresponding to the access request according to the address of the mount file and/or the address of the mount directory included in the link file, and further feeding back the access data to the user; the tagged file information is used for tagging the address of the mounted file and/or the address of the mounted directory in the link file, namely, the mapping capability of file access and directory access is provided, and the mounted file and the mounted directory comprise files and directories in the external storage device.
The flag file information may be set by a developer in the mount design process, for example, by marking the link file, the mount file, and the mount directory with a specific code. In the process that a user triggers an access request for a link file, the electronic device carries the information of the marked file in the access request to mark the current access request, and then obtains access data corresponding to the access request by analyzing the address of the mount file and/or the address of the mount directory included in the link file.
In the embodiment of the application, the files and directories needing to be mounted generally refer to multi-source files and directories stored outside the local computer. In particular, it may be implemented using soft link technology.
Illustratively, the following method can be adopted for file mounting:
link a file in the usual yaml format, which can be designed as follows:
type, file # file represents a file link, and directory represents a directory link
uri: the address of the source of the bos:// bucket/xxx # link, storage supported by the database bos or the database hdfs, etc
The ak, xxxx # corresponds to uri-related parameters, and the corresponding data bos are ak, sk, etc
sk:xxxx
endpoint:xxxxx
After the file is edited, the file can be copied to a designated mount point, a link instruction can be called to take effect, for example, a vtfs link a. link can be called to take effect, and the effect after the instruction takes effect is as follows: when the user accesses the a.link file, the content of the file pointed by the uri can be directly accessed, which is equivalent to linking the file designated by the uri.
For the case of directory links (links), similar to file links, the difference is that type is directory in the above-described files of the yaml format. After the file is edited, the file is copied to a designated mount point, a link instruction is called to take effect, for example, a vtfs link d.link is called to take effect, and the effect after the instruction takes effect is as follows: the link file becomes a directory that can be accessed to view and read the file, the directory contents being the remote directory pointed to by the uri.
It should be noted that, in the implementation of the soft link, it is also necessary to make the electronic device recognize such an link file through a tag, for example, the tag may be given to the link file through a setxattr command. Once the link file is marked, the contents of the link file are automatically read and parsed by an associated interpreter of the electronic device, replacing the return of the file system with the file and directory pointed to by the link file. Once the mark of the link file is removed, the link file becomes a normal file, and the content in the above yaml format is seen after being opened, and the file can be edited again.
According to the file management method and device, the files and the directories stored outside are conveniently mapped to the local through file mounting and directory mounting, convenience is provided for accessing the multi-source files or directories stored outside, local single-machine program access is compatible, and functions supported in the file management process are expanded.
Fig. 7 is a schematic structural diagram of a file management apparatus according to an embodiment of the present application, which may be applied to effectively manage different file versions. The apparatus disclosed in the embodiment of the present application may be implemented by software and/or hardware, and may be integrated on any electronic device with computing capability, such as a terminal or a server.
As shown in fig. 7, the file management apparatus 300 disclosed in the embodiment of the present application may include a snapshot generating module 301 and an operation executing module 302, where:
a snapshot generating module 301, configured to generate snapshot information of the current version file according to the submission request of the current version file, and send the snapshot information to the database;
an operation executing module 302, configured to, if an operation request of a user for a current version file is received in a process of sending snapshot information to a database, execute an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request.
Optionally, the database is used for storing files of different versions according to the version information.
Optionally, the snapshot generating module 301 includes:
the snapshot layer creating unit is used for creating a snapshot layer on the local file system according to the submission request of the current version file;
the snapshot information generating unit is used for generating snapshot information of the current version file on a snapshot layer and deleting the current version file from the local file system;
and the information sending unit is used for sending the snapshot information to the database.
Optionally, the operation executing module 302 includes:
the file copying unit is used for copying the current version file in the snapshot information to a local file system if a write request of a user for the current version file is received in the process of sending the snapshot information to the database;
and the write operation execution unit is used for executing write operation on the current version file copied to the local file system according to the received write request.
Optionally, the database includes a remote database, and the apparatus disclosed in the embodiment of the present application further includes:
the directory storage module is used for storing the directory of the current version file sent to the remote database to a read-only directory layer of the file directory;
the file directory is obtained by combining a read-only directory layer and a read-write directory layer, and the read-write directory layer is used for storing directories of local files.
Optionally, the apparatus disclosed in the embodiment of the present application further includes:
the target writing request receiving module is used for receiving a target writing request of a user to a target storage file;
the file acquisition module is used for acquiring a file which is requested to be accessed currently by the user from a remote database and storing the file to a local file system if the file directory which is requested to be accessed currently by the user is only stored in the read-only directory layer;
and the write operation module is used for executing the write operation corresponding to the target write request based on the file stored in the local file system.
Optionally, the apparatus disclosed in the embodiment of the present application further includes:
the access request receiving module is used for receiving an access request of a user for the link file;
the object data acquisition module is used for acquiring access data corresponding to the access request according to the address of the mount file and/or the address of the mount directory included in the link file if the access request is determined to carry the information of the markup file;
the marked file information is used for marking the address of a mounted file or/and the address of a mounted directory in the link file, and the mounted file and the mounted directory comprise files and directories in the external storage device.
The file management apparatus 300 disclosed in the embodiment of the present application can execute any file management method disclosed in the embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method. Reference may be made to the description of any method embodiment of the present application for details not explicitly described in the apparatus embodiments of the present application.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 8, fig. 8 is a block diagram of an electronic device for implementing a file management method in an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of embodiments of the present application described and/or claimed herein.
As shown in fig. 8, the electronic apparatus includes: one or more processors 401, memory 402, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display Graphical information for a Graphical User Interface (GUI) on an external input/output device, such as a display device coupled to the Interface. In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations, e.g., as a server array, a group of blade servers, or a multi-processor system. In fig. 8, one processor 401 is taken as an example.
The memory 402 is a non-transitory computer readable storage medium provided by the embodiments of the present application. The storage stores instructions executable by the at least one processor, so that the at least one processor executes the file management method provided by the embodiment of the application. The non-transitory computer-readable storage medium of the embodiments of the present application stores computer instructions for causing a computer to execute the file management method provided by the embodiments of the present application.
The memory 402, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the file management method in the embodiment of the present application, for example, the snapshot generating module 301 and the operation executing module 302 shown in fig. 7. The processor 401 executes various functional applications and data processing of the electronic device by running non-transitory software programs, instructions and modules stored in the memory 402, that is, implements the file management method in the above-described method embodiments.
The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 402 may optionally include a memory remotely located from the processor 401, and these remote memories may be connected via a network to an electronic device for implementing the file management method in the present embodiment. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for implementing the file management method in the embodiment of the present application may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected by a bus or other means, and fig. 8 illustrates an example of a connection by a bus.
The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus for implementing the file management method in the present embodiment, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output device 404 may include a display device, an auxiliary lighting device such as a Light Emitting Diode (LED), a tactile feedback device, and the like; the tactile feedback device is, for example, a vibration motor or the like. The Display device may include, but is not limited to, a Liquid Crystal Display (LCD), an LED Display, and a plasma Display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, Integrated circuitry, Application Specific Integrated Circuits (ASICs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs, also known as programs, software applications, or code, include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or Device for providing machine instructions and/or data to a Programmable processor, such as a magnetic disk, optical disk, memory, Programmable Logic Device (PLD), including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device for displaying information to a user, for example, a Cathode Ray Tube (CRT) or an LCD monitor; and a keyboard and a pointing device, such as a mouse or a trackball, by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here, or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
In the embodiment of the application, the snapshot information of the current version file is generated according to the submission request of the current version file, so that on one hand, the snapshot information of the current version file can be stored in the database, and on the other hand, the continuous read-write operation of the user on the current version file can be supported based on the snapshot information, so that the management of different file versions is realized, and the operability of a file system in the file version storage process is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A file management method, comprising:
generating snapshot information of the current version file according to the submission request of the current version file, and sending the snapshot information to a database;
if an operation request of a user for the current version file is received in the process of sending the snapshot information to the database, executing an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request.
2. The method of claim 1, wherein the database is configured to store different versions of files according to version information.
3. The method of claim 1, wherein the generating snapshot information of the current version file according to the submission request of the current version file and sending the snapshot information to a database comprises:
creating a snapshot layer on a local file system according to the submission request of the current version file;
generating snapshot information of the current version file on the snapshot layer, and deleting the current version file from the local file system;
and sending the snapshot information to the database.
4. The method of claim 3, wherein if an operation request of a user for the current version file is received in the process of sending the snapshot information to the database, executing an operation corresponding to the operation request based on the current version file in the snapshot information comprises:
if a write request of a user for the current version file is received in the process of sending the snapshot information to the database, copying the current version file in the snapshot information to the local file system;
and executing write operation on the current version file copied to the local file system according to the received write request.
5. The method of claim 1, wherein the database comprises a remote database, the method further comprising:
storing the directory of the current version file sent to the remote database to a read-only directory layer of a file directory;
the file directory is obtained by combining the read-only directory layer and the read-write directory layer, and the read-write directory layer is used for storing directories of local files.
6. The method of claim 5, wherein the method further comprises:
receiving a target writing request of a user to a target storage file;
if the file directory which the user requests to access currently is only stored in the read-only directory layer, acquiring the file which the user requests to access currently from the remote database, and storing the file to a local file system;
and executing the write operation corresponding to the target write request based on the file stored in the local file system.
7. The method of claim 1, wherein the method further comprises:
receiving an access request of a user for the link file;
if the access request is determined to carry the information of the marked file, acquiring access data corresponding to the access request according to the address of the mount file and/or the address of the mount directory included in the link file;
the marked file information is used for marking the address of a mounted file or/and the address of a mounted directory in the link file, and the mounted file and the mounted directory comprise files and directories in an external storage device.
8. A file management apparatus comprising:
the snapshot generating module is used for generating snapshot information of the current version file according to the submission request of the current version file and sending the snapshot information to a database;
an operation executing module, configured to, if an operation request of a user for the current version file is received in a process of sending the snapshot information to the database, execute an operation corresponding to the operation request based on the current version file in the snapshot information; wherein the operation request comprises a read request and a write request.
9. The apparatus of claim 8, wherein the database is configured to store different versions of files according to version information.
10. The apparatus of claim 8, wherein the snapshot generation module comprises:
a snapshot layer creating unit, configured to create a snapshot layer on a local file system according to the submission request of the current version file;
a snapshot information generating unit, configured to generate snapshot information of the current version file on the snapshot layer, and delete the current version file from the local file system;
and the information sending unit is used for sending the snapshot information to the database.
11. The apparatus of claim 10, wherein the operation execution module comprises:
the file copying unit is used for copying the current version file in the snapshot information to the local file system if a write request of a user for the current version file is received in the process of sending the snapshot information to the database;
and the write operation execution unit is used for executing write operation on the current version file copied to the local file system according to the received write request.
12. The apparatus of claim 8, wherein the database comprises a remote database, the apparatus further comprising:
the directory storage module is used for storing the directory of the current version file sent to the remote database to a read-only directory layer of the file directory;
the file directory is obtained by combining the read-only directory layer and the read-write directory layer, and the read-write directory layer is used for storing directories of local files.
13. The apparatus of claim 12, wherein the apparatus further comprises:
the target writing request receiving module is used for receiving a target writing request of a user to a target storage file;
the file acquisition module is used for acquiring the file which is requested to be accessed by the user currently from the remote database and storing the file to the local file system if the file directory which is requested to be accessed by the user currently is only stored in the read-only directory layer;
and the write operation module is used for executing the write operation corresponding to the target write request based on the file stored in the local file system.
14. The apparatus of claim 8, wherein the apparatus further comprises:
the access request receiving module is used for receiving an access request of a user for the link file;
the object data acquisition module is used for acquiring access data corresponding to the access request according to the address of the mount file and/or the address of the mount directory included in the link file if the access request is determined to carry the information of the markup file;
the marked file information is used for marking the address of a mounted file or/and the address of a mounted directory in the link file, and the mounted file and the mounted directory comprise files and directories in an external storage device.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the file management method of any of claims 1-7.
16. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the file management method of any one of claims 1-7.
CN202010607649.5A 2020-06-29 2020-06-29 File management method, device, equipment and medium Active CN111813742B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010607649.5A CN111813742B (en) 2020-06-29 2020-06-29 File management method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010607649.5A CN111813742B (en) 2020-06-29 2020-06-29 File management method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111813742A true CN111813742A (en) 2020-10-23
CN111813742B CN111813742B (en) 2023-08-04

Family

ID=72856340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010607649.5A Active CN111813742B (en) 2020-06-29 2020-06-29 File management method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111813742B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416422A (en) * 2020-11-17 2021-02-26 上海米哈游网络科技股份有限公司 Development version file submitting method, device, equipment and storage medium
CN112445764A (en) * 2020-11-27 2021-03-05 北京五一视界数字孪生科技股份有限公司 File operation method and device, storage medium and electronic equipment
CN112631832A (en) * 2020-12-23 2021-04-09 苏州三六零智能安全科技有限公司 File system data volume updating method, terminal equipment, storage medium and device
CN112817927A (en) * 2021-01-26 2021-05-18 广州广合科技股份有限公司 Error-proofing method and device for production tool, electronic equipment and storage medium
CN113535404A (en) * 2021-07-29 2021-10-22 江苏云从曦和人工智能有限公司 Data management and control method, system, device and medium
CN114048178A (en) * 2021-11-29 2022-02-15 众和空间(北京)科技有限责任公司 Dual-mode storage and synchronization method of data
US20220317987A1 (en) * 2021-04-01 2022-10-06 Red Hat, Inc Hybrid approach to performing a lazy pull of container images
US20230315678A1 (en) * 2022-03-29 2023-10-05 International Business Machines Corporation Storage driver for managing a multiple layer file system on the cloud

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557583A (en) * 2009-03-19 2009-10-14 珠海银邮光电技术发展股份有限公司 Remote-updating and version-switching method of repeater equipment embedded software
CN102012853A (en) * 2011-01-14 2011-04-13 南开大学 Zero-copy snapshot method
US20180357134A1 (en) * 2013-11-20 2018-12-13 Huawei Technologies Co.,Ltd. Snapshot Generating Method, System, and Apparatus
CN110032541A (en) * 2019-04-12 2019-07-19 苏州浪潮智能科技有限公司 A kind of writeable snapshot implementing method and system
CN110096302A (en) * 2018-01-31 2019-08-06 阿里巴巴集团控股有限公司 Software data storage, upgrade method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557583A (en) * 2009-03-19 2009-10-14 珠海银邮光电技术发展股份有限公司 Remote-updating and version-switching method of repeater equipment embedded software
CN102012853A (en) * 2011-01-14 2011-04-13 南开大学 Zero-copy snapshot method
US20180357134A1 (en) * 2013-11-20 2018-12-13 Huawei Technologies Co.,Ltd. Snapshot Generating Method, System, and Apparatus
CN110096302A (en) * 2018-01-31 2019-08-06 阿里巴巴集团控股有限公司 Software data storage, upgrade method, device, equipment and storage medium
CN110032541A (en) * 2019-04-12 2019-07-19 苏州浪潮智能科技有限公司 A kind of writeable snapshot implementing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵志恒;罗宇;: "基于细粒度快照的远程容灾系统的设计与实现", 计算机工程与科学, no. 07 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416422A (en) * 2020-11-17 2021-02-26 上海米哈游网络科技股份有限公司 Development version file submitting method, device, equipment and storage medium
CN112445764A (en) * 2020-11-27 2021-03-05 北京五一视界数字孪生科技股份有限公司 File operation method and device, storage medium and electronic equipment
CN112445764B (en) * 2020-11-27 2024-05-31 北京五一视界数字孪生科技股份有限公司 File operation method, device, storage medium and electronic equipment
CN112631832A (en) * 2020-12-23 2021-04-09 苏州三六零智能安全科技有限公司 File system data volume updating method, terminal equipment, storage medium and device
CN112817927A (en) * 2021-01-26 2021-05-18 广州广合科技股份有限公司 Error-proofing method and device for production tool, electronic equipment and storage medium
US20220317987A1 (en) * 2021-04-01 2022-10-06 Red Hat, Inc Hybrid approach to performing a lazy pull of container images
US11709665B2 (en) * 2021-04-01 2023-07-25 Red Hat, Inc. Hybrid approach to performing a lazy pull of container images
CN113535404A (en) * 2021-07-29 2021-10-22 江苏云从曦和人工智能有限公司 Data management and control method, system, device and medium
CN114048178A (en) * 2021-11-29 2022-02-15 众和空间(北京)科技有限责任公司 Dual-mode storage and synchronization method of data
US20230315678A1 (en) * 2022-03-29 2023-10-05 International Business Machines Corporation Storage driver for managing a multiple layer file system on the cloud

Also Published As

Publication number Publication date
CN111813742B (en) 2023-08-04

Similar Documents

Publication Publication Date Title
CN111813742B (en) File management method, device, equipment and medium
CN111258609B (en) Upgrading method and device of Kubernetes cluster, electronic equipment and medium
JP7413306B2 (en) Data processing methods, devices, equipment and storage media
US10055113B2 (en) System and method for modifying user interface elements
EP3296862B1 (en) Version control machine
CN111694857B (en) Method, device, electronic equipment and computer readable medium for storing resource data
CN110704162B (en) Method, device and equipment for sharing container mirror image by physical machine and storage medium
US20150169386A1 (en) Automating software availability management based on api versioning
US20150026684A1 (en) Hidden automated data mirroring for native interfaces in distributed virtual machines
KR20210040850A (en) Method, apparatus, device, and storage medium for parsing document
US10210229B2 (en) File creation through virtual containers
US10476757B1 (en) Architecture for implementing centralized management for a computing environment
US20210311770A1 (en) Method for implementing smart contract based on blockchain
US11263174B2 (en) Reducing resource consumption in container image management
CN112565356B (en) Data storage method and device and electronic equipment
US20230367577A1 (en) Method and apparatus for updating cloud platform
CN111752960B (en) Data processing method and device
US11294651B2 (en) Code execution method, device, and rendering apparatus
CN111831320A (en) Plug-in management method and device, electronic equipment and storage medium
CN111796851A (en) Client base library updating method and device, electronic equipment and storage medium
CN111880778A (en) Interface document generation method and device, electronic equipment and storage medium
US8738873B2 (en) Interfacing with a point-in-time copy service architecture
CN112395437B (en) 3D model loading method and device, electronic equipment and storage medium
CN111857656A (en) Data processing method and device, electronic equipment and storage medium
US20230083822A1 (en) Optimized rendering of web pages

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant