File connection method and device, terminal equipment and storage medium
By storing access records of files in the device metadatabase and using cache files to achieve file continuation across devices and applications, the problems of privacy leakage, high cost, slow speed and complex operation of file continuation in the prior art are solved, and the convenience and security of file continuation are improved.
Patent Information
- Application Number
- CN202510245083.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-10
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, files are indirectly connected by multiple devices, such as privacy leakage risks, high cost, slow speed, inability to be connected across applications, and complex operations.
By storing the last access device, device where the file is located and continuation records of files in the device's metadatabase, the file is connected across devices and across applications can be realized, and the content to be displayed is displayed using cache files and write cache files, reducing dependence on the cloud and servers.
It realizes file continuation across devices and applications, reduces costs, improves operational convenience and performance, and ensures data security and scope of application.
Smart Images

Figure CN120256390A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202110185209.X, the filing date of the original application is February 10, 2021, and the entire content of the original application is incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technologies, and in particular, to a file continuation method, apparatus, terminal device, and storage medium. Background Art
[0003] With the development of intelligent devices, using intelligent devices to operate files brings great convenience to users. For example, users can use the application software of a smart phone to watch movies, listen to music, and edit documents. Sharing files among multiple devices can not only give full play to the advantages of each device, but also bring great convenience to users' operations. When users use multiple intelligent devices to operate multimedia files such as videos, audios, and documents, they often hope that after switching devices, they can continue the previous operation, which will facilitate the collaboration between multiple devices.
[0004] In the prior art, usually, multimedia files are stored in the cloud. When other devices need to access the files, they directly obtain the files from the cloud, and at the same time, by transmitting location tags (tags indicating the latest reading or editing position of the files), the continuation effect between devices is achieved. Or, by saving the device information of the terminal device and the reading position information of the files on the server, after the user switches devices, the corresponding reading position information is loaded from the server side to achieve continuation. However, storing files in the cloud poses a risk of privacy leakage, file continuation cannot be achieved across applications, and purchasing cloud space increases the user's usage cost. Moreover, the speed of pulling files from the cloud is slow, which has a certain impact on the efficiency of obtaining files. Storing device information and file reading position information on the server, file continuation cannot be achieved across applications, and the usage scenarios have relatively strict requirements, the supported file types are also limited, and users need to specify device information, with complex operations. Summary of the Invention
[0005] In view of this, this application provides a file continuation method, apparatus, terminal device, and storage medium. According to the file continuation method of the embodiments of this application, cross-device and cross-application continuation of files can be achieved, and file continuation does not need to rely on the cloud and the server, which can reduce the continuation cost.
[0006] In a first aspect, an embodiment of this application provides a file continuation method, which is applied to a file system. The file system includes multiple devices, and metadata of a target file is respectively stored in the metadata databases of the multiple devices. The method includes:
[0007] The current device receives an instruction from the user to open a target file; in response to the instruction to open the target file, the current device determines the last access device, the device where the file is located, and a continuation record of the target file according to the metadata of the target file stored, where the continuation record indicates the operation position when the target file was saved last time; 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 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.
[0008] According to the file continuation method of the embodiments of the present application, by storing attribute information such as the last access device, the device where the file is located, and the continuation record of the file in the metadata database of the device, file continuation does not rely on the cloud and the server, but obtains data information of the file from the corresponding device through the attribute information of the file to complete file continuation, so that cross-device and cross-application continuation of the file can be realized; file continuation does not rely on the cloud and the server, which can reduce the continuation cost; as long as the user gives an instruction to open the target file on the current device, file continuation can be automatically completed, which is convenient for the user to operate; continuation can be based on the cache between devices, so that even if the user does not synchronize the modification to the target file stored in the device where the file is located, file continuation can still be realized, having better performance.
[0009] According to the first aspect, in the first possible implementation manner 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 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 memory space.
[0010] The current device displays 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, the read cache file, and the write cache file in the memory space.
[0011] In this way, the file can realize cross-application continuation on the device storing the file, improving the applicable range of the file continuation method.
[0012] According to the first aspect, in the second possible implementation of the file continuation method, 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;
[0013] 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.
[0014] In this way, the file can achieve cross-application continuation on any device in the file system except the device storing the file, improving the applicable range of the file continuation method.
[0015] According to the first aspect, in the 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;
[0016] 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.
[0017] In this way, the file can achieve cross-device and cross-application continuation on the device storing the file, improving the applicable range of the file continuation method.
[0018] According to the first aspect, in the fourth possible implementation manner of the file continuation method, 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 read cache file acquisition request to the device with a faster transmission speed among the last accessed device and the device where the file is located; the current device receives the returned read cache file;
[0019] 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 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, the received read cache file, and the write cache file.
[0020] In this way, the file can be continued across devices and across applications on any device of the file system, improving the applicable range of the file continuation method.
[0021] According to the first aspect and any one of the possible implementation manners of the above first aspect, in the fifth possible implementation manner of the file continuation method, the current device determines the last accessed device, the device where the file is located, and the continuation record of the target file according to the stored metadata of the target file, including: the current device issues an instruction to the metadata database of the current device, the instruction includes 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 database of the current device determines whether the user has the permission to read and write the target file according to the user identification and the file identification; in the case of 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 be synchronously updated; the current device determines the last accessed device, the device where the file is located, and the continuation record of the target file according to the updated metadata database.
[0022] In this way, when other users do not have the permission to read and write the target file, the target file will not be displayed on the devices used by other users, which can improve data security.
[0023] According to the first aspect and any possible implementation of the above first aspect, in the sixth possible implementation of the file continuation method, when the current device is the same as the device where the target file is located, the method further includes: the current device receives an indication from the user to add a continuation identifier, where the indication to add a continuation identifier indicates adding a continuation identifier to 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 detects whether the metadata of the target file stored in it includes the continuation identifier of the target file; in the case where 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 indication to add a continuation identifier; the current device triggers synchronous updates to the metadata databases of multiple devices in the file system.
[0024] In this way, the user is allowed to enable the file to be accessed continuously by adding an indication of a continuation identifier.
[0025] According to the first aspect and any one of the first to fifth implementations of the first aspect, in the seventh possible implementation of the file continuation method, when the current device is the same as the device where the target file is located, the method further includes: the current device receives an indication from the user to create a file, where the indication to create a file indicates creating the target file in the current device; the current device creates the target file in the current device according to the indication to create a file, and adds the continuation identifier of the target file to the metadata of the target file, where 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 synchronous updates to the metadata databases of multiple devices in the file system.
[0026] In this way, the target file can be accessed across devices as soon as it is created. The user no longer has to send an indication to add a continuation identifier to the current device, reducing the complexity of user operations and improving the user experience.
[0027] According to the first aspect and any possible implementation of the above first aspect, in the eighth possible implementation of the file continuation method, the method further 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 metadata of the stored target file includes the continuation identifier and / or continuation record of the target file; when the metadata includes the continuation identifier and / or continuation record of the target file, the current device deletes the continuation identifier and / or continuation record of the target file in the metadata according to the instruction; the current device triggers the metadata databases of multiple devices in the file system to be synchronously updated.
[0028] In this way, according to the different requirements of the user for file continuation, the corresponding solution can be selected, which is convenient for the user to use when applied to the file system.
[0029] According to the first aspect and any possible implementation of the above first aspect, in the ninth possible implementation of the file continuation method, when the current device is different from the device where the target file is located, the method further includes: the current device receives an editing instruction from the user for the target file; the current device performs an editing operation on the content of the displayed target file on the display interface of the current device according to the instruction; the current device generates a write cache file of the target file according to the operation position, operation type and operation content.
[0030] According to the first aspect and any possible implementation of the above first aspect, in the tenth possible implementation of the file continuation method, when the current device is different from the device where the target file is located, the method further includes: the current device receives a save instruction from the user for 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, 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 receiving the save instruction from the user for the target file; 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 the save instruction from the user for the target file.
[0031] In this way, the editing of the file can be transmitted between devices, so that the latest edited content can be displayed when continuing to display.
[0032] According to the first aspect and any possible implementation manner of the above first aspect, in the eleventh possible implementation manner of the file continuation method, the metadata of the target file further includes the file modification time of the target file. When the current device is the same as the device where the target file is located, 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.
[0033] Based on this, synchronous update of the target file stored on the device can be achieved.
[0034] According to the first aspect and any possible implementation manner of the above first aspect, in the twelfth possible implementation manner of the file continuation method, the method further includes: when displaying the content to be displayed of the target file, updating the last access device to the current device.
[0035] 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. The file continuation device includes:
[0036] A receiving module, configured to receive an instruction from a user to open a target file; a determining module, configured to, in response to the instruction to open the target file, determine the last access device, the file location device, and a continuation record of the target file according to the stored metadata of the target file, where the continuation record indicates the operation position when the target file was last saved; an obtaining module, configured to obtain file data of the target file from at least one of the last access device and the file location device, where the file data includes a read cache file and a write cache file; a display module, configured to display 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.
[0037] According to the second aspect, in the first possible implementation manner of the file continuation device, when the current device, the last access device, and the file location device are the same,
[0038] The obtaining module includes a first obtaining sub-module, configured to load the write cache file and the read cache file in the memory space;
[0039] The display module includes:
[0040] A first display sub-module, configured to, when the write cache file is empty, determine the offset position of the content to be displayed relative to the target file according to the continuation record, and display the content to be displayed according to the offset position and the read cache file in the memory space;
[0041] A second display sub-module, configured to, when the write cache file is not empty, determine an offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the read cache file, and the write cache file in the memory space.
[0042] According to a second aspect, in a second possible implementation manner of the file continuation device, when the current device is the same as the last accessed device and different from the device where the file is located,
[0043] The obtaining module includes a second obtaining sub-module, configured to load the write cache file and the read cache file in the cache space;
[0044] The display module includes:
[0045] A third display sub-module, configured to, when the write cache file is empty, determine an offset position of the content to be displayed relative to the target file according to the continuation record, and display the content to be displayed according to the offset position and the read cache file in the cache space;
[0046] A fourth display sub-module, configured to, when the write cache file is not empty, determine an offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the read cache file, and the write cache file in the cache space.
[0047] According to a second aspect, in a third possible implementation manner 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,
[0048] The obtaining module includes:
[0049] A third obtaining sub-module, configured to send a write cache file obtaining request to the last accessed device;
[0050] A fourth obtaining sub-module, configured to receive the returned write cache file;
[0051] A fifth obtaining sub-module, configured to load the read cache file in the memory space;
[0052] The display module includes:
[0053] A fifth display sub-module, configured to, when the write cache file is empty, determine an offset position of the content to be displayed relative to the target file according to the continuation record, and display the content to be displayed according to the offset position and the read cache file in the memory space;
[0054] The sixth display sub-module is configured to, when the write cache file is not empty, determine the offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the read cache file in the memory space, and the write cache file.
[0055] According to the second aspect, in the fourth possible implementation manner of the file continuation device, when the current device, the last accessed device, and the device where the file is located are all different,
[0056] The obtaining module includes:
[0057] The sixth obtaining sub-module is configured to send a write cache file obtaining request to the last accessed device;
[0058] The seventh obtaining sub-module is configured to receive the returned write cache file;
[0059] The eighth obtaining sub-module is configured to send a read cache file obtaining request to the device with a faster transmission speed among the last accessed device and the device where the file is located;
[0060] The ninth obtaining sub-module is configured to receive the returned read cache file;
[0061] The display module includes:
[0062] The seventh display sub-module is configured to, when the write cache file is empty, determine the offset position of the content to be displayed relative to the target file according to the continuation record, and display the content to be displayed according to the offset position and the received read cache file;
[0063] The eighth display sub-module is configured to, when the write cache file is not empty, determine the offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the received read cache file, and the write cache file.
[0064] According to the second aspect, and any one of the possible implementation manners of the above second aspect, in the fifth possible implementation manner of the file continuation device, the determining module includes:
[0065] The first determining sub-module is configured to send an instruction to the meta-database of the current device, where the instruction includes 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 meta-database of the current device;
[0066] The second determining sub-module is configured to determine whether the user has the permission to read and write the target file according to the user identification and the file identification;
[0067] A third determination sub-module, configured to trigger synchronous update of the meta-databases of multiple devices of a file system when it is confirmed that the user has read and write permissions for the target file;
[0068] A fourth determination sub-module, configured to determine the last accessed device, the device where the file is located, and the continuation record of the target file according to the updated meta-database.
[0069] According to the second aspect and any one of the possible implementation manners of the second aspect above, in the sixth possible implementation manner of the file continuation device, when the current device is the same as the device where the target file is located, the device further includes:
[0070] A first indication receiving module, configured to receive an indication from a user to add a continuation identifier, where the indication to add a continuation identifier indicates adding a continuation identifier to 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;
[0071] A first detection module, configured to detect whether the metadata of the stored target file includes the continuation identifier of the target file;
[0072] An identifier adding module, configured to, when the metadata does not include the continuation identifier of the target file, add the continuation identifier of the target file to the metadata of the target file stored in the current device according to the indication to add a continuation identifier;
[0073] A first update module, configured to trigger synchronous update of the meta-databases of multiple devices of a file system.
[0074] According to the second aspect and any one of the first to fifth implementation manners of the second aspect, in the seventh possible implementation manner of the file continuation device, when the current device is the same as the device where the target file is located, the device further includes:
[0075] A second indication receiving module, configured to receive an indication from a user to create a file, where the indication to create a file indicates creating the target file in the current device;
[0076] A file creating module, configured to create the target file in the current device according to the indication to create a file, and add the continuation identifier of the target file to the metadata of the target file, where the continuation identifier indicates that a continuation record of the target file is allowed to be created in the metadata of the target file;
[0077] A second update module, configured to trigger synchronous update of the meta-databases of multiple devices of a file system.
[0078] According to the second aspect and any possible implementation manner of the above second aspect, in the eighth possible implementation manner of the file continuation device, the device further includes:
[0079] A third indication receiving module, configured to receive an indication from the user to delete the continuation identifier and / or continuation record of the target file;
[0080] A second detection module, configured to detect whether the metadata of the target file stored in the current device includes the continuation identifier and / or continuation record of the target file;
[0081] A deletion module, configured to, when the metadata includes the continuation identifier and / or continuation record of the target file, the current device deletes the continuation identifier and / or continuation record of the target file in the metadata according to the indication;
[0082] A third update module, configured to trigger synchronous update of the metadata databases of multiple devices of the file system.
[0083] According to the second aspect and any possible implementation manner of the above second aspect, in the ninth possible implementation manner of the file continuation device, when the current device is different from the device where the target file is located, the device further includes:
[0084] A fourth indication receiving module, configured to receive an editing indication from the user for the target file;
[0085] An editing module, configured to perform an editing operation on the content of the displayed target file on the display interface of the current device according to the indication;
[0086] A first generation module, configured to generate a write cache file of the target file according to the operation position, operation type, and operation content.
[0087] According to the second aspect and any possible implementation manner of the above second aspect, in the tenth possible implementation manner of the file continuation device, when the current device is different from the device where the target file is located, the device further includes:
[0088] A fifth indication receiving module, configured to receive a save indication from the user for the target file;
[0089] A sending module, configured to send the write cache file to the device where the target file is located according to the indication;
[0090] A record creation module, configured to create a consecutive 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 of the target file from the user, when there is no consecutive record of the target file in the metadata database of the current device;
[0091] A fourth update module, configured to update the consecutive record in the metadata database of the current device according to the operation position in the target file when receiving a save instruction of the target file from the user, when there is a consecutive record of the target file in the metadata database of the current device.
[0092] According to the second aspect, and any one of the possible implementation manners of the above second aspect, in the eleventh possible implementation manner of the file continuation device, the metadata of the target file further includes the file modification time of the target file. When the current device is the same as the device where the target file is located, the device further includes:
[0093] A file receiving module, configured to receive a write cache file;
[0094] A second generation module, configured to generate a new target file according to the write cache file and the target file stored in the memory;
[0095] A fifth update module, configured to update the file modification time information in the metadata of the target file.
[0096] According to the second aspect, and any one of the possible implementation manners of the above second aspect, in the twelfth possible implementation manner of the file continuation device, the device further includes:
[0097] A sixth update module, configured to update the last access device to the current device when displaying the content to be displayed of the target file.
[0098] In a third aspect, an embodiment of the present application provides a terminal device, including: a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions, a file continuation method according to one or several of the above first aspect or various possible implementation manners of the first aspect is implemented.
[0099] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, a file continuation method according to one or several of the above first aspect or various possible implementation manners of the first aspect is implemented.
[0100] These and other aspects of the present application will become more apparent and understandable in the following description of (one or more) embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] The accompanying drawings included in and forming a part of the specification illustrate exemplary embodiments, features, and aspects of the present application and are used to explain the principles of the present application together with the specification.
[0102] Figure 1 Illustrates an exemplary application scenario according to an embodiment of the present application.
[0103] Figure 2 Illustrates an exemplary flowchart of a file connection method according to an embodiment of the present application.
[0104] Figure 3a Illustrates a schematic diagram of an exemplary process for creating a connection identifier according to an embodiment of the present application.
[0105] Figure 3b Illustrates a schematic diagram of an exemplary process for creating a connection identifier according to an embodiment of the present application.
[0106] Figure 3c Illustrates a schematic diagram of another exemplary process for creating a connection identifier according to an embodiment of the present application.
[0107] Figure 3d Illustrates a schematic diagram of another exemplary process for creating a connection identifier according to an embodiment of the present application.
[0108] Figure 4a Illustrates a schematic diagram of an exemplary process for deleting a connection identifier and / or a connection record according to an embodiment of the present application.
[0109] Figure 4b Illustrates a schematic diagram of an exemplary process for deleting a connection identifier and / or a connection record according to an embodiment of the present application.
[0110] Figure 5a Illustrates a schematic diagram of the file connection method according to an embodiment of the present application in an exemplary application scenario.
[0111] Figure 5b Illustrates a schematic diagram of the file connection method according to an embodiment of the present application in an exemplary application scenario.
[0112] Figure 6 Illustrates a flowchart of an example of step S310 according to an embodiment of the present application.
[0113] Figure 7a Illustrates a schematic diagram of the file connection method according to an embodiment of the present application in another exemplary application scenario.
[0114] Figure 7b Illustrates a schematic diagram of the file connection method according to an embodiment of the present application in another exemplary application scenario.
[0115] Figure 8a Shows a schematic diagram of the file continuation method according to an embodiment of the present application in another exemplary application scenario.
[0116] Figure 8b Shows a schematic diagram of the file continuation method according to an embodiment of the present application in another exemplary application scenario.
[0117] Figure 9a Shows a schematic diagram of the file continuation method according to an embodiment of the present application in another exemplary application scenario.
[0118] Figure 9b Shows a schematic diagram of the file continuation method according to an embodiment of the present application in another exemplary application scenario.
[0119] Figure 10a Shows a schematic diagram of the file continuation method according to an embodiment of the present application in another exemplary application scenario.
[0120] Figure 10b Shows a schematic diagram of the file continuation method according to an embodiment of the present application in another exemplary application scenario
[0121] Figure 11a Shows a schematic diagram of an exemplary workflow for a first device to generate a new target file according to an embodiment of the present application.
[0122] Figure 11b Shows a schematic diagram of an exemplary workflow for a first device to generate a new target file according to an embodiment of the present application.
[0123] Figure 12 Shows an exemplary application scenario of interaction between a user and a device according to an embodiment of the present application.
[0124] Figure 13 Shows a structural diagram of a file continuation device according to an embodiment of the present application.
[0125] Figure 14 Shows a schematic structural diagram of an exemplary terminal device according to an embodiment of the present application. Detailed implementation manners
[0126] The following will describe various exemplary embodiments, features, and aspects of the present application in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements having the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0127] As used herein, the term "exemplary" means "serving as an example, embodiment, or illustration". Any embodiment described as "exemplary" herein need not be construed as superior or better than other embodiments.
[0128] In addition, for a better illustration of the present application, numerous specific details are given in the following detailed description. Those skilled in the art should understand that the present application can be implemented without some of these specific details. In some instances, methods, means, elements, and circuits well-known to those skilled in the art are not described in detail so as to highlight the gist of the present application.
[0129] Aiming at the disadvantages of file continuation in the prior art, such as inability to cross applications and high costs, the embodiments of the present application provide a file continuation method, which can realize cross-device and cross-application access to files, and file continuation does not require additional cloud and server costs, and is also relatively convenient for users to operate.
[0130] The file continuation method of the embodiments 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. Among them, the first device, the second device, and the third device can be any type of device, including but not limited to smartphones, personal computers, tablets, etc.
[0131] As Figure 1 shown, in an exemplary application scenario, the file system may include a first device 101 (the device where the file of the target file is located) storing the target file, and a second device 102 and a third device 103. Among them, the first device 101, the second device 102, and the third device 103 all include display devices such as display screens and can display files of various types (for example, documents, videos, audios, 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 each other. The metadata of the target file can be synchronously stored on the first device 101, the second device 102, and the third device 103 (for example, stored in the metadata databases of each device). Table 1 shows an example of the data structure of the metadata according to an embodiment of the present application.
[0132] Table 1
[0133]
[0134] As shown in Table 1, the metadata includes:
[0135] File name, which is used to display the file name. The user can see the file name and issue an instruction to open the file by selecting the file.
[0136] File size, which is used to display the data size of the file.
[0137] File modification time, which is used to record the time information when a new file is generated based on an existing file on the device storing the file.
[0138] File access time, which is used to record the time when the file was last opened and displayed on the device.
[0139] File creation time, which is used to record the time information when the file was created.
[0140] File owner (UID, User Identification), which is used to record the user who can operate on the file, that is, the file owner. By setting the file owner, the users with read and write permissions for the file can be determined.
[0141] File group GID (Group Identification), which is used to record the user group, that is, the user group where the file owner belongs.
[0142] Device where the file is located, which is used to record the device storing the file; by querying the information about the device where the file is located in the metadata, it can be determined which device in the file system (such as within a network) the file to be opened is stored on.
[0143] File inode, which is used to record the inode where the file is stored on the device where the file is located; based on the file inode, the device can find the storage location of the file on the hard disk and read the file content on the hard disk into the memory.
[0144] File type, which is used to record what type of file the file is, such as in txt format, doc format, rmvb format, etc.
[0145] Device access record, which is used to record the device where the file was last opened. By querying the information about the last accessed device in the metadata, it can be determined which device the file to be opened was on when it was last opened.
[0146] Continuation information, including a continuation identifier and a continuation record. The continuation identifier is used to enable the file to be continued, and the continuation record is used to record the operation position in the file where the last operation was performed. According to the continuation information, when the file is opened for display, it can be positioned at the position of the last operation.
[0147] When the target file exists on the first device and the user wants to share the target file on other devices (such as the second device, the third device) in the file system and perform a continuation access, the other devices (such as the second device, 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 respectively through Figure 1The router 104 in it realizes communication), or creates a local area network of the first device, the second device, and the third device, enabling the first device, the second device, and the third device to perform data interaction in the network. The devices in the file system can also be referred to as the devices within the network.
[0148] The metadata of the target files stored on each device can be synchronously updated periodically, or when each target file is opened, it can be triggered by the device (the current device) that opens the target file to synchronously update, or when the device operates on the target file each time, it can be triggered to synchronously update. Through the metadata, the device that operated on the target file last time (the last access device of the target file), the device that stores the target file (the file location device of the target file, which is the first device in this application scenario), and the position of the operation at the previous save of the file in the file (sequential record) can be recorded. Moreover, the second device and the third device can store the file data of the target file read through the cache space, as well as the position of the latest operation on the file in the file. Through the file sequential method of the embodiments of the present application, cross-application file sequential access can be realized in the above file system.
[0149] Next, in combination with the above exemplary application scenarios, and Figures 2 - 12 , the execution process of the file sequential method of an embodiment of the present application will be described.
[0150] Figure 2 An exemplary flowchart showing the file sequential method according to an embodiment of the present application is presented. In one possible implementation, the file sequential method of the embodiments of the present application is applied to a file system. The file system includes multiple devices, and the metadata of the target files are respectively stored in the metadata databases of the multiple devices. The file sequential method of the embodiments of the present application includes:
[0151] S20, the current device receives an instruction from the user to open the target file;
[0152] S21, in response to the instruction to open the target file, the current device determines the last access device, the file location device, and the sequential record of the target file according to the stored metadata of the target file. The sequential record indicates the operation position at the previous save of the target file;
[0153] S22, the current device obtains the file data of the target file from at least one of the last access device and the file location device. The file data includes a read cache file and a write cache file;
[0154] S23, the current device displays the content to be displayed according to at least one of the sequential record of the target file and the file data of the target file.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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.
[0159] In step S102, the current device detects whether the metadata of the stored target file includes a continuation identifier of the target file.
[0160] In step S103, when the continuation identifier of the target file is not included in the metadata, 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.
[0161] In step S104, the current device triggers the metadata databases of multiple devices in the file system to be synchronously updated.
[0162] Among them, the current device may be the device where the target file is located, that is, the first device.
[0163] In a possible implementation, each device in the file system may respectively include a metadata database, which can be used to store data information describing the attributes of the target file. Among them, the continuation identifier is a kind of file attribute information indicating that the file is allowed to be accessed across devices in the file system.
[0164] During the synchronous update process, the first device may change the update time (or version identifier) of the metadata of the target file to the time when the continuation identifier is added (or change it to a new version identifier). Other devices obtain the update time (or version identifier) of the device that triggers the synchronous update (here it is the first device). When it is detected that the update time of the first device is later than the update time of this device (or the version identifier is newer than the version identifier of this 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 this device (or the version identifier is older than the version identifier of this 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 in multiple devices (such as the first device, the second device, and the third device) in the network all includes 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.
[0165] In a possible implementation, the first device can see the file names of files with consecutive identifiers stored on multiple devices of the file system in the shared list of the first device. The consecutive identifier of the target file is a file-level marker corresponding to the target file. When the metadata of the target file includes the consecutive identifier, the target file can be added to the shared list, and users can view the shared list through each device in the network and access the target file in the shared list. After the user opens the target file on the first device and the metadata of the target file has a consecutive identifier, the first device can update the consecutive record in the metadata according to the received save operation of the user on the target file, so that the operation position when the target file was last saved recorded in the consecutive record remains up-to-date; when there is no consecutive record in the file metadata, the first device can create a consecutive record of the target file in the metadata of the first device and record the operation position when the target file was last saved.
[0166] In this way, users only need to issue an instruction to add a consecutive identifier on the device where the file is located, and the target file can be accessed across devices. For users, the operation is simple, improving the user experience.
[0167] In a possible implementation, when the current device is the same as the device where the target file is located, the consecutive identifier of the target file can also be created together with the target file.
[0168] See Figure 3c and Figure 3d , in step S105, the current device receives an instruction from the user to create a file, and the instruction to create a file indicates to create a target file in the current device;
[0169] In step S106, the current device creates a target file in the current device according to the instruction to create a file, and adds a consecutive identifier of the target file to the metadata of the target file. The consecutive identifier indicates that a consecutive record of the target file is allowed to be created in the metadata of the target file;
[0170] In step S107, the current device triggers the metadata databases of multiple devices of the file system to be synchronously updated.
[0171] For example, according to the instruction from the user to create a target file, when the current device creates the target file, it also adds the metadata of the target file to the metadata database of the current device. In this case, the current device can add a consecutive identifier of the target file to the metadata of the target file.
[0172] In this way, the target file can be accessed across devices as soon as it is created. Users do not have to issue an instruction to add a consecutive identifier to the current device, reducing the complexity of user operations and improving the user experience.
[0173] In a possible implementation, the user can also, as needed, delete at least one of the continuation identifier and the continuation record of the target file. This deletion operation can be performed by a device in the file system that has the deletion permission. For example, it can be performed by the device (the first device) where the file storing the target file is located, or it can be set to be performed by any device in the file system (such as the second device or the third device). In a possible implementation, the continuation identifier can be displayed on the interface of the terminal device (for example, displayed as an icon near the target file), can be seen and operated by the user (such as for deletion). When the continuation identifier of the target file is deleted, the continuation record of the target file can also be deleted accordingly.
[0174] Figure 4a and Figure 4b is the process of deleting the continuation identifier and / or the continuation record. In the absence of a continuation identifier, the file cannot be accessed continuously.
[0175] According to Figure 4a and Figure 4b , in step S201, the current device receives an instruction from the user to delete the continuation identifier and / or the continuation record of the target file.
[0176] In step S202, the current device detects whether the metadata of the target file stored includes the continuation identifier and / or the continuation record of the target file.
[0177] In step S203, when the metadata includes the continuation identifier and / or the continuation record of the target file, the current device deletes the continuation identifier and / or the continuation record of the target file in the metadata according to the instruction.
[0178] In step S204, the current device triggers the metadata databases of multiple devices in the file system to be synchronously updated.
[0179] In a possible implementation, the current device can be any device in the file system (for example, the first device), and the target file is stored on the first device. After the continuation identifier of the target file is deleted, the target file will not be allowed to be accessed across devices in the file system.
[0180] According to different requirements of users, users can issue different deletion instructions, and the current device responds differently to different instructions. For example, when a user does not want the target file to be continuously accessed 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. When the metadata of the first device includes a continuation identifier, or includes a continuation identifier and a continuation record, the continuation identifier and continuation record in the metadata of the target file stored by the current device are deleted. After the deletion operation is completed, the first device can trigger the devices in the network to perform synchronous updates.
[0181] After synchronous update, in the metadata of the target file stored by each device in the file system, the corresponding continuation identifier and continuation record are both deleted. The target file will not be continuously accessible among multiple devices in the file system.
[0182] In a possible implementation, the first device can also be provided with a control for opening and closing the file continuation function. By closing the control, the user can delete the continuation identifier and continuation record of the target file in the metadata of the first device. This application does not limit this.
[0183] In a possible implementation, the user may want the target file to still be continuously accessible in the file system, but the new continuous access does not need to be based on the previous continuous access. Based on this, it is also possible to implement deleting the continuation record of the target file while retaining the continuation identifier of the target file.
[0184] For example, the user can issue an instruction to delete the continuation record of the target file. When the current device receives this type of instruction, the current device can detect whether the metadata of the stored target file includes a continuation record. When the metadata of the first device includes a continuation record, the continuation record in the metadata of the stored target file is deleted, while the continuation identifier of the target file is retained. After the deletion operation is completed, the first device can trigger the devices in the network to perform synchronous updates.
[0185] After synchronous update, in the metadata of the target file stored by each device in the file system, the corresponding continuation records are all deleted, and the corresponding continuation identifiers are all retained. In this case, the target file can still be continuously accessed among multiple devices in the file system. However, since there is no continuation record, when the target file is opened and displayed on any device (for example, the second device) in the file system next time, it will be displayed from the initial position of the target file, and the second device will complete the re-creation of the continuation record of the target file.
[0186] In a possible implementation, a control for deleting connection records may be set on each device in the network. The user can trigger the control for deleting connection records through the first device to send an instruction to the first device to delete the connection record of the target file. This application does not limit this.
[0187] In this way, according to the different requirements of the user for file connection, the corresponding solution can be selected, which is convenient for the user to use when applied to the file system.
[0188] In a possible implementation, the user may not want other users except themselves to be able to continuously display the target file when operating the device of the file system. Based on this, a user permission verification part can be added to step S21 described above. The current device determines the last access device, the device where the file is located, and the connection record of the target file according to the metadata of the target file stored, including:
[0189] The current device sends an instruction to the metadata database of the current device. The instruction includes the user identification of the user and the file identification of the target file. The instruction is used to obtain the metadata of the target file stored in the metadata database of the current device. Among them, the metadata of the target file may include the connection record of the target file, the last access device information, and the file location device information.
[0190] The metadata database of the current device determines whether the user has the permission to read and write the target file according to the user identification and the file identification.
[0191] In the case of 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 be synchronously updated.
[0192] 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 connection record of each device in the file system for this target file.
[0193] The current device determines the last access device, the device where the file is located, and the connection record of the target file according to the updated metadata database.
[0194] In a possible implementation, the step of determining whether the user has the permission to read and write the target file can also be completed through other authentication methods. For example, after receiving the instruction sent by the device, the meta-database of the first device, the second device or the third device can return an instruction to trigger the first device, the second device or the third device to perform user-level permission verification on the display interface of the device, such as password verification, fingerprint verification, face recognition verification, etc. After the verification passes, the first device, the second device or the third device sends an instruction containing the information that the verification passes to their respective meta-databases. After receiving the instruction containing the information that the verification passes, the meta-database triggers the meta-databases of multiple devices in the file system to be synchronously updated. The current device can determine the last access device, the device where the file is located and the subsequent record of the target file according to the updated meta-database.
[0195] In this way, when other users do not have the permission to read and write the target file, the target file will not be displayed on the devices used by other users, which can improve data security.
[0196] According to the determined device where the file is located and the last access device, in steps S22 and S23, the current device can obtain the file data of the target file and complete the subsequent display on the display interface of the current device. According to the same or different application scenarios of the current device, the last access device 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 subsequent display completion may include various specific implementation manners. The following combines Figure 5a , Figure 5b , Figure 6 , Figure 7a , Figure 7b , Figure 8a , Figure 8b , Figure 9a , Figure 9b , Figure 10a , Figure 10b , Figure 11a , Figure 11b to describe the processes of the file continuation method according to the embodiments of the present application in several application scenarios.
[0197] In a possible implementation, when the current device, the last access device and the device where the file is located are the same,
[0198] In step S22, 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:
[0199] The current device loads the write cache file and the read cache file in the memory space;
[0200] 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:
[0201] 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;
[0202] 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.
[0203] 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, opens the same file (target file) twice successively, and when opening the target file for the second time, directly displays the operation position (such as the reading position or editing position) of the target file when it was opened for the first time. At this time, the current device, the last accessed device, and the device where the file is located are the same and are all the first device. Figure 5a and Figure 5b shows the working process of the first device when the user opens the target file for the second time in this application scenario.
[0204] Among them, when the first device accesses the target file, all or part of the content of the target file read can be retained in the read cache file, and the operation type (such as insertion, deletion, replacement, etc.) of the operation on the target file, as well as the position and content of the operation (such as the position and content of the insertion, the position and content of the deletion, the position of the replacement, the content before and after the replacement, etc.) can be retained in the write cache file. If the first device saves the target file after operating on it, the content in the write cache file is used to update the content of the target file (such as updating the read cache file), and a new target file is formed for saving (such as saving in the memory or hard disk), and at the same time, the write cache file is cleared. If the operation is not saved after the operation, the operation type, operation position, and operation content still remain in the write cache file.
[0205] Table 2 shows an example of the data structure of the read cache file according to an embodiment of the present application.
[0206] Table 2
[0207] File identifier Offset Size Cached content Cached version number (can be modification time) …
[0208] As shown in Table 2, the read cache file includes:
[0209] A file identifier, used to distinguish different files, and the specified file can be found according to the file identifier.
[0210] Offset, used to determine the operation position where the user last read the file. If the file corresponding to the file identifier is a relatively large file (for example, a video file), during the process of reading the file and obtaining the read cache file, a part of the video file can be obtained first, for example, a part determined according to the offset.
[0211] Size, used to determine the data size of the read cache file.
[0212] Cache content, used to record the file content data read.
[0213] Cache version number, which can 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 represents the file modification time of the target file.
[0214] Table 3 shows an example of the data structure of the write cache file according to an embodiment of the present application.
[0215] Table 3
[0216] File identifier Offset Size Cached content …
[0217] As shown in Table 3, the write cache file includes:
[0218] File identifier, used to distinguish different files. According to the file identifier, the specified file can be found.
[0219] Offset, used to determine the operation position where the user last edited the file.
[0220] Size, used to determine the data size of the write cache file.
[0221] Cache content, used to record the operation position, operation type, and operation content of the file editing operation.
[0222] According to Figure 5a and Figure 5b , in step S301, the first device receives an instruction from the user to open the target file.
[0223] In step S302, the first device sends an instruction to the metadata database of the first device. The instruction includes the user identifier of the user and the file identifier of the target file. The instruction is used to obtain the metadata of the target file stored in the metadata database of the first device. The metadata may include the continuation record of the target file, the last access device information (at this time, it is the first device), and the file location device information (at this time, it is the first device).
[0224] In step S303, the metadata database of the first device determines whether the user has the permission to read and write the target file according to the user identification and file identification in the instruction.
[0225] In step S304, when it is confirmed that the user has the permission to read and write the target file, the first device triggers the metadata databases of multiple devices in the file system 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 database 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.
[0226] In step S305, the first device confirms the last access device and the device where the file is located (both are the first device in this application scenario) of the target file according to the last access device information and the file location device information of the target file in the updated metadata database.
[0227] In step S306, the first device loads the write cache file and the read cache file in the memory space.
[0228] For example, when the current device, the last access device, and the device where the file is located are all the first device, the write cache file and the read cache file in the memory space of the first device are loaded. If the write cache file is empty when the target file was last accessed on the first device, and the target file was not saved when it was last accessed on the first device (for example, the target file was first edited in WORD and not saved, and then the target file was opened in WPS for the second time), then the write cache file is not empty at this time, and the write cache file records the operation type, operation location, and content performed on the target file when the target file was last accessed. 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 into the memory space. In a possible implementation, there may be no read cache file in the memory space. In this case, the file content on the hard disk can be read first and stored in the memory space in the form of a read cache file.
[0229] 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 database 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 at the last save was an insert operation, then the offset position is the insert position in the file (for example, represented by the number of bytes of the file where the insertion cursor is located).
[0230] 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.
[0231] For example, in the read cache file, the offset position can be located, and then the content near the offset position in the read cache file can be applied for display. For example, in the displayed page, the text content near the position of the insertion cursor including the latest insertion operation can be included.
[0232] 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. Among them, the cached content of the write cache file includes the operation type and operation content of the edit operation at the offset position of the target file.
[0233] In step S310, the first device displays the content to be displayed according to the offset position, the read cache file, and the write cache file in the memory space.
[0234] In a possible implementation manner, according to 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 of the operation performed by the write cache file at the operation position can be applied, so as to obtain the file content after the previous operation. Then, according to the offset in the write cache, the operation position of the user's previous edit operation on the file, such as the position of the cursor, can be determined. After combining the content of the file with the position of the cursor, the content to be displayed is obtained, and the content to be displayed is the same as the display content of the display interface after the user's previous operation of opening the file.
[0235] Figure 6 The flowchart showing an example of step S310 according to an embodiment of the present application is shown. According to Figure 6 , in step S310, the cached content of the read cache file is related to the cached content of the write cache file, and the offset position in the write cache file can be located in the cached content of the read cache file. The steps of combining and displaying the read cache file and the write cache file are as follows.
[0236] In step S401, according to the cached content in the write cache file, determine the operation position of the operation on the target file when the target file was accessed last time, and the operation type and operation content corresponding to each operation position.
[0237] In step S402, find the corresponding operation position in the read cache file, and obtain the content to be displayed according to the cached content of the read cache file and the operation type and operation content corresponding to each operation position.
[0238] For example, by writing to a cache file to determine inserting a number at a first position, the read cache file can be cache content including the file content before and after the first position. Combining the read cache file and the write cache file can be that after inserting a number at the first position of the read cache file, the file content data after the first position of the read cache file is sequentially postponed by the size occupied by the number, so as to determine the form of the content to be displayed.
[0239] In step S403, the content to be displayed is displayed on the display interface of the application software. Taking the above-mentioned number insertion as an example, in the displayed content, the cursor can be located at the position where the number is inserted.
[0240] In a possible implementation manner, when the write cache is not empty, the first device can also issue an instruction to force the application of 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 it is opened for the second time, it determines the offset position according to the received write cache file, and reads the file content of the target file that has been changed as the read cache file and stores it in the memory. The first device can apply the read cache file for display, and position the offset position in the form of a cursor and the like on the display interface.
[0241] In this way, files can achieve cross-application continuity on the device storing the files, improving the applicable scope of the file continuity method.
[0242] In a possible implementation manner, when the current device is the same as the previous access device and different from the device where the file is located,
[0243] In step S22, the current device obtains the file data of the target file from at least one of the previous access device and the device where the file is located, including:
[0244] The current device loads the write cache file and the read cache file in the cache space.
[0245] In step S23, the current device displays the content to be displayed according to at least one of the continuity record of the target file and the file data of the target file, including:
[0246] 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 continuity record, and displays the content to be displayed according to the offset position and the read cache file in the cache space;
[0247] 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, the read cache file and the write cache file in the cache space.
[0248] In an exemplary application scenario, when the target file is stored on the first device and the user uses different application software on the second device to open the same file (target file) twice successively, and when the target file is opened for the second time, the operation position (such as the reading position or editing position) of the target file during the first opening is directly displayed. At this time, the device where the file is located can be the first device, and the current device and the last accessed device can be the same and both are the second device. The following uses Figure 7a and Figure 7b as examples to describe the working process of the second device when the user opens the target file for the second time in this application scenario.
[0249] Among them, when the second device accesses the target file stored on the first device, it can save all or part of the file content of the target file read in the read cache file, and save the operation type, operation position, and operation content of the operation on the target file in the write cache file.
[0250] According to Figure 7a and Figure 7b , in step S501, the second device receives an instruction from the user to open the target file.
[0251] In step S502, the second device issues an instruction to the metadata database of the second device. The instruction includes the user identifier of the user and the file identifier of the target file. The instruction is used to obtain the metadata of the target file stored in the metadata database of the second device. The metadata at least includes the continuation record of the target file, the last accessed device information (which is the second device at this time), and the file location device information (which is the first device at this time).
[0252] In step S503, the metadata database of the second device determines whether the user has the permission to read and write the target file according to the user identifier and file identifier in the instruction.
[0253] In step S504, when it is confirmed that the user has the read and write permissions, the second device triggers the metadata databases of multiple devices in the file system 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 database can ensure that the metadata on the second device records the latest device access records and continuation records of each device in the file system for the target file.
[0254] In step S505, the second device confirms the last accessed device and the file location device of the target file according to the last accessed device information and the file location device information of the target file in the updated metadata database. (In this application scenario, the last accessed device is the second device and the file location device is the first device).
[0255] In step S506, the second device loads the write cache file and the read cache file in the cache space.
[0256] For example, when the current device and the last accessed device are the second device, and the file location device is the first device, the second device loads the write cache file and the read cache file in the cache space. If the write cache file is empty when the target file was last accessed on the second device, and if the target file was not saved when it was last accessed on the second device (for example, when the target file was first edited in WORD and not saved, and then opened in WPS for the second time), then the write cache file is not empty at this time. The write cache file records the operation type, operation location, and operation content for the target file when the target file was last accessed. When the current device and the last accessed 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 file location device (the first device) to obtain the read cache file in the cache space of the first device. The read cache file in the cache space of the first device can be the file content read from the hard disk by the first device and 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.
[0257] 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 meta-database 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 during the last save was an insert operation, then the offset position is the insert position in the file (for example, represented by the number of bytes of the file where the insertion cursor is located).
[0258] In step S508, the content to be displayed is displayed according to the offset position and the read cache file in the cache space.
[0259] For example, in the read cache file, the offset position can be located, and then the content near the offset position in the read cache file can be applied for display. For example, in the displayed page, it may include the text content near the position of the insertion cursor containing the latest insert operation.
[0260] 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.
[0261] In step S510, the content to be displayed is displayed according to the offset position, the read cache file, and the write cache file in the cache space.
[0262] An example process of step S510 in the embodiments of this application can be referred to Figure 6 for the process.
[0263] In this way, the file can achieve cross-application continuation on any device in the file system other than the device storing the file, improving the applicable range of the file continuation method.
[0264] In a possible implementation manner, when the current device is the same as the device where the file is located and different from the last accessed device,
[0265] 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:
[0266] The current device sends a write cache file acquisition request to the last accessed device;
[0267] The current device receives the returned write cache file;
[0268] The current device loads the read cache file in the memory space;
[0269] 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:
[0270] 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;
[0271] 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, the read cache file in the memory space, and the write cache file.
[0272] In an exemplary application scenario, the target file is stored on a first device. The user first uses an 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. Among them, the application software used on the second device and the first device can be different. 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 during the first opening is directly displayed. At this time, the current device and the device where the file is located can be the same and is the first device, and the last accessed device can be the second device. The following takes Figure 8a and Figure 8b as an example to describe the working process of the first device when the user opens the target file for the second time in this application scenario.
[0273] According to Figure 8a and Figure 8b In step S601, the first device receives an instruction from the user to open the target file.
[0274] In step S602, the first device issues an instruction to the metadata database of the first device. The instruction includes the user identification of the user and the file identification of the target file, and is used to obtain the metadata of the target file stored in the metadata database of the first device. The metadata at least includes the continuity record of the target file, the information of the last accessed device (which is the second device at this time), and the information of the device where the file is located (which is the first device at this time).
[0275] In step S603, the metadata database of the first device determines whether the user has the permission to read and write the target file according to the user identification and file identification in the instruction.
[0276] In step S604, when it is confirmed that the user has the read and write permission, the metadata databases of multiple devices in 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 database can ensure that the metadata recorded on the first device is the latest device access record and continuity record of the target file in the file system for each device.
[0277] In step S605, the first device confirms the last accessed device and the device where the file is located of the target file according to the information of the last accessed device and the device where the file is located of the target file in the updated metadata database. (In this application scenario, the last accessed device is the second device and the device where the file is located is the first device).
[0278] In step S606, the first device sends a write cache file acquisition request to the last accessed device (the second device).
[0279] In step S607, the first device receives the returned write cache file.
[0280] In step S608, the first device loads the read cache file in the memory space.
[0281] For example, when the current device where the file is located is the first device and the last accessed device is the second device, the write cache file of the target file can be obtained by transmitting data information between the devices. If the write cache file is empty when the target file was last accessed on the second device, and the target file was not saved when it was last accessed on the second device (for example, when the target file was first edited in WORD on the second device and not saved, and then the target file was opened in WPS on the first device the second time), then the write cache file is not empty at this time. The write cache file records the operation type, operation location, and operation content performed on the target file when the target file was last accessed. 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 into the memory space. In a possible implementation, there may be no read cache file in the memory space. In this case, the file content on the hard disk can be read first and stored in the memory space in the form of a read cache file.
[0282] 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 consecutive record. The consecutive record can be obtained from the meta database of the first device. The offset position is associated with the operation position when the target file was last saved. For example, if the operation at the last save was an insert operation, then the offset position is the insert position in the file (for example, represented by the number of bytes of the file where the insertion cursor is located).
[0283] In step S610, the content to be displayed is displayed according to the offset position and the read cache file in the memory space.
[0284] For example, in the read cache file, the offset position can be located, and then the content near the offset position in the read cache file can be applied for display. For example, in the displayed page, the text content near the position of the insertion cursor including the latest insert operation can be included.
[0285] In step S611, when the write cache file is not empty, the first device determines the offset position of the content to be displayed relative to the file according to the write cache file;
[0286] In step S612, the content to be displayed is displayed according to the offset position, the read cache file in the memory space, and the write cache file.
[0287] An example process of step S612 in the embodiments of the present application can refer to Figure 6 the process.
[0288] In a possible implementation, when displaying the content to be displayed of the target file, the last accessed device is updated to the current device. For example, in this application scenario, in step S21, if the last accessed device of the target file determined according to the metadata database of the second device is the second device, then in step S23, after the content to be displayed is completed on the first device, in the metadata of the target file stored on the second device, the information of the last accessed device of the target file can be updated to the first device. In this way, the next time a device (e.g., the third device) accesses the target file continuously, the last accessed 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.
[0289] In this way, files can be continuously accessed across devices and applications on the device where the files are stored, improving the applicable range of the file continuous access method.
[0290] In a possible implementation, when the current device, the last accessed device, and the device where the file is located are all different,
[0291] 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:
[0292] The current device sends a write cache file acquisition request to the last accessed device;
[0293] The current device receives the returned write cache file;
[0294] The current device sends a read cache file acquisition request to the device with a faster transmission speed among the last accessed device and the device where the file is located;
[0295] The current device receives the returned read cache file.
[0296] In step S23, the current device displays the content to be displayed according to at least one of the continuous access record of the target file and the file data of the target file, including:
[0297] 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 continuous access record, and displays the content to be displayed according to the offset position and the received read cache file;
[0298] 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, the received read cache file, and the write cache file.
[0299] In an exemplary application scenario, the target file is stored on a first device. The user uses different application software on a second device and a third device, opens the same file (the target file) twice successively, and when the target file is opened the second time, the operation position (such as the reading position or the editing position) of the target file during the first opening is directly displayed. At this time, 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. Below, taking Figure 9a and Figure 9b as an example, an exemplary working process of the third device when the user opens the target file the second time in this application scenario will be described.
[0300] According to Figure 9a and Figure 9b , in step S701, the third device receives an instruction from the user to open the target file.
[0301] In step S702, the third device sends an instruction to the metadata database of the third device. The instruction includes the user identification of the user and the file identification of the target file. The instruction is used to obtain the metadata of the target file stored in the metadata database of the third device. The metadata at least includes the continuation record of the target file, the information of the last accessed device (which is the second device at this time), and the information of the device where the file is located (which is the first device at this time).
[0302] In step S703, the metadata database of the third device determines whether the user has the permission to read and write the target file according to the user identification and the file identification in the instruction.
[0303] In step S704, when it is confirmed that the user has the permission to read and write the target file, the third device triggers a synchronous update of the metadata databases of multiple devices in 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 third device records the latest device access records and continuation records of each device in the file system for the target file.
[0304] In step S705, the third device confirms the last accessed device and the device where the file is located of the target file according to the information of the last accessed device and the information of the device where the file is located of the target file in the updated metadata database (in this application scenario, the last accessed device is the second device and the device where the file is located is the first device).
[0305] In step S706, the third device sends a request to obtain the write cache file to the last accessed device (the second device). In Figure 9a and Figure 9b , the last accessed device (the second device) and the device where the file is located (the first device) are different.
[0306] In step S707, the returned write cache file is received.
[0307] 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 write cache file was saved when the target file was last accessed on the second device, the write cache file is empty. If the write cache file was not saved when the target file was last accessed on the second device (for example, the second device edited the target file using WORD for the first time and did not save it, and then the third device opened the target file using WPS for the second time), then the write cache file is not empty at this time, and the write cache file records the operation type, operation location, and operation content for the target file when the target file was last accessed.
[0308] 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, then step S717 is executed (see Figure 9b ), and the third device determines the offset position of the content to be displayed relative to the file according to the write cache file.
[0309] 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.
[0310] In step S710, the third device receives the data returned by the device where the file is located; wherein, the third device records the second time information when the returned data is received; the third device can confirm the data transmission time from the third device to the device where the file is located (the first device) according to the first time information and the second time information.
[0311] In step S711, the third device issues an instruction to instruct the last accessed device (the second device) to return data of a preset size; wherein, the third device records the third time information when the instruction is issued.
[0312] In step S712, the third device receives the data returned by the last accessed device; wherein, the third device records the fourth time information when the returned data is received; the third device can confirm the data transmission time from the third device to the last accessed device (the second device) according to the third time information and the fourth time information.
[0313] 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 last accessed device (the second device) according to the time from issuing the instruction to receiving the returned data to the file - located device (the first device) and the last accessed device (the second device); in Figure 9aIn the exemplary workflow, the device with a faster transmission speed is the device accessed last (the second device).
[0314] In step S714, the third device sends a request to obtain the read cache file to the device with a faster transmission speed among the device accessed last and the device where the file is located (the device accessed last, i.e., the second device).
[0315] 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 device accessed last (the second device) (for example, the second device clears the cache space), and the device accessed last (the second device) is not the device where the file is located (the first device). In this case, the device accessed last (the second device) can return an empty read cache file. When the read cache file received by the third device is empty, the third device can send a request to obtain the read cache file to the device where the file is located (the first device). Among them, the read cache file is stored in the memory space of the device where the file is located (the first device), and the read cache file is the file data of the target file read from the hard disk into 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 from 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 the third device receives the read cache file and the read cache file is not empty, it is stored in the cache space of the third device, and then the received read cache file is applied for display.
[0316] In step S716, the content to be displayed is displayed according to the offset position and the received read cache file.
[0317] 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.
[0318] In step S718 (see Figure 9b ), the content to be displayed is displayed according to the offset position, the received read cache file, and the write cache file.
[0319] An example process of step S718 in the embodiments of the present application can refer to Figure 6 the process.
[0320] In a possible implementation, the read cache file acquisition request sent by the third device in this application scenario to a device with a faster transmission speed (the last accessed device) may include, for example, the position information of the content data of the read cache file to be acquired in the target file (the target file), where the position information can be determined according to the write cache file. For example, the write cache file may include multiple operation positions, and it can be determined that the start position of the read cache file is at least earlier than the first operation position among the multiple operation positions, and it can be determined that the end position of the read cache file is at least later than the last operation position among the multiple operation positions.
[0321] In a possible implementation, the data volume of the target file may be small. For example, the target file may be a document file. In this case, all the content of the target file can be transmitted between multiple devices in the form of a read cache file. In a possible implementation, the data volume of the target file may be large. For example, the target file is a video file. In this case, the data volume of the read cache file transmitted at one time can be preset.
[0322] For example, a read cache file that satisfies the start position being at least earlier than the first operation position among the multiple operation positions and the end position being 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, continue playing from the playback position on the last accessed device; meanwhile, the current device sends a read cache file acquisition request to the last accessed device or the device where the file is located again. Among them, the read cache request contains the position information of the second read cache file to be acquired. In this application scenario, the start position of the second read cache file can be the same as the end position of the first read cache file, and the end position of the second read cache file can be, for example, the end position such that the second read cache file is a preset data volume.
[0323] For example, the preset size of the read cache file transmitted at one time can be 40M, the target file is 200M in total, and the end position of the first read cache file is at the 10M position of the target file. The start position of the second read cache file can be, for example, at the 10M position of the target file, and the end position can be, for example, at the 50M position of the target file.
[0324] In a possible implementation, Figure 9a and Figure 9bThe last accessed device and the device where the file is located may 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 steps of separately sending instructions to the last accessed device and the device where the file is located to probe the transmission speed (steps S709 - S715) can be omitted; that is, when 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 according to the connection record, it directly sends a read cache file acquisition request to the first device; or, when 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 according to 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 combined. For example, the third device sends a request to the first device, requesting the first device to 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 simultaneously according to the request.
[0325] In this way, the file can be on any device of the file system, realizing cross - device and cross - application connection, and improving the applicable range of the file connection method.
[0326] In a possible implementation, in an exemplary application scenario, the target file is stored on the first device. After the second device completes the connection 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, the third device) opens the target file at this time, the third device can determine that the second device was the last one to operate on the target file according to the last accessed 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 a save instruction from the user 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 connection record of the target file in the metadata database of the second device.
[0327] Next, take Figure 10a and Figure 10b as an example to describe the workflow of the current device (the second device) for editing the target file after completing the connection display of the target file and receiving the save instruction in this application scenario.
[0328] According to Figure 10a and Figure 10b, when the current device is different from the device where the target file is located, in step S901, the current device receives an editing instruction from the user for the target file.
[0329] In step S902, the current device performs an editing operation on the content of the displayed target file on the display interface of the current device according to the instruction; wherein, the types of editing operations may include deletion, modification, replacement, etc. of the file content by the user.
[0330] In step S903, the current device generates a write cache file for the target file according to the operation position, operation type, and operation content. Since the second device (the current device) is not the device where the target file is located (the first device), the write cache file is stored in the cache space of the second device; in a possible implementation, if the editing object is continuously displayed on the second device and stored in the file of the second device, the write cache file is stored in the memory space of the second device.
[0331] Further, when the user saves the target file, the following steps may further be included:
[0332] In step S904, the current device receives a save instruction from the user for the target file.
[0333] 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.
[0334] When sending the write cache file, the write cache file on the second device can be cleared; or, a copy of the write cache file can also be sent, and the write cache file is 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.
[0335] In step S906, when there is no consecutive record of the target file in the meta-database of the current device, a consecutive record of the target file is created in the meta-database of the current device according to the operation position in the target file when receiving the save instruction from the user for the target file; or, in step S907, when there is a consecutive record of the target file in the meta-database of the current device, the consecutive record in the meta-database of the second device is updated according to the operation position in the target file when receiving the save instruction from the user for the target file. In this case, the created consecutive record or the updated consecutive record indicates the offset position determined according to the operation position of the latest operation.
[0336] In this way, the editing of the file can be transmitted between devices, so that the latest edited content can be displayed when continuously displayed.
[0337] In a possible implementation, in the above exemplary application scenario, the target file is continuously displayed on a remote device (such as a second device) other than the device (the first device) where the target file is located. After the user edits the target file on the second device and the second device receives the save operation of the user for the target file, the second device sends the write cache file to the first device. After receiving the write cache file, the first device can generate a new target file based on the write cache file and the target file stored on the first device. Figure 11a And Figure 11b FIG. shows an exemplary workflow of the first device generating a new target file according to an embodiment of the present application.
[0338] According to Figure 11a And Figure 11b , in a possible implementation, the metadata of the target file further includes the file modification time of the target file. When the current device is the same as the device where the target file is located,
[0339] In step S100, the current device receives the write cache file.
[0340] In step S101, the current device generates a new target file based on the write cache file and the target file stored in the memory.
[0341] In step S102, the current device updates the file modification time information in the metadata of the target file.
[0342] 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 has undergone a substantial change, and the modification time of the file can be updated. The file modification time information can be associated with the version information of the metadata database. According to the file modification time information, the latest metadata database among the metadata databases of multiple devices can be determined. Based on this, the synchronous update of the target files stored on the devices can be realized, and the synchronous update of the metadata databases of multiple devices can be realized.
[0343] Figure 12 FIG. shows an exemplary application scenario of user-device interaction according to an embodiment of the present application.
[0344] Such as Figure 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", gives 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 a continuation identifier for the file "Fruit" so that the file "Fruit" can be continued.
[0345] The user can click on the file "Fruit" seen on APP1 to give 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.
[0346] The user can edit the displayed file content on the display interface. For example, after "Wumei, etc.", insert the following text:
[0347] Cool fruits:
[0348] Watermelon, muskmelon, pear, mandarin orange, orange, banana, mulberry, persimmon, water chestnut, etc.
[0349] At this time, the position of the user's last operation, 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 give 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.
[0350] Figure 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:
[0351] A receiving module 1301, configured to receive an instruction from the user to open a target file;
[0352] A determination module 1302, configured to, in response to the indication of opening the target file, determine the last access device, the file location device of the target file, and a continuation record according to the metadata of the stored target file, where the continuation record indicates the operation position of the target file when it was saved last time;
[0353] An acquisition module 1303, configured to acquire file data of the target file from at least one of the last access device and the file location device, where the file data includes a read cache file and a write cache file;
[0354] A display module 1304, configured to display 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.
[0355] In a possible implementation manner, when the current device, the last access device, and the file location device are the same,
[0356] The acquisition module includes a first acquisition sub-module, configured to load the write cache file and the read cache file in the memory space;
[0357] The display module includes:
[0358] A first display sub-module, configured to, when the write cache file is empty, determine the offset position of the content to be displayed relative to the target file according to the continuation record, and display the content to be displayed according to the offset position and the read cache file in the memory space;
[0359] A second display sub-module, configured to, when the write cache file is not empty, determine the offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the read cache file, and the write cache file in the memory space.
[0360] In a possible implementation manner, when the current device and the last access device are the same, and are different from the file location device,
[0361] The acquisition module includes a second acquisition sub-module, configured to load the write cache file and the read cache file in the cache space;
[0362] The display module includes:
[0363] A third display sub-module, configured to, when the write cache file is empty, determine the offset position of the content to be displayed relative to the target file according to the continuation record, and display the content to be displayed according to the offset position and the read cache file in the cache space;
[0364] The fourth display sub-module is configured to, when the write cache file is not empty, determine the offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the read cache file in the cache space, and the write cache file.
[0365] In a possible implementation, when the current device is the same as the device where the file is located and different from the last accessed device,
[0366] The obtaining module includes:
[0367] The third obtaining sub-module is configured to send a write cache file obtaining request to the last accessed device;
[0368] The fourth obtaining sub-module is configured to receive the returned write cache file;
[0369] The fifth obtaining sub-module is configured to load the read cache file in the memory space;
[0370] The display module includes:
[0371] The fifth display sub-module is configured to, when the write cache file is empty, determine the offset position of the content to be displayed relative to the target file according to the continuity record, and display the content to be displayed according to the offset position and the read cache file in the memory space;
[0372] The sixth display sub-module is configured to, when the write cache file is not empty, determine the offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the read cache file in the memory space, and the write cache file.
[0373] In a possible implementation, when the current device, the last accessed device, and the device where the file is located are all different,
[0374] The obtaining module includes:
[0375] The sixth obtaining sub-module is configured to send a write cache file obtaining request to the last accessed device;
[0376] The seventh obtaining sub-module is configured to receive the returned write cache file;
[0377] The eighth obtaining sub-module is configured to send a read cache file obtaining request to the device with a faster transmission speed among the last accessed device and the device where the file is located;
[0378] The ninth obtaining sub-module is configured to receive the returned read cache file;
[0379] The display module includes:
[0380] A seventh display sub-module, configured to, when the write cache file is empty, determine the offset position of the content to be displayed relative to the target file according to the continuity record, and display the content to be displayed according to the offset position and the received read cache file;
[0381] An eighth display sub-module, configured to, when the write cache file is not empty, determine the offset position of the content to be displayed relative to the target file according to the write cache file, and display the content to be displayed according to the offset position, the received read cache file, and the write cache file.
[0382] In a possible implementation, the determination module includes:
[0383] A first determination sub-module, configured to send an instruction to the meta-database of the current device, where the instruction includes 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 meta-database of the current device;
[0384] A second determination sub-module, configured to determine whether the user has the permission to read and write the target file according to the user identification and the file identification;
[0385] A third determination sub-module, configured to, when it is confirmed that the user has the permission to read and write the target file, trigger the meta-databases of multiple devices of the file system to be synchronously updated;
[0386] A fourth determination sub-module, configured to determine the last access device, the file location device, and the continuity record of the target file according to the updated meta-database.
[0387] In a possible implementation, when the current device is the same as the file location device of the target file, the apparatus further includes:
[0388] A first indication receiving module, configured to receive an indication from the user to add a continuity identifier, where the indication to add a continuity identifier indicates adding a continuity identifier to the target file, and the continuity identifier indicates that a continuity record of the target file is allowed to be created in the metadata of the target file;
[0389] A first detection module, configured to detect whether the metadata of the stored target file includes the continuity identifier of the target file;
[0390] An identifier adding module, configured to, when the metadata does not include the continuity identifier of the target file, add the continuity identifier of the target file to the metadata of the target file stored in the current device according to the indication to add a continuity identifier;
[0391] A first update module, configured to trigger synchronous update of the metadata databases of multiple devices of a file system.
[0392] In a possible implementation, when the current device is the same as the device where the file of the target file is located, the apparatus further includes:
[0393] A second indication receiving module, configured to receive an indication from a user to create a file, where the indication to create a file indicates to create the target file in the current device;
[0394] A file creation module, configured to create the target file in the current device according to the indication to create a file, and add a continuation identifier of the target file to the metadata of the target file, where the continuation identifier indicates that a continuation record of the target file is allowed to be created in the metadata of the target file;
[0395] A second update module, configured to trigger synchronous update of the metadata databases of multiple devices of a file system.
[0396] In a possible implementation, the apparatus further includes:
[0397] A third indication receiving module, configured to receive an indication from a user to delete a continuation identifier and / or a continuation record of a target file;
[0398] A second detection module, configured to detect whether the metadata of the target file stored in the current device includes the continuation identifier and / or the continuation record of the target file;
[0399] A deletion module, configured to, when the metadata includes the continuation identifier and / or the continuation record of the target file, delete the continuation identifier and / or the continuation record of the target file in the metadata according to the indication in the current device;
[0400] A third update module, configured to trigger synchronous update of the metadata databases of multiple devices of a file system.
[0401] In a possible implementation, when the current device is different from the device where the file of the target file is located, the apparatus further includes:
[0402] A fourth indication receiving module, configured to receive an editing indication from a user for the target file;
[0403] An editing module, configured to perform an editing operation on the content of the target file displayed on a display interface of the current device according to the indication;
[0404] A first generation module, configured to generate a write cache file of the target file according to an operation position, an operation type, and operation content.
[0405] In a possible implementation, when the current device is different from the device where the target file is located, the apparatus further includes:
[0406] A fifth indication receiving module, configured to receive a save indication of a user for a target file;
[0407] A sending module, configured to send the write cache file to the device where the target file is located according to the indication;
[0408] A record creation module, configured to create 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 save indication of the user for the target file, when there is no continuation record of the target file in the metadata database of the current device;
[0409] A fourth update module, configured to update the continuation record in the metadata database of the current device according to the operation position in the target file when receiving the save indication of the user for the target file, when there is a continuation record of the target file in the metadata database of the current device.
[0410] In a possible implementation, the metadata of the target file further includes the file modification time of the target file. When the current device is the same as the device where the target file is located, the apparatus further includes:
[0411] A file receiving module, configured to receive a write cache file;
[0412] A second generation module, configured to generate a new target file according to the write cache file and the target file stored in the memory;
[0413] A fifth update module, configured to update the file modification time information in the metadata of the target file.
[0414] In a possible implementation, the apparatus further includes:
[0415] A sixth update module, configured to update the last access device to the current device when displaying the content to be displayed of the target file.
[0416] Figure 14 FIG. shows an exemplary structural schematic diagram of a terminal device according to an embodiment of the present application. Refer to Figure 14 , the terminal device 200 may be used to execute Figures 2 - 12 The file continuation method in the embodiment. Refer to Figure 14 , the terminal device 200 includes:
[0417] The terminal device 200 includes components such as 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 can understand that Figure 14 the terminal structure shown in
[0418] does not limit the terminal, and it may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Among them:
[0419] The RF circuit 110 can be used for receiving and sending signals during information reception or call processes, and can complete the work of the acquisition module in this application. Specifically, 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, antennas, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a 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 the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.The memory 120 can be used to store software programs and each module 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. Among them, the program storage area may store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, a text display function, etc.); the data storage area may store data created according to the use of the terminal device 200 (such as audio data, video data, documents, etc.), and the above metadata, etc. In addition, the memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 120 may also include a memory controller to provide access to the memory 120 by the processor 180 and the receiving device 130.
[0420] The receiving device 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls, and 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 a touchpad, can collect touch operations of a user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch-sensitive surface 131), and drive corresponding connection devices according to a preset program. Optionally, the touch-sensitive surface 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user, 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 contact coordinates, and then sends it to the processor 180, and can receive commands sent by the processor 180 and execute them. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch-sensitive surface 131. In addition to the touch-sensitive surface 131, the receiving device 130 may also 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, function keys (such as volume control keys, power-on keys, etc.), a trackball, a mouse, a joystick, etc.
[0421] The display device 140 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the terminal device 200. These graphical user interfaces 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 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface 131 can 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 Figure 14 the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to realize the input and input functions, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize the input and output functions.
[0422] The terminal device 200 may further 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. Among them, the ambient light sensor can adjust the brightness of the display panel 141 according to the brightness of the ambient light. The proximity sensor can turn off the display panel 141 and / or the backlight when the terminal device 200 is moved to the ear. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; As for other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors that the terminal device 200 can also be configured with, they will not be elaborated here.
[0423] 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 electrical signal converted from the received audio data to the speaker 161, and the speaker 161 converts it into a sound signal for output; 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 then converted into audio data. After the audio data is output to the processor 180 for processing, it is sent to another terminal, for example, via 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 earphone jack to provide communication between the peripheral earphone and the terminal device 200.
[0424] WiFi belongs to short - range wireless transmission technology. The terminal device 200 can help users send and receive emails, browse the web, 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 transmission can be carried out between the multiple terminal devices through the WiFi module 170. Although Figure 14 the WiFi module 170 is shown, it can be understood that it does not belong to an essential component of the terminal device 200 and can be omitted entirely within the scope of not changing the essence of the invention as needed.
[0425] The processor 180 is the control center of the terminal device 200. It connects various parts of the entire terminal device using various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and by 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. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above - mentioned modem processor may not be integrated into the processor 180 either.
[0426] The terminal device 200 also includes a power source 190 (such as a battery) that powers each component. Optionally, the power source can be logically connected to the processor 180 through a power management system, thereby realizing functions such as management of charging, discharging, and power consumption management through the power management system. The power source 190 may also include any components such as one or more DC or AC power sources, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0427] Although not shown, the terminal device 200 may also include a camera, a Bluetooth module, etc., which will not be elaborated 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, where 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 those for executing Figures 2 - 12 the method of the embodiment of the present application.
[0428] An embodiment of the present application provides an electronic device, including: a processor and a memory for storing processor - executable instructions; wherein, the processor is configured to implement the above - mentioned method when executing the instructions.
[0429] Embodiments of the present application provide a non-volatile computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above-mentioned method is implemented.
[0430] Embodiments of the present application provide a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device executes the above-mentioned method.
[0431] For the exemplary description of the above embodiments, reference may be made to the description above for Figures 1 - 14 , which will not be repeated here.
[0432] A computer-readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium can 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 above. More specific examples (non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), electrically programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded devices, such as punch cards or raised structures in grooves storing instructions thereon, and any suitable combination of the above.
[0433] The computer-readable program instructions or code described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded to an external computer or external storage device through 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, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter 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 media in each computing / processing device.
[0434] The computer program instructions for performing the operations 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 the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through 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., by using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer - readable program instructions to customize 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.
[0435] Aspects of the present application are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer - readable program instructions.
[0436] 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 apparatus to produce a machine such that, when the instructions are executed by the processor of the computer or other programmable data - processing apparatus, a device is produced that implements the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer - readable program instructions can also be stored in a computer - readable storage medium, and these instructions cause a computer, a programmable data - processing apparatus, and / or other devices to work in a specific manner. Thus, the computer - readable medium storing the instructions includes a manufactured article that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0437] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to generate a computer-implemented process, such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / acts specified in one or more blocks of the flowchart and / or block diagram.
[0438] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functionality involved.
[0439] It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by hardware (e.g., circuitry or an ASIC (Application Specific Integrated Circuit)) that performs the corresponding functions or acts, or may be implemented by a combination of hardware and software, such as firmware.
[0440] Although the present application has been described in conjunction with the various embodiments, it will be understood by those skilled in the art that various changes in the disclosed embodiments may be understood and effected while practicing the claimed application. In the claims, the word "comprising" does not exclude other elements or steps, and the singular "a" or "an" does not exclude a plurality. A single processor or other unit may implement several functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not indicate that these measures cannot be combined to advantage.
[0441] The embodiments of the present application have been described above. The above description is exemplary and not exhaustive, and is also not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of the technology in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein.
Claims
1. A file connection method, characterized in that, The method is applied to a file system, which includes multiple devices. Metadata of a target file is stored in the metadata databases of the multiple devices respectively. The method includes: The current device receives an instruction from a user to open the target file; In response to the instruction to open the target file, the current device determines the file data and the continuation record of the target file according to the stored metadata of the target file. The file data includes a read cache file and a write cache file, and the continuation record indicates the operation position when the target file was last saved; 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.
2. The document connection method according to claim 1, wherein, The current device determines the file data and the continuation record of the target file according to the stored metadata of the target file, including: 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; 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.
3. The document succession method according to claim 2, characterized in that 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 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.
4. The document succession method according to claim 2, characterized in that, 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; 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, the read cache file in the cache space, and the write cache file.
5. The document succession method according to claim 2, characterized in that, 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; 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, the read cache file in the memory space, and the write cache file.
6. The document connection method according to claim 2, 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 read cache file acquisition request to the device with a faster transmission speed among the last accessed 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 continuation 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, the received read cache file, and the write cache file.
7. The document connection method according to claims 2-6, characterized in that, The current device determines the last accessed device, the device where the file is located, and the continuation record of the target file according to the stored metadata of the target file, including: The current device issues an instruction to the metadata database of the current device, and the instruction includes 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 database of the current device determines whether the user has the permission to read and write the target file according to the user identification and the file identification; When it is confirmed that the user has the permission to read and write the target file, the current device triggers the metadata databases of multiple devices in the file system to be synchronously updated; The current device determines the last access device, the device where the file is located, and the continuation record of the target file according to the updated metadata database.
8. The document connection method according to claims 2-7, characterized in that, When the current device is the same as the device where the target file is located, the method further includes: The current device receives an instruction from the user to add a continuation identifier, and the instruction to add a continuation identifier indicates adding a continuation identifier to the target file, and the continuation identifier indicates allowing the creation of a continuation record of the target file in the metadata of the target file; The current device detects whether the metadata of the stored target file includes the continuation identifier of the target file; 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 a continuation identifier; The current device triggers the metadata databases of multiple devices in the file system to be synchronously updated.
9. The document connection method according to claims 2-7, characterized in that, When the current device is the same as the device where the target file is located, the method further includes: The current device receives an instruction from the user to create a file, and the instruction to create a file indicates creating the target file 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 the continuation identifier of the target file to the metadata of the target file, and the continuation identifier indicates allowing the creation of a continuation record of the target file in the metadata of the target file; The current device triggers the metadata databases of multiple devices in the file system to be synchronously updated.
10. The document continuation method according to claims 1-9, characterized in that, The method further includes: The current device receives an instruction from the user to delete the continuation identifier and / or the continuation record of the target file; The current device detects whether the metadata of the stored target file includes the continuation identifier and / or the continuation record of the target file; When the metadata includes the continuation identifier and / or the continuation record of the target file, the current device deletes the continuation identifier 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 in the file system to be synchronously updated.
11. The document continuation method according to claims 1-10, characterized in that, When the current device is different from the device where the target file is located, the method further includes: The current device receives an edit instruction from the user for the target file; The current device performs an edit operation on the content of the displayed target file on the display interface of the current device according to the instruction; The current device generates a write cache file of the target file according to the operation position, operation type, and operation content.
12. The document continuation method according to claims 1-11, characterized in that, When the current device is different from the device where the target file is located, the method further includes: The current device receives a save instruction from the user for 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 consecutive record of the target file in the metadata database of the current device, a consecutive 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 receiving the save instruction from the user; When there is a consecutive record of the target file in the metadata database of the current device, the consecutive record in the metadata database of the current device is updated according to the operation position in the target file when receiving the save instruction from the user.
13. The document connection method according to claims 1-12, characterized in that, The metadata of the target file further includes the file modification time of the target file. When the current device is the same as the device where the target file is located, 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.
14. The document continuation method according to claims 2-13, characterized in that, The method further includes: When displaying the content to be displayed of the target file, the last access device is updated to the current device.
15. A file connection device, characterized in that, The file continuity device is applied to the file system, and the file continuity device includes: A receiving module, configured to receive an instruction from the user to open a target file; A determining module, configured to respond to the instruction to open the target file, and determine the last access device, the file location device, and the consecutive record of the target file according to the stored metadata of the target file, where the consecutive record indicates the operation position when the target file was saved last time; An obtaining module, configured to obtain the file data of the target file from at least one of the last access device and the file location device, where the file data includes a read cache file and a write cache file; A display module, configured to display the content to be displayed according to at least one of the consecutive record of the target file and the file data of the target file.
16. A terminal device, characterized in that, Including: A processor; A memory for storing instructions executable by the processor; Wherein, when the processor is configured to execute the instructions, the method according to any one of claims 1-14 is implemented.
17. A non - volatile computer - readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1-14 is implemented.