A file continuation method, device, terminal equipment and storage medium

By storing access and continuation records of files in the device metadatabase, cross-device and cross-application connection of files is achieved, and the problems of relying on the cloud and server in the existing technology are solved, cost and privacy risks are reduced, and operational convenience and performance are improved.

CN114911759BActive Publication Date: 2025-03-07HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110185209.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-10
Publication Date
2025-03-07
Estimated Expiration
2041-02-10

AI Technical Summary

Technical Problem

In the prior art, file connection cannot be cross-device and cross-application, and relying on the cloud and server, there are problems such as risk of privacy leakage, high cost and low efficiency.

Method used

By storing the last access device, device where the file is located, and connection records in the device's metadatabase, the file is connected across devices and across applications can be realized, and file data is directly obtained from the corresponding device, avoiding relying on the cloud and server.

Benefits of technology

It realizes cross-device and cross-application connection, reduces the cost of connection, improves operational convenience and performance, and avoids the privacy risks of cloud storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911759B_ABST
    Figure CN114911759B_ABST
Patent Text Reader

Abstract

The present application relates to a file continuation method, device, terminal device and storage medium. The file continuation method is applied to a file system. The file system includes multiple devices. Metadata of target files are stored in the metadata databases of the multiple devices respectively. The method includes: the current device receives an instruction from a user to open a target file; the current device determines the last access device of the target file, the device where the file is located and the continuation record according to the metadata of the stored target file, and the current device obtains the file data of the target file from at least one of the last access device and the device where the file is located; the current device displays the content to be displayed according to the continuation record of the target file and at least one of the file data of the target file. The file continuation method according to the embodiment of the present application can realize the cross-device and cross-application continuation of files; file continuation does not need to rely on the cloud and server, which can reduce the continuation cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a file continuation method, apparatus, terminal device and storage medium. Background Art

[0002] With the development of smart devices, using smart devices to operate files has brought great convenience to users. For example, users can use smartphone applications to watch movies, listen to music, and edit documents. Using multiple devices to share files not only allows each device to give full play to its own advantages, but also brings great convenience to user operations. When users use multiple smart devices to operate multimedia files such as videos, audio, and documents, users often hope to continue the last operation after switching devices, which will bring convenience to the collaboration between users' multiple devices.

[0003] In the prior art, multimedia files are usually stored in the cloud. When other devices need to access files, they directly obtain the files from the cloud, and at the same time, the continuation effect between devices is achieved by transmitting location tags (tags indicating the latest reading or editing location of the file). Alternatively, by saving the device information of the terminal device and the read location information of the file on the server, after the user switches the device, the corresponding read location information is loaded from the server to achieve continuation. However, storing files in the cloud poses a risk of privacy leakage, and file continuation cannot be achieved across applications. At the same time, purchasing cloud space increases the user's usage cost, and the speed of pulling files from the cloud is slow, which has a certain impact on the efficiency of obtaining files. However, if the device information and the file's read location information are stored on the server, file continuation cannot be achieved across applications, and the usage scenario requirements are relatively stringent. The supported file types are also limited, and the user needs to specify the device information, which is complicated to operate. Summary of the invention

[0004] In view of this, the present application provides a file continuation method, apparatus, terminal device and storage medium. According to the file continuation method of the embodiment of the present application, cross-device and cross-application continuation of files can be achieved, and file continuation does not need to rely on the cloud and server, which can reduce the continuation cost.

[0005] In a first aspect, an embodiment of the present application provides a file continuation method, the method being applied to a file system, the file system comprising a plurality of devices, the metadata of the target file being respectively stored in metadata databases of the plurality of devices, the method comprising:

[0006] The current device receives an instruction from a user to open a target file; in response to the instruction to open the target file, the current device determines the last access device of the target file, the device where the file is located, and a continuation record based on the metadata of the target file stored, and the continuation record indicates the operation position when the target file was last saved; the current device obtains file data of the target file from at least one of the last access device and the device where the file is located, and the file data includes a read cache file and a write cache file; the current device displays the content to be displayed based on the continuation record of the target file and at least one of the file data of the target file.

[0007] According to the file continuation method of the embodiment of the present application, by storing attribute information such as the last access device of the file, the device where the file is located, and the continuation record in the metadata database of the device, file continuation does not need to rely on the cloud and server, but instead obtains the file's data information from the corresponding device through the file's attribute information to complete the file continuation, thereby enabling cross-device and cross-application continuation of files; file continuation does not need to rely on the cloud and server, which can reduce the continuation cost; the user only needs to make an instruction to open the target file on the current device, and the file continuation can be completed automatically, which is convenient for the user to operate; devices can be continuation based on cache, so that even if the user does not synchronize the changes to the target file stored on the device where the file is located, file continuation can be achieved, with better performance.

[0008] According to the first aspect, in a first possible implementation of the file continuation method, when the current device, the last access device, and the device where the file is located are the same, the current device obtains the file data of the target file from at least one of the last access device and the device where the file is located, including: the current device loads a write cache file and a read cache file in a memory space;

[0009] The current device displays the content to be displayed according to the continuation record of the target file and at least one of the file data of the target file, including: when the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the memory space; when the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file in the memory space and the write cache file.

[0010] In this way, files can be continued across applications on the device where the files are stored, thereby improving the applicability of the file continuation method.

[0011] According to the first aspect, in a second possible implementation of the file continuation method, when the current device is the same as the last access device and different from the device where the file is located, the current device obtains the file data of the target file from at least one of the last access device and the device where the file is located, including: the current device loads the write cache file and the read cache file in the cache space;

[0012] The current device displays the content to be displayed according to the continuation record of the target file and at least one of the file data of the target file, including: when the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the cache space; when the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the cache space.

[0013] In this way, files can be continued across applications on any device in the file system except the device storing the files, thereby improving the applicability of the file continuation method.

[0014] According to the first aspect, in a third possible implementation of the file continuation method, when the current device is the same as the device where the file is located and different from the last accessed device, the current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including: the current device sends a write cache file acquisition request to the last accessed device; the current device receives the returned write cache file; the current device loads the read cache file in the memory space;

[0015] The current device displays the content to be displayed according to the continuation record of the target file and at least one of the file data of the target file, including: when the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the memory space; when the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file in the memory space and the write cache file.

[0016] In this way, files can be continued across devices and applications on the devices where the files are stored, thereby improving the applicability of the file continuation method.

[0017] According to the first aspect, in a fourth possible implementation of the file continuation method, when the current device, the last access device, and the device where the file is located are all different, the current device obtains the file data of the target file from at least one of the last access device and the device where the file is located, including: the current device sends a write cache file acquisition request to the last access device; the current device receives the returned write cache file; the current device sends a read cache file acquisition request to the device with a faster transmission speed between the last access device and the device where the file is located; the current device receives the returned read cache file;

[0018] The current device displays the content to be displayed according to the connection record of the target file and at least one of the file data of the target file, including: when the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the connection record, and displays the content to be displayed according to the offset position and the received read cache file; when the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the received read cache file and the write cache file.

[0019] In this way, files can be saved on any device in the file system, and can be continued across devices and applications, thus improving the applicability of the file continuation method.

[0020] According to the first aspect, and any possible implementation of the first aspect above, in a fifth possible implementation of the file continuation method, the current device determines the last access device of the target file, the device where the file is located, and the continuation record based on the stored metadata of the target file, including: the current device sends an instruction to the metadata database of the current device, the instruction includes the user identifier of the user and the file identifier of the target file, and the instruction is used to obtain the metadata of the target file stored in the metadata database of the current device; the metadata database of the current device determines whether the user has the permission to read and write the target file based on the user identifier and the file identifier; when confirming that the user has the permission to read and write the target file, the current device triggers the metadata databases of multiple devices of the file system to perform synchronous updates; the current device determines the last access device of the target file, the device where the file is located, and the continuation record based on the updated metadata database.

[0021] In this way, when other users do not have read and write permissions for the target file, the target file will not be displayed on the devices used by other users, which can improve data security.

[0022] According to the first aspect, and any possible implementation of the first aspect above, in a sixth possible implementation of the file continuation method, when the current device and the device where the file of the target file is located are the same, the method also includes: the current device receives a user's instruction to add a continuation identifier, the instruction to add a continuation identifier indicates adding a continuation identifier to the target file, and the continuation identifier indicates allowing to create a continuation record of the target file in the metadata of the target file; the current device detects whether the metadata of the target file stored includes the continuation identifier of the target file; if the metadata does not include the continuation identifier of the target file, the current device adds the continuation identifier of the target file to the metadata of the target file stored in the current device according to the instruction to add the continuation identifier; the current device triggers the metadata database of multiple devices of the file system to be updated synchronously.

[0023] In this way, the user is allowed to add a continuation mark indication so that the file can be accessed continuously.

[0024] According to the first aspect, and any one of the first to fifth implementation methods of the first aspect, in a seventh possible implementation method of the file continuation method, when the current device and the device where the file of the target file is located are the same, the method also includes: the current device receives a user's instruction to create a file, and the instruction to create a file indicates that the target file is created in the current device; the current device creates the target file in the current device according to the instruction to create a file, and adds a continuation identifier of the target file in the metadata of the target file, and the continuation identifier indicates that a continuation record of the target file is allowed to be created in the metadata of the target file; the current device triggers the metadata database of multiple devices of the file system to be updated synchronously.

[0025] In this way, the target file can be accessed across devices once it is created. The user no longer needs to send an instruction to add a continuation mark to the current device, which reduces the complexity of user operations and improves user experience.

[0026] According to the first aspect, and any possible implementation of the first aspect above, in an eighth possible implementation of the file continuation method, the method also includes: the current device receives an instruction from the user to delete the continuation identifier and / or continuation record of the target file; the current device detects whether the stored metadata of the target file includes the continuation identifier and / or continuation record of the target file; in the case that the continuation identifier and / or continuation record of the target file is included in the metadata, the current device deletes the continuation identifier and / or continuation record of the target file in the metadata according to the instruction; and the current device triggers the metadata databases of multiple devices of the file system to perform synchronous updates.

[0027] In this way, according to the different needs of users for file continuation, a corresponding solution can be selected, which is convenient for users to use when applied to the file system.

[0028] According to the first aspect, and any possible implementation of the first aspect above, in a ninth possible implementation of the file continuation method, when the current device and the device where the file of the target file is located are different, the method also includes: the current device receives an editing instruction from a user for the target file; the current device performs an editing operation on the content of the target file displayed on the display interface of the current device according to the instruction; the current device generates a write cache file for the target file according to the operation position, operation type and operation content.

[0029] According to the first aspect, and any possible implementation of the first aspect above, in a tenth possible implementation of the file continuation method, when the current device and the device where the file of the target file is located are different, the method further includes: the current device receives a user's save instruction for the target file; the current device sends the write cache file to the device where the file of the target file is located according to the instruction; when there is no continuation record of the target file in the metadata database of the current device, based on the operation position in the target file when the user's save instruction for the target file is received; when there is a continuation record of the target file in the metadata database of the current device, based on the operation position in the target file when the user's save instruction for the target file is received, the continuation record in the metadata database of the current device is updated.

[0030] In this way, edits to the file can be transferred between devices so that the latest edits can be shown when the display continues.

[0031] According to the first aspect, and any possible implementation of the first aspect above, in an eleventh possible implementation of the file continuation method, the metadata of the target file also includes the file modification time of the target file, and when the current device and the device where the file of the target file is located are the same, the method also includes: the current device receives a write cache file; the current device generates a new target file based on the write cache file and the target file stored in the memory; the current device updates the file modification time information in the metadata of the target file.

[0032] Based on this, the target files stored on the device can be updated synchronously.

[0033] According to the first aspect, and any possible implementation of the first aspect above, in a twelfth possible implementation of the file continuation method, the method further includes: when displaying the to-be-displayed content of the target file, the last accessed device is updated to the current device.

[0034] In a second aspect, an embodiment of the present application provides a file continuation device, the file continuation device is applied to the file system, and the file continuation device includes:

[0035] A receiving module is used to receive an instruction from a user to open a target file; a determining module is used to determine, in response to the instruction to open the target file, a device where the target file was last accessed, a device where the file is located, and a continuation record based on the metadata of the target file stored, wherein the continuation record indicates the operation position when the target file was last saved; an acquiring module is used to acquire file data of the target file from at least one of the last access device and the device where the file is located, wherein the file data includes a read cache file and a write cache file; and a display module is used to display content to be displayed based on at least one of the continuation record of the target file and the file data of the target file.

[0036] According to the second aspect, in a first possible implementation of the file continuation device, when the current device, the last accessed device, and the device where the file is located are the same,

[0037] The acquisition module includes a first acquisition submodule, which is used to load the write cache file and the read cache file in the memory space;

[0038] The display module comprises:

[0039] A first display submodule, configured to determine, when the write cache file is empty, an offset position of the content to be displayed relative to the target file according to the connection record, and display the content to be displayed according to the offset position and the read cache file in the memory space;

[0040] The second display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0041] According to the second aspect, in a second possible implementation of the file continuation device, when the current device is the same as the last access device and different from the device where the file is located,

[0042] The acquisition module includes a second acquisition submodule, which is used to load the write cache file and the read cache file in the cache space;

[0043] The display module comprises:

[0044] A third display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the continuation record when the write cache file is empty, and display the content to be displayed according to the offset position and the read cache file in the cache space;

[0045] The fourth display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the read cache file and the write cache file in the cache space.

[0046] According to the second aspect, in a third possible implementation of the file continuation device, when the current device is the same as the device where the file is located and different from the last accessed device,

[0047] The acquisition module comprises:

[0048] A third acquisition submodule, used for sending a write cache file acquisition request to the last accessed device;

[0049] The fourth acquisition submodule is used to receive the returned write cache file;

[0050] The fifth acquisition submodule is used to load the read cache file in the memory space;

[0051] The display module comprises:

[0052] a fifth display submodule, configured to determine, when the write cache file is empty, an offset position of the content to be displayed relative to the target file according to the connection record, and display the content to be displayed according to the offset position and the read cache file in the memory space;

[0053] The sixth display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0054] According to the second aspect, in a fourth possible implementation of the file continuation device, when the current device, the last access device, and the device where the file is located are all different,

[0055] The acquisition module comprises:

[0056] A sixth acquisition submodule, used for sending a write cache file acquisition request to the last accessed device;

[0057] The seventh acquisition submodule is used to receive the returned write cache file;

[0058] An eighth acquisition submodule, configured to send a cache file read acquisition request to a device with a faster transmission speed between the last access device and the device where the file is located;

[0059] The ninth acquisition submodule is used to receive the returned read cache file;

[0060] The display module comprises:

[0061] a seventh display submodule, configured to determine, when the write cache file is empty, an offset position of the content to be displayed relative to the target file according to the connection record, and display the content to be displayed according to the offset position and the received read cache file;

[0062] The eighth display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the received read cache file and write cache file.

[0063] According to the second aspect, and any possible implementation of the second aspect, in a fifth possible implementation of the file continuation device, the determining module includes:

[0064] A first determining submodule is configured to issue an instruction to the metadata database of the current device, wherein the instruction includes a user identifier of the user and a file identifier of the target file, and the instruction is configured to obtain metadata of the target file stored in the metadata database of the current device;

[0065] A second determination submodule, used to determine whether the user has the authority to read and write the target file according to the user identifier and the file identifier;

[0066] A third determination submodule is used to trigger the synchronous update of the metadata bases of multiple devices of the file system when confirming that the user has the read and write permissions for the target file;

[0067] The fourth determination submodule is used to determine the last access device of the target file, the device where the file is located, and the continuation record according to the updated metadata library.

[0068] According to the second aspect, and any possible implementation of the second aspect, in a sixth possible implementation of the file continuation device, when the current device and the device where the file of the target file is located are the same, the device further includes:

[0069] A first instruction receiving module, configured to receive an instruction from a user to add a continuation identifier, wherein the instruction to add a continuation identifier indicates adding a continuation identifier to the target file, and the continuation identifier indicates allowing a continuation record of the target file to be created in the metadata of the target file;

[0070] A first detection module, used for detecting whether the metadata of the stored target file includes a continuation identifier of the target file;

[0071] an identification adding module, configured to, when the metadata does not include a continuation identification of the target file, add a continuation identification of the target file to the metadata of the target file stored in the current device according to the instruction of adding the continuation identification;

[0072] The first updating module is used to trigger the metadata bases of multiple devices of the file system to be synchronously updated.

[0073] According to the second aspect, and any one of the first to fifth implementations of the second aspect, in a seventh possible implementation of the file continuation device, when the current device and the device where the file of the target file is located are the same, the device further includes:

[0074] A second instruction receiving module, configured to receive an instruction from a user to create a file, wherein the instruction to create a file indicates to create the target file in the current device;

[0075] A file creation module, configured to create the target file in the current device according to the instruction for creating the file, and add a continuation mark of the target file in the metadata of the target file, wherein the continuation mark indicates that a continuation record of the target file is allowed to be created in the metadata of the target file;

[0076] The second updating module is used to trigger the metadata bases of multiple devices of the file system to be updated synchronously.

[0077] According to the second aspect, and any possible implementation of the second aspect, in an eighth possible implementation of the file continuation device, the device further includes:

[0078] A third instruction receiving module, used for receiving an instruction from a user to delete a continuation mark and / or a continuation record of a target file;

[0079] A second detection module, configured for the current device to detect whether the metadata of the target file stored therein includes a continuation identifier and / or a continuation record of the target file;

[0080] a deleting module, configured to, when the metadata includes a continuation mark and / or a continuation record of the target file, delete the continuation mark and / or the continuation record of the target file in the metadata according to the instruction by the current device;

[0081] The third updating module is used to trigger the metadata bases of multiple devices of the file system to be synchronously updated.

[0082] According to the second aspect, and any possible implementation of the second aspect, in a ninth possible implementation of the file continuation device, when the current device and the device where the file of the target file is located are different, the device further includes:

[0083] A fourth instruction receiving module, configured to receive an instruction from a user to edit the target file;

[0084] An editing module, used to edit the content of the target file displayed on the display interface of the current device according to the instruction;

[0085] The first generating module is used to generate a write cache file of the target file according to an operation position, an operation type and an operation content.

[0086] According to the second aspect, and any possible implementation manner of the second aspect, in a tenth possible implementation manner of the file continuation device, when the current device and the device where the file of the target file is located are different, the device further includes:

[0087] A fifth instruction receiving module, configured to receive a user's instruction to save the target file;

[0088] A sending module, used for sending the write cache file to the device where the target file is located according to the instruction;

[0089] A record creation module, configured to create a continuation record of the target file in the metadata database of the current device when there is no continuation record of the target file in the metadata database of the current device, according to the operation position in the target file when a save instruction for the target file is received from the user;

[0090] The fourth updating module is used to update the continuation record in the metadata database of the current device when there is a continuation record of the target file in the metadata database of the current device according to the operation position in the target file when receiving the user's save instruction for the target file.

[0091] According to the second aspect, and any possible implementation manner of the second aspect, in an eleventh possible implementation manner of the file continuation device, the metadata of the target file also includes a file modification time of the target file, and when the current device and the device where the file of the target file is located are the same, the device further includes:

[0092] A file receiving module, used for receiving write cache files;

[0093] A second generating module, used for generating a new target file according to the write cache file and the target file stored in the memory;

[0094] The fifth updating module is used to update the file modification time information in the metadata of the target file.

[0095] According to the second aspect, and any possible implementation of the second aspect, in a twelfth possible implementation of the file continuation device, the device further includes:

[0096] A sixth updating module is used to update the last access device to the current device when displaying the to-be-displayed content of the target file.

[0097] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the file continuation method of the above-mentioned first aspect or one or several of the multiple possible implementation methods of the first aspect when executing the instructions.

[0098] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the file continuation method of the above-mentioned first aspect or one or several of the multiple possible implementation methods of the first aspect.

[0099] These and other aspects of the present application will become more apparent from the following description of the embodiment(s). BRIEF DESCRIPTION OF THE DRAWINGS

[0100] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present application and, together with the description, serve to explain the principles of the present application.

[0101] Figure 1 An exemplary application scenario according to an embodiment of the present application is shown.

[0102] Figure 2 An exemplary flow chart of a file continuation method according to an embodiment of the present application is shown.

[0103] Figure 3a A schematic diagram showing an exemplary process of creating a continuation identifier according to an embodiment of the present application.

[0104] Figure 3b A schematic diagram showing an exemplary process of creating a continuation identifier according to an embodiment of the present application.

[0105] Figure 3c A schematic diagram showing another exemplary process of creating a continuation identifier according to an embodiment of the present application.

[0106] Figure 3d A schematic diagram showing another exemplary process of creating a continuation identifier according to an embodiment of the present application.

[0107] Figure 4a A schematic diagram showing an exemplary process of deleting a continuation identifier and / or a continuation record according to an embodiment of the present application.

[0108] Figure 4b A schematic diagram showing an exemplary process of deleting a continuation identifier and / or a continuation record according to an embodiment of the present application.

[0109] Figure 5a A schematic diagram showing a file continuation method according to an embodiment of the present application in an exemplary application scenario.

[0110] Figure 5b A schematic diagram showing a file continuation method according to an embodiment of the present application in an exemplary application scenario.

[0111] Figure 6 A flowchart showing an example of step S310 according to an embodiment of the present application is shown.

[0112] Figure 7a A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0113] Figure 7b A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0114] Figure 8a A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0115] Figure 8b A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0116] Figure 9a A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0117] Figure 9b A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0118] Fig.10a A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario.

[0119] Fig.10b A schematic diagram showing a file continuation method according to an embodiment of the present application in another exemplary application scenario

[0120] Fig.11a A schematic diagram showing an exemplary workflow of a first device generating a new target file according to an embodiment of the present application.

[0121] Fig.11b A schematic diagram showing an exemplary workflow of a first device generating a new target file according to an embodiment of the present application.

[0122] Fig.12 An exemplary application scenario of user interaction with a device according to an embodiment of the present application is shown.

[0123] Fig.13 A structural diagram of a file continuation device according to an embodiment of the present application is shown.

[0124] Fig.14 A schematic diagram of an exemplary structure of a terminal device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0125] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0126] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0127] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0128] In view of the shortcomings of the prior art such as the inability to continue files across applications and high costs, the embodiments of the present application provide a file continuation method that can achieve continuous access to files across devices and applications, and file continuation does not require additional cloud and server costs, and is also more convenient for users to operate.

[0129] The file continuation method of the embodiment of the present application can be applied to a file system. Figure 1 An exemplary application scenario according to an embodiment of the present application is shown, wherein the first device, the second device, and the third device may be any type of device, including but not limited to a smart phone, a personal computer, a tablet computer, and the like.

[0130] like Figure 1 As shown, in an exemplary application scenario, the file system may include a first device 101 (the device where the target file is located) storing a target file, as well as a second device 102 and a third device 103, wherein the first device 101, the second device 102 and the third device 103 all include display devices such as display screens, which can display files of various types (e.g., documents, videos, audio, etc.). The second device 102 and the third device 103 can access the target file on the first device 101 for reading or editing, and the second device 102 and the third device 103 can also access each other to read or edit the files being edited by the other party. The metadata of the target file can be synchronously stored on the first device 101, the second device 102 and the third device 103 (e.g., stored in the metadata database of each device), and Table 1 shows an example of the data structure of the metadata according to an embodiment of the present application.

[0131] Table 1

[0132]

[0133] As shown in Table 1, the metadata includes:

[0134] File name, used to display the file name. Users can see the file name and issue an instruction to open the file by selecting the file.

[0135] File size, used to display the data size of the file.

[0136] File modification time is used to record the time information when a new file is generated based on an existing file on the device storing the file.

[0137] File access time, used to record the time when the file was last opened and displayed on the device.

[0138] File creation time, used to record the time information when the file was created.

[0139] The file owner (UID, User Identification) is used to record the user who can operate the file, that is, the file owner. By setting the file owner, you can determine the user who has read and write permissions to the file.

[0140] The file group GID (Group Identification) is used to record the user group, that is, the user group to which the file owner belongs.

[0141] The device where the file is located is used to record the device where the file is stored. By querying the file device information in the metadata, it can be determined on which device in the file system (for example, in the network) the file to be opened is stored.

[0142] The file index node is used to record the index node of the file stored in the device where the file is located; based on the file index node, the device can find the storage location of the file in the hard disk and read the file content in the hard disk into the memory.

[0143] File type is used to record the type of file, such as txt, doc, rmvb, etc.

[0144] The device access record is used to record the device that last opened the file. By querying the last access device information in the metadata, you can determine on which device the file to be opened was last opened.

[0145] The continuation information includes a continuation mark and a continuation record. The continuation mark is used to allow the file to be continued, and the continuation record is used to record the operation position of the last operation in the file. According to the continuation information, when the file is opened for display, it can be located at the position of the last operation.

[0146] When a target file exists on the first device and the user wants to share the target file with other devices (such as the second device and the third device) in the file system for subsequent access, the other devices (such as the second device and the third device) and the first device can be added to the same local area network, for example, connected to the same WIFI (such as by connecting to Figure 1The router 104 in the file system can communicate with the first device, or create a local area network of the first device, the second device and the third device, so that the first device, the second device and the third device can exchange data in the network. The devices in the file system can also be called devices in the network.

[0147] The metadata of the target file stored on each device can be updated synchronously and periodically, or can be triggered by the device that opens the target file (current device) each time the target file is opened, or can be triggered each time the device operates the target file. Metadata can record the device that last operated the target file (the device that last accessed the target file), the device that stores the target file (the device where the target file is located, which is the first device in this application scenario), and the position of the operation in the file when the file was last saved (continuation record), and the second device and the third device can store the file data of the read target file and the position of the latest operation in the file through the cache space. Through the file continuation method of the embodiment of the present application, cross-application file continuation access can be achieved in the above-mentioned file system.

[0148] In combination with the above exemplary application scenarios, Figure 2-Figure 12 , to illustrate the execution process of the file continuation method of an embodiment of the present application.

[0149] Figure 2 An exemplary flow chart of a file continuation method according to an embodiment of the present application is shown. In a possible implementation, the file continuation method of the embodiment of the present application is applied to a file system, the file system includes multiple devices, and the metadata of the target file is respectively stored in the metadata databases of the multiple devices. The file continuation method of the embodiment of the present application includes:

[0150] S20, the current device receives an instruction from a user to open a target file;

[0151] S21, in response to the instruction to open the target file, the current device determines the last access device of the target file, the device where the file is located, and a continuation record according to the stored metadata of the target file, wherein the continuation record indicates the operation position when the target file was last saved;

[0152] S22, the current device obtains file data of the target file from at least one of the last accessed device and the device where the file is located, the file data including a read cache file and a write cache file;

[0153] S23, the current device displays the content to be displayed according to at least one of the continuous record of the target file and the file data of the target file.

[0154] According to the file continuation method of the embodiment of the present application, by storing attribute information such as the last access device of the file, the device where the file is located, and the continuation record in the metadata database, file continuation does not need to rely on the cloud and the server. Instead, the file's data information is obtained from the corresponding device through the file's attribute information to complete the file continuation, thereby enabling cross-device and cross-application continuation of the file; file continuation does not need to rely on the cloud and the server, which can reduce the continuation cost; the user only needs to make an instruction to open the target file on the current device, and the file continuation can be completed automatically, which is convenient for the user to operate; devices can be continuation based on cache, so that even if the user does not synchronize the changes to the target file stored on the device where the file is located, file continuation can be achieved, with better performance.

[0155] In one possible implementation, the premise that a target file can be continuously accessed between multiple devices in a file system is that it has a continuation identifier. A user can select the target file and set it so that the target file can be continuously accessed by other devices. In response to the user's setting operation, the first device can create a continuation identifier for the target file. The continuation identifier indicates that it is allowed to create a device access record and a continuation record in the metadata of the target file. The device access record indicates the target device that last operated the target file among multiple devices in the file system, and the continuation record includes the position of the latest operation on the file in the file. The user can also select multiple target files in batches to create continuation identifiers for each of the multiple target files.

[0156] Figure 3a , Figure 3b , Figure 3c and Figure 3d This is an exemplary process of creating a continuation mark. If the target file has a continuation mark, cross-device and cross-application file continuation can be completed. If the current device and the device where the target file is located are the same, the continuation mark of the target file can be created on the current device.

[0157] See also Figure 3a and Figure 3b In step S101, the current device receives a user's instruction to add a continuation identifier, which may indicate adding a continuation identifier to a target file, and the continuation identifier indicates allowing a continuation record of the target file to be created in the metadata of the target file.

[0158] In step S102, the current device detects whether the metadata of the stored target file includes a continuation identifier of the target file.

[0159] In step S103, when the metadata does not include the continuation identifier of the target file, the current device adds the continuation identifier of the target file to the metadata of the target file stored in the current device according to the instruction to add the continuation identifier.

[0160] In step S104, the current device triggers the metadata bases of multiple devices of the file system to be synchronously updated.

[0161] The current device may be the device where the target file is located, that is, the first device.

[0162] In a possible implementation, each device of the file system may include a metadata library, which can be used to store data information describing the attributes of the target file. The continuation flag is a file attribute information indicating that the file is allowed to be continuously accessed across devices in the file system.

[0163] During the synchronous update process, the first device can change the update time (or version identifier) ​​of the metadata of the target file to the time of adding the continuation identifier (or change it to a new version identifier), and other devices obtain the update time (or version identifier) ​​of the device that triggers the synchronous update (here, the first device). When it is detected that the update time of the first device is later than the update time of the current device (or the version identifier is newer than the version identifier of the current device), the latest metadata can be obtained from the first device to achieve the synchronous update of the metadata of the target file on each device. If other devices detect that the update time of the device that triggers the synchronous update is earlier than the update time of the current device (or the version identifier is older than the version identifier of the current device), they can also send their own metadata to the device that triggers the synchronous update to achieve the synchronous update. After the synchronous update, the metadata of the target file stored by multiple devices in the network (such as the first device, the second device, and the third device) all include the continuation identifier of the target file. In this way, multiple devices in the file system can see the name of the target file in the shared list, so that users can issue instructions to open the target file on different devices.

[0164] In one possible implementation, the first device can see the file names of files with continuation identifiers stored on multiple devices of the file system in the sharing list of the first device. The continuation identifier of the target file is a file-level mark corresponding to the target file. When the metadata of the target file includes the continuation identifier, the target file can be added to the sharing list, and the user can view the sharing list through each device in the network and access the target file in the sharing list. After the user opens the target file on the first device, if there is a continuation identifier in the metadata of the target file, the first device can update the continuation record in the metadata according to the received user's save operation on the target file, so that the operation position of the target file recorded in the continuation record when it was last saved remains up to date; when there is no continuation record in the file metadata, the first device can create a continuation record of the target file in the metadata of the first device and record the operation position of the target file when it was last saved.

[0165] In this way, the user only needs to issue an instruction to add a continuation mark on the device where the file is located, and the target file can be accessed across devices. The operation is simple for the user and the user experience is improved.

[0166] In a possible implementation, when the current device and the device where the target file is located are the same, the continuation mark of the target file may also be created together with the target file.

[0167] See also Figure 3c and Figure 3d In step S105, the current device receives a user's instruction to create a file, and the instruction to create a file indicates that a target file is created in the current device;

[0168] In step S106, the current device creates the target file in the current device according to the instruction to create the file, and adds a continuation mark of the target file in the metadata of the target file, where the continuation mark indicates that a continuation record of the target file is allowed to be created in the metadata of the target file;

[0169] In step S107, the current device triggers the metadata bases of multiple devices of the file system to be synchronously updated.

[0170] For example, according to the user's instruction to create a target file, the current device also adds the metadata of the target file in the metadata database of the current device while creating the target file. In this case, the current device can add a continuation mark of the target file in the metadata of the target file.

[0171] In this way, the target file can be accessed across devices once it is created. The user no longer needs to send an instruction to add a continuation mark to the current device, which reduces the complexity of user operations and improves user experience.

[0172] In a possible implementation, the user may also delete at least one of the continuation mark and the continuation record of the target file as needed. The deletion operation may be performed by a device with deletion authority in the file system, such as a device storing the target file (the first device), or may be configured to be executable by any device in the file system (such as the second device or the third device). In a possible implementation, the continuation mark may be displayed on the interface of the terminal device (such as an icon near the target file), and may be viewed and operated by the user (such as deleting it). When the continuation mark of the target file is deleted, the continuation record of the target file may also be deleted.

[0173] Figure 4a and Figure 4b It is the process of deleting the continuation mark and / or continuation record. In the absence of the continuation mark, the file cannot be accessed continuously.

[0174] according to Figure 4a and Figure 4b In step S201, the current device receives a continuation mark and / or a continuation record instruction of deleting a target file from a user.

[0175] In step S202, the current device detects whether the metadata of the stored target file includes a continuation identifier and / or a continuation record of the target file.

[0176] In step S203, when the metadata includes a continuation mark and / or a continuation record of the target file, the current device deletes the continuation mark and / or the continuation record of the target file in the metadata according to the instruction.

[0177] In step S204, the current device triggers the metadata bases of multiple devices of the file system to be synchronously updated.

[0178] In a possible implementation, the current device may be any device in the file system (eg, the first device), and the target file is stored on the first device. After the continuation identifier of the target file is deleted by the current device, the target file will not be allowed to be accessed across devices in the file system.

[0179] According to different needs of users, users can issue different deletion instructions, and the current device responds differently to different instructions. For example, when the user does not want the target file to be accessed continuously in the file system, an instruction to delete the continuation identifier of the target file can be issued, or an instruction to delete the continuation identifier and continuation record of the target file can be issued. When the current device receives the above instructions, it can detect whether the metadata of the stored target file includes a continuation identifier, or detect whether the metadata of the target file includes a continuation identifier and a continuation record, and if the continuation identifier is included in the metadata of the first device, or if the continuation identifier and the continuation record are included, delete the continuation identifier and the continuation record in the metadata of the target file stored in the current device. After the deletion operation is completed, the first device can trigger each device in the network to perform a synchronous update.

[0180] After the synchronization update, the corresponding continuation identifier and continuation record in the metadata of the target file stored in each device in the file system are deleted. The target file will not be accessible between multiple devices in the file system.

[0181] In a possible implementation, the first device may also be provided with a control capable of turning on and off the file continuation function, and the user may delete the continuation identifier and continuation record of the target file in the metadata of the first device by turning off the control. This application does not limit this.

[0182] In a possible implementation, the user may wish that the target file can still be accessed continuously in the file system, but the new access does not need to be performed on the basis of the previous access. Based on this, it is also possible to delete the continuation record of the target file while retaining the continuation mark of the target file.

[0183] For example, a user may issue an instruction to delete the continuation record of a target file. When the current device receives such an instruction, the current device may detect whether the metadata of the stored target file includes the continuation record. If the metadata of the first device includes the continuation record, the continuation record in the metadata of the stored target file is deleted, while the continuation mark of the target file is retained. After the deletion operation is completed, the first device may trigger each device in the network to perform a synchronous update.

[0184] After the synchronous update, the corresponding continuation records in the metadata of the target file stored in each device in the file system are deleted, and the corresponding continuation identifiers are retained. In this case, the target file can still be continuously accessed between multiple devices in the file system, but since there is no continuation record, the next time the target file is opened and displayed on any device in the file system (for example, the second device), it will be displayed from the initial position of the target file, and the continuation record of the target file will be recreated by the device (the second device).

[0185] In a possible implementation, each device in the network may be provided with a control capable of deleting the continuation record. The user may trigger the control capable of deleting the continuation record through the first device, and send an instruction to the first device to delete the continuation record of the target file. This application does not limit this.

[0186] In this way, according to the different needs of users for file continuation, a corresponding solution can be selected, which is convenient for users to use when applied to the file system.

[0187] In a possible implementation, the user may not want other users other than himself to be able to continue to display the target file when operating the device of the file system. Based on this, a user authority verification part can be added to the step S21 described above, and the current device determines the last access device of the target file, the device where the file is located, and the continuation record according to the metadata of the stored target file, including:

[0188] The current device sends an instruction to the metadata database of the current device, the instruction including the user identification of the user and the file identification of the target file, and the instruction is used to obtain the metadata of the target file stored in the metadata database of the current device. The metadata of the target file may include the continuation record of the target file, the last access device information, and the device information where the file is located.

[0189] The metadata database of the current device determines whether the user has the authority to read and write the target file according to the user ID and the file ID.

[0190] When confirming that the user has the read and write permissions for the target file, the current device triggers the metadata databases of multiple devices of the file system to be synchronously updated.

[0191] In this case, the metadata of the target file stored on each device is synchronously updated to the latest version. Triggering the synchronous update of the metadata database can ensure that the metadata database on the current device records the latest last access device information and continuation records of the target file by each device in the file system.

[0192] The current device determines the last access device of the target file, the device where the file is located, and the continuation record according to the updated metadata database.

[0193] In a possible implementation, the step of determining whether the user has the authority to read and write the target file can also be completed by other authentication methods. For example, after receiving the instruction sent by the device, the metadata library of the first device, the second device, or the third device can return an instruction that triggers the first device, the second device, or the third device to perform a user-level permission check on the display interface of the device, such as password verification, fingerprint verification, face recognition verification, etc. After the verification is passed, the first device, the second device, or the third device sends an instruction containing the information that the verification passed to its respective metadata library. After the metadata library receives the instruction containing the information that the verification passed, it triggers the metadata library of multiple devices of the file system to be synchronously updated. The current device can determine the last access device of the target file, the device where the file is located, and the continuation record based on the updated metadata library.

[0194] In this way, when other users do not have read and write permissions for the target file, the target file will not be displayed on the devices used by other users, which can improve data security.

[0195] According to the determined device where the file is located and the device where the file was last accessed, in steps S22 and S23, the current device can obtain the file data of the target file and complete the continuous display on the display interface of the current device. According to the same or different application scenarios of the current device, the device where the file is last accessed, and the device where the file is located, in steps S22 and S23, the acquisition of the file data of the target file and the completion of the continuous display may include a variety of specific implementations, as shown below in combination Figure 5a , Figure 5b , Figure 6 , Figure 7a , Figure 7b , Figure 8a , Figure 8b , Figure 9a , Figure 9b , Fig.10a , Fig.10b , Fig.11a , Fig.11b To describe the process of the file continuation method according to the embodiment of the present application in several application scenarios.

[0196] In a possible implementation, when the current device, the last accessed device, and the device where the file is located are the same,

[0197] In step S22, the current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including:

[0198] The write cache file and read cache file in the current device load memory space;

[0199] In step S23, the current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including:

[0200] When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the memory space;

[0201] When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0202] For example, the current device may be the first device, and the target file is stored on the first device. In an exemplary application scenario, the user uses different application software on the first device storing the target file to open the same file (target file) twice, and when opening the target file for the second time, the operation position (such as the reading position or the editing position) of the target file when opening it for the first time is directly displayed. At this time, the current device, the last access device, and the device where the file is located are the same and are all the first device. Figure 5a and Figure 5b The flowchart of the first device is shown when the user opens the target file for the second time in this application scenario.

[0203] Among them, when the first device accesses the target file, all or part of the contents of the read target file can be retained in the read cache file, and the operation type (such as insert, delete, replace, etc.) of the operation performed on the target file, as well as the location and content of the operation (such as the location and content of insertion, the location and content of deletion, the location of replacement, the content before and after replacement, etc.) can be retained in the write cache file. If the first device saves the target file after operating it, the content of the target file is updated with the content in the write cache file (such as updating the read cache file), and a new target file is formed for saving (such as saving in memory or hard disk), and the write cache file is cleared at the same time. If no saving is performed after the operation, the operation type, operation location and operation content are still retained in the write cache file.

[0204] Table 2 shows an example of the data structure of a read cache file according to an embodiment of the present application.

[0205] Table 2

[0206] File Identification Offset size Caching content Cache version number (can be modification time) 。。。

[0207] As shown in Table 2, the read cache file includes:

[0208] File identifiers are used to distinguish different files. The specified file can be found based on the file identifiers.

[0209] The offset is used to determine the operation position of the user's most recent read operation on the file. If the file corresponding to the file identifier is a relatively large file (for example, a video file), when reading the file and obtaining the read cache file, a part of the video file can be obtained first, such as the part determined by the offset.

[0210] Size, used to determine the data size of the read cache file.

[0211] Cache content, used to record the read file content data.

[0212] The cache version number may be the file modification time. For example, if the read cache file is obtained by reading the file data of the target file, then the cache version number indicates the file modification time of the target file.

[0213] Table 3 shows an example of the data structure of a write cache file according to an embodiment of the present application.

[0214] Table 3

[0215] File Identification Offset size Caching content 。。。

[0216] As shown in Table 3, the write cache file includes:

[0217] File identifiers are used to distinguish different files. The specified file can be found based on the file identifiers.

[0218] Offset, used to determine the location of the last edit operation performed by the user on the file.

[0219] Size, used to determine the data size of the write cache file.

[0220] Cache content is used to record the operation location, operation type, and operation content of the file editing operation.

[0221] according to Figure 5a and Figure 5b In step S301, the first device receives an instruction from a user to open a target file.

[0222] In step S302, the first device sends an instruction to the metadata database of the first device, where the instruction includes a user identifier of the user and a file identifier of the target file. The instruction is used to obtain metadata of the target file stored in the metadata database of the first device. The metadata may include a connection record of the target file, last access device information (in this case, the first device), and device information where the file is located (in this case, the first device).

[0223] In step S303, the metadata library of the first device determines whether the user has the authority to read and write the target file according to the user identifier and the file identifier in the instruction.

[0224] In step S304, after confirming that the user has read and write permissions to the target file, the first device triggers the metadata databases of multiple devices in the file system to perform synchronous updates, so that the metadata of the target file stored on each device is synchronously updated to the latest version; triggering the synchronous update of the metadata database can ensure that the metadata on the first device records the latest device access records and connection records of the target file by each device in the file system.

[0225] In step S305, the first device confirms the last access device and the device where the target file is located (both are the first device in this application scenario) according to the last access device information and the device information where the file is located in the updated metadata database.

[0226] In step S306, the first device loads the write cache file and the read cache file in the memory space.

[0227] For example, when the current device, the last accessed device, and the device where the file is located are all first devices, the write cache file and the read cache file in the memory space of the first device are loaded. If the target file was saved when it was last accessed on the first device, the write cache file is empty, and the target file was not saved when it was last accessed on the first device (for example, the target file was edited through WORD for the first time and not saved, and the target file was opened through WPS for the second time), then the write cache file is not empty at this time, and the write cache file records the type of operation performed on the target file when the target file was last accessed, the location of the operation, and the content. When the current device and the device where the file is located are the same (both are first devices), the read cache file is the file data of the target file read from the hard disk to the memory space. In a possible implementation, there may be no read cache file in the memory space. In this case, the file content in the hard disk can be read first and stored in the memory space in the form of a read cache file.

[0228] In step S307, when the write cache file is empty, the first device determines the offset position of the content to be displayed relative to the target file according to the continuation record. The continuation record can be obtained through the metadata library of the first device, and the offset position is associated with the operation position when the target file was last saved. For example, if the operation when the last save was an insert operation, the offset position is the insertion position in the file (for example, represented by the file byte number where the insertion cursor is located).

[0229] In step S308, the first device displays the content to be displayed according to the offset position and the read cache file in the memory space.

[0230] For example, the offset position can be located in the read cache file, and then the content near the offset position in the read cache file can be displayed. For example, the displayed page can include text content near the position of the insertion cursor of the latest insertion operation.

[0231] In step S309, when the write cache file is not empty, the first device determines the offset position of the content to be displayed relative to the target file according to the write cache file, wherein the cache content of the write cache file includes the operation type and operation content of the editing operation performed at the offset position of the target file.

[0232] In step S310, the first device displays the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0233] In one possible implementation, based on the operation position recorded in the write cache file, the corresponding position can be found in the read cache file, so that at the corresponding position in the read cache file, the operation type and operation content performed by the write cache file at the operation position can be applied, thereby obtaining the file content after the last operation, and then based on the offset in the write cache, the operation position of the user's last editing operation on the file, such as the position of the cursor, can be determined. After combining the file content with the cursor position, the content to be displayed is obtained. The content to be displayed is the same as the display content of the display interface after the user last opened the file for operation.

[0234] Figure 6 A flowchart showing an example of step S310 according to an embodiment of the present application is shown. Figure 6 In step S310, the cache content of the read cache file is associated with the cache content of the write cache file, and the offset position in the write cache file can be located in the cache content of the read cache file. The steps of combining and displaying the read cache file and the write cache file are as follows.

[0235] In step S401, based on the cache content in the write cache file, the operation position of the target file when the target file was accessed last time and the operation type and operation content corresponding to each operation position are determined.

[0236] In step S402, the corresponding operation position is found in the read cache file, and the content to be displayed is obtained according to the cache content of the read cache file and the operation type and operation content corresponding to each operation position.

[0237] For example, the write cache file is used to determine that a number is inserted at the first position, and the read cache file may be a cached content including the first position and the file content before and after the first position, so that the read cache file and the write cache file are combined. After a number is inserted at the first position of the read cache file, the file content data after the first position of the read cache file may be sequentially extended to the position of the size occupied by the number, thereby determining the form of the content to be displayed.

[0238] In step S403, the content to be displayed is displayed on the display interface of the application software. Taking the above-mentioned insertion of a number as an example, in the displayed content, the cursor may be located at the position where the number is inserted.

[0239] In a possible implementation, when the write cache is not empty, the first device may also issue an instruction to forcibly apply the write cache file to the target file stored on the first device, thereby changing the file content of the target file. When the first device displays the target file when opening it for the second time, it determines the offset position according to the received write cache file, and reads the file content of the changed target file as a read cache file and stores it in the memory. The first device may apply the read cache file for display, and locate the offset position in the display interface in the form of a cursor or the like.

[0240] In this way, files can be continued across applications on the device where the files are stored, thereby improving the applicability of the file continuation method.

[0241] In a possible implementation, when the current device is the same as the last accessed device and different from the device where the file is located,

[0242] In step S22, the current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including:

[0243] The write cache file and read cache file in the current device load cache space.

[0244] In step S23, the current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including:

[0245] When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the cache space;

[0246] When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the cache space.

[0247] In an exemplary application scenario, when the target file is stored on the first device, the user uses different application software on the second device to open the same file (target file) twice, and when the target file is opened for the second time, the operation position (such as reading position or editing position) of the target file when it is opened for the first time is directly displayed. In this case, the device where the file is located can be the first device, and the current device and the last access device can be the same and both are the second device. Figure 7a and Figure 7b Taking for example, the workflow of the second device when the user opens the target file for the second time in this application scenario is described.

[0248] When the second device accesses a target file stored on the first device, it may save all or part of the target file's read content in a read cache file, and save the operation type, operation location, and operation content of the target file in a write cache file.

[0249] according to Figure 7a and Figure 7b In step S501, the second device receives an instruction from a user to open a target file.

[0250] In step S502, the second device sends an instruction to the metadata database of the second device, where the instruction includes a user identifier of the user and a file identifier of the target file. The instruction is used to obtain metadata of the target file stored in the metadata database of the second device, where the metadata includes at least a connection record of the target file, last access device information (in this case, the second device), and device information where the file is located (in this case, the first device).

[0251] In step S503, the metadata library of the second device determines whether the user has the authority to read and write the target file according to the user identifier and the file identifier in the instruction.

[0252] In step S504, after confirming that the user has read and write permissions, the second device triggers the synchronous update of the metadata databases of multiple devices of the file system, so that the metadata of the target file stored on each device is synchronously updated to the latest version; triggering the synchronous update of the metadata database can ensure that the metadata on the second device records the latest device access records and connection records of the target file by each device in the file system.

[0253] In step S505, the second device confirms the last access device and the device where the target file is located according to the last access device information and the device information where the file is located in the updated metadata database (in this application scenario, the last access device is the second device and the device where the file is located is the first device).

[0254] In step S506, the second device loads the write cache file and the read cache file in the cache space.

[0255] For example, when the current device and the last access device are the second device, and the device where the file is located is the first device, the second device loads the write cache file and the read cache file in the cache space. If the target file was saved when it was last accessed on the second device, the write cache file is empty. If the target file was not saved when it was last accessed on the second device (for example, the target file was edited through WORD for the first time and not saved, and the target file was opened through WPS for the second time), then the write cache file is not empty at this time, and the write cache file records the type of operation, operation location and operation content performed on the target file when the target file was last accessed. When the current device and the last access device are the same (both are the second device), the read cache file is the file data of the target file in the cache space of the second device. In a possible implementation, there may be no read cache file in the cache space. In this case, a read cache acquisition request can be directly sent to the device where the file is located (the first device) to obtain the read cache file of the cache space of the first device. The read cache file of the cache space of the first device can be the file content in the hard disk read by the first device, and the file is stored in the memory space in the form of a read cache file. After the second device obtains the read cache file, it can be stored in the cache space of the second device.

[0256] In step S507, when the write cache file is empty, the second device determines the offset position of the content to be displayed relative to the target file according to the continuation record. The continuation record can be obtained through the metadata library of the second device, and the offset position is associated with the operation position when the target file was last saved. For example, if the operation when the last save was an insert operation, the offset position is the insertion position in the file (for example, represented by the file byte number where the insertion cursor is located).

[0257] In step S508, the content to be displayed is displayed according to the offset position and the read cache file in the cache space.

[0258] For example, the offset position can be located in the read cache file, and then the content near the offset position in the read cache file can be displayed. For example, the displayed page can include text content near the position of the insertion cursor of the latest insertion operation.

[0259] In step S509, when the write cache file is not empty, the offset position of the content to be displayed relative to the target file is determined according to the write cache file.

[0260] In step S510, the content to be displayed is displayed according to the offset position and the read cache file and the write cache file in the cache space.

[0261] An example process of step S510 in the present embodiment can be referred to Figure 6 process.

[0262] In this way, files can be continued across applications on any device in the file system except the device storing the files, thereby improving the applicability of the file continuation method.

[0263] In a possible implementation, when the current device is the same as the device where the file is located and is different from the device last accessed,

[0264] In step S22, the current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including:

[0265] The current device sends a write cache file acquisition request to the last accessed device;

[0266] The current device receives the returned write cache file;

[0267] The current device loads the read cache file in the memory space;

[0268] In step S23, the current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including:

[0269] When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the memory space;

[0270] When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0271] In an exemplary application scenario, when the target file is stored on the first device, the user first uses the application software to open the target file on a device other than the first device (for example, the second device in this exemplary application scenario), and then uses the application software to open the same file on the first device, wherein the application software used on the second device and the first device may be different. When the target file is opened for the second time, the operation position (for example, the reading position or the editing position) of the target file when it is opened for the first time is directly displayed. At this time, the current device and the device where the file is located may be the same and the first device, and the last accessed device may be the second device. Figure 8a and Figure 8b Taking as an example, the workflow of the first device when the user opens the target file for the second time in this application scenario is described.

[0272] according to Figure 8a and Figure 8b In step S601, the first device receives an instruction from a user to open a target file.

[0273] In step S602, the first device sends an instruction to the metadata database of the first device, where the instruction includes a user identifier of the user and a file identifier of the target file. The instruction is used to obtain metadata of the target file stored in the metadata database of the first device, where the metadata includes at least a connection record of the target file, last access device information (in this case, the second device), and device information where the file is located (in this case, the first device).

[0274] In step S603, the metadata library of the first device determines whether the user has the authority to read and write the target file according to the user identifier and the file identifier in the instruction.

[0275] In step S604, when it is confirmed that the user has read and write permissions, the metadata bases of multiple devices of the file system are triggered to be synchronously updated, so that the metadata of the target file stored on each device is synchronously updated to the latest version. Triggering the synchronous update of the metadata base can ensure that the metadata on the first device records the latest device access records and continuation records of each device in the file system for the target file.

[0276] In step S605, the first device confirms the last access device and the device where the target file is located according to the last access device information of the target file and the device information where the file is located in the updated metadata database (in this application scenario, the last access device is the second device and the device where the file is located is the first device).

[0277] In step S606, the first device sends a write cache file acquisition request to the last accessed device (the second device).

[0278] In step S607, the first device receives the returned write cache file.

[0279] In step S608, the first device loads the read cache file in the memory space.

[0280] For example, when the current device and the device where the file is located are the first device, and the device last accessed is the second device, the write cache file of the target file can be obtained by transmitting data information between devices. If the target file was saved when it was last accessed on the second device, the write cache file is empty, and the target file was not saved when it was last accessed on the second device (for example, the target file was edited through WORD on the second device for the first time and was not saved, and the target file was opened through WPS on the first device for the second time), then the write cache file is not empty at this time, and the write cache file records the type of operation performed on the target file when the target file was last accessed, as well as the operation location and operation content. When the current device and the device where the file is located are the same (both are the first device), the read cache file is the file data of the target file read from the hard disk to the memory space. In a possible implementation, there may be no read cache file in the memory space. In this case, the file content in the hard disk can be read first and stored in the memory space in the form of a read cache file.

[0281] In step S609, when the write cache file is empty, the first device determines the offset position of the content to be displayed relative to the target file according to the continuation record. The continuation record can be obtained through the metadata library of the first device, and the offset position is associated with the operation position when the target file was last saved. For example, if the operation when the last save was an insert operation, the offset position is the insertion position in the file (for example, represented by the file byte number where the insertion cursor is located).

[0282] In step S610, the content to be displayed is displayed according to the offset position and the read cache file in the memory space.

[0283] For example, the offset position can be located in the read cache file, and then the content near the offset position in the read cache file can be displayed. For example, the displayed page can include text content near the position of the insertion cursor of the latest insertion operation.

[0284] In step S611, when the write cache file is not empty, the first device determines the offset position of the to-be-displayed content relative to the file according to the write cache file;

[0285] In step S612, the content to be displayed is displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0286] An example process of step S612 of the present embodiment can be referred to Figure 6 process.

[0287] In a possible implementation, when displaying the to-be-displayed content of the target file, the last access device is updated to the current device. For example, in this application scenario, in step S21, the last access device of the target file determined by the metadata database of the second device is the second device, then in step S23, after the to-be-displayed content is displayed on the first device, the last access device information of the target file in the metadata of the target file stored by the second device can be updated to the first device. In this way, the next time a device (for example, a third device) continues to access the target file, the last access device of the target file determined on the third device is the first device, and the third device can obtain the write cache file information from the first device.

[0288] In this way, files can be continued across devices and applications on the devices where the files are stored, thereby improving the applicability of the file continuation method.

[0289] In a possible implementation, when the current device, the last accessed device, and the device where the file is located are all different,

[0290] In step S22, the current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including:

[0291] The current device sends a write cache file acquisition request to the last accessed device;

[0292] The current device receives the returned write cache file;

[0293] The current device sends a request to obtain a cache file to a device with a faster transmission speed between the last accessed device and the device where the file is located;

[0294] The current device receives the returned read cache file.

[0295] In step S23, the current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including:

[0296] When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the received read cache file;

[0297] When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the received read cache file and write cache file.

[0298] In an exemplary application scenario, the target file is stored on the first device. The user uses different application software on the second and third devices to open the same file (target file) twice. When the target file is opened for the second time, the operation position (such as the reading position or the editing position) of the target file when it is opened for the first time is directly displayed. In this case, the device where the file is located can be the first device, the last accessed device can be the second device, and the current device can be the third device. Figure 9a and Figure 9b Taking the example of FIG. 1 as an example, an exemplary workflow of the third device when the user opens the target file for the second time in this application scenario is described.

[0299] according to Figure 9a and Figure 9b In step S701, the third device receives an instruction from a user to open a target file.

[0300] In step S702, the third device sends an instruction to the metadata database of the third device, where the instruction includes a user identifier of the user and a file identifier of the target file. The instruction is used to obtain metadata of the target file stored in the metadata database of the third device, where the metadata includes at least a connection record of the target file, last access device information (in this case, the second device), and device information where the file is located (in this case, the first device).

[0301] In step S703, the metadata library of the third device determines whether the user has the authority to read and write the target file according to the user identifier and the file identifier in the instruction.

[0302] In step S704, when confirming that the user has the read and write permissions for the target file, the third device triggers the metadata databases of multiple devices of the file system to perform a synchronous update, so that the metadata of the target file stored on each device is synchronously updated to the latest version. Triggering the synchronous update of the metadata database can ensure that the metadata on the third device records the latest device access records and continuation records of the target file by each device in the file system.

[0303] In step S705, the third device confirms the last access device and the device where the target file is located according to the last access device information and the device where the file is located in the updated metadata database (in this application scenario, the last access device is the second device and the device where the file is located is the first device).

[0304] In step S706, the third device sends a write cache file acquisition request to the last access device (the second device). Figure 9a and Figure 9b In the example, the last access device (second device) and the device where the file is located (first device) are different.

[0305] In step S707, the returned write cache file is received.

[0306] For example, when the current device and the device where the file is located are the first device, and the last accessed device is the second device, the write cache file and the read cache file of the target file can be obtained by transmitting data information between the devices. If the target file was saved when it was last accessed on the second device, the write cache file is empty, and the target file was not saved when it was last accessed on the second device (for example, the second device edited the target file through WORD for the first time and did not save it, and the third device opened the target file through WPS for the second time), then the write cache file is not empty at this time, and the write cache file records the type of operation, operation location and operation content performed on the target file when the target file was last accessed.

[0307] In step S708, when the write cache file is empty, the third device determines the offset position of the content to be displayed relative to the target file according to the continuation record; if the write cache file is not empty, step S717 is executed (see Figure 9b ), the third device determines the offset position of the content to be displayed relative to the file based on the write cache file.

[0308] In step S709, the third device issues an instruction to instruct the device where the file is located (the first device) to return data of a preset size; wherein the third device records the first time information when the instruction is issued.

[0309] In step S710, the third device receives data returned by the device where the file is located; wherein the third device records the second time information of receiving the returned data; the third device can confirm the data transmission time from the third device to the device where the file is located (the first device) based on the first time information and the second time information.

[0310] In step S711, the third device issues an instruction to instruct the last accessed device (second device) to return data of a preset size; wherein the third device records the third time information when the instruction is issued.

[0311] In step S712, the third device receives the data returned by the last access device; wherein the third device records the fourth time information of receiving the returned data; the third device can confirm the data transmission time from the third device to the last access device (second device) based on the third time information and the fourth time information.

[0312] In step S713, the third device determines the device with a faster transmission speed, that is, the device with a shorter data transmission time, between the device where the file is located (the first device) and the device that was last accessed (the second device) according to the time from sending the instruction to the device where the file is located (the first device) and the device that was last accessed (the second device) to receiving the returned data; Figure 9aIn the exemplary workflow of , the device with the faster transmission speed is the device that was accessed last time (the second device).

[0313] In step S714, the third device sends a request to obtain the cache file to the device with a faster transmission speed (the last access device, ie, the second device) between the last access device and the device where the file is located.

[0314] In step S715, the third device receives the returned read cache file. In a possible implementation, there may be no read cache file in the cache space of the last access device (second device) (for example, the second device clears the cache space), and the last access device (second device) is not the device where the file is located (first device). In this case, the last access device (second device) can return an empty read cache file. When the received read cache file is empty, the third device can send a read cache file acquisition request to the device where the file is located (first device). Among them, the memory space of the device where the file is located (first device) stores the read cache file, and the read cache file is the file data of the target file read from the hard disk to the memory space. In a possible implementation, there may be no read cache file in the memory space of the first device. In this case, the first device can first read the file content in the hard disk, store it in the memory space in the form of a read cache file, and then return the read cache file to the third device. After receiving the read cache file and the read cache file is not empty, the third device stores it in the cache space of the third device, and then applies the received read cache file for display.

[0315] In step S716, the content to be displayed is displayed according to the offset position and the received read cache file.

[0316] In step S717 (see Figure 9b ), when the write cache file is not empty, the third device determines the offset position of the content to be displayed relative to the file according to the write cache file, and executes the above steps S709-S715.

[0317] In step S718 (see Figure 9b ), and displays the content to be displayed according to the offset position and the received read cache file and write cache file.

[0318] An example process of step S718 of the present embodiment can be referred to Figure 6 process.

[0319] In a possible implementation, the read cache file acquisition request sent by the third device in this application scenario to the device with a faster transmission speed (the last accessed device) may include, for example, the location information of the content data of the read cache file to be acquired in the target file (target file), wherein the location information may be determined based on the write cache file. For example, the write cache file may include multiple operation positions, and the start position of the read cache file may be determined to be at least earlier than the first operation position among the multiple operation positions, and the end position of the read cache file may be determined to be at least later than the last operation position among the multiple operation positions.

[0320] In a possible implementation, the target file may have a small amount of data, for example, the target file may be a document file, in which case the entire content of the target file may be transmitted between multiple devices in the form of a read cache file. In a possible implementation, the target file may have a large amount of data, for example, the target file may be a video file, in which case the amount of data of the read cache file transmitted at one time may be preset.

[0321] For example, a read cache file that satisfies the conditions that the starting position is at least earlier than the first operation position among the multiple operation positions, and the ending position is at least later than the last operation position among the multiple operation positions is determined as the first read cache file. After the current device receives the first read cache file, the display of the content to be displayed is completed, for example, the playback continues from the playback position of the last accessed device; at the same time, the current device sends a read cache file acquisition request to the last accessed device or the device where the file is located again. The read cache request contains the location information of the second read cache file to be acquired. In this application scenario, the starting position of the second read cache file can be the same as the ending position of the first read cache file, and the ending position of the second read cache file can be, for example, an ending position that makes the second read cache file a preset size of data.

[0322] For example, the size of the read cache file for one transmission can be 40M, the target file is 200M in total, and the end position of the first read cache file is 10M of the target file. The start position of the second read cache file can be, for example, 10M of the target file, and the end position can be, for example, 50M of the target file.

[0323] In one possible implementation, Figure 9a and Figure 9bThe last access device and the device where the file is located in can also be the same (for example, both are the first device). In this case, the read cache file and the write cache file must come from the first device, and the step of sending instructions to the last access device and the device where the file is located to test the transmission speed can be omitted (steps S709-S715); that is, after the write cache file is empty and the third device determines the offset position of the content to be displayed relative to the target file based on the continuation record, it directly sends a read cache file acquisition request to the first device; or, after the write cache file is not empty and the third device determines the offset position of the content to be displayed relative to the target file based on the write cache file, it directly sends a read cache file acquisition request to the first device. In a possible implementation, the instructions for obtaining the read cache file and the write cache file can also be merged. For example, the third device sends a request to the first device, and the request is used to make the first device send the read cache file and the write cache file to the third device, and the first device returns the read cache file and the write cache file to the third device at the same time according to the request.

[0324] In this way, files can be saved on any device in the file system, and can be continued across devices and applications, thus improving the applicability of the file continuation method.

[0325] In a possible implementation, in an exemplary application scenario, the target file is stored on the first device. After the second device completes the continuous display of the file content of the target file on the display interface of the application software, the user can edit the displayed file content on the display interface of the second device, and the content edited by the user in this access is stored in the cache space of the second device in the form of a write cache file. If a new device (for example, a third device) opens the target file at this time, the third device can determine that the second device last operated the target file based on the last access device information (i.e., the device access record) in the metadata, and send a write cache file acquisition request to the second device; when the second device receives the write cache acquisition request from the third device, it can return the write cache file in the cache space to the third device. If the user's save instruction is received on the second device at this time, the second device can return the write cache file in the cache space to the first device and update the continuation record of the target file in the metadata database of the second device.

[0326] Below Fig.10a and Fig.10b Taking the example of the current device (second device) in this application scenario, the workflow of editing the target file after completing the continuous display of the target file and receiving the saving instruction is described.

[0327] according to Fig.10a and Fig.10bWhen the current device and the device where the target file is located are different, in step S901, the current device receives a user's instruction to edit the target file.

[0328] In step S902, the current device performs an editing operation on the content of the target file displayed on the display interface of the current device according to the instruction; wherein the type of editing operation may include deletion, modification, replacement, etc. of the file content by the user.

[0329] In step S903, the current device generates a write cache file of the target file according to the operation position, operation type and operation content. Since the second device (current device) is not the device where the target file is located (first device), the write cache file is stored in the cache space of the second device; in a possible implementation, if the edited object is a file that is continuously displayed on the second device and stored in the second device, the write cache file is stored in the memory space of the second device.

[0330] Furthermore, when the user saves the target file, the following steps may be included:

[0331] In step S904, the current device receives a user's instruction to save the target file.

[0332] In step S905, the current device sends the write cache file to the device where the target file is located (the first device) according to the instruction.

[0333] While sending the write cache file, the write cache file on the second device can be cleared; alternatively, a write cache file can be copied and sent, and the write cache file can be retained in the cache space of the second device, so that after the user clicks Save on the second device, the target file can still be displayed.

[0334] In step S906, when there is no continuation record of the target file in the metadata database of the current device, a continuation record of the target file is created in the metadata database of the current device according to the operation position in the target file when the user's instruction to save the target file is received; or, in step S907, when there is a continuation record of the target file in the metadata database of the current device, a continuation record in the metadata database of the second device is updated according to the operation position in the target file when the user's instruction to save the target file is received. In this case, the created continuation record or the updated continuation record indicates the offset position determined according to the operation position of the latest operation.

[0335] In this way, edits to the file can be transferred between devices so that the latest edits can be shown when the display continues.

[0336] In a possible implementation, in the above exemplary application scenario, the target file is continuously displayed on a remote device (e.g., a second device) other than the device (the first device) where the target file is located, and after the user edits the file on the second device, the second device sends the write cache file to the first device after receiving the user's save operation on the target file. After the first device receives the write cache file, it can generate a new target file based on the write cache file and the target file stored on the first device. Fig.11a and Fig.11b A schematic diagram showing an exemplary workflow of a first device generating a new target file according to an embodiment of the present application.

[0337] according to Fig.11a and Fig.11b In a possible implementation, the metadata of the target file also includes the file modification time of the target file. When the current device and the device where the target file is located are the same,

[0338] In step S100, the current device receives a write cache file.

[0339] In step S101, the current device generates a new target file according to the write cache file and the target file stored in the memory.

[0340] In step S102, the current device updates the file modification time information in the metadata of the target file.

[0341] In a possible implementation, a new target file is generated on the device where the file is located, that is, the file content of the target file is substantially changed, and the modification time of the file can be updated. The modification time information of the file can be associated with the version information of the metadata database. According to the modification time information of the file, the latest metadata database among the metadata databases of multiple devices can be determined. Based on this, the synchronous update of the target file stored on the device and the synchronous update of the metadata databases of multiple devices can be achieved.

[0342] Fig.12 An exemplary application scenario of user interaction with a device according to an embodiment of the present application is shown.

[0343] like Fig.12As shown, the user sees the files "Fruit" and "Physical Examination Items" that can be opened on the first device (e.g., mobile phone) using the first application (e.g., APP1), and by clicking "Yes" in the dialog box of "Whether to set the file 'Fruit' as a continuable file", issues an instruction to add a continuation identifier to the file "Fruit"; after receiving the user's instruction, when the file system of the mobile phone detects that the file "Fruit" is stored on the mobile phone and the file metadata on the mobile phone does not include the continuation identifier of the file "Fruit", it can create the continuation identifier of the file "Fruit" so that the file "Fruit" can be continued.

[0344] The user can click on the file "Fruit" seen on APP1 to issue an instruction to open the file "Fruit". After the file system determines that the user has read and write permissions for the file "Fruit", it can obtain the file content of the file "Fruit" and display it on the display interface of APP1.

[0345] The user can edit the displayed file content on the display interface. For example, after "Wumei, etc.", insert the following text:

[0346] Cool fruits:

[0347] Watermelon, muskmelon, pear, mandarin orange, tangerine, banana, mulberry, persimmon, water chestnut, etc.

[0348] At this time, the last operation position of the user, that is, the cursor position, is after "Water chestnut, etc."; the user can see the files "Fruit" and "Physical Examination Items" that can be opened on the second device (e.g., tablet computer) using the second application (e.g., APP2). The user can click on the file "Fruit" seen on APP2 to issue an instruction to open the file "Fruit". After the file system of the second device determines that the user has read and write permissions for the file "Fruit", it can obtain the file content of the file "Fruit" and display it on the display interface of APP2. At this time, the file content displayed on the display interface of APP2 is the file content after the user's read and write operations on APP1 on the mobile phone; the cursor position displayed on the display interface of APP2 is also the cursor position after the user's read and write operations on APP1 on the mobile phone. In this way, cross-device and cross-application continuation of files can be achieved based on multiple devices connected to the same local area network.

[0349] Fig.13 The structural diagram of a file continuation device according to an embodiment of the present application is shown. The file continuation device is applied to the file system, and the file continuation device includes:

[0350] A receiving module 1301, configured to receive an instruction from the user to open a target file;

[0351] A determination module 1302 is used to determine, in response to the instruction to open the target file, a device where the target file was last accessed, a device where the file is located, and a continuation record according to the stored metadata of the target file, wherein the continuation record indicates an operation location when the target file was last saved;

[0352] An acquisition module 1303 is used to acquire file data of the target file from at least one of the last access device and the device where the file is located, wherein the file data includes a read cache file and a write cache file;

[0353] The display module 1304 is configured to display the content to be displayed according to at least one of the connection record of the target file and the file data of the target file.

[0354] In a possible implementation, when the current device, the last accessed device, and the device where the file is located are the same,

[0355] The acquisition module includes a first acquisition submodule, which is used to load the write cache file and the read cache file in the memory space;

[0356] The display module comprises:

[0357] A first display submodule, configured to determine, when the write cache file is empty, an offset position of the content to be displayed relative to the target file according to the connection record, and display the content to be displayed according to the offset position and the read cache file in the memory space;

[0358] The second display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0359] In a possible implementation, when the current device is the same as the last access device and different from the device where the file is located,

[0360] The acquisition module includes a second acquisition submodule, which is used to load the write cache file and the read cache file in the cache space;

[0361] The display module comprises:

[0362] A third display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the continuation record when the write cache file is empty, and display the content to be displayed according to the offset position and the read cache file in the cache space;

[0363] The fourth display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the read cache file and the write cache file in the cache space.

[0364] In a possible implementation, when the current device is the same as the device where the file is located and different from the device last accessed,

[0365] The acquisition module comprises:

[0366] A third acquisition submodule, used for sending a write cache file acquisition request to the last accessed device;

[0367] The fourth acquisition submodule is used to receive the returned write cache file;

[0368] The fifth acquisition submodule is used to load the read cache file in the memory space;

[0369] The display module comprises:

[0370] a fifth display submodule, configured to determine, when the write cache file is empty, an offset position of the content to be displayed relative to the target file according to the connection record, and display the content to be displayed according to the offset position and the read cache file in the memory space;

[0371] The sixth display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

[0372] In a possible implementation, when the current device, the last accessed device, and the device where the file is located are all different,

[0373] The acquisition module comprises:

[0374] A sixth acquisition submodule, used for sending a write cache file acquisition request to the last accessed device;

[0375] The seventh acquisition submodule is used to receive the returned write cache file;

[0376] An eighth acquisition submodule, configured to send a cache file read acquisition request to a device with a faster transmission speed between the last access device and the device where the file is located;

[0377] The ninth acquisition submodule is used to receive the returned read cache file;

[0378] The display module comprises:

[0379] a seventh display submodule, configured to determine, when the write cache file is empty, an offset position of the content to be displayed relative to the target file according to the connection record, and display the content to be displayed according to the offset position and the received read cache file;

[0380] The eighth display submodule is used to determine the offset position of the content to be displayed relative to the target file according to the write cache file when the write cache file is not empty, and display the content to be displayed according to the offset position and the received read cache file and write cache file.

[0381] In a possible implementation, the determining module includes:

[0382] A first determining submodule is configured to issue an instruction to the metadata library of the current device, wherein the instruction includes a user identifier of the user and a file identifier of the target file, and the instruction is configured to obtain metadata of the target file stored in the metadata library of the current device;

[0383] A second determination submodule, used to determine whether the user has the authority to read and write the target file according to the user identifier and the file identifier;

[0384] A third determination submodule is used to trigger the synchronous update of the metadata bases of multiple devices of the file system when confirming that the user has the read and write permissions for the target file;

[0385] The fourth determination submodule is used to determine the last access device of the target file, the device where the file is located, and the continuation record according to the updated metadata library.

[0386] In a possible implementation manner, when the current device and the device where the file of the target file is located are the same, the apparatus further includes:

[0387] A first instruction receiving module, configured to receive an instruction from a user to add a continuation identifier, wherein the instruction to add a continuation identifier indicates adding a continuation identifier to the target file, and the continuation identifier indicates allowing a continuation record of the target file to be created in the metadata of the target file;

[0388] A first detection module, used for detecting whether the metadata of the stored target file includes a continuation identifier of the target file;

[0389] an identification adding module, configured to, when the metadata does not include a continuation identification of the target file, add a continuation identification of the target file to the metadata of the target file stored in the current device according to the instruction of adding the continuation identification;

[0390] The first updating module is used to trigger the metadata bases of multiple devices of the file system to be synchronously updated.

[0391] In a possible implementation manner, when the current device and the device where the file of the target file is located are the same, the apparatus further includes:

[0392] A second instruction receiving module, configured to receive an instruction from a user to create a file, wherein the instruction to create a file indicates to create the target file in the current device;

[0393] A file creation module, configured to create the target file in the current device according to the instruction for creating the file, and add a continuation mark of the target file in the metadata of the target file, wherein the continuation mark indicates that a continuation record of the target file is allowed to be created in the metadata of the target file;

[0394] The second updating module is used to trigger the metadata bases of multiple devices of the file system to be updated synchronously.

[0395] In a possible implementation manner, the device further includes:

[0396] A third instruction receiving module, used for receiving an instruction from a user to delete a continuation mark and / or a continuation record of a target file;

[0397] A second detection module, configured for the current device to detect whether the metadata of the target file stored therein includes a continuation identifier and / or a continuation record of the target file;

[0398] a deleting module, configured to, when the metadata includes a continuation mark and / or a continuation record of the target file, delete the continuation mark and / or the continuation record of the target file in the metadata according to the instruction by the current device;

[0399] The third updating module is used to trigger the metadata bases of multiple devices of the file system to be synchronously updated.

[0400] In a possible implementation manner, when the current device and the device where the file of the target file is located are different, the apparatus further includes:

[0401] A fourth instruction receiving module, configured to receive an instruction from a user to edit the target file;

[0402] An editing module, used to edit the content of the target file displayed on the display interface of the current device according to the instruction;

[0403] The first generating module is used to generate a write cache file of the target file according to an operation position, an operation type and an operation content.

[0404] In a possible implementation manner, when the current device and the device where the file of the target file is located are different, the apparatus further includes:

[0405] A fifth instruction receiving module, configured to receive a user's instruction to save the target file;

[0406] A sending module, used for sending the write cache file to the device where the target file is located according to the instruction;

[0407] A record creation module, configured to create a continuation record of the target file in the metadata database of the current device when there is no continuation record of the target file in the metadata database of the current device, according to the operation position in the target file when a save instruction for the target file is received from the user;

[0408] The fourth updating module is used to update the continuation record in the metadata database of the current device when there is a continuation record of the target file in the metadata database of the current device according to the operation position in the target file when receiving the user's save instruction for the target file.

[0409] In a possible implementation, the metadata of the target file also includes the file modification time of the target file, and when the current device and the device where the file of the target file is located are the same, the apparatus further includes:

[0410] A file receiving module, used for receiving write cache files;

[0411] A second generating module, used for generating a new target file according to the write cache file and the target file stored in the memory;

[0412] The fifth updating module is used to update the file modification time information in the metadata of the target file.

[0413] In a possible implementation manner, the device further includes:

[0414] A sixth updating module is used to update the last access device to the current device when displaying the to-be-displayed content of the target file.

[0415] Fig.14 A schematic diagram showing an exemplary structure of a terminal device according to an embodiment of the present application is shown in FIG. Fig.14 , the terminal device 200 can be used to execute Figure 2-Figure 12 The file continuation method in the embodiment. Fig.14 , the terminal device 200 includes:

[0416] The terminal device 200 includes a radio frequency (RF) circuit 110, a memory 120 including one or more computer-readable storage media, a receiving device 130, a display device 140, a sensor 150, an audio circuit 160, a wireless fidelity (WiFi) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that Fig.14 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0417] The RF circuit 110 can be used for receiving and sending signals during information transmission or calls, and can complete the work of the acquisition module in this application. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 180 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 110 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), (General Packet Radio Service General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0418] The memory 120 can be used to store software programs and various modules of the embodiments of the present application. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, a text display function, etc.), etc.; the data storage area may store data (such as audio data, video data, documents, etc.) created according to the use of the terminal device 200, as well as the above-mentioned metadata, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 120 may also include a memory controller to provide the processor 180 and the receiving device 130 with access to the memory 120.

[0419] The receiving device 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control, to complete the function of receiving user instructions. Specifically, the receiving device 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display screen or touch pad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 131), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 131 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch-sensitive surface 131 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131, the receiving device 130 may further include other input devices 132. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0420] The display device 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal device 200, which can be composed of graphics, text, icons, videos and any combination thereof. The display device 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. Further, the touch-sensitive surface 131 may cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Fig.14 In the embodiment, the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to implement input and output functions, but in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to implement input and output functions.

[0421] The terminal device 200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the terminal device 200 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the terminal device 200, they will not be repeated here.

[0422] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the terminal device 200. The audio circuit 160 can transmit the received audio data to the speaker 161 after converting the received audio data into an electrical signal, which is converted into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another terminal through the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earplug jack to provide communication between an external headset and the terminal device 200.

[0423] WiFi is a short-range wireless transmission technology. The terminal device 200 can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 170. It provides users with wireless broadband Internet access. When multiple terminal devices are connected to the same WiFi, data can be transmitted between multiple terminal devices through the WiFi module 170. Fig.14 The WiFi module 170 is shown, but it is understandable that it is not a necessary component of the terminal device 200 and can be omitted as needed without changing the essence of the invention.

[0424] The processor 180 is the control center of the terminal device 200. It uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the terminal device 200 and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 180 may include one or more processing cores; optionally, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.

[0425] The terminal device 200 also includes a power supply 190 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 180 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 190 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0426] Although not shown, the terminal device 200 may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display device of the terminal is a touch screen display, and the terminal also includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include a program for executing Figure 2-Figure 12 The method of the embodiment of the present application.

[0427] An embodiment of the present application provides an electronic device, comprising: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.

[0428] An embodiment of the present application provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above method is implemented.

[0429] An embodiment of the present application provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, a processor in the electronic device executes the above method.

[0430] The exemplary description of the above embodiments can be found in the above Figure 1-Figure 14 The description is not repeated here.

[0431] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing.

[0432] The computer-readable program instructions or codes described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0433] The computer program instructions for performing the operation of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present application.

[0434] Various aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0435] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0436] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0437] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, system, method and computer program product according to multiple embodiments of the present application. In this regard, each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in reverse order sometimes, depending on the functions involved.

[0438] It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by hardware (such as a circuit or ASIC (Application Specific Integrated Circuit)) that performs the corresponding function or action, or can be implemented by a combination of hardware and software, such as firmware.

[0439] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0440] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A file continuation method, characterized in that: The method is applied to a file system, the file system includes a plurality of devices, metadata of target files are respectively stored in metadata databases of the plurality of devices, and the method includes: The current device receives an instruction from a user to open a target file; In response to the instruction to open the target file, the current device determines the last access device of the target file, the device where the file is located, and a continuation record according to the stored metadata of the target file, wherein the continuation record indicates the operation position when the target file was last saved; The current device obtains file data of the target file from at least one of the last accessed device and the device where the file is located, the file data including a read cache file and a write cache file; The current device displays the content to be displayed according to at least one of the continuous record of the target file and the file data of the target file.

2. The file continuation method according to claim 1, characterized in that: When the current device, the last accessed device, and the device where the file is located are the same, The current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including: The current device loads the write cache file and the read cache file in the memory space; The current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including: When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the memory space; When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

3. The file continuation method according to claim 1, characterized in that: When the current device is the same as the last accessed device and different from the device where the file is located, The current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including: The current device loads the write cache file and the read cache file in the cache space; The current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including: When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the cache space; When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the cache space.

4. The file continuation method according to claim 1, characterized in that: When the current device is the same as the device where the file is located and different from the device last accessed, The current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including: The current device sends a write cache file acquisition request to the last accessed device; The current device receives the returned write cache file; The current device loads the read cache file in the memory space; The current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including: When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the continuation record, and displays the content to be displayed according to the offset position and the read cache file in the memory space; When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the read cache file and the write cache file in the memory space.

5. The file continuation method according to claim 1, characterized in that: When the current device, the last accessed device, and the device where the file is located are all different, The current device obtains the file data of the target file from at least one of the last accessed device and the device where the file is located, including: The current device sends a write cache file acquisition request to the last accessed device; The current device receives the returned write cache file; The current device sends a request to obtain a cache file to a device with a faster transmission speed among the last access device and the device where the file is located; The current device receives the returned read cache file; The current device displays the content to be displayed according to at least one of the continuation record of the target file and the file data of the target file, including: When the write cache file is empty, the current device determines the offset position of the content to be displayed relative to the target file according to the connection record, and displays the content to be displayed according to the offset position and the received read cache file; When the write cache file is not empty, the current device determines the offset position of the content to be displayed relative to the target file according to the write cache file, and displays the content to be displayed according to the offset position and the received read cache file and write cache file.

6. The file continuation method according to any one of claims 1 to 5, characterized in that: The current device determines the last access device of the target file, the device where the file is located, and the continuation record according to the stored metadata of the target file, including: The current device sends an instruction to a metadata database of the current device, the instruction including a user identifier of the user and a file identifier of the target file, and the instruction is used to obtain metadata of the target file stored in the metadata database of the current device; The metadata database of the current device determines whether the user has the authority to read and write the target file according to the user identifier and the file identifier; When confirming that the user has the read and write permissions for the target file, the current device triggers the metadata databases of multiple devices of the file system to be synchronously updated; The current device determines the last access device of the target file, the device where the file is located, and the continuation record according to the updated metadata library.

7. The file continuation method according to any one of claims 1 to 5, characterized in that: When the current device and the device where the file of the target file is located are the same, the method further includes: The current device receives an instruction from a user to add a continuation mark, wherein the instruction to add a continuation mark indicates adding a continuation mark to the target file, and the continuation mark indicates allowing to create a continuation record of the target file in the metadata of the target file; The current device detects whether the metadata of the target file stored includes a continuation identifier of the target file; In a case where the metadata does not include a continuation identifier of the target file, the current device adds a continuation identifier of the target file to the metadata of the target file stored in the current device according to the instruction of adding the continuation identifier; The current device triggers the metadata databases of multiple devices of the file system to be synchronously updated.

8. The file continuation method according to any one of claims 1 to 5, characterized in that: When the current device and the device where the file of the target file is located are the same, the method further includes: The current device receives a user's instruction to create a file, where the instruction to create a file indicates that the target file is created in the current device; The current device creates the target file in the current device according to the instruction to create a file, and adds a continuation mark of the target file in the metadata of the target file, wherein the continuation mark indicates that a continuation record of the target file is allowed to be created in the metadata of the target file; The current device triggers the metadata databases of multiple devices of the file system to be synchronously updated.

9. The file continuation method according to any one of claims 1 to 5, characterized in that: The method further comprises: The current device receives a continuation mark and / or a continuation record instruction of a deletion target file from a user; The current device detects whether the stored metadata of the target file includes a continuation identifier and / or a continuation record of the target file; In a case where the metadata includes a continuation mark and / or a continuation record of the target file, the current device deletes the continuation mark and / or the continuation record of the target file in the metadata according to the instruction; The current device triggers the metadata databases of multiple devices of the file system to be synchronously updated.

10. The file continuation method according to any one of claims 1 to 5, characterized in that: When the current device and the target file are located on different devices, the method further includes: The current device receives an instruction from a user to edit the target file; The current device performs an editing operation on the content of the target file displayed on the display interface of the current device according to the instruction; The current device generates a write cache file for the target file according to the operation position, operation type and operation content.

11. The file continuation method according to any one of claims 1 to 5, characterized in that: When the current device and the target file are located on different devices, the method further includes: The current device receives a user's instruction to save the target file; The current device sends the write cache file to the device where the target file is located according to the instruction; When there is no continuation record of the target file in the metadata database of the current device, creating a continuation record of the target file in the metadata database of the current device according to the operation position in the target file when receiving a save instruction for the target file from the user; When there is a continuation record of the target file in the metadata database of the current device, the continuation record in the metadata database of the current device is updated according to the operation position in the target file when receiving a save instruction for the target file from the user.

12. The file continuation method according to any one of claims 1 to 5, characterized in that: The metadata of the target file also includes the file modification time of the target file. When the current device and the device where the file of the target file is located are the same, the method further includes: The current device receives a write cache file; The current device generates a new target file according to the write cache file and the target file stored in the memory; The current device updates the file modification time information in the metadata of the target file.

13. The file continuation method according to any one of claims 1 to 5, characterized in that: The method further comprises: When displaying the to-be-displayed content of the target file, the last accessed device is updated to the current device.

14. A file continuation device, characterized in that: The file continuation device is applied to a file system, and the file continuation device comprises: A receiving module, used for receiving an instruction from a user to open a target file; a determination module, configured to determine, in response to the instruction to open the target file, a device where the target file was last accessed, a device where the file is located, and a continuation record according to the stored metadata of the target file, wherein the continuation record indicates an operation location when the target file was last saved; An acquisition module, used for acquiring file data of the target file from at least one of the last accessed device and the device where the file is located, wherein the file data includes a read cache file and a write cache file; The display module is used to display the content to be displayed according to at least one of the connection record of the target file and the file data of the target file.

15. A terminal device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method of any one of claims 1-13 when executing the instructions.

16. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Network bookmark and method for accessing network files

    CN102082760A

  • Transferring and caching a cloud file in a distributed filesystem

    US9852149B1