File processing method and device, electronic equipment and storage medium

Real-time data synchronization between documents and tables is achieved through the file subscription mechanism, which solves the problems of data management and real-time synchronization in the existing technology, and simplifies data consistency management between files.

CN119106011APending Publication Date: 2024-12-10ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411210515.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Existing documents and tables are difficult to communicate with each other, which makes it difficult to manage data and achieve real-time data synchronization.

Method used

Through the file subscription mechanism, the server monitors the content changes of the second file in real time and updates the relevant content in the first file to realize real-time data interoperability between files.

Benefits of technology

Real-time data synchronization between files is realized, data management is simplified, data replication and multiple file management are avoided, and data consistency between referenced files and referenced files is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106011A_ABST
    Figure CN119106011A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a file processing method and device, electronic equipment and a storage medium. The file processing method is executed by a server side and comprises the steps that a first request is obtained, and the first request is used for requesting a first file to subscribe to a second file; establishing subscription between the first file and the second file in response to the first request; under the condition of determining that the content of the second file is changed based on the subscription, acquiring a first file version of the second file subjected to the content change; and updating content related to the second file in the first file based on the first file version of the second file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to but is not limited to the field of data processing technology, and in particular to a file processing method and device, electronic device and storage medium. Background Art

[0002] At present, when people use documents, spreadsheets and other applications, they often encounter situations where they need to reference other documents, spreadsheets and other applications, such as cross-document or cross-form references. However, existing documents or forms are independent of each other, and it is difficult for one document or form to communicate with another, making it difficult to manage data. Summary of the invention

[0003] Embodiments of the present disclosure provide a method and device for processing a file, an electronic device, and a storage medium.

[0004] A first aspect of an embodiment of the present disclosure provides a method for processing a file, which is executed by a server and includes:

[0005] Obtaining a first request, wherein the first request is used to request the first file to subscribe to the second file;

[0006] In response to the first request, establishing a subscription between the first file and the second file;

[0007] When it is determined based on the subscription that the content of the second file is changed, obtaining a first file version of the second file in which the content is changed;

[0008] Based on the first file version of the second file, content related to the second file is updated in the first file.

[0009] In some embodiments, the first file version includes at least one of the following:

[0010] The content of the second file that has been changed;

[0011] The second file after the content has been modified;

[0012] Content in the second document that is relevant to the first document;

[0013] The changes in the second file that are related to the first file.

[0014] In some embodiments, determining that content of the second file has been changed based on the subscription includes:

[0015] Obtaining change information about the second file based on the subscription;

[0016] Based on the acquired change information, it is determined that the second file has been changed, wherein the change information is used to indicate that the second file has been changed.

[0017] In some embodiments, the method further comprises:

[0018] Acquire multiple pieces of change information, wherein one piece of change information is used to indicate a first event that a second file is changed;

[0019] Based on the plurality of change information, merging the plurality of first events to generate a second event;

[0020] Obtaining the version of the first file whose content has been changed in the second file, including:

[0021] Based on the second event, a first file version in which content of the second file is changed is obtained.

[0022] In some embodiments, based on the plurality of change information, merging a plurality of first events to generate a second event includes: in the case where a first event is running, merging other first events except the running first event to generate the second event;

[0023] Based on the second event, obtaining a first file version in which content of the second file is changed includes: after the first event is completed, obtaining the first file version based on the second event.

[0024] In some embodiments, before obtaining the first request, the method further includes:

[0025] Obtain a second request, where the second request is used to request the first file to reference content of the second file;

[0026] Based on the second request, a reference relationship between the first file and the second file is determined, wherein the reference relationship is used to indicate content in the first file that is related to the second file.

[0027] In some embodiments, before obtaining the first request, the method further includes:

[0028] Obtaining a third request, where the third request is used to access the first file;

[0029] In response to the third request, determining a status of the second file when it is determined that the first file references the second file;

[0030] When it is determined that the status of the second file is online, a first request is initiated to request the first file to subscribe to the second file.

[0031] In some embodiments, the method further comprises:

[0032] When it is determined that the state of the second file is an offline state, obtaining a stored second file version including the content of the second file, wherein the second file version is a version of the second file in an offline state;

[0033] Based on the second file version of the second file, content related to the second file is updated in the first file.

[0034] In some embodiments, updating content related to a second file in a first file includes:

[0035] The content of the second file is displayed in the first file, or the content processed based on the content of the second file is displayed.

[0036] In some embodiments, the method further comprises: determining whether to grant the first file permission for the second file;

[0037] Acquiring the first file version in which the content of the second file is changed includes: acquiring the first file version in which the content of the second file is changed when it is determined that the first file is granted permission for the second file.

[0038] In some embodiments, the permissions include one of the following:

[0039] A first sub-right, wherein the first sub-right is used to indicate that the first file has the right to subscribe to all contents of the second file;

[0040] The second sub-rights are used to indicate that the first file has the right to subscribe to a predetermined portion of the second file.

[0041] A second aspect of the disclosed embodiment provides a method for processing a file, which is executed by a client and includes:

[0042] Access the first file;

[0043] The first file is displayed, wherein the first file displays content related to the second file; when a subscription is established between the first file and the second file, the content related to the second file is content updated based on the first file version of the second file; the first file version is a file version of the second file with content changed, obtained when it is determined based on the subscription that the content of the second file has changed.

[0044] In some embodiments, the method further includes: sending a second request, wherein the second request is used to request the first file to reference content of the second file to determine content in the first file that is related to the second file.

[0045] In some embodiments, when the second file is in an offline state, the content related to the second file is content updated based on a second file version of the second file; the second file version is a version of the second file in an offline state.

[0046] In some embodiments, the method further includes: when the user accessing the first file is the first user, sending a fourth request initiated by the first user, the fourth request is used to grant the first file permission for the second file; the first user has permission to access the first file and the second file.

[0047] In some embodiments, the method further comprises:

[0048] In a case where the user accessing the first file is the second user, determining a granting status of the first file's permission for the second file, wherein the second user does not have permission to access the second file;

[0049] In the case where it is determined that the first file is granted permission for the second file, the first file is displayed, and the first file displays content related to the content that is modified based on the content of the second file.

[0050] A third aspect of the present disclosure provides a file processing device, the device comprising:

[0051] An acquisition module is configured to acquire a first request, wherein the first request is used to request the first file to subscribe to the second file;

[0052] A processing module, configured to establish a subscription between the first file and the second file in response to the first request;

[0053] an acquisition module configured to acquire a first file version in which the content of the second file has been changed, when it is determined based on the subscription that the content of the second file has been changed;

[0054] The processing module is configured to update the content related to the second file in the first file based on the first file version of the second file.

[0055] A fourth aspect of the present disclosure provides a file processing device, the device comprising:

[0056] an access module configured to access a first file;

[0057] The display module is configured to display a first file, wherein the first file displays content related to a second file, and when a subscription is established between the first file and the second file, the content related to the second file is content updated based on a first file version of the second file, and the first file version is a file version of the second file with content changes obtained when it is determined based on the subscription that the content of the second file has changed.

[0058] A fifth aspect of the present disclosure provides an electronic device, including:

[0059] processor;

[0060] a memory for storing processor-executable instructions;

[0061] The processor is configured to implement any file processing method of the embodiment of the present disclosure when running executable instructions.

[0062] A sixth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, wherein the readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements any file processing method of an embodiment of the present disclosure.

[0063] A seventh aspect of the embodiments of the present disclosure provides a computer program product, which includes a computer program or instructions. When the computer program product or instructions are executed by a processor, any file processing method of the embodiments of the present disclosure is implemented.

[0064] In the disclosed embodiment, after obtaining the first request for the first file to subscribe to the second file, the server can determine that the first file subscribes to the second file; and in the case where the content of the second file is changed, obtain the first file version of the second file with the changed content; and can update the content related to the second file in the first file based on the first file version of the second file. In this way, the changes of the second file can be subscribed by the first file, and in the case of changes in the content of the second file, the second content with the changed content can be viewed in real time based on the first file, thereby realizing the intercommunication of the content (i.e., data) in the two files and facilitating the management of data.

[0065] Furthermore, the user does not need to make unnecessary copies of a piece of data (such as the second file), nor does he need to combine multiple data into one file, thereby avoiding the situation where a single data is too complicated and allowing multiple first files that reference the second file to maintain data consistency with the second file, that is, when the second file is modified, the first file that references the second file is also modified.

[0066] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0068] Figure 1 The figure is a flowchart of a first file processing method according to an exemplary embodiment.

[0069] Figure 2 The figure is a flowchart of a method for processing a second file according to an exemplary embodiment.

[0070] Figure 3 is a schematic diagram of a third file processing method according to an exemplary embodiment.

[0071] Figure 4 It is a flowchart of a fourth file processing method according to an exemplary embodiment.

[0072] Figure 5 It is a flowchart of a fifth file processing method according to an exemplary embodiment.

[0073] Figure 6 It is a flowchart of a sixth file processing method according to an exemplary embodiment.

[0074] Figure 7 It is a flowchart of a seventh file processing method according to an exemplary embodiment.

[0075] Figure 8 It is a flowchart of an eighth file processing method according to an exemplary embodiment.

[0076] Fig. 9 It is a flowchart of a ninth file processing method shown according to a typical implementation of an embodiment.

[0077] Fig.10 is a schematic diagram of a tenth file processing method shown according to a typical implementation of an embodiment.

[0078] Fig.11 The figure is a schematic diagram of the structure of a device for processing a file according to an exemplary embodiment.

[0079] Fig.12 The figure is a schematic diagram of the structure of a device for processing a file according to an exemplary embodiment.

[0080] Fig.13 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0081] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.

[0082] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0083] like Figure 1 As shown, the present disclosure provides a method for processing a file, comprising the following steps:

[0084] Step 101: Obtain a first request, where the first request is used to request a first file to subscribe to a second file;

[0085] Step 102: In response to the first request, establishing a subscription between the first file and the second file;

[0086] Step 103: when it is determined based on the subscription that the content of the second file is changed, obtaining a first file version of the second file in which the content is changed;

[0087] Step 104: Based on the first file version of the second file, update the content related to the second file in the first file.

[0088] The file processing method provided in the embodiments of the present disclosure can be executed by various terminals or electronic devices; the terminal or electronic device is a terminal or electronic device used as a service end (or server). Optionally, the terminal or electronic device may include but is not limited to at least one of the following: a computer, a server, a tablet computer, a smart wearable device, a vehicle-mounted device, a smart home device, and a smart office device. Exemplarily, the file processing method provided in the embodiments of the present disclosure is executed by a service end (e.g., a server).

[0089] In some embodiments, the first file and the second file may be files of various types.

[0090] Exemplarily, the first file and / or the second file may be a table-type file. For example, both the first file and the second file may be a spreadsheet. A spreadsheet, also known as an electronic data table, is a file supported by a computer program that simulates a calculation table on paper. It displays a grid consisting of a series of rows and columns. Numerical values, calculation formulas, or texts may be stored in cells. For example, both the first file and the second file may be spreadsheets supported by EXCEL or WPS.

[0091] Exemplarily, the first file and / or the second file may be files including a table. For example, the first file and the second file may be files of a presentation type and / or a document type, and the first file and the second file may include a spreadsheet or the like.

[0092] Exemplarily, the first file and / or the second file may be a non-table type document. For example, the first file and the second file may be a presentation type and / or document type file, and the first file and the second file may contain text, graphics, audio and / or video files. Optionally, the first file and the second file may include links and / or areas with cell formats; links and / or areas with cell formats in one file may be used to reference content in another file.

[0093] In some embodiments, the first file and the second file may be online files or offline files. Exemplarily, both the first file and the second file may be online table files.

[0094] Here, online files are usually files stored on the server side, which can be accessed and operated through the network, and can also be set to allow multiple users to access and modify the file content at the same time. Offline files refer to files stored locally on the client side, which can be directly accessed without going through the network. When multiple users access the same offline file, they cannot view each other's changes to the file in real time.

[0095] Furthermore, the state of the online file may include an online state and an offline state. The online state means that there is a client accessing the online file through the network. The offline state means that there is no client accessing the online file through the network.

[0096] In some embodiments, an offline file may have an associated online file. When the offline file is opened using a client, the offline file may be switched to an online file associated with the offline file, so that the online file is in an online state. The online file may be accessed and operated through the network, and may be set to allow multiple users to access and modify the file content at the same time. Furthermore, after the online file is saved, the offline file associated with the online file may be synchronized based on the online file.

[0097] In the embodiment of the present disclosure, the subscription of a first file to a second file refers to: the first file subscribes to the update (modification) of the second file. Subscriptions between files may include: file-level subscriptions and content-level subscriptions, wherein file-level subscriptions refer to subscriptions based on the dimension of files. Among them, content-level subscriptions refer to subscriptions based on the dimension of part of the content in the file. In the case where the first file successfully subscribes to the second file, if the second file is modified, the content related to the modified content of the second file may be updated in the first file. In one embodiment, a connection between the first file and the second file may be established, and in the case where the second file is updated (modified), the first file may be notified of the update (modification) of the second file through the connection.

[0098] In some embodiments, the prerequisite for establishing the subscription between the first file and the second file in step 102 may be that the first file is related to the second file, and the first file and the second file are online.

[0099] In other embodiments, the prerequisite for establishing the subscription between the first file and the second file in step 102 may be: the first file is related to the second file, the first file and the second file are online, and the first file authorizes the second file.

[0100] In some other embodiments, the prerequisite for establishing a subscription between the first file and the second file in step 102 may be: the first file is related to the second file, the first file and the second file are online, and the user accessing the first file has access rights to the first file and the second file.

[0101] In the embodiment of the present disclosure, the first file and the second file are related, which means that the content of the first file is changed as the content of the second file is changed, and may include but is not limited to: there is a reference relationship between the first file and the second file. The first file authorizes the second file, which means that the first file is granted the right to subscribe to the second file.

[0102] In some embodiments, before the first file subscribes to the second file, it may include: establishing a correlation between the first file and the second file, such as the first file citing the second file. Here, the first file citing the second file may include: at least part of the content of the first file citing at least part of the content of the second file. For example, the entire content of the first file references all or part of the content of the second file, and another example is that part of the content of the first file references all or part of the content of the second file. Exemplarily, the first content of the first file references the second content of the second file; wherein the first content may be all or part of the content of the first file; and the second content may be all or part of the content of the second file.

[0103] Optionally, the first file and the second file may each include at least one cell. Exemplarily, one or more cells of one file may reference one or more cells of another file.

[0104] Optionally, the first file and the second file may each include at least one region. Exemplarily, one or more regions of one file may reference one or more regions of another file; the region may include region data.

[0105] Optionally, the first file may include at least one first content; the second file may include at least one second content. Here, one first content may be at least one cell of the first file or may be the content of an area of ​​the first file; one second content may be at least one cell of the second file or may be the content of an area of ​​the second file.

[0106] Optionally, the manner in which the first file references the second file includes at least one of the following manners:

[0107] Method 1: Acquire the second content of the second file referenced by the first file, and display the first content in the first file as the second content.

[0108] Exemplarily, the content of the second cell of the second file is obtained, and the content of the second cell is the second content; and the content of the first cell in the first file is displayed as the content of the second cell, and the content of the first cell is the first content. Specifically, if the formula "=$AAA$BBB" is written in the first cell of the first file, where "$AAA" represents the address of the second file and "$BBB" represents the address of the second cell, then the first cell of the first file can reference the second cell of the second file. The above reference method of the address of the second file, the address of the second cell, and the formula is only an example, and the specific representation method is not limited.

[0109] Method 2: Obtain the second content of the second file referenced by the first file, and perform preset processing on the second content; display the first content in the first file as the second content after preset processing, wherein the preset processing may include at least one of the following: format processing, content processing.

[0110] Exemplarily, the format processing may include: adjusting the format of the second content to a format that matches the first content, and adjusting the format of the second content to a preset format.

[0111] Among them, format processing may include text format processing, image format conversion, text format processing, etc. Exemplarily, text format processing may include font selection, font size selection, etc. of text; for example, the second content of the second file may be displayed in the first file, and the second content may be adjusted to a font and / or font size that matches the first content. Exemplarily, image format conversion may include converting an image into a format such as JPEG or GIF; for example, the first content in the first file is displayed as a second image in a predetermined JPEG format, and the second image is the second content of the second file and is displayed in a GIF format in the second file. Exemplarily, text format processing may include page margin adjustment, line spacing adjustment, special paragraph format adjustment, etc.; for example, the second content of the second file is displayed in the first file, and the second content is adjusted to the same line spacing and / or page spacing as the first content.

[0112] Exemplarily, the content processing may include at least one of the following: formula calculation processing, content generation processing, and the like.

[0113] Among them, the formula calculation processing can be processed by a formula calculation service; the formula calculation service can calculate at least the second content according to the formula corresponding to the first content to obtain the calculated second content as the output result of the formula calculation service. Exemplarily, the formula corresponding to the first content can be: a formula configured for the first content. For example, the content displayed in the first cell of the first file is the first content, and the first formula is set in the first cell. The first formula is used to calculate the sum of the squares of the contents of the second cell to the sixth cell of the second file, wherein the contents of the second cell to the sixth cell of the second file are the second content; the formula calculation service calculates the sum of the squares of the contents of the second cell to the sixth cell of the second file, and displays the sum of the squares as the first content in the first cell of the first file.

[0114] Among them, the content generation process can be processed by a content generation service; the content generation service is a service that can automatically generate content, and the generated content can include text, rich text, etc. Specifically, the content generation service is integrated with preset functions related to content processing. This function can be implemented by a neural network model or a preset content processing rule. Exemplarily, the neural network model can be a large language model, a generative adversarial model, an encoder and / or a decoder, etc., which can be used to implement functions related to content processing such as proofreading text errors, detecting sensitive words, summaries or document polishing. The preset content processing rule can be a rule for proofreading text errors, detecting sensitive words or document polishing, so as to implement content processing functions such as proofreading text errors, detecting sensitive words or document polishing. In a specific embodiment, the content generation service can process the received content with the corresponding function and then output the result. For example, the second content can be used as the input content of the content generation service, and the content generation service generates the processed second content after processing the input second content as the output result of the content generation service.

[0115] Method three: obtaining the second content of the second file referenced by the first file, and displaying the first content in the first file as first information indicating the second content, wherein the first information may include at least one of the following: a link, a formula, a character string, an icon, etc.

[0116] The displaying of the first content of the first file as the first information indicating the second content may be performed without granting the first file permission for the second file.

[0117] In some embodiments, obtaining the first request in step 101 may include: obtaining the first request when it is determined that the first file references the second file. The first request may be a subscription request.

[0118] For example, the prerequisite for establishing a subscription between the first file and the second file is that the first file and the second file have a reference relationship, and the first file and the second file are online; then in a specific embodiment, the subscription service, the service of the first file, and the service of the second file can be run in the server. The service of the first file can initiate a first request to the subscription service to request the first file to subscribe to the second file when it is determined that the first file references the second file; the subscription service responds to the first request to control the establishment of a connection between the service of the first file and the service of the second file when the subscription service determines that the first file and the second file are online, so that the first file subscribes to the second file. The above subscription service, the first file service, and the second file service are all services that execute preset task processes and can run on the same or different servers. In addition, the subscription service, the first file service, and the second file service can also re-segment or combine specific services based on actual conditions, and the implementation of the present disclosure is not limited thereto, such as determining the online status of the first file and the second file by the service of the first file.

[0119] In some embodiments, the first file subscribing to the second file means that the first file subscribes to the changes of the second file. When the first file successfully subscribes to the second file, if the second file is changed, the content related to the changed content of the second file can be updated in the first file.

[0120] In some embodiments, the modification of the second file may include modification of at least part of the content of the second file.

[0121] Optionally, the second file includes a second content, and the second content of the second file is processed to obtain a third content, and the third content is the content that has been modified in the second file. Exemplarily, processing the second content of the second file to obtain the third content may include: performing a first operation on the second content of the second file to obtain the third content; wherein the first operation may include but is not limited to at least one of the following: adding, deleting, modifying, etc. at least part of the second content.

[0122] In some embodiments, establishing a subscription between the first file and the second file in step 102 may include: establishing a subscription between the first file and part or all of the content of the second file.

[0123] In some embodiments, establishing a subscription between a first file and part or all of the contents of a second file means that: there is at least one set of related contents between the first file and the second file, and a subscription between at least part of the related contents can be achieved.

[0124] The following is a detailed description using the example of the relevant content being the content having a reference relationship.

[0125] Exemplarily, the first file may include a first first content and a second first content; the second file may include a first second content and a second second content; it is assumed that: the first first content of the first file may reference the first second content of the second file, and the second first content of the first file may reference the second second content of the second file.

[0126] At this time, a method for implementing the subscription between the first file and part or all of the content of the second file can be: the server establishes a subscription between the first file and the entire content of the second file; for example, a subscription is established between the first first content of the first file and the first second content of the second file, and a subscription is established between the second first content of the first file and the second second content of the second file. If the first second content of the second file is changed, the changed content of the first second content in the second file is updated in the first first content of the first file; or, if the second content of the second file is changed, the changed content of the second second content in the second file is updated in the second first content of the first file.

[0127] Another way to implement the subscription between the first file and part or all of the content of the second file may be: the server establishes a subscription between the first file and part of the content of the second file; for example, a subscription is established between the first first content of the first file and the first second content of the second file, or a subscription is established between the second first content of the first file and the second second content of the second file. For example, if the first first content of the first file subscribes to the first second content of the second file; if the first second content of the second file is changed, the changed content of the first second content of the second file is updated in the first first content of the first file; or, if the changed content of the second content of the second file is changed, if the second first content of the first file does not subscribe to the second second content of the second file, the second second content of the first file is not updated.

[0128] In the case of establishing a subscription between the first file and part of the content of the second file, it can be determined whether to establish a subscription between the contents based on the aforementioned different subscription preconditions. For example, the subscription precondition includes that the user accessing the first file has access rights to the first file and the second file. In the above embodiment, if the user has access rights including: allowing access to the first first content of the first file, allowing access to the second first content of the first file, allowing access to the first second content of the second file, and not allowing access to the second second content of the second file, then in the case where the first first content references the first second content and the second first content references the second second content, since the user has access rights to the first first content and the first second content, a subscription between the first first content and the first second content can be established; since the user does not have access rights to the second second content, a subscription between the second first content and the second second content cannot be established.

[0129] In some other embodiments, the establishment of a subscription between a first file and part or all of the contents of a second file refers to: the subscription of the first file to the second file is a content-level subscription or a file-level subscription. Exemplarily, in the embodiment of the present disclosure, when the subscription of the first file to the second file is a content-level subscription, the second file will be updated in the first file only when the content subscribed by the first file is changed; and even if the content not subscribed by the first file is changed, it cannot be updated in the first file.

[0130] In some embodiments, determining in step 103 that the content of the second file has been changed based on the subscription includes:

[0131] Obtaining change information about the second file based on the subscription;

[0132] Based on the acquired change information, it is determined that the second file has been changed, wherein the change information is used to indicate that the second file has been changed.

[0133] Optionally, the change information may be used to indicate that content in the second file subscribed by the first file has changed.

[0134] Exemplarily, when determining that the first file subscribes to the second file, the subscription service receives change information sent by the service of the second file; and based on the change information, determines that the second file is changed.

[0135] Exemplarily, after receiving the change information, the subscription service sends the change information to the service of the first file; the subscription service receives the fifth request sent by the service of the first file based on the change information, wherein the fifth request is used to request to obtain the changed content of the second file; based on the fifth request, the subscription service obtains the first file version in which the content of the second file has been changed, and sends the first file version to the service of the first file.

[0136] Here, the subscription service obtains the first file version in at least two implementation modes:

[0137] One implementation method: When the subscription service determines that the first file subscribes to the second file and determines that the content of the second file has changed, the subscription service can directly obtain the first file version of the second file with the changed content sent by the service of the second file. In this way, the subscription service can obtain the first file version without receiving the fifth request for obtaining the second file version.

[0138] Another implementation method: when the subscription service determines that the first file subscribes to the second file and determines that the content of the second file has changed, the subscription service sends the change information to the service of the first file; if the subscription service receives the fifth request sent by the service of the first file based on the change information, the subscription service obtains the first file version of the second file that has changed and is sent by the service of the second file. In this way, the subscription service needs to receive the fifth request sent by the service of the first file to obtain the first file version.

[0139] The first file version may be at least a portion of the second file, and the at least a portion may include a portion of the second file related to the first file and / or a modified portion of the second file.

[0140] In some embodiments, the first file version includes at least one of the following:

[0141] The modified content in the second file, that is, the modified content in the second file;

[0142] The second file after the content has been modified;

[0143] Content in the second document that is relevant to the first document;

[0144] The changes in the second file that are related to the first file.

[0145] The modified content may refer to the modified content, the modified operation and / or the identifier of the modified content.

[0146] For example, when the modification to the second file is to perform a first operation on the second content of the second file to obtain a third content, the third content is the modified content, the first operation is the modification operation, and the identifier of the second content is the identifier of the modified content.

[0147] Then, the modified content may refer to at least one of the third content, the first operation, and the identifier of the second content.

[0148] The following is a detailed description using the modified content as an example.

[0149] For example, when the first file version is the entire second file, the first file version may include: the second file with modified content. The first file may update the part of the first file related to the second file based on the first file version having the entire content of the second file.

[0150] For another example, when the first file version is part of the second file, the first file version may include: the modified part of the second file, such as the modified content in the second file, or the modified content in the second file related to the first file.

[0151] For another example, when the first file version is part of the second file, the first file version may include: the part of the second file related to the first file, such as the content in the second file related to the first file, and the modified content of the content in the second file related to the first file.

[0152] For another example, when the first file version is part of the second file, the first file version may include: the part of the second file related to the first file, and the modified part of the second file, such as the modified content of the content in the second file related to the first file.

[0153] Exemplarily, the changed content in the second file may be: a snapshot of the changed content in the second file, etc. For example, if the content in the second to sixth cells in the second file is changed, the first file version may include the changed second to sixth cells in the second file.

[0154] Here, a snapshot refers to a copy or a replica of data reproduction; for example, for a file, a snapshot of the file may refer to an instant copy of the file, which includes all information of the file at the time when the snapshot is generated.

[0155] Exemplarily, the second file after the content is changed may be: a snapshot of the second file after the content is changed, etc. For example, if the content in the second to sixth cells in the second file is changed, the first file version may include the second file, and the second to sixth cells in the second file display the changed content.

[0156] Exemplarily, the content in the second file related to the first file may be: a snapshot of the content in the second file related to the first file; for example, the content in the second file related to the first file may be: a snapshot of the content of the part of the second file referenced by the first file.

[0157] Exemplarily, the changed content of the content related to the first file in the second file may be: a snapshot of the changed content of the content related to the first file in the second file; for example, the changed content of the content related to the first file in the second file may be: a snapshot of the changed content of the part of the content in the second file referenced by the first file, the second file has a first second content and a second second content, both of which are referenced by the first file, but only the second second content is changed, then the changed content is a snapshot of the modified second second content.

[0158] The related content refers to the content with correlation. In the embodiment of the present disclosure, the correlation between the first file and the second file means that the content of the first file is changed as the content of the second file is changed, which may include but is not limited to: there is a reference relationship between the first file and the second file.

[0159] In this way, the first file version with the content of the second file changed can be obtained by obtaining a snapshot or the like, that is, the first file version can be obtained in a variety of file formats to adapt to more application scenarios.

[0160] In this way, when the content of the second file is changed, only the changed content and / or the changed content related to the first file can be obtained, thereby reducing data transmission, saving power consumption, etc. Alternatively, the entire second file including the changed content or all content related to the first file can be obtained, so there is no need to extract the changed content of the second file, which facilitates the operation of the service of the second file and reduces the amount of calculation of the service of the second file.

[0161] In some embodiments, step 104 may include: determining the modified content of the second file based on the first file version of the second file and the stored third file version of the second file; and updating the content related to the modified content of the second file in the first file.

[0162] Optionally, the third file version is the file version before the second file is modified.

[0163] One implementation method is: if the first file version is the modified content in the second file, the server determines the related content of the modified content in the second file in the first file, and updates the modified content of the second file in the related content.

[0164] Another implementation method is: if the first file version is the second file after the content has been changed, the server determines the changed content of the second file based on the first file version and the third file version, and then determines the related content of the changed content in the second file in the first file, and updates the changed content of the second file in the related content.

[0165] In the disclosed embodiment, the changed content of the second file can be updated in the first file according to the specific content of the acquired first file version. For example, if the first file version is the changed content of the second file, the changed content of the second file can be directly updated in the first file; for another example, if the first file version is the second file after the content is changed, the changed content of the second file can be determined based on the stored third file version and the first file version and then updated. In this way, there is no need to update the entire first file, and the partial content update of the first file is realized, which reduces the power consumption of the updated file and increases the update rate.

[0166] In some embodiments, updating the content related to the second file in the first file in step 104 includes: displaying the content of the second file in the first file, or displaying the content processed based on the content of the second file.

[0167] For the example of a first file citing a second file, displaying the content of the second file in the first file may correspond to reference method one, and displaying the content processed based on the content of the second file may correspond to reference methods two and three.

[0168] Optionally, in step 104, updating the content related to the second file in the first file includes: updating the first content of the first file along with the updating of the content of the second file. Exemplarily, the server updates the modified content of the second content of the second file in the first content of the first file.

[0169] Optionally, the method further includes: after updating the content related to the second file in the first file, displaying the updated first file.

[0170] Exemplarily, the first content of the first file is related to the second content of the second file; if the second content of the second file is changed, one implementation method is: directly update and replace the first content of the first file with the changed content of the second file; another implementation method is: based on the changed content of the second content of the second file, process the changed second content to obtain the fourth content, and then update and replace the first content of the first file with the fourth content. For example, the first cell of the first file is the related content of the second to tenth cells of the second file, and the value of the first cell is the sum of the values ​​in the second to tenth cells. If the values ​​in the second to tenth cells are changed, the value in the first cell is the sum of the values ​​in the second to tenth cells after the changes, that is, it can be considered as the content of the second file after the changed content is processed.

[0171] Thus, in the disclosed embodiment, the changed content of the second file can be directly updated in the first file, or the content after the changed content of the second file is updated, thereby effectively realizing the intercommunication of data between files and achieving the consistency of data in multiple related files.

[0172] In the disclosed embodiment, after obtaining the first request for the first file to subscribe to the second file, the server can determine that the first file subscribes to the second file; and in the case where the content of the second file is changed, obtain the first file version of the second file with the changed content; and can update the content related to the second file in the first file based on the first file version of the second file. In this way, the changes of the second file can be subscribed by the first file, and in the case of changes in the content of the second file, the second content with the changed content can be viewed in real time based on the first file, thereby realizing the intercommunication of the content (i.e., data) in the two files and facilitating the management of data.

[0173] Furthermore, the user does not need to make unnecessary copies of a piece of data (such as the second file), nor does he need to combine multiple data into one file, thereby avoiding the situation where a single data is too complicated and allowing multiple first files that reference the second file to maintain data consistency with the second file, that is, when the second file is modified, the first file that references the second file is also modified.

[0174] In some embodiments, after step 104, the method may further include: sending the updated first file to the client so that the client displays the updated first file. In this way, it is ensured that the updated first file is displayed in the client of the first file, and synchronous updating of the first file etc. of the client and the server is achieved.

[0175] In some other embodiments, the method may further include: sending the first file version to the client so that the client updates the content related to the second file in the first file. Optionally, step 104 may also be replaced by sending the first file version to the client so that the client updates the content related to the second file in the first file.

[0176] Here, the client updates the content related to the second file in the first file according to the first file version, which is similar to the step in which the server updates the content related to the second file in the first file according to the first file version; the implementation method of the client updating the content related to the second file in the first file according to the first file version can be referred to the implementation method of the server updating the content related to the second file in the first file according to the first file version (for example, the above-mentioned step 104), which will not be repeated here.

[0177] In this way, the server can also send the first file version to the client, so that the client can update the first file, thereby achieving synchronous update of the first file etc. on the client and the server.

[0178] like Figure 2 As shown, in some embodiments, the method further includes:

[0179] Step 105: Acquire multiple pieces of change information, wherein one piece of change information is used to indicate a first event that a change occurs in the second file;

[0180] Step 106: Based on the plurality of change information, merge the plurality of first events to generate a second event;

[0181] Obtaining the first file version of the second file with content changed in step 103 includes: Step 1031: Based on the second event, obtaining the first file version of the second file with content changed.

[0182] Optionally, step 105 may be replaced by obtaining at least one change information. When obtaining multiple change information, multiple first events indicated in the multiple change information are merged.

[0183] Optionally, obtaining multiple pieces of change information in step 105 may include: obtaining multiple pieces of change information sent by a service of the second file.

[0184] In some embodiments, step 106 includes: when the first events respectively indicated by the plurality of change information have not started to run, merging the plurality of first events indicated by the plurality of change information to generate the second event.

[0185] For example, Figure 3As shown, the server obtains the change information of B1, B2, B3 and B4 sent by the service of the second file, wherein the change information of B1, B2, B3 and B4 respectively indicates the first events of b1, b2, b3 and b4; if b1, b2, b3 and b4 have not started running, b1, b2, b3 and b4 are merged to generate a new second event of b4; the server obtains the second event based on the new b4 and obtains the first file version in which the content of the second file is changed. Here, the server can send the change information indicating the new second event of b4 to the service of the first file.

[0186] In this embodiment, the modification information may include at least one of the following: status information of the modification of the second file, and modification operation performed on the second file. The status information of the modification of the second file is used to indicate whether the second file has been modified, such as confirming that the second file has been modified when the status information is the first status information. The first status information may be a preset value, such as a preset numerical value, a preset character string, etc. The modification operation performed on the second file may be an editing operation, a comment operation, an annotation operation, etc. on the second file.

[0187] When the change information is status information that the second file has been changed, multiple first events indicated by multiple change information are merged to generate a second event, including: taking any first event or the last first event among the multiple first events indicated by the multiple change information as the merged second event.

[0188] In the case where the change information is a change operation performed on the second file, merging multiple first events indicated by multiple change information to generate a second event includes: merging the change operations corresponding to the multiple first events indicated by the multiple change information to generate the second event.

[0189] Thus, in the embodiment of the present disclosure, since the second event in the present application is determined based on the merger of multiple first events, the content of the first text version obtained based on the second event is consistent with the content of the first file version obtained based on multiple first events, and the update effect achieved is consistent.

[0190] In other embodiments, step 106 includes: when a first event is running, merging other first events except the running first event to generate a second event; step 1031 includes: after the first event is completed, obtaining the first file version based on the second event.

[0191] Optionally, the running first event may be any first event among multiple first events indicated by multiple pieces of modification information.

[0192] Optionally, the running first event may be the first first event indicated by the first change information. For example, step 106 may include: when the first first event indicated by the first change information is running, merging other first events except the first first event to generate a second event.

[0193] Exemplarily, the server obtains the change information of B1, B2, B3 and B4 sent by the service of the second file, wherein the change information of B1, B2, B3 and B4 respectively indicates the first events of b1, b2, b3 and b4; if b1 is starting to run, b2, b3 and b4 are merged to generate a new second event of b4; the server obtains the first file version in which the content of the second file is changed based on the second event of the new b4 after b1 is completed. Here, the server can send both the change information indicating the first event of b1 and the change information indicating the second event of the new b4 to the service of the first file.

[0194] Thus, in the embodiment of the present disclosure, since the present application can merge multiple first events that have not yet been executed in multiple change information into a second event, and obtain the first file version based on the first event and the second event after the execution in the change information, the first file version obtained based on the first event and the second event after the execution is consistent with the first file version obtained based on the multiple first events in the multiple change information that have not been merged, and the update effect achieved is consistent.

[0195] In the disclosed embodiment, when the server obtains multiple change information, the events indicated by the multiple change information can be merged into one event, so as to obtain the first file version based on the merged event; in this way, the update effect before and after the merge event can be consistent, and the server does not need to perform an update-related operation for each change information, thereby reducing the server's update computing resources. For example, when the user frequently edits the second file, the update action will be frequently triggered, and the disclosed embodiment can merge multiple edit events, so there is no need to trigger the update action multiple times, and only one update action is required, thereby reducing the server's computing resources.

[0196] In other embodiments, if the change information is instruction-type information, that is, the above-mentioned change operation, for example, one change information is used to indicate a change that occurred in the second file; then the server does not initiate the fifth request, that is, does not obtain the first file version from the service of the second file, but directly determines the first file version based on the merged change information.

[0197] Optionally, the method further includes: obtaining multiple change information, wherein one change information is used to indicate a change that occurred in the second file; obtaining the first file version of the second file with content changed in step 103 includes: determining the first file version of the second file with content changed based on the multiple change information.

[0198] Exemplarily, the server obtains three pieces of change information, wherein the three pieces of change information are respectively used to indicate that the content of the first position of the second file has been changed, the content of the second position of the second file has been changed, and the content of the third position of the second file has been changed. The server then merges and modifies the second file based on the three pieces of change information to obtain a modified version of the first file; for example, the server modifies the content of the first position, the second position, and the third position of the second file based on the second file.

[0199] Thus, in the present embodiment, for instruction-type information, there is no need to trigger the update action multiple times for multiple modification requests from the user, and only one update action is required, thereby reducing the computing resources on the server side.

[0200] like Figure 4 As shown, in some embodiments, before step 101, the method further includes:

[0201] Step 107: Obtain a second request, where the second request is used to request the first file to reference the content of the second file;

[0202] Step 108: Based on the second request, determine a reference relationship between the first file and the second file, wherein the reference relationship is used to indicate content in the first file that is related to the second file.

[0203] In some embodiments, obtaining the second request in step 107 may include: obtaining the second request sent by the client. For example, the server obtains the second request sent by the client of the first file.

[0204] In some embodiments, the first file references the content of the second file, including: the first file references all or part of the content of the second file.

[0205] In some embodiments, the file processing method may include: step 107 , step 108 , step 101 , step 102 , step 103 , and step 104 .

[0206] In the embodiment of the present disclosure, the reference relationship between the first file and the second file can be determined by the server, thereby laying a foundation for the first file to subscribe to the second file.

[0207] In some other embodiments, after step 108, the following further includes: step 109: when it is determined that the first file needs to reference the second file, updating the content related to the second file in the first file. Optionally, the file processing method may include: step 107, step 108 and step 109.

[0208] In some other embodiments, step 108 may include: when it is determined that the first file needs to reference the second file, obtaining a fourth file version of the second file; and sending the fourth file version to the client so that the client updates the content related to the second file in the first file.

[0209] In the embodiments of the present disclosure, it is possible to implement a first file referencing the content of a second file, that is, to implement data intercommunication between files, making it easy to implement data management between files.

[0210] In some embodiments, the method further includes: obtaining a second request sent by the client;

[0211] Sending the first file version to the client includes: sending the first file version to the client based on the second request.

[0212] In this way, when the client sends a second request for the first file to reference the second file, that is, when the client has a demand, the server can send the first file version to the client so that the client can display the referenced second file content in the first file.

[0213] In some embodiments, before step 101 of obtaining the first request, the process further includes:

[0214] Obtaining a third request, where the third request is used to access the first file;

[0215] In response to the third request, determining a status of the second file when it is determined that the first file references the second file;

[0216] When it is determined that the status of the second file is online, a first request is initiated to request the first file to subscribe to the second file.

[0217] In the embodiment of the present disclosure, accessing the first file may mean that there is a client (eg, a user on the client) accessing the first file through a network. If there is a client accessing the first file through a network, the state of the first file is an online state.

[0218] In some embodiments, obtaining the third request may include: obtaining the third request sent by the client. Exemplarily, the server obtains the third request sent by the client of the first file.

[0219] Thus, in the embodiment of the present disclosure, when the first file and the second file are online, that is, when the first file and the second file are opened, the content related to the second file is updated in the first file; thus, there is no need to update the second file in an offline state, thereby reducing the computing resources of the server, etc. Furthermore, if the second file is offline, the subscription of the first file to the second file cannot be realized, so the embodiment of the present disclosure can realize the subscription of the first file to the second file when both the first file and the second file are online.

[0220] In some embodiments, the method further comprises:

[0221] When it is determined that the state of the second file is an offline state, obtaining a stored second file version including the content of the second file, wherein the second file version is a version of the second file in an offline state;

[0222] Based on the second file version of the second file, content related to the second file is updated in the first file.

[0223] Exemplarily, the stored second file version is: a second file version stored at a time closest to the current time.

[0224] Exemplarily, the second file version may be: a snapshot of the second file.

[0225] Exemplarily, updating the content related to the second file in the first file based on the second file version of the second file may include: updating the content related to the second file in the first file based on the second file version of the second file and the reference relationship between the first file and the second file. For example, if the reference relationship between the first file and the second file is that the first content of the first file references the second content of the second file, the server may display the second content or display the content processed based on the second content in the area where the first content of the first file is located based on the second file version.

[0226] Thus, in the embodiment of the present disclosure, when the second file is offline, the update of the second file referenced by the first file can also be achieved by obtaining the second file version in the offline state.

[0227] like Figure 5 As shown, in some embodiments, the method further includes:

[0228] Step 110: Determine whether to grant the first file permission for the second file;

[0229] In step 103, obtaining the first file version in which the content of the second file is changed includes:

[0230] Step 1032: When it is determined that the first file is granted permission to access the second file, a first file version in which the content of the second file is modified is obtained.

[0231] Optionally, permissions include one of the following:

[0232] A first sub-right, wherein the first sub-right is used to indicate that the first file has the right to subscribe to all contents of the second file;

[0233] The second sub-rights are used to indicate that the first file has the right to subscribe to a predetermined portion of the second file.

[0234] For example, if it is determined that the first file is granted the first sub-rights for the second file, when any content of the second file is modified, the content related to the second file can be updated in the first file.

[0235] Exemplarily, if it is determined that the first file is granted the second sub-rights for the second file, such as granting the first file the second sub-rights for the first second content of the second file, but not granting the second sub-rights for the second second content of the second file; then when the first second content of the second file is changed, the content related to the first second content of the second file can be updated in the first file; and when the second second content of the second file is changed, the content related to the second second content of the second file cannot be updated in the first file. Here, the first second content of the second file is a predetermined part of the content. Optionally, the first second content and the second second content of the second file can both be considered as sub-files of the second file.

[0236] In this way, the first file can grant permissions to the entire second file, or the first file can grant permissions to part of the second file's content. If the first file grants permissions to part of the second file's content, smaller-granularity permission granting management can be achieved.

[0237] In the embodiments of the present disclosure, when a user account has multiple files, at least some of the files can be opened to the public and / or at least some of the files can be opened to the public, or at least some of the content in a file can be opened to the public and / or at least some of the content can be kept confidential, thereby achieving effective permission management and control over the data of multiple files.

[0238] In some embodiments, the method further includes: obtaining a fourth request sent by the client, the fourth request being used to grant the first file permission for the second file. In this way, whether to grant the first file permission for the second file can be determined based on the message sent by the client.

[0239] In some embodiments, the method further includes: if it is determined that the first file has not been granted permission to the second file, outputting prompt information; wherein the prompt information is used to prompt the first file to grant permission to the second file. In this way, if the permission is not granted, it can also be determined based on the prompt information whether to grant the first file permission to the second file.

[0240] In some embodiments, the method further includes: sending a prompt message to the client, the prompt message being used to prompt the client to send the fourth message. Thus, the prompt message can also be used to prompt the client to initiate authorization.

[0241] The following is a method for processing files executed by the client, which is similar to the description of the method for processing files executed by the server mentioned above; for technical details and beneficial effects not disclosed in the embodiment of the method for processing files executed by the client in the disclosed embodiment, please refer to the description of the embodiment of the method for processing files executed by the server in the disclosed embodiment, which will not be repeated here.

[0242] like Figure 6 As shown, the second aspect of the embodiment of the present disclosure provides a method for processing a file, including:

[0243] Step 201: Access the first file;

[0244] Step 202: Display the first file, wherein the first file displays content related to the second file; when a subscription is established between the first file and the second file, the content related to the second file is content updated based on the first file version of the second file; the first file version is a file version of the second file with content changed, obtained when it is determined based on the subscription that the content of the second file has changed.

[0245] The file processing method in the embodiment of the present disclosure may be executed by a terminal or an electronic device, which is a terminal or an electronic device used as a client.

[0246] In some embodiments, accessing the first file causes the second file to be switched from an offline state to an online state.

[0247] In some embodiments, the first file and the second file may be the first file and the second file in the above embodiment, respectively; the first file version may be the first file version in the above embodiment; and so on.

[0248] In some embodiments, the method further includes: sending a second request, wherein the second request is used to request the first file to reference content of the second file to determine content in the first file that is related to the second file.

[0249] In some embodiments, when the second file is in an offline state, the content related to the second file is content updated based on a second file version of the second file; the second file version is a version of the second file in an offline state.

[0250] In some embodiments, the method further includes: when the first file is accessed, sending a fourth request for granting the first file permission for the second file. Optionally, the fourth request is for requesting granting the first file permission for the second file.

[0251] Optionally, the method further includes: when the user accessing the first file is the first user, sending a fourth request initiated by the first user, the fourth request being used to grant the first file permission for the second file; the first user has permission to access the first file and the second file.

[0252] Here, after receiving the fourth request sent by the client, the server may determine to grant the first file permission for the second file.

[0253] In some embodiments, the method further includes: when the user accessing the first file is the second user, determining the granting of permissions of the first file to the second file, wherein the second user does not have permission to access the second file; when it is determined that the first file is granted permission to the second file, displaying the first file, and the first file displays content related to the content that has been modified based on the content of the second file. Here, the second user does not have reference permission, and the first file is granted subscription permission to the second file; thus, when the second user opens the first file, since the first user has granted the first file permission to subscribe to the second file, the first file can still update the content related to the second file.

[0254] In some other embodiments, the method further includes: when the user accessing the first file is the first user, determining the granting of the first file's permission to the second file, wherein the first user has the permission to access the second file; when it is determined that the first file is granted the permission to the second file, displaying the first file, wherein the first file displays the content related to the content that has been modified based on the content of the second file. Here, the first user has the reference permission, and the first file is granted the subscription permission to the second file; thus, when the first user accesses the first file, since the first user has granted the first file the permission to subscribe to the second file, the first file can update the content related to the second file.

[0255] In this way, when the first file is granted subscription rights to the second file, regardless of whether the user has access rights to the second file (i.e., whether the user has reference rights to the second file), the content related to the second file can be updated in the first document, thereby achieving data interoperability between files.

[0256] In some embodiments, the method further includes: in the case where it is determined that the first file is not granted permission for the second file, the first file is displayed, and the content in the first file that refers to the content of the second file is displayed as first information; the first information includes at least one of the following: a link, a formula, a string, and an icon. Here, the first file is not granted subscription permission for the second file. In this way, in the case where the first file is not granted permission for the second file, the content in the first file that refers to the content of the second file can only be displayed as the first information, so that the content for which the subscription permission is not granted is not referenced and displayed, thereby improving the security of private data.

[0257] In other embodiments, the method further includes: when it is determined that the first file is not granted permission for the second file and only the second user accesses the first file, the first file is displayed, and the first file displays content related to the historical content of the second file. In this way, when the first file is not granted permission for the second file and the user accessing the first file is only the second user, the content related to the changes in the content of the second file cannot be displayed in the first file, thereby reducing the risk of the second file being leaked; and because the confidentiality of the historical content of the second file is not high, it may be content that is open to the public or has been displayed before, so displaying content related to the historical content of the second file in the first file will not increase the risk of the latest changes in the second file being leaked.

[0258] In some other embodiments, the method further includes: when it is determined that the first file is not granted permission for the second file and the first user and the second user have accessed the first file, the first file is displayed, and the first file displays content related to the content that has been modified based on the content of the second file, and the content related to the content that has been modified based on the content of the second file is triggered to be generated by the first user. In this way, since the first user and the second user access the first file at the same time, even if the first file is not granted permission for the second file, the second file here is data that can be made public to the first user, and therefore the risk of private data leakage will not be increased.

[0259] In some embodiments, the method further includes: when it is determined that the first file is not granted permission for the second file, displaying the first file, and the first file does not display content related to content that has been modified based on the content of the second file. Here, the user accessing the first file can be the first user or the second user. In this way, when it is determined that the first file is not granted permission for the second file, the content related to the second file cannot be updated in the first file, so that private data can be kept private, thereby reducing the risk of private data being leaked.

[0260] In other embodiments, the method further includes: when it is determined that the first file is not granted permission to access the second file and the user accessing the first file is the first user, displaying the first file, wherein the first file displays content related to the content modified based on the content of the second file. In this way, since the first user has access rights to the second file, the first file can be viewed even if the first file is not granted permission to access the second file.

[0261] In some embodiments, the method further includes: obtaining prompt information; wherein the prompt information is used to prompt the first file to grant permissions to the second file; and sending a fourth request based on the prompt information. In this way, in the case where the first file is not granted permissions to the second file, the prompt information sent by (the server) can also be obtained to initiate a fourth request to the server to grant the first file permissions to the second file, so as to facilitate granting the first file permissions to the second file.

[0262] In order to further explain any embodiment of the present disclosure, several specific embodiments are provided below.

[0263] Example 1

[0264] like Figure 7 As shown, the present disclosure provides a method for processing a file, comprising the following steps:

[0265] Step 301: The processor of the first file sends a second request to the service of the first file. Optionally, the second request is used to request the first file to reference the content of the second file. The second request may be a reference request.

[0266] Step 302: The service of the first file determines that the first file is granted permission for the second file, and sends a sixth request. Optionally, the sixth request is used to obtain the content of the second file.

[0267] Step 303: The service of the second file sends the content of the second file to the service of the first file.

[0268] Here, the server may run a subscription service, a first file service, a second file service, and the like.

[0269] Exemplarily, if the second file is online, the service of the first file can obtain the latest content of the second file from the service of the second file; or, if the second file is offline, the service of the first file can obtain a second file version (e.g., a snapshot) of the stored content of the second file.

[0270] Step 304: The service of the second file sends the content of the second file to the processor of the first file.

[0271] Step 305: The processor of the first file sends a first request to the service of the first file. Optionally, the first request is used to request to subscribe to the second file. The first request may be a subscription request.

[0272] Step 306: When the service of the first file determines that the first file is granted permission for the second file, the service sends a first request to the subscription service.

[0273] Step 307: The subscription service sends a first request to the service of the second file, so that the first file subscribes to the second file.

[0274] In the embodiment of the present disclosure, after the service of the online first file obtains the request of the first file to reference the second file, the content of the second file can be referenced in the first file, thereby realizing the intercommunication of data between the files.

[0275] Example 2

[0276] like Figure 8 As shown, the present disclosure provides a method for processing a file, comprising the following steps:

[0277] Step 401: The processor of the second file obtains modification information. Optionally, the modification information is used to indicate that the second file is modified.

[0278] Step 402: The processor of the second file sends change information to the service of the second file.

[0279] Step 403: The service of the second file sends the change information to the subscription service.

[0280] Step 404: The subscription service sends the change information to the service of the first file.

[0281] Step 405: The service of the first file sends a fifth request to the service of the second file to obtain the first file version with the content of the second file changed. Optionally, the fifth request is used to request to obtain the changed content of the second file.

[0282] Exemplarily, the interaction between the service of the first file and the service of the second file may be through a subscription service.

[0283] Exemplarily, when the first file subscribes to the second file, step 405 is performed.

[0284] Step 406: The service of the first file sends the first file version to the processor of the first file.

[0285] In some optional embodiments, the processor of the first file updates the first file based on the first file version.

[0286] In an embodiment of the present disclosure, when a first file and a second file have a reference relationship and both the first file and the second file are online, content related to the changed content of the second file can be updated in the first file, that is, changes in the data source of the second file can be viewed in real time in the first file.

[0287] Furthermore, the user does not need to make unnecessary copies of a piece of data (such as the second file), nor does he need to combine multiple data into one file, thereby avoiding the situation where a single data is too complicated and allowing multiple first files that reference the second file to maintain data consistency with the second file, that is, when the second file is modified, the first file that references the second file is also modified.

[0288] Example 3

[0289] like Fig. 9 As shown, the present disclosure provides a method for processing a file, comprising the following steps:

[0290] Step 501: A file manager grants the first file permission to the second file. Optionally, the file manager may be a client of the first file or a client or other terminal used by the first user.

[0291] Step 502: The collaborator determines that it has the authority to access the first file. Optionally, the collaborator may be a client used by the second user.

[0292] Step 503: The service of the first file sends a fifth request to the server. Optionally, the fifth request is used to obtain the content of the second file. Optionally, the server may be the server in the above embodiment.

[0293] Step 5041: If the server determines that the first file has not been granted permission to access the second file, the server prompts the file manager to grant permission.

[0294] Step 5042: If the server determines to grant the first file permission to the second file, it sends a fifth request.

[0295] Step 505: The service of the second file sends the content of the second file to the server.

[0296] Step 506: The server sends the content of the second file to the service of the first file.

[0297] In the disclosed embodiment, when a file manager references a second file in a first file, the file manager needs to first associate the first file with the second file and grant the first file permission to the second file; if the first file is not granted permission to the second file, other users cannot access the second file; if the first file is granted permission to the second file, other users can access the second file through the first file; the processor of the first file can display the referenced content of the second file through the file, thereby reducing the risk of public disclosure of private data in the second file.

[0298] In this way, the embodiments of the present disclosure can effectively implement the management and control of different contents or regional permissions of files, such as realizing that private data is not disclosed to the public and / or non-private data can be disclosed to the public.

[0299] Example 4

[0300] Combination Fig.10 In an embodiment of the present disclosure, a method for processing a file is provided, comprising the following steps:

[0301] Step 601: The service of the second file sends a plurality of change information to the server. Optionally, the plurality of change information may be change information indicating the first event of b1, b2, b3 and b4 respectively.

[0302] Step 6021: The server runs the first event of b1.

[0303] Step 6022: The server may merge the first events indicated in the multiple change information; for example, merge the first events of b2, b3 and b4 into a new second event of b4.

[0304] In some optional embodiments, if b1 is not running, the first events of b1, b2, b3 and b4 may be merged into a new second event of b4.

[0305] Step 603: Send the modification information of the first event indicating b1 and the modification information of the second event indicating the new b4 to the service of the first file.

[0306] In the disclosed embodiment, when a user frequently edits the second file, the frequent editing events can be merged into one event, thereby eliminating the need to trigger the update action multiple times. Instead, the update action is triggered once, which can reduce the computing resources of the server.

[0307] like Fig.11 As shown, the present disclosure provides a file processing device, including:

[0308] The acquisition module 71 is configured to acquire a first request, wherein the first request is used to request the first file to subscribe to the second file;

[0309] The processing module 72 is configured to establish a subscription between the first file and the second file in response to the first request;

[0310] The acquisition module 71 is configured to acquire the first file version of the second file in which the content has been changed, when it is determined based on the subscription that the content of the second file has been changed;

[0311] The processing module 72 is configured to update the content related to the second file in the first file based on the first file version of the second file.

[0312] A file processing device provided by an embodiment of the present disclosure is applied in a server.

[0313] In some embodiments, the acquisition module 71 is configured to acquire change information about the second file based on a subscription; and determine that the second file has been changed based on the acquired change information, wherein the change information is used to indicate that the second file has been changed.

[0314] In some embodiments, the first file version includes at least one of the following:

[0315] The content of the second file that has been changed;

[0316] The second file after the content has been modified;

[0317] Content in the second document that is relevant to the first document;

[0318] The changes in the second file that are related to the first file.

[0319] In some embodiments, the acquisition module 71 is configured to acquire a plurality of change information, wherein one change information is used to indicate a first event that a change occurs in the second file;

[0320] A processing module 72 is configured to merge multiple first events to generate a second event based on multiple change information;

[0321] The acquisition module 71 is configured to acquire, based on the second event, a first file version in which content of the second file is modified.

[0322] In some embodiments, the processing module 72 is configured to merge other first events except the running first event to generate a second event when there is a first event running;

[0323] The acquisition module 71 is configured to acquire the first file version based on the second event after the first event is completed.

[0324] In some embodiments, the acquisition module 71 is configured to acquire a second request, wherein the second request is used to request the first file to reference the content of the second file;

[0325] The processing module 72 is configured to determine a reference relationship between the first file and the second file based on the second request, wherein the reference relationship is used to indicate content in the first file that is related to the second file.

[0326] In some embodiments, the acquisition module 71 is configured to acquire a third request, where the third request is used to access the first file;

[0327] The processing module 72 is configured to, in response to the third request, determine the status of the second file when it is determined that the first file references the second file;

[0328] The processing module 72 is configured to initiate a first request to request the first file to subscribe to the second file when it is determined that the status of the second file is online.

[0329] In some embodiments, the acquisition module 71 is configured to acquire a stored second file version including the content of the second file when determining that the state of the second file is an offline state, wherein the second file version is a version of the second file in an offline state;

[0330] The processing module 72 is configured to update the content related to the second file in the first file based on the second file version of the second file.

[0331] In some embodiments, the processing module 72 is configured to display the content of the second file in the first file, or to display the content after being processed based on the content of the second file.

[0332] In some embodiments, the processing module 72 is configured to determine whether to grant the first file permission for the second file;

[0333] The acquisition module 71 is configured to acquire a first file version in which content of the second file is modified when it is determined that the first file is granted permission to access the second file.

[0334] In some embodiments, the permissions include one of the following:

[0335] A first sub-right, wherein the first sub-right is used to indicate that the first file has the right to subscribe to all contents of the second file;

[0336] The second sub-rights are used to indicate that the first file has the right to subscribe to a predetermined portion of the second file.

[0337] like Fig.12 As shown, the present disclosure provides a file processing device, including:

[0338] An access module 81, configured to access a first file;

[0339] The display module 82 is configured to display a first file, wherein the first file displays content related to the second file; when a subscription is established between the first file and the second file, the content related to the second file is content updated based on the first file version of the second file; the first file version is a file version of the second file with content changes obtained when it is determined based on the subscription that the content of the second file has changed.

[0340] A file processing device provided by an embodiment of the present disclosure is applied in a client.

[0341] In some embodiments, the device further includes: a sending module configured to send a second request, wherein the second request is used to request the first file to reference content of the second file to determine content in the first file that is related to the second file.

[0342] In some embodiments, when the second file is in an offline state, the content related to the second file is content updated based on a second file version of the second file; the second file version is a version of the second file in an offline state.

[0343] In some embodiments, the sending module is configured to send a fourth request initiated by the first user when the user accessing the first file is the first user, the fourth request being used to grant the first file permission to the second file; the first user has permission to access the first file and the second file.

[0344] In some embodiments, the apparatus further comprises: a processing module configured to determine, when the user accessing the first file is the second user, the granting of the permission of the first file to the second file, wherein the second user does not have the permission to access the second file;

[0345] The display module 82 is configured to display the first file when it is determined that the first file is granted permission to the second file, and the first file displays content related to the content modified based on the content of the second file.

[0346] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0347] An embodiment of the present disclosure further provides an electronic device, including:

[0348] processor;

[0349] a memory for storing processor-executable instructions;

[0350] The processor is configured to implement the file processing method of any embodiment of the present disclosure when running the executable instructions.

[0351] The electronic device may be the terminal in the above embodiment.

[0352] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to remember information stored thereon after the communication device loses power.

[0353] The processor can be connected to the memory through a bus, etc., to read the executable program stored in the memory, for example, to implement the following Figures 1 to 10 The method for processing the file indicated in any item.

[0354] like Fig.13 FIG. 1 is a diagram showing a structure of an electronic device 90 according to an exemplary embodiment. The electronic device 90 may be a terminal in the above embodiment. For example, the electronic device 90 may be provided as a network side device. Fig.12 The electronic device 90 includes a processing component 91, which further includes one or more processors, and a memory resource represented by a processor 92 for storing instructions executable by the processing component 91, such as an application. The application stored in the processor 92 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 91 is configured to execute instructions to perform any method of the aforementioned method applied in the base station.

[0355] The electronic device 90 may further include a power supply component 93 configured to perform power management of the electronic device 90, a wired or wireless network interface 94 configured to connect the electronic device 90 to a network, and an input / output (I / O) interface 95. The electronic device 90 may operate based on an operating system stored in the processor 92, such as Windows Server TM, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

[0356] The embodiments of the present disclosure further provide a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, wherein when the executable program is executed by a processor, the method for processing a file in any embodiment of the present disclosure is implemented. Figures 1 to 10 The method for processing the file indicated in any item.

[0357] An embodiment of the present disclosure provides a computer-readable storage medium, which stores an executable program. When the executable program is executed by a processor, the file processing method provided by any one of the above technical solutions is implemented.

[0358] The computer-readable storage medium may specifically be: a non-temporary computer-readable storage medium.

[0359] Exemplarily, such as a memory including an executable program, the above instructions can be executed by the processing component 91 of the electronic device to complete the above method.

[0360] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0361] An embodiment of the present disclosure provides a computer program product, which includes a computer program or instructions. When the computer program product or the instructions are processed and executed, the file processing method provided by any one of the aforementioned technologies is implemented.

[0362] Those skilled in the art will readily appreciate other implementations of the disclosed embodiments after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the disclosed embodiments, which follow the general principles of the disclosed embodiments and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the disclosed embodiments are indicated by the following claims.

[0363] It should be understood that the embodiments of the present disclosure are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present disclosure is limited only by the appended claims.

Claims

1. A method for processing a file, characterized in that: Executed by the server, including: Obtaining a first request, wherein the first request is used to request a first file to subscribe to a second file; In response to the first request, establishing a subscription between the first file and the second file; When it is determined based on the subscription that the content of the second file is changed, obtaining a first file version of the second file in which the content is changed; Based on the first file version of the second file, content related to the second file is updated in the first file.

2. The method according to claim 1, characterized in that: The first file version includes at least one of the following: The modified content in the second file; the second file after the content is changed; content in the second file that is related to the first file; The modified content of the second file that is related to the first file.

3. The method according to claim 1 or 2, characterized in that: The determining, based on the subscription, that the content of the second file has been changed includes: Acquire change information about the second file based on the subscription; Based on the acquired change information, it is determined that the second file has been changed, wherein the change information is used to indicate that the second file has been changed.

4. The method according to claim 3, characterized in that The method further includes: acquiring a plurality of change information, wherein one piece of the change information is used to indicate a first event that a second file is changed; based on the plurality of change information, merging a plurality of the first events to generate a second event; The obtaining of the first file version of the second file with content changed includes: based on the second event, obtaining the first file version of the second file with content changed.

5. The method according to claim 4, characterized in that The merging of the plurality of first events to generate the second event based on the plurality of change information includes: when the first event is running, merging the other first events except the running first event to generate the second event; The obtaining, based on the second event, the first file version in which the content of the second file is changed includes: obtaining the first file version based on the second event after the first event is completed.

6. The method according to claim 1 or 2, characterized in that: Before obtaining the first request, the method further includes: Obtaining a second request, wherein the second request is used to request the first file to reference content of a second file; Based on the second request, a reference relationship between the first file and the second file is determined, wherein the reference relationship is used to indicate content in the first file that is related to the second file.

7. The method according to claim 1, characterized in that Before obtaining the first request, the method further includes: Obtaining a third request, where the third request is used to access the first file; In response to the third request, determining a status of the second file when it is determined that the first file references the second file; When it is determined that the status of the second file is online, the first request is initiated to request the first file to subscribe to the second file.

8. The method according to claim 7, characterized in that The method further comprises: When it is determined that the state of the second file is an offline state, obtaining a stored second file version including the content of the second file, wherein the second file version is a version of the second file in an offline state; Based on the second file version of the second file, content related to the second file is updated in the first file.

9. The method according to claim 1, characterized in that: The updating of the content related to the second file in the first file includes: The content of the second file is displayed in the first file, or the content processed based on the content of the second file is displayed.

10. The method according to claim 1, characterized in that The method further includes: determining whether to grant the first file permission for the second file; The obtaining of the first file version of the second file with content changed includes: obtaining the first file version of the second file with content changed when it is determined that the first file is granted permission for the second file.

11. The method according to claim 10, characterized in that The permissions include one of the following: A first sub-right, wherein the first sub-right is used to indicate that the first file has the right to subscribe to all contents of the second file; The second sub-rights are used to indicate that the first file has the right to subscribe to a predetermined portion of the second file.

12. A method for processing a file, characterized in that: Executed by the client, including: Access the first file; A first file is displayed, wherein the first file displays content related to a second file; when a subscription is established between the first file and the second file, the content related to the second file is content updated based on a first file version of the second file; and the first file version is a file version of the second file with content changed, obtained when it is determined based on the subscription that the content of the second file has changed.

13. The method according to claim 12, characterized in that The method further comprises: A second request is sent, wherein the second request is used to request the first file to reference content of the second file to determine content in the first file that is related to the second file.

14. The method according to claim 12, characterized in that When the second file is in an offline state, the content related to the second file is content updated based on a second file version of the second file; the second file version is a version of the second file in an offline state.

15. The method according to claim 12, characterized in that The method further comprises: In the case that the user accessing the first file is the first user, a fourth request initiated by the first user is sent, where the fourth request is used to grant the first file permission for the second file; the first user has permission to access the first file and the second file.

16. The method according to claim 15, characterized in that The method further comprises: In a case where the user accessing the first file is a second user, determining a granting status of the first file's permission for the second file, wherein the second user does not have permission to access the second file; In the case where it is determined that the first file is granted the permission for the second file, the first file is displayed, and the first file displays content related to the content that is modified based on the content of the second file.

17. A file processing device, characterized in that: The device comprises: An acquisition module is configured to acquire a first request, wherein the first request is used to request a first file to subscribe to a second file; a processing module, configured to establish a subscription between the first file and the second file in response to the first request; The acquisition module is configured to, when it is determined based on the subscription that the content of the second file is changed, acquire a first file version of the second file in which the content is changed; The processing module is configured to update the content related to the second file in the first file based on the first file version of the second file.

18. A file processing device, characterized in that: The device comprises: an access module configured to access a first file; The display module is configured to display a first file, wherein the first file displays content related to a second file; when a subscription is established between the first file and the second file, the content related to the second file is content updated based on a first file version of the second file; and the first file version is a file version of the second file with content changed, obtained when it is determined based on the subscription that the content of the second file has changed.

19. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the file processing method described in any one of claims 1 to 11 or claims 12 to 16 when running the executable instructions.

20. A readable storage medium, characterized in that: The readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the file processing method described in any one of claims 1 to 11 or claims 12 to 16.

21. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or instruction is executed by a processor, the file processing method described in any one of claims 1 to 11 or claims 12 to 16 is implemented.

Citation Information

Patent Citations

  • Reference document updating method and device, electronic equipment and storage medium

    CN111858518A

  • Document synchronization method and device, equipment and medium

    CN114996230A

  • Method and device for realizing information processing, computer storage medium and terminal

    CN115269614A

  • Methods and systems to facilitate providing spreadsheet and database data to users via a social network

    US20120330995A1