File access control method and system
By introducing the 'file bundle' and 'relay lock' mechanisms, the problem that the file lock mechanism in the existing technology cannot handle unified operations and file conflicts of multiple related files is solved, and strong consistency and collaborative editing of files are achieved.
Patent Information
- Application Number
- CN202010404031.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-05-13
AI Technical Summary
The existing file locking mechanism cannot reliably prevent file conflicts, especially when multiple users edit the same file at the same time. It cannot ensure file consistency and cannot handle unified operations on multiple related files.
Introducing the concept of 'file cluster', binding multiple files and/or folders as a whole for synchronization, locking, and unlocking operations, and ensuring exclusive access to files through the 'relay lock' mechanism to ensure that no files can be accessed before they are fully synchronized. Allow editing, use 'exclusive conditions' to determine whether the file can continue to be edited.
It effectively prevents file conflicts, ensures file consistency, enhances synchronization of multiple related files and collaboration during editing, and avoids editing conflicts caused by file inconsistencies in the prior art.
Smart Images

Figure CN113672966B
Abstract
Description
Technical Field
[0001] The present application relates to the fields of computers and the Internet, and in particular to a control method and system for file sharing access. Background Art
[0002] With the development of network technology and the popularity of online office, it is often necessary for multiple parties in multiple regions to share or operate the same file through the network, so there is a need for corresponding sharing and operation mechanisms to avoid errors or confusion.
[0003] There are currently two main solutions for multiple parties to share the same file:
[0004] The first is to store the files on the server, and each user can access the same original file remotely. However, this solution has high requirements on network conditions. In the case of poor network conditions (for example, slow upload and download speeds) or large files, the performance of network access is poor compared to accessing local files.
[0005] The second method is to distribute copies of the file to each user's local computer, and then use synchronization to ensure the consistency of the file copies in various locations. The synchronization method can be automatic synchronization through the network or software, such as automatically detecting file changes through the program, uploading or downloading the latest version of the file. The synchronization method can also be manual synchronization, such as: copying using a USB flash drive or a mobile hard disk, using instant messaging software, sending by email, etc.
[0006] For the second solution, when multiple users edit the same file on multiple terminals, editing conflicts may occur. For example, if two people modify the same part of the same file at the same time, which party's changes should be retained during synchronization and merging will become a problem. To solve this problem, one way is to lock the file, that is, when a user opens the file, the file is locked, and users on other terminals are not allowed to change other copies of the file, that is, the locker has exclusive use of the file; when the locker closes the file, the file is unlocked to allow the next editor to have exclusive use of the file. Summary of the invention
[0007] After long-term observation and experiments, the inventors found that the existing file lock technology has the following disadvantages because it uses the opening and closing events of a single file as the triggering conditions for locking and unlocking:
[0008] (1) When a user opens a file, it cannot be guaranteed that the file version is the latest. If the user edits a file based on a non-latest version, the result of the edit may conflict with the latest version saved on the server.
[0009] (2) The closing event of a file is not a sufficient condition for unlocking. When a file is closed, although it indicates that the current user has finished editing, it does not mean that the file has been synchronized. In other words, it cannot ensure that the locally updated content can be obtained by users on other ends in a timely manner. This will result in users on other ends not editing based on the latest version of the file, which may result in conflicting files.
[0010] (3) There is no concept of "file cluster". The existing file lock mechanism can only operate on a single file, and it is impossible to bind multiple files together and operate them uniformly as the same file. The file model provided by some software is a "file cluster" consisting of a "main file" and some "subsidiary files (folders)". The contents of these files are related. When the content of one of the files changes, the contents of other files may also change accordingly. For example: the central model (Central Model) provided by Autodesk Revit software is composed of a *.rvt file and *.dat and other files in the *_backup folder. If these files are not locked and synchronized uniformly, there is a possibility of conflicting files, for example: the main file is not unlocked, but the subsidiary files have been updated and synchronized.
[0011] In summary, the existing file lock mechanism cannot reliably prevent the generation of conflicting files.
[0012] In view of the above shortcomings of the prior art, the inventors, after long-term research and analysis, creatively proposed the following ideas to solve the technical problems existing in the prior art:
[0013] (1) Before opening a file, you need to ensure that the file is safe, reliable, and can be edited without the risk of file conflicts.
[0014] Use a driver or a self-implemented file system to intercept user access operations to files, so that when the file does not meet the "continued editing" requirement, the access request is blocked. Add the concept of "exclusive condition" to check whether the file meets the "exclusive condition" before the access operation is allowed. If so, the operation is allowed; if not, the operation is blocked.
[0015] (2) Supplement the file unlocking conditions to ensure that after the file is marked as unlocked, users on other ends can obtain the "continued editable" version of the file.
[0016] After detecting that the file is closed, it is not unlocked immediately, but the relevant information about the file is updated to the server, such as synchronizing the entire file, updating the "exclusive conditions" required for the next locker, etc.
[0017] (3) It is necessary to be able to bind multiple files and / or folders together and synchronize, lock, unlock, etc. as a whole, which is beneficial for the file model provided by software such as Autodesk Revit. Multiple interrelated files can be classified into the same structure or object (file cluster). For files in the same file cluster, you can wait until all files in the file cluster are ready (for example: all are in the unlocked state) before synchronizing them together, instead of synchronizing them immediately when a single file is updated, which causes conflicts when other files are not ready. This can effectively solve the problem of conflicts caused by the failure of multiple related files to be synchronized as a whole or consistently.
[0018] The concept of "file cluster" is introduced, and the association relationship of file clusters is stored in the data structure of the software. When operating one of the files, corresponding operations are also taken on other associated files.
[0019] In view of the above-mentioned defects of the prior art, the present application provides a file access control method and system, which realizes exclusive access to files through a relay lock mechanism in a wide area network environment, especially for ensuring strong consistency of files when multiple people in multiple regions edit the same file at the same time.
[0020] The word "relay" in relay lock comes from the fact that the Nth user can only have exclusive control of the file after satisfying the exclusive condition given by the N-1th user. The "exclusive condition" can be a direct or indirect condition, and its purpose is to ensure that before the Nth edit, the content of the local file copy is completely consistent with the result of the N-1th edit. Any condition that can achieve this purpose can be called an "exclusive condition". The direct and indirect conditions can be:
[0021] (1) Direct conditions: The file feature value information saved by the server will be directly used for local file verification, such as file version number, file hash value, and the last modification time of the file.
[0022] (2) Indirect conditions: The server does not directly save the verification conditions of the file, but saves the method of obtaining the conditions. For example, in the scenario of P2P or LAN accelerated synchronization, the exclusive condition can be the communication method of the previous locker (such as IP address). The next visitor will communicate directly with the previous locker to obtain the feature value of the local file of the previous locker for verification. At the same time, if the feature values are inconsistent, the latest version of the file can be directly pulled from the previous locker in a P2P manner.
[0023] A "file cluster" is a collection of multiple files and / or folders that are linked together so that they can be operated as a single file.
[0024] When a user operates a file locally, the user first determines whether the local file is a "continued editable" file. A "continued editable" file means that the user can edit the file based on this version without causing conflicts in the subsequent process. A file can be continued to be edited if it meets two conditions:
[0025] (1) The file is in the unlocked state;
[0026] (2) The file meets the “exclusive condition”, that is, before the Nth edit, the file content is consistent with the result of the N-1th edit.
[0027] Correspondingly, if the file is in a locked state, or the file does not meet the "exclusive condition", it can be considered that the file is not a "continued editable" file, that is, continuing to edit the file may cause conflicts.
[0028] It should be noted that when multiple parties share, synchronize and edit the same file, a local version of the file will be saved in the local operating system or storage of each party, and an online version of the file will also be saved on the server (or online platform, cloud). Through the sharing and synchronization mechanism, the contents of each local version and online version of the file will be saved as consistent. Therefore, in this application, the local version and online version of the file are collectively referred to as the file by default, that is, any one or more of the local version and online version of the file may be included, unless explicitly indicated or distinguished. In addition, unless otherwise indicated, the local operation file in this application refers to various operations such as opening, viewing, editing, saving, transferring, marking, etc. on the local version of the file stored at the client (or device, user device); similarly, the online operation file in this application refers to various operations such as opening, viewing, editing, saving, transferring, marking, etc. on the online version of the file stored on the server.
[0029] On the one hand, the present application provides a file access control method, comprising: when an access operation to a target file is monitored, obtaining the locking status and exclusive condition of the target file; and judging whether access to the target file is allowed based on the locking status and the exclusive condition; wherein, if the locking status is unlocked and the exclusive condition is met, access to the target file is allowed.
[0030] In some embodiments, optionally, the locking state is first determined, and then the exclusive condition is determined; wherein, if the locking state is locked, access to the target file is not allowed; and / or if the locking state is unlocked but the exclusive condition is not satisfied, access to the target file is not allowed.
[0031] In some embodiments, optionally, the target file, and other files associated with the target file, form a file cluster based on an association relationship, wherein the target file and other files are in the form of files or folders; and other files in the file cluster have the same locking status and exclusive conditions as the target file; and when an operation is performed on the target file, corresponding operations are performed on other files in the file cluster according to the association relationship.
[0032] In some embodiments, optionally, based on the information included in the exclusive condition, it is determined whether the current content of the target file is consistent with the content of the target file saved last time, thereby determining whether the exclusive condition is satisfied.
[0033] In some embodiments, optionally, the exclusive condition includes a direct condition, which is configured as information that can be directly used to determine whether the current content of the target file is consistent with the content of the target file saved last time; and / or the exclusive condition includes an indirect condition, which is configured to be able to be used to obtain the direct condition.
[0034] In some embodiments, the exclusive condition may optionally include one or more of the following information: version number of the file; hash value of the file; last modification time of the file; characteristic value of the file; communication method of the last visitor of the file; method for obtaining the last saved version of the file.
[0035] In some embodiments, optionally, the direct condition includes a version number of the file; comparing the version number of the target file with the version number in the exclusive condition; wherein, if the version number of the target file is the same as the version number in the exclusive condition, determining that the current content of the target file is consistent with the content previously saved in the target file; if the version number of the target file is smaller than the version number in the exclusive condition, determining that the target file needs to be updated; and if the version number of the target file is larger than the version number in the exclusive condition, determining that an error has occurred.
[0036] In some embodiments, optionally, the indirect condition includes a communication method of the previous visitor, and the communication with the previous visitor is performed according to the communication method of the previous visitor in the exclusive condition to obtain from the previous visitor a direct condition for comparing whether the current content of the target file is consistent with the content of the target file saved previously; and / or the indirect condition includes a method for obtaining the previous saved version, and the previous saved version is obtained according to the method for obtaining the previous saved version in the exclusive condition to update the target file.
[0037] In some embodiments, optionally, after accessing the target file, the pre-unlock operation is completed first, then the exclusive condition is updated, and the lock state is modified to unlocked.
[0038] In some embodiments, optionally, the pre-unlocking operation includes one or more of the following operations: closing the target file; saving the target file; uploading the saved target file to the server; uploading the folder associated with the target file to the server; performing corresponding operations on the file cluster to which the target file belongs and other files included therein.
[0039] On the other hand, the present application also provides a file access control system, including a client, the client including: a relay lock logic module, configured to obtain the locking status and exclusive condition of the target file when an access operation to the target file is monitored, and to determine whether access to the target file is allowed based on the locking status and exclusive condition; and an access interception module, configured to intercept or release the access operation to the target file based on the judgment result of the relay lock logic module; wherein the relay lock logic module is further configured to allow access to the target file when the locking status is unlocked and the exclusive condition is met.
[0040] In some embodiments, optionally, the client further includes: a relay lock service detection module configured to detect whether the relay lock logic module is operating normally; and / or an access monitoring module configured to monitor access operations to the target file.
[0041] In some embodiments, optionally, it also includes: a server configured to save the locking state and exclusive conditions of the target file; the relay lock logic module is communicatively connected to the server and configured to obtain the locking state and exclusive conditions of the target file from the server.
[0042] In some embodiments, optionally, the relay lock logic module is further configured to first determine the lock state and then determine the exclusive condition; wherein, if the lock state is locked, access to the target file is not allowed; and / or if the lock state is unlocked but the exclusive condition is not met, access to the target file is not allowed.
[0043] In some embodiments, optionally, the target file, and other files associated with the target file, form a file cluster based on an association relationship; wherein the target file and other files are in the form of files or folders; and other files in the file cluster have the same locking status and exclusive conditions as the target file; and the client is configured to be able to perform corresponding operations on other files in the file cluster according to the association relationship when operating on the target file.
[0044] In some embodiments, optionally, the relay lock logic module is further configured to determine whether the current content of the target file is consistent with the content of the target file saved last time based on the information included in the exclusive condition, thereby determining whether the exclusive condition is met; wherein the exclusive condition includes one or more of the following information: version number of the file; hash value of the file; last modification time of the file; characteristic value of the file; communication method of the last visitor of the file; method of obtaining the last saved version of the file.
[0045] In some embodiments, optionally, the relay lock logic module is further configured to be able to compare the version number of the target file with the version number in the exclusive condition, and determine whether the current content of the target file is consistent with the content saved last time the target file is saved; wherein, if the version number of the target file is the same as the version number in the exclusive condition, then it is determined that the current content of the target file is consistent with the content saved last time the target file is saved; if the version number of the target file is smaller than the version number in the exclusive condition, then it is determined that the target file needs to be updated; and if the version number of the target file is larger than the version number in the exclusive condition, then it is determined that an error has occurred.
[0046] In some embodiments, optionally, the relay lock logic module is further configured to communicate with the previous visitor according to the communication method of the previous visitor in the exclusive condition to compare whether the current content of the target file is consistent with the content of the target file saved last time; and / or the relay lock logic module is further configured to obtain the previous saved version according to the method of obtaining the previous saved version in the exclusive condition to update the target file.
[0047] In some embodiments, optionally, the client is further configured to complete the pre-unlock operation after accessing the target file, then update the exclusive condition, and change the lock state to unlocked; wherein the pre-unlock operation includes one or more of the following operations: closing the target file; saving the target file; uploading the saved target file to the server; uploading the folder associated with the target file to the server.
[0048] On the other hand, the present application also provides a file access control method, comprising: when an access operation to a target file is monitored, querying whether the target file is included in a file cluster, wherein the target file is in the form of a file or a folder; and if the target file is included in the file cluster, determining whether the access operation to the target file is allowed based on the status of the file cluster.
[0049] In some embodiments, optionally, it further includes: if the access operation to the target file is allowed, the file cluster and / or other files contained in the file cluster are processed accordingly, wherein the other files are in the form of files or folders.
[0050] In some embodiments, optionally, the file cluster includes a file list, the file list includes a file identifier corresponding to each file in the file cluster; and the target file is queried by retrieving the file list to determine whether it is included in the file cluster.
[0051] In some embodiments, optionally, if the file identifier of the target file is included in the file list, or the target file belongs to a folder in the file list, the target file is included in the file cluster.
[0052] In some embodiments, optionally, the state of the file cluster includes one or more of the following states: locked; unlocked; readable; writable; deletable; exclusive; and its child items can be operated.
[0053] In some embodiments, optionally, the state of the file cluster is the minimum permission state of all files in the file cluster.
[0054] In some embodiments, optionally, the access operation includes one or more of the following operations: read; write; delete; add file; add subfolder.
[0055] In some embodiments, optionally, if the status of the file cluster is locked, access operations to the target file are not allowed.
[0056] In some embodiments, optionally, if the status of the file cluster is unlocked and the access operation is delete, the access operation to the target file is allowed and the target file is removed from the file cluster.
[0057] On the other hand, the present application also provides a file access control system, including: a file cluster module, the file cluster module includes a file list, the file list includes a file identifier corresponding to each file in the file cluster, wherein each file in the file cluster is in the form of a file or a folder.
[0058] In some embodiments, optionally, it also includes: an access monitoring module, which is configured to monitor and control access operations to the target file; the access monitoring module is further configured to query the file cluster module whether the target file is included in the file cluster when the access operation to the target file is monitored, wherein the target file is in the form of a file or a folder; the file cluster module is further configured to query whether the target file is included in the file cluster, wherein if the target file is included in the file cluster, the status of the file cluster is fed back to the access monitoring module; the access monitoring module is further configured to determine whether to allow access operations to the target file based on the status of the file cluster.
[0059] In some embodiments, optionally, it also includes: an associated operation module, which is configured to process the file cluster and / or other files contained in the file cluster accordingly when the access operation to the target file is allowed, wherein the other files include files or folders.
[0060] In some embodiments, optionally, the access monitoring module is further configured to query whether the target file is included in the file cluster by retrieving the file list.
[0061] In some embodiments, optionally, if the file identifier of the target file is included in the file list, or the target file belongs to a folder in the file list, the target file is included in the file cluster.
[0062] In some embodiments, optionally, the state of the file cluster includes one or more of the following states: locked; unlocked; readable; writable; deletable; exclusive; and its child items can be operated.
[0063] In some embodiments, optionally, the state of the file cluster is the minimum permission state of all files in the file cluster.
[0064] In some embodiments, optionally, the access operation includes one or more of the following operations: read; write; delete; add file; add subfolder.
[0065] In some embodiments, optionally, the access monitoring module is further configured to disallow access operations to the target file when the status of the file cluster is locked.
[0066] In some embodiments, optionally, when the status of the file cluster is unlocked and the access operation is delete, the access monitoring module is further configured to allow access operations to the target file; and the associated operation module is further configured to remove the target file from the file cluster.
[0067] On the other hand, the present application also provides a file access control device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor is configured to implement the steps of the above-mentioned file access control method when executing the computer program.
[0068] On the other hand, the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned file access control method can be implemented.
[0069] Compared with the existing file locking mechanism, the method and system provided by this application have at least the following advantages:
[0070] (1) By intercepting the user's file opening event through the driver or the self-implemented file system, and adding the judgment of the "exclusive condition" when locking, it effectively prevents the editor from opening the file that does not meet the "continued editing" condition and prevents conflicts.
[0071] (2) After the file is closed, it is unlocked only after the prerequisites for unlocking are executed, which makes it possible for other users to obtain the "continued editable" file in point (1).
[0072] (3) The concept of "file cluster" extends the support of file locks from a single file to multiple files and / or folders.
[0073] Compared with the prior art, the file access control method and system of the present application can ensure file consistency in some situations where file conflicts cannot be detected or avoided using existing file lock methods, thereby significantly reducing the occurrence of file conflicts and enhancing the consistency of shared files.
[0074] The concept, specific structure and technical effects of the present application will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The present application will be more readily understood when the following detailed description is read in conjunction with the accompanying drawings, in which like reference numerals represent like parts throughout, and in which:
[0076] Figure 1 It is a structural diagram of an embodiment of the file access control system in this application.
[0077] Figure 2 This is a module diagram of an embodiment of a client in the present application.
[0078] Figure 3 This is a module diagram of an embodiment of a server in the present application.
[0079] Figure 4 This is a schematic diagram of the architecture of an embodiment of the file access control system in this application.
[0080] Figure 5 A schematic diagram of file status migration of an embodiment of a file access control method in the present application.
[0081] Figure 6 The figure is a flowchart of an embodiment of the file access control method in the present application.
[0082] Figure 7 This is a schematic diagram of the architecture of an embodiment of the file access control system in this application.
[0083] Figure 8 It is a structural diagram of an embodiment of a computer device, equipment or terminal in the present application. DETAILED DESCRIPTION
[0084] The technical solutions in the embodiments of the present application will be described clearly and completely below. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The present application can be embodied by many different forms of embodiments, and the protection scope of the present application is not limited to the embodiments mentioned in the text. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work should belong to the scope of protection of the present application.
[0085] Various specific embodiments of the present application will be described below with reference to the accompanying drawings that form a part of this specification. It should be understood that although terms indicating directions are used in this application, such as "front", "back", "up", "down", "left", "right", "inside", "outside", "top", "bottom", "positive", "negative", "near", "far", "lateral", "longitudinal", "width direction", "length direction", "height direction", "axial", "radial", "clockwise", "counterclockwise", etc., to describe various example structural parts and elements of the present application, these terms are used here only for the purpose of convenience of description, and these terms are determined based on the exemplary orientations shown in the accompanying drawings. The embodiments disclosed in the present application can be set in different directions, so these terms indicating directions are only for illustration and should not be regarded as limitations.
[0086] For the convenience of description, the connection relationship between the modules or parts shown in the drawings is only an exemplary description, and those skilled in the art can adopt other equivalent connection relationships, as long as the modules or parts can also realize the functions of the technical solution of the present application under such connection relationships. The embodiments disclosed in the present application can be arranged according to different equivalent connection relationships, so the connection relationships shown in the drawings and the relevant contents of the specification are only for illustration and should not be regarded as limitations.
[0087] The size of each component shown in the drawings is arbitrarily shown, and the present application does not limit the specific size of each component unless there is a clear record or description in the specification and drawings. In order to make the illustration clearer, the size of the components in some places in the drawings is appropriately exaggerated or the corresponding proportional relationship is adjusted.
[0088] Ordinal numbers such as "first" and "second" used in this application are only used for distinction and identification, and do not have any other meanings. If not specifically specified, they do not indicate a specific order or have a specific association. For example, the term "first component" itself does not imply the existence of the "second component", and the term "second component" itself does not imply the existence of the "first component".
[0089] Figure 1 FIG. 1 is a schematic diagram of a structure of an embodiment of a file access control system in this application. Figure 1 As shown, the system includes clients (or terminals, devices, equipment, entities) 100A, 100B, 100C (collectively referred to as clients 100), servers (also referred to as online platforms, cloud, service end) 110 and networks 120. Three clients are shown here for illustrative purposes, but in fact the system may include any number of clients. Similarly, other modules or components described and shown in this application may also include single or multiple instances, without loss of generality, to meet the needs of the embodiments.
[0090] The client 100 may be any suitable computer client, handheld mobile client, tablet computer, or other computing device for locally storing, viewing, editing files (or content items), and synchronizing files with the server 110 and other clients 100 .
[0091] Each client 100 communicates with the server 110 via the network 120. The network 120 may be any suitable network, for example, a local area network, a wide area network, a private network, a global network, and any combination thereof. In some embodiments, the client 100 communicates with a local network service provider via a wired or wireless communication network, and communicates with the server 110 via the Internet. The clients 100A, 100B, and 100C may communicate with each other via the server 110, or may communicate via the network 120 or other communication networks (such as Figure 1 The two devices (shown by dashed lines) communicate directly with each other, such as via point-to-point (P2P) communication, a Bluetooth connection, or a wired connection via a universal serial bus (USB).
[0092] The server 110 provides file sharing and synchronization services for the users of the client 100, for example, allowing the user of the client 100A to share the same file with the users of other clients 100B and 100C. The server 110 can also be updated in response to changes in the content of the shared file, and allows the shared file to be updated synchronously across multiple clients 100. For example: based on the local modification of the file at the client 100A, the file at the clients 100B, 100C and the server 110 is updated to the final (or latest, most recent, last) version of the file saved at the client 100A. Similarly, the file at the clients 100A, 100B, and 100C can also be updated to the final version of the file saved at the server 110 based on the online modification of the file at the server 110.
[0093] In some embodiments, the same user can synchronize files between multiple clients 100 associated with the user's account, and the user can also share and synchronize files between clients 100 associated with other users' accounts.
[0094] The content stored by the client 100 and the server 110 may include data or content stored in a digital form of any type or format, such as digital data, documents, multimedia (e.g., images, photos, videos, audio, streaming media, etc.), data files, databases, source codes, object codes, records, and any other types of data, files, or folders. If not otherwise specified, they are collectively referred to as files or content items, and the forms and types of their storage or presentation can all be files or folders. In some operating systems, files (File) and folders (Directory) are collectively referred to as file system entries (FileSystem Entries). If not otherwise specified in this application, they are also collectively referred to as files or content items together with the above content. The files stored by the server 110 can also be used to organize other files or content items, such as folders, tables, collections, albums, playlists, or for other database structures (e.g., object-oriented, keys, values, etc.). In practice, various clients 100 can synchronize files of different groups based on the association of accounts and corresponding permissions.
[0095] Figure 2 FIG. 1 is a schematic diagram of a module of an embodiment of the client 100 in the present application. Figure 2As shown, the client 100 includes an operating system 210, a local file collaboration program 240, and one or more local applications 220. The local applications 220 may include various applications for creating, viewing, using, and modifying files stored on the client 100, such as a word processor, a spreadsheet, a database management system, a code editor, an image or video editor, an e-book reader, an audio or video player, etc. The local file collaboration program 240 may be used independently or in conjunction with the operating system 210, the local application 220, etc., for operations and processing such as sharing, synchronization, monitoring, and collaboration of local files of the client 100, so as to execute and implement various file access control methods provided in the present application. The operating system 210 on each client 100 provides a local file management system and may run various software modules, such as the local application 220 and the local file collaboration program 240.
[0096] The client 100 may also include a display for providing information to the user, and a touch screen is included in some clients 100. The client 100 may also include a network interface for communicating with the server 110 via the network 120. The client 100 may also include a user input module, which may receive user input from various user input clients such as a keyboard, a mouse, a touchpad, or other clients. For the sake of simplicity of description, conventional components above and more of the client 100 are not shown in the figure, such as one or more computer processors, local fixed memory (such as RAM and ROM) and optional removable memory (such as SD card and USB flash drive), power supply, audio and video output client, etc. The client 100 may also include additional components such as a camera or a positioning module. The camera may be used to capture images or videos. The positioning module uses, for example, global positioning satellite signals, cellular data, base station signals, network data, or other methods to determine the location of the client 100. The local application 220 or the local file collaborative program 240 may use the position module to obtain position data and add the position data to the metadata of the relevant file, such as an image captured by the camera.
[0097] The client 100 can access the server 110 in various ways. The local file collaborative program 240 can be a dedicated application or module that provides access to the services of the server 110, and can provide access to shared files through a user interface, or provide access to other applications through corresponding interfaces or protocols. Alternatively, the local file collaborative program 240 can integrate access to the server 110 with the local file management system provided by the operating system 210. When access to the server 110 is integrated into the local file management system, the file organization scheme stored and maintained on the server 110 can be represented as a local file structure by the local file collaborative program 240 in combination with the operating system 210. The local file collaborative program 240 can be implemented in various forms, such as an independent application, an application plug-in, or a browser extension.
[0098] The operating system 210 can process and identify various events. Such events include requests from local applications 220 to close or open files or content items. As described below, these events can be monitored and extracted by the file collaboration program 240 and used to identify operations or changes related to files. Events managed and controlled by the operating system 210 can be called system events. These events and various information and data that can be extracted from these events are related to the operating system 210 and do not rely on the local application 220 or other applications.
[0099] The local file collaboration program 240 can identify interactions that occur with respect to a file, such as when a user opens, closes, or edits a file on the client 100. These interactions are monitored or identified by the local file collaboration program 240 to generate interaction information describing the file interactions. The interaction information may include interactions with the file collaboration program 240 and interactions with the local application 220. Other types of interaction information may also include status information, comments, messages, notification requests, etc. related to the file, which may be obtained by the file collaboration program 240. Messages may include notification messages between other clients 100, messages indicating that the user intends to interact with the file (e.g., open, edit, save, update), and messages indicating that the user intends to start a collaborative editing or session.
[0100] Notification requests may include a request to be notified when another user's interaction information changes. Interaction information may also include metadata modifications, such as version descriptions or requests for further information about related files stored on server 110, such as a request to view version information or previous file versions.
[0101] The interaction information may be sent to other clients 100 that share or synchronize the file, such as a warning to other users on another client that the file is related to the file, that other users want to edit the file, or initiate an editing session, etc. The local file collaboration program 240 may identify when a user interacts with a file using a local application 220, and may also receive input information from the user. In various embodiments, the user's presence in the file (e.g., the user has an open file or content being edited) may be identified through interaction with the operating system 210.
[0102] The client 100 may receive files or updated versions of files from the local file collaboration program 240, and allow the user to view, modify and interact with the files using various local applications 220 stored or running on the client 100. For example, the client 100 may include an image editing application that operates image content, a word processing application that allows text content to be modified, or a computer-aided design (CAD) application that allows modification of graphic content, etc. The interaction information is determined by the client 100 via the user interaction application, and the interaction information may be sent to other clients 100. In addition, when the client 100 receives interaction information related to other clients 100, the client 100 may display the interaction information, for example, in the form of a user interface element.
[0103] In some embodiments, the application that detects interactive information related to the file is different from the application that views or manipulates the file. For example, the application that detects interactive information is different from the photo editing application that manipulates or displays the image content. In various embodiments, the application that detects interactive information is also responsible for synchronizing the file with the server 110, and monitoring can be performed for various applications, files, or content, or monitoring can be integrated into each type of file viewer. For example, for each of the photo editing application, the word processing application, and the playlist editing application, a general monitoring plug-in or application can be used, or a specific monitoring plug-in or application can be used separately.
[0104] In some embodiments, clients 100 that share or synchronize a file can collaboratively edit the file. Collaborating users (or entities) can open, view, or edit a file in a local application 220. In some embodiments, two or more collaborative users can edit the file simultaneously during collaboration. Collaborating users can make changes to content visible to other collaborative users in real time and view changes made to the file and its content by other collaborative users. In some embodiments, user collaboration is managed by a local file collaboration program 240.
[0105] The local file collaborative program 240 may include a relay lock service detection module 241 , a relay lock logic module 242 , an access interception module 243 , and an access monitoring module 244 .
[0106] The client 100 is locally provided with a shared folder or a shared file system, and the access monitoring module 244 can monitor the access operation of the files or folders therein. When it is monitored that an application (e.g., a local application 220) accesses a shared file, the access can be intercepted by the access interception module 243, and the access can be denied or allowed according to the specific circumstances. In addition, the system events (e.g., Close File) of the files or folders inside the shared folder or the shared file system can also be monitored.
[0107] The relay lock service detection module 241 is used to detect whether the relay lock logic module 242 is operating normally, to ensure that the files or folders in the shared folder cannot be opened when the relay lock logic module 242 is not operating, or the relay lock logic module 242 can be successfully invoked before being opened.
[0108] The access interception module 243 can intercept the file access operation in the shared folder or shared file system, and decide whether to release or block the access operation after interacting with the relay lock logic module 242.
[0109] The relay lock service detection module 241, access interception module 243, and access monitoring module 244 can be a file system implemented by a driver or its own application, or can be implemented in the form of file manager software, and its purpose is to meet the interception of file access operations and the monitoring of file or folder system events.
[0110] In some embodiments, the file system is part of the operating system, and file system events are monitored and issued by the operating system. These events issued by the operating system can be monitored, intercepted or processed by a driver or the application itself.
[0111] In some embodiments, a file manager software may be written or set up, which has functions similar to the resource manager of the operating system, and then the local folders and files in the operating system are hidden, so that the user can only access these files through this file manager software, which is equivalent to replacing the file system or resource manager of the operating system itself with the file manager software. Since the user operates these files through the file manager software interface written or set up separately, the file manager software itself can know what operations the user has performed, and each operation record of the user will be monitored and intercepted by this file manager software, so there is no need to monitor the events of the operating system itself.
[0112] The relay lock logic module 242 can communicate with the server 110, obtain the lock state and exclusive condition of the shared file from the server 110, and determine whether to allow access to the shared file based on the lock state and exclusive condition. The access interception module 243 can intercept or release the access operation to the shared file based on the judgment result of the relay lock logic module 242.
[0113] Figure 3 FIG. 1 is a schematic diagram of a module of an embodiment of the server 110 in the present application. Figure 3 As shown, the server 110 may include an online file collaboration module 340 and a storage module 310. For the purpose of simplicity, the figure does not show other various necessary or optional software and hardware modules and devices that the server 110 may include, such as a processor, a memory, a display device, an input device, a network interface, an operating system, an application program, etc.
[0114] The online file collaboration module 340 can manage and process shared files and related information stored in the server 110, and can interact with the local file collaboration program 240 of the client 100 to process and synchronize shared files between multiple clients 100 and the server 110. For example, if the first entity (user) of the client 100A modifies a shared file, the local file collaboration program 240 of the client 100A can upload the modification information and the modified final version of the file to the server 110 through the online file collaboration module 340, so as to update the file stored on the server 110 to the modified final version, and make corresponding records or marks. Later or simultaneously, it can also be further transmitted to other clients 100B and 100C that store the file through the file collaboration module 340, so as to update the file stored on the client 100B and the client 100C to the modified final version.
[0115] In some embodiments, multiple clients 100 may also interact through the online file collaboration module 340 of the server 110. For example, when a first entity at client 100A is operating or editing a shared file, and a second entity at another client 100B opens the file and attempts to modify it, the online file collaboration module 340 may send corresponding notification or prompt information to client 100A and client 100B, respectively. For example, a message may be sent to the second entity at client 100B to prompt that the file is being edited by the first entity at client 100A, so that the second entity can take actions such as closing the file, abandoning the operation, and issuing a collaborative editing request; a message may be sent to the first entity at client 100A to prompt that there are other entities' operations or requests for the file, so that the first entity can take actions such as closing the file, saving the file, and accepting a collaborative editing request.
[0116] The storage module 310 can store shared files and information related to shared files, such as the lock status, exclusive conditions, file clusters and associations of shared files. The server 110 will record the file status of all shared files or file clusters. The file status mainly consists of two parts:
[0117] (1) Lock status: There are two values: Locked (locked) and Unlocked (unlocked), which are used to indicate whether the file is currently occupied.
[0118] (2) Exclusive conditions: The conditions that must be met for the next visitor to exclusively own the file.
[0119] Based on the above-mentioned client 100 and server 110, the present application provides a method and system for file access control, which is described in more detail below by way of examples.
[0120] The file access control method provided by this application may include the following steps:
[0121] Step 1: When an access operation to a target file is detected, the locking state and exclusive condition of the target file are obtained.
[0122] Step 2: Determine whether to allow access to the target file based on the lock state and the exclusive condition. If the lock state is unlocked and the exclusive condition is met, access to the target file is allowed.
[0123] In some embodiments, the lock state may be determined first, and then the exclusive condition may be determined. If the lock state is locked, access to the target file is not allowed, and the exclusive condition is no longer determined. If the lock state is unlocked, the exclusive condition is determined. If the lock state is unlocked and the exclusive condition is met, access to the target file is allowed; if the lock state is unlocked but the exclusive condition is not met, access to the target file is not allowed.
[0124] In some embodiments, the target file and other files and / or folders associated with the target file can form a file cluster based on the association relationship. The other files and / or folders in the file cluster have the same locking state and exclusive condition as the target file. When the target file is operated, the other files and / or folders in the file cluster are operated accordingly according to the association relationship. For example, when the locking state of the target file is modified to Locked, the locking states of the other files and / or folders in the file cluster are also modified to Locked at the same time, so that when a user accesses the target file, other files and / or folders in the file cluster are not allowed to be accessed by other users, so that all files in the file cluster remain consistent.
[0125] In some embodiments, a relevant tool (such as subst, etc.) can be used on the client to map the folder where the file or file cluster is located to a drive letter to ensure that the files and folders therein have the same file path on different clients. This method is beneficial for some software that relies on file paths or absolute file paths (such as Autodesk Revit software).
[0126] In some embodiments, for the case of a file cluster, it can be determined whether the target file is a member of a file cluster: if so, the lock state of the file cluster is used as its lock state ("one person locked, the whole family locked"), and the exclusive condition is also the exclusive condition of the file cluster; if not, it is processed as a single file. In fact, in a sense, a single file can also be regarded as a file cluster with only one member.
[0127] In this step, it is possible to determine whether the current content of the local target file is consistent with the content of the target file saved last time (or the latest, last, most recent, or last time) based on the information included in the exclusive condition, thereby determining whether the exclusive condition is met. The exclusive condition is used to determine whether the local file is consistent with the most recently updated public version. Depending on the way the determination information is obtained, the exclusive condition may include direct conditions and / or indirect conditions.
[0128] Direct conditions can be used directly to determine whether the current content of the local target file is consistent with the content of the target file saved last time. Direct conditions may include one or more of the following information: file version number; file hash value; file last modification time; file feature value.
[0129] Indirect conditions are used to obtain direct conditions and / or the latest version of the target file. Indirect conditions may include one or more of the following information: the communication method of the previous visitor of the file; the method of obtaining the previous saved version of the file. Compared with the server storing the complete judgment information (direct conditions), the server stores the "key" for obtaining the complete judgment information (indirect conditions). After the client obtains the "key", it obtains the complete judgment information by itself, which can effectively reduce the space occupied by the server.
[0130] In some embodiments, relevant information for file comparison may be obtained based on indirect conditions, such as Hash codes, Hash trees, and other Hash values of files. When the files are determined to be inconsistent, data for updating the files may be further obtained, such as directly downloading the entire file based on indirect conditions.
[0131] In some embodiments, the exclusive condition includes a hash value of a previously saved file. By comparing the hash value of the target file with the hash value in the exclusive condition, it can be determined whether the current content of the target file is consistent with the content saved previously, thereby determining whether the exclusive condition is met.
[0132] In some embodiments, the exclusive condition includes a self-incrementing version number of the file (the corresponding version number is updated after the file is modified, and the version number of the updated file is greater than the version number of the previous file). The judgment can be made by comparing the version number of the target file with the version number in the exclusive condition, and different situations can be distinguished to take corresponding measures.
[0133] If the version number of the target file is the same as the version number in the exclusive condition, it is determined that the current content of the target file is consistent with the content saved last time, and the exclusive condition is satisfied.
[0134] If the version number of the target file is smaller than the version number in the exclusive condition, it means that the current version of the target file is older and the target file needs to be updated. At this time, the file synchronization update operation can be performed normally, for example, the user can be prompted or the target file can be automatically updated to the latest version (that is, the version finally saved by the previous user).
[0135] If the version number of the target file is greater than the version number in the exclusive condition, it can be determined that an abnormal unlocking error has occurred. For example, after the previous user locked the file, an abnormal shutdown or client crash occurred, resulting in a failure to unlock the file normally, and then the file was unlocked due to a lock timeout or forced unlocking by the administrator. At this time, the user can be reminded whether to save the file separately to prevent the loss of work content.
[0136] In some embodiments, the server does not directly save the verification condition for verifying the file content, but saves the method for obtaining the verification condition. For example, the exclusive condition includes the communication method of the previous user (indirect condition), so that the current visitor can directly communicate with the previous user to obtain the verification condition for comparing and verifying the file content (direct condition) from the previous user, so as to verify the file content and determine whether the exclusive condition is met.
[0137] In some embodiments, the communication method of the previous visitor in the exclusive condition can be used to communicate with the previous visitor to obtain a direct condition from the previous visitor for comparing whether the current content of the target file is consistent with the content of the target file saved the previous time, so as to compare whether the current content of the target file is consistent with the content of the target file saved the previous time; the previous saved version can also be obtained according to the acquisition method of the previous saved version in the exclusive condition to update the target file. In this embodiment, the direct condition can be saved at the previous visitor, or it can be generated by performing corresponding operations when communicating with the previous visitor through indirect conditions.
[0138] As an example, in the scenario of P2P or LAN accelerated synchronization, the exclusive condition can be the communication method (such as IP address) of the previous user (i.e., the previous locker), and the current user (i.e., the current visitor) will communicate directly with the previous user to obtain the characteristic value of the local file of the previous user for verification. The characteristic value of the file may have been saved at the previous user and can be directly obtained through indirect conditions; or it may be newly generated by performing corresponding operations when communicating with the previous user through indirect conditions. When the verification result indicates that the characteristic value of the file is inconsistent, the latest version of the file can be directly pulled from the previous user in a P2P manner.
[0139] Since direct conditions need to be stored or obtained through calculation, and they are not needed before the next user accesses the file. Therefore, the indirect conditions used to obtain direct conditions are usually saved on the server, and when the direct conditions are needed, they are obtained or calculated in some way, which can effectively save storage space and optimize execution time. For example, the exclusive conditions used for judgment are still direct conditions such as version numbers and hash values, but before the next user edits, the version number and hash value are not used, so they can be delayed until they are really needed to be obtained or calculated, without consuming resources for storage or calculation in advance, thereby saving storage space and optimizing the initial execution time.
[0140] Step 3: After accessing the target file, first complete the pre-unlock operation, then update the exclusive condition, and then change the lock state to unlock. The pre-unlock operation may include one or more of the following operations: close the target file; save the target file; upload the saved target file to the server; upload the folder associated with the target file to the server; perform corresponding operations on the file cluster to which the target file belongs and other files included in it. In this way, the next user can be provided with a "continued editable" file without the risk of file conflict.
[0141] Figure 4 FIG. 1 is a schematic diagram of an embodiment of the file access control system in this application. Figure 4 As shown, when an application exclusive access operation is detected for a shared target file (or folder), the relay lock service detection module 241 inquires the relay lock logic module 242 whether it is running. The relay lock logic module 242 responds to the inquiry and returns its own running status to the relay lock service detection module 241. The relay lock service detection module 241 determines whether to intercept or release this access operation based on the result returned by the inquiry. If the relay lock logic module 242 operates normally and returns a signal indicating a normal operating state to the relay lock service detection module 241, the relay lock service detection module 241 releases this access operation. If the relay lock logic module 242 does not operate normally, returns a signal indicating an abnormal operating state to the relay lock service detection module 241, or the relay lock service detection module 241 does not receive a return signal from the relay lock logic module 242, the relay lock service detection module 241 intercepts this access operation. In this way, it can be ensured that the access operation is performed when the relay lock logic module 242 operates normally.
[0142] When the access interception module 243 receives the access operation request, it asks the relay lock logic module 242 whether to release this access operation. The relay lock logic module 242 responds to the inquiry and further requests the file status of the target file from the server 110. The server 110 responds to the request and returns the lock status and exclusive condition of the target file to the relay lock logic module 242. The relay lock logic module 242 determines whether to allow this access operation based on the acquired lock status and exclusive condition, and returns the judgment result to the access interception module 243. The access interception module 243 intercepts or releases this access operation based on the judgment result returned by the relay lock logic module 242. If the relay lock logic module 242 determines that this access operation can be allowed, the access interception module 243 releases this access operation, and the target file can be accessed. If the relay lock logic module 242 determines that this access operation cannot be allowed, the access interception module 243 intercepts this access operation, and the target file cannot be accessed, thereby avoiding the situation where a file conflict occurs due to accessing the target file.
[0143] In the present application, the access operation to a file may include various operations such as opening, reading, modifying, editing, saving, and updating the file. In some embodiments, when it is determined that there is a risk of file conflict, different processing methods can be selected according to different types of access operations, for example, operations such as opening in a read-only manner can be allowed, while operations such as modification and editing are not allowed. In some embodiments, when it is determined that there is a risk of file conflict and access operations are not allowed or access operations are intercepted, a prompt can be further given to the user to guide the user to take corresponding safer operations, such as opening the target file in a read-only manner, or updating the target file to the latest modified version first. In the present application, for the convenience of description, no distinction is made between specific operation types, and they are uniformly and generally described as access operations.
[0144] Figure 5 This is a file status migration diagram of an embodiment of the file access control method in this application, which shows the process of server file status migration. Figure 5 As shown, in the initial state, that is, for a newly created or newly added shared file, the lock state is Unlocked, and the exclusive condition is Null (indicating that the condition is empty or there is no condition), that is, there are no restrictions and anyone is eligible for exclusive use.
[0145] User 0 starts accessing the file and changes the lock state of the file to Locked, thereby monopolizing the file during the access process and not allowing other users to access the file. When user 0 ends accessing the file, the corresponding exclusive condition is given and the lock state is changed to Unlocked for subsequent access by other users.
[0146] When user N tries to access the file, it is determined that the lock state of the file is Unlocked, and the exclusive condition given by the previous user N-1 is met, then user N is allowed to access the file. User N starts to access the file and changes the lock state of the file to Locked, thereby monopolizing the file during the access process and not allowing other users to access the file. At this time, user N has not updated the exclusive condition of the file, and the exclusive condition of the file still remains the exclusive condition given by the previous user N-1. However, since the lock state of the file is Locked at this time, other users are not allowed to access it, so there is no need to determine whether the exclusive condition is met, and the exclusive condition is meaningless during the access process of user N. When user N ends access to the file, the corresponding exclusive condition is given and updated, and the lock state is changed to Unlocked for subsequent access by other users.
[0147] When the next user N+1 tries to access the file, a judgment is made based on the lock status and exclusive conditions updated after user N ends the access to determine whether user N+1 is allowed to access. If the lock status is Unlocked and meets the exclusive condition given by the previous user N, user N+1 is allowed to access. User N+1 starts to access the file and changes the lock status of the file to Locked, thereby monopolizing the file during the access process and not allowing other users to access the file. At this time, user N+1 has not updated the exclusive condition of the file, and the exclusive condition of the file remains the exclusive condition given by the previous user N. When user N+1 ends the access to the file, the corresponding exclusive condition is given and updated, and the lock status is changed back to Unlocked for subsequent access by other users. Thereafter, the access process of more users is similar to the access process of user N and user N+1 mentioned above.
[0148] In this way, each user accesses the file according to the exclusive conditions given by the previous user, and gives the latest exclusive conditions after the access ends, and then passes it to the next user. That is, the file lock is relayed between users, strictly ensuring that user N edits based on the edited version of the previous user N-1, thereby ensuring the consistency of the file and effectively preventing the occurrence of file conflicts.
[0149] The present application also provides a file access control system, which may include a client and a server. The server is configured to save the lock state and exclusive conditions of the target file. The client may include: a relay lock logic module, an access interception module, a relay lock service detection module, and an access monitoring module.
[0150] The relay lock logic module is connected to the server in communication and is configured to obtain the lock status and exclusive conditions of the target file from the server when an access operation to the target file is detected, and to determine whether to allow access to the target file based on the lock status and exclusive conditions. The access interception module is configured to intercept or release the access operation to the target file based on the judgment result of the relay lock logic module. The relay lock service detection module is configured to detect whether the relay lock logic module is operating normally. The access monitoring module is configured to monitor the access operation to the target file.
[0151] In some embodiments, the relay lock logic module is further configured to first determine the lock state and then determine the exclusive condition. If the lock state is locked, access to the target file is not allowed, and the exclusive condition is no longer determined. If the lock state is unlocked, the exclusive condition is determined. If the lock state is unlocked and the exclusive condition is met, access to the target file is allowed; if the lock state is unlocked but the exclusive condition is not met, access to the target file is not allowed.
[0152] For the case of a file cluster, the relay lock logic module is further configured to first determine whether the target file is a member of a file cluster: if so, the lock state of the file cluster is used as its lock state ("one person is locked, the whole family is locked"), and the exclusive condition is also the exclusive condition of the file cluster; if not, it is processed as a single file. In fact, in a sense, a single file can also be regarded as a file cluster with only one member.
[0153] The file cluster module can be used to record and retrieve file cluster list information, that is, to answer whether a certain file is a member of a certain file cluster and which file cluster it is a member of. The relay lock logic module is used to determine whether access is allowed. In some embodiments, the file cluster module can be a built-in part of the relay lock logic module.
[0154] In some embodiments, the relay lock logic module is further configured to determine whether the current content of the target file is consistent with the content of the target file saved last time based on the information included in the exclusive condition, thereby determining whether the exclusive condition is met.
[0155] In some embodiments, the relay lock logic module is further configured to compare the version number of the target file with the version number in the exclusive condition, and determine whether the current content of the target file is consistent with the content of the target file saved last time. If the version number of the target file is the same as the version number in the exclusive condition, it is determined that the current content of the target file is consistent with the content of the target file saved last time; if the version number of the target file is less than the version number in the exclusive condition, it is determined that the target file needs to be updated; and if the version number of the target file is greater than the version number in the exclusive condition, it is determined that an error occurs.
[0156] In some embodiments, the relay lock logic module is further configured to communicate with the previous visitor according to the communication mode of the previous visitor in the exclusive condition to compare whether the current content of the target file is consistent with the content of the target file saved last time.
[0157] In some embodiments, the relay lock logic module is further configured to obtain the previous saved version according to the method for obtaining the previous saved version in the exclusive condition to update the target file.
[0158] When the target file belongs to a file cluster, the client may be configured to perform corresponding operations on other files and / or folders in the file cluster according to the association relationship when operating the target file.
[0159] The client is further configured to complete the pre-unlock operation after accessing the target file, update the exclusive condition, and then change the lock state to unlock.
[0160] Figure 6FIG. 1 is a flowchart of an embodiment of the file access control method in this application. Figure 6 As shown, when an application exclusive access operation is detected, first check whether the relay lock service is enabled. If the relay lock service is not enabled, the access is denied or the relay lock service is invoked.
[0161] If the relay lock service is already enabled, the current (or latest, updated after the last save) lock status and exclusive conditions of the file can be obtained from the server to continue to determine whether to allow this access. If the lock status is locked, the access is denied. If the lock status is unlocked, determine whether the exclusive conditions are met.
[0162] If the exclusive condition is not met, relevant operations are triggered to make the file meet the exclusive condition, and the locking state and exclusive condition of the file are obtained from the server again, and whether to allow this access is continued in a similar manner to the above.
[0163] If the exclusive condition is met, a lock request is sent to the server to change the lock state of the file to locked, so as to exclusively occupy the file and allow this access.
[0164] When this access ends, the file is synchronized with the server or other clients to synchronize the copies of each file to the final saved version, and then an unlock request is sent to the server. When the server unlocks the file, it first updates the exclusive condition and then changes the lock state to unlocked.
[0165] In some embodiments, the file access control method may include the following steps:
[0166] Step 1: When an application attempts to exclusively access a file copy under the synchronization folder, the operation will first be intercepted by the Relay Lock service detection module to check whether the Relay Lock service process is started: if not, the access will be denied and the process will be exited; if it has been started and is running normally, proceed to step 2.
[0167] Step 2: The operation will be intercepted by the access interception module, and the relay lock logic module will be asked whether to allow the operation.
[0168] Step 3: The relay lock logic module will request the current status of the file from the server (obtain the lock status and exclusive conditions) and execute as follows:
[0169] (1) If the lock status is Unlocked and the local file status meets the exclusive condition: first send a notification to the server to lock the file as the current machine (change the lock status of the file on the server to Locked); then release this exclusive access operation.
[0170] (2) If the lock status is Unlocked, but the local file status does not meet the exclusive condition: first trigger the relevant operation to meet the condition (such as: pull the latest version of the file from the server), during which time the access operation remains blocked; then return to step 3.
[0171] (3) If the lock status is Locked: Ignore the exclusive condition, directly block the exclusive access operation, and exit the process.
[0172] Step 4: When the exclusive access of the application is completed (e.g., the Close File event of the file system is detected), the application will first wait for the prerequisites for unlocking to be completed, such as waiting for the relevant files or folders to be completely uploaded to the server; then update the file status to the server, including:
[0173] (1) Update the exclusive condition (given by the user who currently completes the exclusive operation);
[0174] (2) Change the lock status to Unlocked.
[0175] In some embodiments, the abnormal situation may be handled as follows:
[0176] (1) Network anomaly: Before the server returns to the locked state, the access interception module will continue to block the modification operation, that is, the file cannot be accessed. The solution of this application simulates the use scenario of Windows Shared Folder in the case of multiple file copies, that is, the scenario of remote access to the same file. Therefore, it is reasonable that the file cannot be accessed when the network is abnormal.
[0177] (2) Accidents such as client restart or abnormal crash, computer shutdown, etc., cause the locked file to fail to be unlocked as expected: According to the view of "simulating remote access to the same file", these phenomena should be handled as network anomalies ("disconnection"), that is, the "remote file" will be unlocked immediately, and the user's unsaved content will be lost immediately. However, in the solution of this application, the locked state will remain until the user's work status returns to normal, so as to avoid the loss of the user's edits as much as possible. Of course, it is also possible to allow the administrator to force unlocking on the server side, or to set an expiration time to automatically unlock the file when it expires. Only then will the user's edits be lost.
[0178] In the embodiment of the present application, the relay lock service detection module and the access interception module can be implemented by the relay lock service detection driver and the access interception driver respectively, or can be replaced by a self-implemented file system to meet the access interception requirements. The relay lock logic module can be an independently running process.
[0179] In some embodiments, the exclusive condition is a "file version number", and the file access control method may include the following steps:
[0180] Step 1: When an application attempts to exclusively access a file copy under the synchronization folder, the operation will first be intercepted by the Relay Lock service detection driver to check whether the Relay Lock logic process is started: if not, the access will be denied and the process will be exited; if it has been started and is running normally, proceed to step 2.
[0181] Step 2: The operation will be driven by the access interception, and the relay lock logic process will be asked whether to allow the operation.
[0182] Step 3: The relay lock logic process will request the current lock status and file version number of the file from the server and execute as follows:
[0183] (1) If the lock status is Unlocked and the local file version number is equal to the server file version number: first send a notification to the server to lock the file as the current machine (change the lock status of the file on the server to Locked); then the driver releases this exclusive access operation.
[0184] (2) If the lock status is Unlocked, but the local file version number is smaller than the server file version number: first pull the latest version of the file / file cluster from the server, update the local file and version number, and keep blocking access operations during this period; then return to step 3;
[0185] (3) If the lock status is Unlocked, but the local file version number is greater than the server file version number: This indicates that the local file has been unlocked abnormally. The user is prompted to back up the local file, overwrite the local version with the server version, and return to step 3.
[0186] (4) If the lock status is Locked: directly block the exclusive access operation and exit the process.
[0187] Step 4: When the access interception driver detects a closing event of a file in the file cluster, it means that the user has completed editing, and the following operations will be performed: first upload the local file / file cluster to the server and wait for the operation to be completed; then update the file status to the server, including:
[0188] (1) Update the file version number. For example, if the version number before editing is N, then change the version number to N+1 after editing.
[0189] (2) Change the lock status to Unlocked.
[0190] In some embodiments, the exclusive condition is "file hash", and P2P synchronization is used for files. The file access control method may include the following steps:
[0191] Step 1 and step 2 are similar to the above-mentioned embodiment.
[0192] Step 3: The relay lock logic process will request the server for the current lock status of the file, the file hash, and the IP address of the last editor (user N-1). The file hash can be selected differently depending on the situation:
[0193] (1) When the file is small (less than a certain threshold, such as less than 4M): directly perform hash calculation on the entire file;
[0194] (2) When the file is large (larger than a certain threshold, such as larger than 4M): the file is divided into blocks and the hash is calculated, so the file hash will be a hash list. The operation here is similar to the incremental synchronization algorithm.
[0195] (3) When there are too many files in a file cluster, Merkle Tree, or Hash tree, can be used. In this way, the server only needs to save a top Hash or root Hash for verification, without maintaining too much information. The information of the Hash tree can be received by P2P or anywhere else, and then verified with the top Hash obtained from the trusted server.
[0196] Since the Hash tree (Merkle Tree) covers both Hash lists and Hash values (i.e., Hash lists, etc. are a special case of Hash trees), the following execution steps are taken as an example of the Hash tree, and the other cases are similar. After user N obtains the top Hash of the file cluster and the "IP address of user N-1":
[0197] (I) If the lock status is Unlocked, obtain the Hash tree from user N-1 through "user N-1's IP address" and verify the Hash tree with the top Hash. If the verification fails, it means that the Hash source is not credible, then warn the user and ask him to obtain it from a reliable source and exit the process; if the verification passes, it means that the Hash tree is credible, then compare the Hash with the Hash tree of the local file cluster: if they are consistent, send a notification to the server, change the lock status of the file on the server to Locked, and let the driver release this exclusive access operation; if they are inconsistent, obtain the latest version of the relevant file from user N-1 through "user N-1's IP address" to update the local file and Hash tree. During this period, the access operation should be blocked, and return to step 3 after the update is completed;
[0198] (II) If the lock status is Locked: directly block the exclusive access operation and exit the process.
[0199] Step 4: When the access interception driver detects a closing event of a file in the file cluster, it means that the user has completed the editing, and the following operations will be performed:
[0200] (1) Recalculate the Hash tree of the local file and store it;
[0201] (2) Submit the top hash of the latest hash tree and the local IP address to the server;
[0202] (3) Change the lock status to Unlocked.
[0203] Hash is a function that maps data of any length into one-to-one corresponding data. In theory, it tries to satisfy "injection", that is, one-to-one, rather than one-to-many or many-to-one. Through a specific calculation method, data or files of a longer length can be mapped to data of a shorter length. When comparing data or files, if the data or file itself is relatively large, the time efficiency and space efficiency of the comparison will be relatively low. If data communication is involved, the communication cost will also be relatively high. By mapping larger data or files into one-to-one corresponding smaller data through Hash, and then comparing them, the time efficiency and space efficiency of the comparison can be effectively improved, and the communication cost is also relatively low.
[0204] In some embodiments, for data integrity verification, the entire data may be hashed before data transmission to obtain a fixed-length hash value, and then after the user obtains the data through data transmission, the data may be hashed again, and the result of the operation may be compared with the previous hash value. If the two hash values are equal, it indicates that the obtained data is not damaged. This may be done because a slight change in the input data will cause the hash result to be completely unrecognizable, and it is difficult to infer the characteristics of the original input data based on the hash value.
[0205] If the amount of data is small and the data transmission channel is relatively stable, it is advisable to use a single Hash. However, if the amount of data is large or the data transmission channel is not stable, once the data is damaged, it needs to be retrieved, which is inefficient. For large amounts or unstable data transmission channels, in order to verify the integrity and consistency of the data, large files can be divided into small data blocks (for example, into 2K data blocks). The advantage of this is that if a small block of data is damaged during transmission, then only the damaged block of data needs to be retrieved, without having to re-download the entire file.
[0206] At this time, you need to hash each data block to get a Hash List. In order to verify the integrity and consistency of the Hash List itself, you can piece together the Hash values of each small block of data, and then perform another Hash operation on this long string to get the root Hash (Top Hash or Root Hash) of the Hash List. When obtaining data, first get the correct root Hash from a trusted data source, use the root Hash to verify the Hash List, and then verify each obtained data block through the verified Hash List.
[0207] Merkle Tree (or Merkle Tree) can be regarded as a generalization of Hash List (Hash List can be regarded as a special Merkle Tree, that is, a multi-fork Merkle Tree with a tree height of 2). At the bottom layer, like Hash List, data can be divided into small data blocks and correspond to corresponding hash values. As the tree goes up (calculated layer by layer from bottom to top), it does not directly calculate the root hash, but merges two adjacent hash values into a string, and then calculates the hash value of this string, so that every two hash values are combined together to obtain a "sub-hash value". If the total number of hash values at the bottom layer is odd, then there must be a "single" hash value in the end. In this case, it is directly hashed, so its sub-hash value can also be obtained. Continue to push up according to the tree level, using the same method, you can get a new level of hash values with a smaller number, and finally form an upside-down tree. At the root of the tree, there is only one root hash value (or top hash value) left in this generation, which is called Root Hash (or Top Hash).
[0208] Before obtaining data, you can first obtain the Merkle Tree root (MerkleRoot), i.e. the root hash value, of the file from a trusted source, and then obtain the Merkle Tree from other trusted or untrusted sources. Check the received Merkle Tree with the trusted root. If the Merkle Tree is damaged or false, obtain another Merkle Tree from another source until you obtain a Merkle Tree that matches the trusted root.
[0209] The main difference between Merkle Tree and Hash List is that a branch of Merkle Tree can be directly obtained and verified immediately. This is because the file can be divided into small data blocks, so if a piece of data is damaged, just re-obtain this data block. If the file is very large, then both Merkle Tree and Hash List are very large or numerous, but Merkle Tree can obtain one of the branches at a time, and then immediately verify this branch. If the branch verification passes, you can continue to obtain the corresponding data. Hash List can only be verified after obtaining the entire Hash List.
[0210] In the present application, different Hash verification methods can be selected according to the situation of the file and the network. In some embodiments, the server can save multiple Hash values and provide different verification methods as appropriate. For example, when a certain verification method fails to successfully verify, it can be switched to another verification method. Similarly, in addition to the Hash value, the exclusive condition can also include a variety of information such as the version number of the file, the characteristic value, the communication address of the previous user, and the method of obtaining the previously saved file, so as to provide corresponding verification or processing methods according to different situations, thereby enhancing the compatibility and robustness of the system.
[0211] The file access control method and system provided by the present application, based on the locking state of the file, adds verification of the exclusive condition. Before the operation of accessing the file is allowed, it is first checked whether the file satisfies the exclusive condition. If not, the operation is blocked, thereby ensuring that the file at this time is a safe and reliable "continued editable" file version with no risk of file conflict, effectively avoiding the problem that the existing file locking mechanism cannot reliably prevent the occurrence of file conflicts.
[0212] The present application also provides a file access control method, including the following contents:
[0213] When an access operation to a target file is detected, it is queried whether the target file is contained in a certain file cluster. The target file can be in the form of a file or a folder.
[0214] If the target file is included in a certain file cluster, it is further determined whether the access operation to the target file is allowed according to the status of the file cluster.
[0215] If the access operation to the target file is allowed, the file cluster and / or other files contained in the file cluster are processed accordingly. The other files contained in the file cluster may be in the form of files or folders.
[0216] The file cluster includes a file list, and the file list includes a file identifier corresponding to each file in the file cluster. The file list can be retrieved to query whether the target file is included in a certain file cluster. If the file identifier of the target file is included in the file list, or the target file belongs to a folder in the file list, then the target file is included in the file cluster.
[0217] The status of a file cluster may include one or more of the following statuses: locked; unlocked; readable; writable; deletable; exclusive; and its child items can be operated. Each file contained in the file cluster may also have one or more of the above statuses. In some embodiments, the status of the file cluster and all the files contained in the file cluster are the same. In other embodiments, the status of the file cluster and each file contained in the file cluster may be different, but the status of the file cluster is the minimum permission status of all the files in the file cluster.
[0218] The access operation may include one or more of the following operations: read; write; delete; add file; add subfolder. If the status of the file cluster is locked, the access operation to the target file is not allowed. If the status of the file cluster is unlocked and the access operation is delete, the access operation to the target file is allowed and the target file is removed from the file cluster.
[0219] Figure 7 FIG. 1 is a schematic diagram of an embodiment of the file access control system in this application. Figure 7 As shown, the file access control system includes a file cluster module, and the file cluster module can store multiple file clusters. Each file cluster includes a file list, and the file list includes a file identifier corresponding to each file in the file cluster. Each file in the file cluster can be in the form of a file or a folder. The files and folders in the file cluster are stored in the file system.
[0220] The file access control system may also include an access monitoring module for monitoring and controlling access operations to target files. When an access operation to a target file is detected, it is queried whether the target file is included in a file cluster, wherein the target file may be in the form of a file or a folder; and if the target file is included in the file cluster, it is determined whether the access operation to the target file is allowed according to the state of the file cluster.
[0221] The file access control system may also include a method for processing the file cluster and / or other files contained in the file cluster accordingly when the access operation to the target file is allowed. The other files in the file cluster may be in the form of files or folders.
[0222] The access monitoring module can query whether the target file is included in a certain file cluster by searching the file list. If the file identifier of the target file is included in the file list, or the target file belongs to a folder in the file list, then the target file is included in the file cluster.
[0223] In some embodiments, when the status of the file cluster is locked, the access monitoring module does not allow access operations to the target file. When the status of the file cluster is unlocked and the access operation is delete, the access monitoring module allows access operations to the target file, and the associated operation module removes the target file from the file cluster.
[0224] In some embodiments, the implementation principle of the file cluster mechanism is to insert an intermediate layer between the file operator and the real file system, so that the file operator can understand the file status of the real file system through the "file cluster module" to decide whether to allow the operation, and synchronously update the data records of the file cluster during the actual operation.
[0225] A file cluster can record the following two aspects of information:
[0226] (1) File cluster status: used to provide a reference for the legality and side effects of operations. In some embodiments, the status is only Locked and Unlocked. In some other embodiments, the status may include but is not limited to: readable, writable, deletable, exclusive, operable sub-items, etc. The status can be expressed as a status mark, which is applied to all files or folders contained in the file cluster, and its corresponding meaning can be determined by the actual implementation. In some embodiments, the status of a file cluster is the minimum permission status of the files or folders it contains (the intersection of the status).
[0227] (2) A list containing file identifiers (e.g., a list of file or folder IDs representing file identifiers): The file ID is unique within the file system, and the corresponding file can be found through the ID. In some embodiments, the file ID can be the path of the file. In some embodiments, the same ID cannot be included in multiple file clusters, and cannot be a subitem of an ID in another file cluster, that is, within the same system, the ID lists of file clusters cannot have intersections, so as to avoid operational conflicts.
[0228] In some embodiments, initially, an empty file cluster may be created and its state initialized. Then, the file or folder ID is added to its ID list. When a user reads, writes, deletes, adds a file or subfolder, etc. to a file or folder, the file cluster module will put the ID of the file or folder into the file cluster list for retrieval. There are two matching conditions:
[0229] (1) Exact match: The file or folder being operated is an item in the file cluster ID list.
[0230] (2) Contains: The file or folder being operated is a child of a folder in the file cluster ID list.
[0231] If there is no matching file cluster, it means that the target file does not belong to any file cluster, and the file or folder is processed in the normal way. If there is a matching file cluster, its file cluster status is checked to determine whether to perform the operation and the corresponding side effects of the operation.
[0232] For example, when a user reads or writes the file "Folder A / File A.docx", the file cluster module finds that the file belongs to "File Cluster 0001" and the file cluster is in the Locked state, so the access is blocked.
[0233] For example: when the user deletes "Folder C / Folder A", the file cluster module knows that it belongs to "File Cluster 0002" and the file cluster is in the Unlocked state, so the operation is allowed and the "Folder C / Folder A" path is removed from the file cluster ID list (that is, the corresponding side effect).
[0234] The file clustering mechanism can enhance the "multi-end strong consistency" of the relay lock. The following uses the Central Model of Autodesk Revit as an example to illustrate how the file clustering mechanism works (Autodesk Revit is a series of software from Autodesk, used in the field of Building Information Modeling (BIM), which can help architects design, build and maintain better quality and more energy-efficient buildings. It is one of the most widely used software in my country's construction industry BIM system).
[0235] The Central Model of Autodesk Revit contains a "filename.rvt" file and a "filename_backup" folder. When the user edits "filename.rvt" and saves it synchronously, some *.dat files will be added to the "filename_backup" folder, while the original *.dat files remain unchanged. If these *.dat files are synchronized to other ends independently at this time, conflicts will occur. Therefore, the "filename.rvt" file and the "filename_backup" folder can be associated together through the file cluster mechanism, and the lock status of the "filename.rvt" file can be detected to determine whether the files in the "filename_backup" folder should be synchronized.
[0236] This embodiment can actually be regarded as: "filename.rvt" and "filename_backup" originally belong to the same "file". A corresponding example is the "*.docx" file of Microsoft Office software. This type of file is actually a "*.zip" compression package. After decompression, it can be found that it contains a large number of scattered data files, but they are packaged together to form a single "file" in appearance, and can be processed as a single file. In the Central Model of Autodesk Revit, there is no packaging process, but corresponding operations are also required for multiple files. In similar situations, users cannot change the "bulk" file structure, so the file cluster mechanism can be used to help them form a strong association.
[0237] In some embodiments, the present application also provides a computer device, apparatus or terminal, the internal structure of which can be as follows: Figure 8 As shown. The computer device, equipment or terminal includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor is used to provide computing and control capabilities, and the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the various methods, processes, and steps disclosed in the present application are implemented, or when the processor executes the computer program, the functions of each module or unit in the embodiment disclosed in the present application are implemented. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the shell, or an external keyboard, touchpad or mouse, etc.
[0238] Exemplarily, a computer program may be divided into one or more modules or units, which are stored in a memory and can be executed by a processor to implement the technical solution of the present application. These modules or units may be a series of computer program instruction segments that can perform specific functions, and the instruction segments are used to describe the execution process of the computer program in a device, equipment or terminal.
[0239] The above-mentioned devices, equipment or terminals may be computing devices such as desktop computers, notebooks, mobile electronic devices, PDAs and cloud servers. Those skilled in the art should understand that the structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation on the device, equipment or terminal to which the present application scheme is applied. The specific device, equipment or terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0240] The processor may be a central processing unit (CPU), or other general or special processors, microprocessors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor is the control center of the above-mentioned device, equipment or terminal, and uses various interfaces and lines to connect various parts of the device, equipment or terminal.
[0241] The memory can be used to store computer programs, modules and data. The processor realizes various functions of the device, equipment or terminal by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store various types of data created according to the application (such as multimedia data, documents, operation history records, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), a disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0242] The present application also provides a computer-readable storage medium on which a computer program is stored, and the steps of the above method are implemented when the computer program is executed by a processor. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0243] The modules and units integrated in the above-mentioned devices or terminal equipment, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on such an understanding, the present application implements all or part of the processes in the various methods disclosed, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned methods when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0244] In some embodiments, the various methods, processes, modules, devices, equipment or systems disclosed in the present application may be implemented or executed in one or more processing devices (e.g., digital processors, analog processors, digital circuits designed to process information, analog circuits designed to process information, state machines, computing devices, computers and / or other mechanisms for electronically processing information). The one or more processing devices may include one or more devices that perform some or all operations of the method in response to instructions stored electronically on an electronic storage medium. The one or more processing devices may include one or more devices that are configured by hardware, firmware and / or software and are specifically designed to perform one or more operations of the method. The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field within the technical scope disclosed in the present application, according to the technical solution and its inventive concept of the present application, shall be equivalently replaced or changed, and shall be covered within the protection scope of the present application.
[0245] The embodiments of the present application can be carried out in hardware, firmware, software or various combinations thereof, and can also be implemented as instructions stored on machine-readable media and can be read and executed using one or more processing devices. In some embodiments, the machine-readable medium may include various mechanisms for storing and / or transmitting information in a machine (e.g., computing device) readable form. For example, a machine-readable storage medium may include a read-only memory, a random access memory, a disk storage medium, an optical storage medium, a flash memory device, and other media for storing information, and a machine-readable transmission medium may include various forms of propagation signals (including carrier waves, infrared signals, digital signals) and other media for transmitting information. Although firmware, software, routines or instructions can be described in the above disclosure in terms of specific exemplary aspects and embodiments of performing certain actions, it will be apparent that such descriptions are only for convenience purposes and such actions are actually generated by machine equipment, computing devices, processing devices, processors, controllers, or other devices or machines that execute firmware, software, routines or instructions.
[0246] In the claims and specification of this application, a module used to perform a specified function or a module described using functional features is intended to cover any manner capable of performing the function, such as a combination of circuit elements that perform the function, software used to perform or implement the function, or any form of software, firmware, code, and a combination thereof with appropriate circuits. The functions provided by various modules are combined together in the manner claimed in the claims, and it should be considered that any module, component, or element that can provide these functions is equivalent or equivalent to the module defined in the claims.
[0247] This specification uses examples to disclose the present application, one or more of which are described or illustrated in the specification and its drawings. Each example is provided for the purpose of explaining the present application, not for limiting the present application. In fact, it is obvious to those skilled in the art that various modifications and variations can be made to the present application without departing from the scope or spirit of the present application. For example, the illustrated or described features as part of one embodiment can be used together with another embodiment to obtain a further embodiment. Therefore, it is intended that the present application covers modifications and variations within the scope of the attached claims and their equivalents. The above is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any technical solution that can be obtained by logical analysis, reasoning or limited experiments based on the concept of the present application by any technician familiar with the art, or easily conceivable changes or replacements, should be included in the scope of protection of the present application.
Claims
1. A file access control method, characterized in that: include: When an access operation to a target file is detected, a locking state and an exclusive condition of the target file are obtained; as well as Determining whether to allow access to the target file according to the locking state and the exclusive condition; Wherein, if the locking state is unlocked and the exclusive condition is satisfied, access to the target file is allowed; After accessing the target file, first complete the pre-unlocking operation, then update the exclusive condition, and modify the locking state to unlocked; wherein the locking state is used to identify whether the file is currently occupied by someone; The pre-unlocking operation includes one or more of the following operations: closing the target file; saving the target file; uploading the target file saved this time to the server; uploading the folder associated with the target file to the server; performing corresponding operations on the file cluster to which the target file belongs and other files included therein; The exclusive condition is a condition given by the previous visitor and needs to be satisfied by the next visitor to exclusively own the file.
2. The file access control method according to claim 1, characterized in that: First determine the locking state, then determine the exclusive condition; wherein, If the lock status is locked, access to the target file is not allowed; and / or If the lock state is unlocked but does not satisfy the exclusive condition, access to the target file is not allowed.
3. The file access control method according to claim 1, characterized in that: The target file and other files associated with the target file form a file cluster based on an association relationship, wherein the target file and the other files are in the form of files or folders; and the other files in the file cluster have the same locking state and exclusive condition as the target file; and When the target file is operated, corresponding operations are performed on the other files in the file cluster according to the association relationship.
4. The file access control method according to claim 1, characterized in that: According to the information included in the exclusive condition, it is judged whether the current content of the target file is consistent with the content of the target file saved last time, so as to determine whether the exclusive condition is satisfied.
5. The file access control method according to claim 4, characterized in that: The exclusive condition includes a direct condition, and the direct condition is configured as information that can be directly used to determine whether the current content of the target file is consistent with the content of the target file saved last time; and / or The exclusive condition includes an indirect condition, and the indirect condition is configured to be used to obtain the direct condition.
6. The file access control method according to claim 5, characterized in that: The direct condition includes a version number of the file; Compare the version number of the target file with the version number in the exclusive condition; wherein, If the version number of the target file is the same as the version number in the exclusive condition, determining that the current content of the target file is consistent with the content of the target file saved last time; If the version number of the target file is smaller than the version number in the exclusive condition, then determining that the target file needs to be updated; and If the version number of the target file is greater than the version number in the exclusive condition, it is determined that an error occurs.
7. The file access control method according to claim 5, characterized in that: The indirect condition includes a communication method of a previous visitor, and the previous visitor is communicated with according to the communication method of the previous visitor in the exclusive condition to obtain from the previous visitor a direct condition for comparing whether the current content of the target file is consistent with the content of the target file saved last time; and / or The indirect condition includes a method for obtaining a previously saved version, and the previously saved version is obtained according to the method for obtaining the previously saved version in the exclusive condition to update the target file.
8. A file access control system, characterized in that: The method comprises a client, wherein the client comprises: The relay lock logic module is configured to obtain the lock state and exclusive condition of the target file when an access operation to the target file is detected, and determine whether to allow access to the target file according to the lock state and the exclusive condition; and an access interception module, configured to intercept or release access operations to the target file according to the judgment result of the relay lock logic module; Wherein, the relay lock logic module is further configured to allow access to the target file when the lock state is unlocked and the exclusive condition is satisfied; The client is further configured to complete the pre-unlocking operation after accessing the target file, then update the exclusive condition, and modify the locking state to unlocked; wherein the locking state is used to identify whether the file is currently occupied by someone; The pre-unlocking operation includes one or more of the following operations: closing the target file; saving the target file; uploading the target file saved this time to the server; uploading the folder associated with the target file to the server; The exclusive condition is a condition given by the previous visitor and needs to be satisfied by the next visitor to exclusively own the file.
9. The file access control system according to claim 8, characterized in that: The client also includes: A relay lock service detection module, configured to detect whether the relay lock logic module is operating normally; and / or The access monitoring module is configured to monitor access operations to the target file.
10. The file access control system according to claim 8, characterized in that: Also includes: A server configured to save a locking state and an exclusive condition of the target file; The relay lock logic module is in communication connection with the server and is configured to obtain the locking state and exclusive condition of the target file from the server.
11. The file access control system according to claim 8, characterized in that: The relay lock logic module is further configured to first determine the lock state and then determine the exclusive condition; wherein, If the lock status is locked, access to the target file is not allowed; and / or If the lock state is unlocked but does not satisfy the exclusive condition, access to the target file is not allowed.
12. The file access control system according to claim 8, characterized in that: The target file and other files associated with the target file form a file cluster based on an association relationship; wherein the target file and the other files are in the form of files or folders; and the other files in the file cluster have the same locking state and exclusive condition as the target file; and The client is configured to perform corresponding operations on the other files in the file cluster according to the association relationship when operating the target file.
13. The file access control system according to claim 8, characterized in that: The relay lock logic module is further configured to determine whether the current content of the target file is consistent with the content of the target file saved last time according to the information included in the exclusive condition, so as to determine whether the exclusive condition is satisfied; wherein, The exclusive condition includes one or more of the following information: the version number of the file; the hash value of the file; the last modification time of the file; the characteristic value of the file; the communication method of the last visitor of the file; and the method for obtaining the last saved version of the file.
14. The file access control system according to claim 13, characterized in that: The relay lock logic module is further configured to compare the version number of the target file with the version number in the exclusive condition, and determine whether the current content of the target file is consistent with the content of the target file saved last time; wherein, If the version number of the target file is the same as the version number in the exclusive condition, determining that the current content of the target file is consistent with the content of the target file saved last time; If the version number of the target file is smaller than the version number in the exclusive condition, then determining that the target file needs to be updated; and If the version number of the target file is greater than the version number in the exclusive condition, it is determined that an error occurs.
15. The file access control system according to claim 13, characterized in that: The relay lock logic module is further configured to communicate with the previous visitor according to the communication mode of the previous visitor in the exclusive condition to compare whether the current content of the target file is consistent with the content of the target file saved last time; and / or The relay lock logic module is further configured to acquire the previous saved version according to the acquisition method of the previous saved version in the exclusive condition to update the target file.
16. A file access control device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: The processor is configured to implement the steps of the file access control method according to any one of claims 1 to 7 when executing the computer program.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the file access control method according to any one of claims 1 to 7 can be implemented.
