CN116663504A - Collaborative file editing method and device, storage medium and electronic equipment - Google Patents

Collaborative file editing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116663504A
CN116663504A CN202310936360.1A CN202310936360A CN116663504A CN 116663504 A CN116663504 A CN 116663504A CN 202310936360 A CN202310936360 A CN 202310936360A CN 116663504 A CN116663504 A CN 116663504A
Authority
CN
China
Prior art keywords
editing
file
user
offline
version
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310936360.1A
Other languages
Chinese (zh)
Inventor
杨知霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Creative Beautiful Technology Co ltd
Original Assignee
Beijing Jinwei Zhiguang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jinwei Zhiguang Information Technology Co ltd filed Critical Beijing Jinwei Zhiguang Information Technology Co ltd
Priority to CN202310936360.1A priority Critical patent/CN116663504A/en
Publication of CN116663504A publication Critical patent/CN116663504A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a collaborative file editing method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when the user is switched from the offline state to the online state, judging whether the user needs to edit the data offline synchronously; if the user needs to edit the data offline synchronously, determining a target collaborative file, judging whether the target collaborative file accords with editing conditions, and if so, determining a file version to be edited corresponding to the target collaborative file; determining an editing operation set corresponding to a user in a local database, wherein the editing operation set comprises a plurality of editing operation data, and the editing operation data are operation data generated by editing a target collaborative file by the user in an offline state; judging whether the editing operation set accords with the automatic synchronization condition, if so, carrying out file editing processing on the file version to be edited according to the editing operation set to obtain the latest file version. By applying the method of the invention, the user can edit the file when the network is abnormal, and the user experience can be improved.

Description

Collaborative file editing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a collaborative file editing method and apparatus, a storage medium, and an electronic device.
Background
Collaborative software is one of common tools in life and work of people, for example, a collaborative office tool for editing documents in a collaborative manner by multiple people in the daily office field, and a collaborative product design tool such as MasterGo in the product research and development field. Files cooperatively processed by the cooperative software may be referred to as cooperative files.
The software operation service (Software as a Service, saaS) is one of the common service modes of collaborative software, that is, a user can obtain a required software service through a network without installing a software product on a device, and a Web-based system and an application (Web App) are one of the common forms of collaborative software. The file data of the Web App are usually stored in a cloud server, in the editing process of the collaborative file, the editing operation of the collaborative file performed by a user on an operation interface is needed to be synchronized to the server through a network so as to realize file editing, and when the user equipment is disconnected from the server, the editing operation is stopped.
In the existing collaborative file editing mode, when a user goes offline due to abnormal network, the editing function of the collaborative file is usually stopped, and the user can only edit the collaborative file normally under the condition that the network is normal. In an actual application scene, a user still generally has an operation requirement when the user is abnormally offline, and based on the existing editing mode, the operation data generated by the user in an offline state are usually lost, so that the offline editing requirement of the user is difficult to meet, the user loss is easy to cause, and the user experience is poor.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a collaborative file editing method, which solves the problems that offline operation data is easy to be lost, offline editing requirements of users are difficult to be met, and user experience is poor in the existing editing mode.
The embodiment of the invention also provides a collaborative file editing device which is used for ensuring the practical realization and application of the method.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
a collaborative file editing method, comprising:
when a user is switched from an offline state to an online state, judging whether the user needs to edit data offline synchronously;
if the user needs to edit the data offline synchronously, determining a target collaborative file corresponding to the user, and judging whether the target collaborative file accords with preset editing conditions;
if the target collaborative file accords with the editing condition, determining a file version to be edited corresponding to the target collaborative file;
determining an editing operation set corresponding to the user in a preset local database; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
Judging whether the editing operation set accords with a preset automatic synchronization condition or not;
and if the editing operation set accords with the automatic synchronization condition, carrying out file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
In the above method, optionally, the determining whether the user needs to edit the data offline synchronously includes:
judging whether editing data corresponding to the user exists in the local database;
if the editing data corresponding to the user exists in the local database, judging whether the user exits from the editing page of the target collaborative file when the user is in an offline state;
and if the user does not exit the editing page of the target collaborative file in an offline state, determining that the user needs to edit data offline synchronously.
The method, optionally, further comprises:
if the user exits the editing page of the target collaborative file in an offline state, prompting the user to select whether to synchronize offline editing data;
and if the instruction for selecting the synchronous offline editing data by the user is received, determining that the user needs to synchronize the offline editing data.
In the above method, optionally, the determining whether the target collaborative file meets a preset editing condition includes:
judging whether the target collaborative file is deleted currently or not;
if the target collaborative file is not deleted currently, judging whether the user currently has the editing authority of the target collaborative file;
if the user currently has the editing authority of the target collaborative file, determining the current file version of the target collaborative file and the offline operation file version corresponding to the user;
judging whether the current file version is matched with the offline operation file version or not;
and if the current file version is matched with the offline operation file version, determining that the target collaborative file accords with the editing condition.
The method, optionally, further comprises:
if the current file version is not matched with the offline operation file version, judging whether the target collaborative file accords with a preset historical version editing condition or not;
if the target collaborative file accords with the historical version editing condition, determining a historical version set corresponding to the target collaborative file; the history version set comprises history file versions of at least one target collaborative file;
Prompting the user to select whether to synchronize offline editing data on a history file version in the history version set;
and if an instruction of the user for selecting to synchronize offline editing data on the historical file version in the historical version set is received, determining that the target collaborative file meets the editing condition.
In the above method, optionally, the determining whether the editing operation set meets a preset automatic synchronization condition includes:
determining the operation data amount corresponding to the editing operation set;
judging whether the operation data volume is smaller than a preset data volume threshold value or not;
and if the operation data amount is smaller than the data amount threshold value, determining that the editing operation set meets the automatic synchronization condition.
The method, optionally, further comprises:
if the editing operation set does not accord with the automatic synchronization condition, prompting the user to select whether to synchronize the editing operation set;
when receiving an instruction for synchronizing the editing operation set, performing file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
A collaborative file editing apparatus comprising:
the first judging unit is used for judging whether the user needs to edit data offline synchronously or not when the user is switched from an offline state to an online state;
the second judging unit is used for determining a target collaborative file corresponding to the user if the user needs to edit data offline synchronously, and judging whether the target collaborative file accords with preset editing conditions or not;
the first determining unit is used for determining a file version to be edited corresponding to the target collaborative file if the target collaborative file accords with the editing condition;
the second determining unit is used for determining an editing operation set corresponding to the user in a preset local database; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
a third judging unit, configured to judge whether the editing operation set meets a preset automatic synchronization condition;
and the editing unit is used for carrying out file editing processing on the file version to be edited according to the editing operation set if the editing operation set accords with the automatic synchronization condition, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium resides to perform a collaborative file editing method as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors in accordance with a collaborative file editing method as described above.
Based on the above-mentioned method for editing collaborative files provided by the embodiment of the invention, the method comprises the following steps: when the user is switched from the offline state to the online state, judging whether the user needs to edit the data offline synchronously; if the offline editing data is required to be synchronized, determining a target collaborative file corresponding to the user, and judging whether the target collaborative file accords with preset editing conditions; if the editing conditions are met, determining a file version to be edited corresponding to the target collaborative file; determining an editing operation set corresponding to a user in a preset local database, wherein the editing operation set comprises a plurality of editing operation data stored in advance, and each editing operation data is operation data generated by editing a target collaborative file by the user in an offline state; judging whether the editing operation set accords with a preset automatic synchronization condition or not; and if the automatic synchronization condition is met, carrying out file editing processing on the file version to be edited according to the editing operation set to obtain the latest file version of the target collaborative file. By applying the method provided by the embodiment of the invention, the editing operation data generated by the user in the off-line state can be stored in the local database, and when the user is switched to the on-line state, namely the network is normal, the collaborative file can be edited based on the pre-stored editing operation data, so that the synchronization of the off-line editing operation data is realized. The user can continuously edit the collaborative file when the network is abnormal, thereby being beneficial to meeting the offline editing requirement of the user and improving the use experience of the user.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a collaborative file editing method according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method of collaborative file editing according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of a module architecture involved in collaborative file editing according to an embodiment of the present invention;
FIG. 4 is an exemplary diagram of a storage architecture for collaborative file editing operation data according to an embodiment of the present invention;
FIG. 5 is an exemplary diagram of a collaborative file editing process provided by an embodiment of the present invention;
FIG. 6 is a diagram illustrating a collaborative file editing process according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating another example of a collaborative file editing process according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a collaborative file editing apparatus according to an embodiment of the present invention;
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As known from the background art, when the user device is disconnected from the server of the collaborative software, the editing operation of the user cannot be synchronized. When editing the collaboration file, the user equipment is often disconnected from the server for some reasons, such as interruption and fluctuation of the user network, the user enables a VPN (virtual private network), and an abnormality occurs in the server of the collaboration software or in the CDN (content delivery network) of the collaboration software application. In these disconnected scenarios, the user may still continue editing the collaborative file, but the editing operation data that cannot be synchronized to the server at this time is usually recorded as cached data of the web page, and if the user refreshes or leaves the web page, the data is lost, so that it is difficult to synchronize the editing data to the server. Therefore, the existing editing mode of the collaborative file is difficult to meet the offline editing requirement of the user, and the use experience of the user is poor.
Therefore, the embodiment of the invention provides a collaborative file editing method, which stores editing operation data generated by a user in an offline state in a local database, and edits a collaborative file based on the editing operation data in the local database in a preset mode when the user is switched to an online state, so that the offline editing of the collaborative file is realized, and the user experience is improved.
The embodiment of the invention provides a collaborative file editing method, which can be applied to collaborative software, an execution subject of the collaborative file editing method can be a device processor running the collaborative software, and a flow chart of the method is shown in fig. 1, and the method comprises the following steps:
s101: when a user is switched from an offline state to an online state, judging whether the user needs to edit data offline synchronously;
in the method provided by the embodiment of the invention, the collaborative software can be a product design tool for multi-person collaboration, such as Master Go. The collaborative file cooperatively processed by the collaborators is stored in the cloud server, the collaborators can log in front-end webpages of collaborative software through terminal equipment such as a computer, and the collaborative file is opened and edited at the webpage end.
Under the condition that the user terminal equipment and the server of the collaborative software can be normally connected, when the user account logs in the collaborative software, the user is switched from an offline state to an online state. The switching of the user state can occur in two scenarios, one is that the user has previously exited the collaborative software or edited the page, and in the normal situation of the network, has logged in again in the front page of the collaborative software. When the user uses the collaborative software, the terminal device is disconnected with the server, so that the user is in an off-line state, and the user stays on the editing page until the network connection between the terminal device and the server is restored, and then the user can be automatically switched to an on-line state.
When the user is switched from the offline state to the online state, judging whether the user needs to synchronize the offline editing data according to preset judging conditions, wherein the judging conditions are mainly that whether the user edits the collaborative file to generate corresponding editing operation data when the user is switched to the offline state before the current state, and confirming whether the editing operation data generated in the offline state need to be synchronized to a server so as to edit the collaborative file. The specific condition content can be set according to the actual application requirements. If the user edits the collaborative file in an offline state and confirms that the editing operation data need to be synchronized, determining that the user needs to synchronize the offline editing data. If the user does not edit the collaborative file in the offline state or confirms that the editing operation data are not synchronized, determining that the user does not need to synchronize the offline editing data. If the user does not need to edit the data offline synchronously, the process can be directly ended, and the user can be normally provided with service.
S102: if the user needs to edit the data offline synchronously, determining a target collaborative file corresponding to the user, and judging whether the target collaborative file accords with preset editing conditions;
In the method provided by the embodiment of the invention, if the user is determined to need to edit data offline synchronously, the collaborative file edited by the user in an offline state is determined to be the target collaborative file. Specifically, the target collaborative file may be determined according to an editing object corresponding to editing operation data generated by a user in an offline state. If the user edits the plurality of collaborative files in the offline state, displaying each collaborative file with offline editing through a list, allowing the user to select the collaborative file currently needing to synchronize data, and taking the collaborative file selected by the user as a target collaborative file.
In the method provided by the embodiment of the invention, the editing conditions are set according to the actual application requirements, namely, the target collaborative file can be edited based on the editing operation data in the offline state under the condition that the target collaborative file meets the preset conditions. Because the collaborative file is a file that can be cooperatively processed by multiple people, the editing operation of the user in the offline state is performed on the collaborative file at that time, and during the offline period of the user, the state of the target collaborative file may change, and editing may not be supported any more. Therefore, whether the target collaborative file meets the preset editing condition is required to be judged, if so, the subsequent flow is carried out, and if not, the flow can be stopped, and the reason is fed back through the front end interface.
S103: if the target collaborative file accords with the editing condition, determining a file version to be edited corresponding to the target collaborative file;
in the method provided by the embodiment of the invention, if the target collaborative file is determined to meet the preset editing condition, the version of the file to be edited corresponding to the target collaborative file can be determined according to the file data recorded in the server. The file version to be edited can be the current file version of the target collaborative file, or can be a certain historical file version of the target collaborative file. Specifically, the difference between the current file version of the target collaborative file and the file version edited offline by the user is determined. And if the current file version of the target collaborative file is the file version edited by the user, taking the current file version as the file version to be edited. If the difference between the current file version of the target collaborative file and the file version edited by the user is large, that is, the current file version and the file version edited by the user are different, the judgment can be specifically performed by the version number, and at the moment, the user can select a historical file version suitable for synchronous data as the file version to be edited.
S104: determining an editing operation set corresponding to the user in a preset local database; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
In the method provided by the embodiment of the invention, editing operation data generated by editing the collaborative file by a user at the front end is stored in the local database, specifically, the front end can call the IndexdDB database to store the editing operation data to the memory and the local disk of the browser, and the IndexdDB is an existing browser database and is not described in detail herein. Under the condition that the network is normal, the editing operation data stored in the local database are synchronously uploaded to the server one by one in a queue form, and after receiving a receipt of the server, the current end correspondingly deletes the editing operation data uploaded in the local database. When the terminal equipment is disconnected with the server, editing operation data generated by a user cannot be uploaded, and the editing operation data can be reserved in a local database. In a specific implementation process, the storage capacity of the local database may be set, and when the stored editing operation data exceeds the storage capacity, the collaborative file may be set to a read-only mode.
When the target collaborative file is processed, all editing operation data corresponding to the target collaborative file can be obtained from a local database, namely, the editing operation data stored when a user edits the target collaborative file in an offline state, so that an editing operation set is obtained.
S105: judging whether the editing operation set accords with a preset automatic synchronization condition or not;
in the method provided by the embodiment of the invention, the automatic synchronization condition is preset according to the actual demand, namely, the editing operation set can enter the actual data synchronization flow under the condition that the condition is met, and if the editing operation set does not meet the condition, the user is required to confirm and then perform data synchronization. Specifically, the automatic synchronization condition may be set according to the data size of the editing operation set.
S106: and if the editing operation set accords with the automatic synchronization condition, carrying out file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
In the method provided by the embodiment of the invention, if the editing operation set accords with the automatic synchronization condition through judgment, the editing operation set is used as the editing data of the target collaborative file, each editing operation data in the set is sequentially uploaded to the server so as to edit the file version to be edited of the target collaborative file, and after receiving a receipt sent by the server, the uploaded editing operation data in the local database is deleted. When all the editing operation data are successfully uploaded, and the server successfully completes the combination of the editing data, the file editing processing can be considered to be completed. The file version to be edited after the file editing processing is the latest file version of the target collaborative file, and the latest file version is presented when the collaborative user opens the target collaborative file. In a specific implementation process, the latest file version before the current file editing can be stored as a historical file version, and when the cooperator is in objection to the updated file version, file restoration can be performed.
Based on the method provided by the embodiment of the invention, when the user is switched from the offline state to the online state, whether the user needs to edit data offline synchronously is judged; if the user needs to edit the data offline synchronously, determining a target collaborative file, and judging whether the target collaborative file accords with preset editing conditions; if the conditions are met, determining a file version to be edited of the target collaborative file; determining an editing operation set corresponding to a user in a local database, wherein the editing operation set comprises a plurality of editing operation data stored in advance, and each editing operation data is operation data generated by editing a target collaborative file by the user in an offline state; judging whether the editing operation set accords with a preset automatic synchronization condition or not; and if the conditions are met, carrying out file editing processing on the file version to be edited according to the editing operation set to obtain the latest file version of the target collaborative file. By applying the method provided by the embodiment of the invention, the editing operation data generated by the user in the off-line state can be stored in the local database, and when the user is switched to the on-line state, namely the network is normal, the collaborative file can be edited based on the pre-stored editing operation data, so that the synchronization of the off-line editing operation data is realized. The user can continuously edit the collaborative file when the network is abnormal, thereby being beneficial to meeting the offline editing requirement of the user and improving the use experience of the user.
On the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process for determining whether the user needs to edit data offline synchronously, which is mentioned in step S101, includes:
judging whether editing data corresponding to the user exists in the local database;
in the method provided by the embodiment of the invention, whether the editing data of the server generated by the current user is not uploaded in the local database is queried, namely, editing operation data generated by editing the collaborative file by the user. If the local database does not have the editing data corresponding to the current user, determining that the user does not need to synchronize the offline editing data.
If the editing data corresponding to the user exists in the local database, judging whether the user exits from the editing page of the target collaborative file when the user is in an offline state;
in the method provided by the embodiment of the invention, if the editing data corresponding to the current user exists in the local database, whether the user exits the editing page of the target collaborative file in an offline state or not can be determined according to the condition of the current page when the user resumes connection to enter the service, for example, if the user enters the service, the user is considered to not exit the editing page in the offline state. If the user is not editing the page when entering the service, but is on the home page or other page, the user is considered to have exited the editing page of the file, or exited the tool, during offline. The scene corresponding to the user which does not exit the editing page in the offline state is that the user logs in the front page under the condition that the network is normal before, edits the collaborative file online, and has network disconnection in the editing process, the user changes from the online state to the offline state, then the user still stays in the front page to perform editing operation until the network is restored, and the user is switched from the offline state to the online state. The scene corresponding to the user which exits the editing page in the offline state is that when the user edits the collaborative file online, network disconnection occurs in the editing process, the user performs editing operation in the offline state, but does not wait for network recovery, the user exits the front-end page in the offline state, and then the user logs in the front-end page again.
And if the user does not exit the editing page of the target collaborative file in an offline state, determining that the user needs to edit data offline synchronously.
In the method provided by the embodiment of the invention, if the user does not exit the editing page of the target collaborative file in an offline state, the user is considered to need to synchronously edit the data offline.
Based on the method provided by the embodiment of the invention, if the user resumes the network connection after the network disconnection occurs in the editing process, the data edited by the user offline can be synchronized under the condition that the user is not felt, which is beneficial to further improving the use experience of the user.
On the basis of the method provided by the embodiment, the method provided by the embodiment of the invention further comprises the following steps:
if the user exits the editing page of the target collaborative file in an offline state, prompting the user to select whether to synchronize offline editing data;
in the method provided by the embodiment of the invention, if the user has closed the editing page of the target collaborative file before judging, the user is prompted to select whether to synchronize offline editing data, specifically, the name of the collaborative file edited in an offline state can be displayed to the user, the existence of the uploading-free editing operation data of the collaborative file is indicated, and a corresponding selection control is provided for the user to select whether to synchronize the offline editing data.
And if the instruction for selecting the synchronous offline editing data by the user is received, determining that the user needs to synchronize the offline editing data.
In the method provided by the embodiment of the invention, if the user triggers the control for synchronizing the offline editing data in the front-end interface, the control is regarded as an instruction for sending the offline editing data, and when the processor receives the instruction, the user is determined to need to synchronize the offline editing data. If an instruction of selecting the unsynchronized offline editing data by the user is received, determining that the user does not need to synchronize the offline editing data.
Based on the method provided by the embodiment of the invention, when the user logs in again, the user can select whether to synchronize the offline editing data, so that the method is favorable for meeting various editing requirements of the user.
Referring to fig. 2 on the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process for determining whether the target collaborative file meets the preset editing condition in step S102 includes:
s201: judging whether the target collaborative file is deleted currently or not;
in the method provided by the embodiment of the invention, when the target collaborative file is required to be edited, the state information of the target collaborative file can be queried from the server, whether the target collaborative file is deleted or not can be identified according to the data returned by the server, if the server returns a response message that the target collaborative file is deleted, the current deletion of the target collaborative file is determined, at the moment, the target collaborative file is deleted, the front-end page can be used for feeding back the user that the target collaborative file is deleted, the offline editing data can not be synchronized temporarily, and the editing process is stopped.
S202: if the target collaborative file is not deleted currently, judging whether the user currently has the editing authority of the target collaborative file;
in the method provided by the embodiment of the invention, if the target collaborative file is not deleted, further inquiring whether the user still has the editing authority of the target collaborative file currently. If the server feeds back that the user does not have the editing authority of the target collaborative file currently, the server feeds back the user that the user does not have the editing authority currently through the front-end page, temporarily cannot synchronize offline editing data, and suspends the editing process.
S203: if the user currently has the editing authority of the target collaborative file, determining the current file version of the target collaborative file and the offline operation file version corresponding to the user;
in the method provided by the embodiment of the invention, if the user currently has the editing authority of the target collaborative file, the current file version of the target collaborative file is obtained from the server, the file version edited by the user in the offline state is determined according to the editing operation data of the user in the offline state, and the file version is used as the offline operation file version corresponding to the user. The file version of the collaborative file may be identified by version information, such as an attribute value of a file key (filekey) attribute.
S204: judging whether the current file version is matched with the offline operation file version or not;
in the method provided by the embodiment of the invention, the current file version of the target collaborative file and the offline operation file version edited by the user in an offline manner are compared to determine whether the current file version and the offline operation file version are matched, namely whether the current file version and the current file version edited by the user in an offline manner are the same.
S205: and if the current file version is matched with the offline operation file version, determining that the target collaborative file accords with the editing condition.
In the method provided by the embodiment of the invention, if the current file version of the target collaborative file is matched with the offline operation file version, the target collaborative file is considered to accord with the preset editing condition.
The collaborative file is a file cooperatively processed by a plurality of collaborators, the state of the collaborative file possibly changes at any time, and based on the method provided by the embodiment of the invention, whether the target collaborative file can be synchronized with offline editing data or not is determined through a series of judging operations such as whether the file is deleted, the user permission, the file version and the like, so that the conflict of collaborative operation can be avoided.
On the basis of the method provided by the embodiment, the method provided by the embodiment of the invention further comprises the following steps:
If the current file version is not matched with the offline operation file version, judging whether the target collaborative file accords with a preset historical version editing condition or not;
in the method provided by the embodiment of the invention, the historical version editing conditions are set according to the actual demands, and when the historical file data meet the conditions, the historical file version suitable for synchronizing the offline editing data is indicated. For example, a history file version that exists closer to the offline-operation file version may be set as the history version editing condition.
If the current file version of the target collaborative file is not matched with the offline operation file version, the historical version information of the target collaborative file is obtained, namely the historical file version of the target collaborative file still stored in the server is obtained. And if the target collaborative file does not have the historical file version, determining that the target collaborative file does not accord with the historical version editing condition. If the target collaborative file has the historical file version, judging whether version information of the historical file version is matched with the condition requirement of the historical version editing condition, if so, considering that the target collaborative file accords with the historical version editing condition, and if not, considering that the target collaborative file does not accord with the historical version editing condition, and also determining that the target collaborative file does not accord with the editing condition.
If the target collaborative file accords with the historical version editing condition, determining a historical version set corresponding to the target collaborative file; the history version set comprises history file versions of at least one target collaborative file;
in the method provided by the embodiment of the invention, if the target collaborative file is judged to be in accordance with the historical version editing condition, version information of the historical file version of the target collaborative file stored in the server is acquired. Depending on the actual storage situation, the target collaborative file may only have one historical file version reserved, or may have multiple historical file versions. And taking the acquired historical file version as a historical version set corresponding to the target collaborative file.
Prompting the user to select whether to synchronize offline editing data on a history file version in the history version set;
in the method provided by the embodiment of the invention, each historical file version in the historical version set is displayed to the user through the front-end page, and a selection control is provided for the user to select whether to synchronize offline editing data on the historical file version. If the user selects one of the history file versions, he considers that he chooses to synchronize offline editing data on that history file version. And if the user selects the control for asynchronous offline editing of the data, determining that the target collaborative file does not accord with the preset editing condition.
And if an instruction of the user for selecting to synchronize offline editing data on the historical file version in the historical version set is received, determining that the target collaborative file meets the editing condition.
In the method provided by the embodiment of the invention, if the user selects to synchronize offline editing data on the historical file version, the target collaborative file is determined to accord with the preset editing condition.
Based on the method provided by the embodiment of the invention, if the current file version is not matched with the file version edited offline by the user, the user can select the historical file version to synchronize the offline editing data, so that the situation that the editing object has overlarge difference and the editing data cannot be merged is avoided.
On the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process for determining whether the editing operation set meets the preset automatic synchronization condition in step S105 includes:
determining the operation data amount corresponding to the editing operation set;
in the method provided by the embodiment of the invention, the total data amount of all the editing operation data in the editing operation set can be determined according to the data information of the editing operation data, and the total data amount of all the editing operation data is used as the operation data amount corresponding to the editing operation set, wherein the operation data amount is the data volume of the editing operation set.
Judging whether the operation data volume is smaller than a preset data volume threshold value or not;
in the method provided by the embodiment of the invention, a data volume threshold is preset according to the actual application requirement, when the data volume to be uploaded exceeds the threshold, the user is required to confirm the uploading, and if the data volume does not exceed the threshold, the uploading can be automatically performed.
Comparing the operation data quantity corresponding to the editing operation set with a preset data quantity threshold value, and if the operation data quantity corresponding to the editing operation set is larger than the preset data quantity threshold value, determining that the editing operation set does not accord with the preset automatic synchronization condition.
And if the operation data amount is smaller than the data amount threshold value, determining that the editing operation set meets the automatic synchronization condition.
In the method provided by the embodiment of the invention, if the operation data volume is smaller than the data volume threshold value, the editing operation set is determined to accord with the preset automatic synchronization condition. And if the operation data amount is equal to the data amount threshold, the method can also be configured to edit the operation set to meet the automatic synchronization condition.
According to the method provided by the embodiment of the invention, when the data volume of the editing operation data to be synchronized is smaller, the data can be automatically synchronized under the condition that a user is not felt, so that the user experience is further improved.
On the basis of the method shown in fig. 1, the method provided by the embodiment of the invention further includes:
if the editing operation set does not accord with the automatic synchronization condition, prompting the user to select whether to synchronize the editing operation set;
in the method provided by the embodiment of the invention, if the editing operation set is judged to be not in accordance with the automatic synchronization condition in the judgment process of the step S105, a corresponding selection control is displayed to the user through the front-end page, and the user is prompted to select whether to synchronize the editing operation set. If the user chooses not to synchronize the editing operation set, ending the editing process.
When receiving an instruction for synchronizing the editing operation set, performing file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
In the method provided by the embodiment of the present invention, if the user selects the synchronous editing operation set, the data of each editing operation in the editing operation set is uploaded to the server, and the specific processing manner is the same as that of the corresponding content in step S106, which is referred to the previous embodiment and will not be described herein again.
Based on the method provided by the embodiment of the invention, when the editing operation set does not accord with the automatic synchronization condition, the user can confirm whether to perform data synchronization, thereby being beneficial to meeting the diversified demands of the user and avoiding the conflict of collaborative editing.
In order to better explain the method provided by the embodiment of the invention, the embodiment of the invention provides a collaborative file editing method based on the method provided by the embodiment of the invention by combining with an actual application scene. The method provided by the embodiment of the invention is applied to a product design tool for multi-person collaboration, such as Master Go. In the method provided by the embodiment of the invention, the front end is connected with the server through a WebSocket (WS), wherein the WS is a full duplex communication protocol based on TCP. The user's editing operation for each minimum unit in the canvas may form a Changeset, i.e., a change set. The Changeset waiting to be uploaded to the server may be referred to as Pending Changeset, i.e., the waiting change set. When each user edits a file at the same time, a large number of changesets are generated, and these changesets are processed into upload queues and uploaded to the server one by one.
In the method provided by the embodiment of the invention, the Changeset can be stored locally for realizing WS disconnection, and can be uploaded to a server after WS recovery, so that the module architecture and the data storage of the canvas editing function are correspondingly designed. The module architecture of the canvas editing function, as shown in fig. 3, the View Layer (View Layer) calls an editor, specifically, an editor session object of the editor, the editor calls WebSocket connection to upload editing operation data, the editor calls an index db database, and the storage of the change set, that is, change set storage (Changeset Store), is implemented through the index db. The editor invokes a Canvas (Canvas) compiled based on WASM and c++ for editing by the user. WASM refers to WebAssembly, which is a coded format that can run in a browser, and c++ and WASM are both existing computer languages and are not described in detail herein. The storage architecture of the file editing operation data may be as shown in fig. 4, the data layer adopts an object oriented database system (ObjectStore), the data may be correspondingly stored in the form of "userid_documetid_filekey", and the database engine layer adopts an index db database. userID can be understood as a user name, docmentID as a file name, and fileKey as a file key.
In the collaborative file editing method provided by the embodiment of the invention, so-called file editing is mainly to upload editing operation data generated by a user in an offline state to a server so as to synchronize offline editing into a file, and the method can be understood as an offline editing synchronization process. The collaborative file editing process provided by the embodiment of the invention is illustrated by combining the contents such as the actual processing flow, the front-end page prompt and the like.
When the user logs in the front end page of the collaborative software through the browser to edit the file under the normal condition of the network, editing operation data (Changeset) can be generated, and the front end calls the IndexdDB to store all the editing operation data to the memory and the local disk of the browser. When the network is normal, the editing operation data are synchronously uploaded to the server, and after the current end receives a server receipt, the corresponding editing operation data in the local storage are deleted.
Referring to fig. 5, when the front end detects that the WS is disconnected, that is, the network connection is disconnected, it is determined whether the local storage is normal, that is, whether the index db database can be normally called, if the storage is abnormal, the editing operation of the user is blocked, and the connection is disconnected by the box-flicking prompt, so as to prevent data loss, the read-only mode is started. If the storage is normal, the connection is prompted to be interrupted through the popup frame, the user can continue editing, and the data are automatically synchronized after connection is restored, so that the editing operation of the user is not blocked. Editing operation data generated by continuous operation of a user is stored in a local disk and a browser memory by calling an IndexdDB database, and the editing operation data is not uploaded to a server at this time, and a receipt of the server is not received, so that the editing operation data is reserved in the browser memory and the local disk. Considering the physical limitation of local storage, when the data generated by the continuous editing of the user reaches 1G, the front end automatically blocks the editing authority of the user and carries out corresponding prompt, and the user is prompted to 'full local storage, so as to prevent the data from being lost, and a read-only mode is started'. In the process of editing by the user, whether the user finishes editing and tries to close the file can be identified, if the user does not close the file, the user continues to wait for network recovery, if the user tries to close the file, the user prompts that the file is in an offline editing state currently through a popup frame, and the editing is saved to the local and is synchronized after the network recovery, but the page is closed at the moment, and the editing still possibly is lost). And if the user still selects to close the page, executing the page closing operation.
When the front end detects WS recovery, the editing operation data which is reserved locally is arranged at the forefront of the uploading queue and is sent to the server first. After receipt, prompting the user that the offline editing and synchronizing of the file are successful, and deleting the data in the local storage. The specific processing procedure will be described with reference to fig. 6 and 7.
As shown in fig. 6, when it is detected that the user accesses under the condition that the WS connection is normal, the timing for starting synchronization is determined according to the state of the user when offline, if the user remains on the canvas in the offline process, the offline editing synchronization process is entered. If the user has logged out of the collaborative software or closed the browser and is logged in again, the user can receive a prompt 'whether the user is synchronous or not before having asynchronous offline editing before when the user returns to the homepage', the user confirms whether to restore the offline editing data, and when the user selects to synchronize the offline editing, the user can jump to the page of the related file, enter the offline editing synchronization flow, and if the user edits a plurality of files offline, provide file entries for the user to select. If the user directly enters the file page of the data to be synchronized after logging in, entering an offline editing synchronization process.
As shown in fig. 7, after entering the offline editing synchronization process, it is required to determine whether the file currently required to be edited is deleted, if so, the front page prompts "the file is deleted by a popup frame," and the offline editing can be synchronized after contacting other collaborators for recovery ", and the offline editing synchronization process can be suspended at this time.
If the file is not deleted, judging whether the user still has the editing authority, if the user does not have the editing authority, prompting "the user does not have the editing authority of the current file, but the offline operation of the file before the user is still not synchronized, and synchronizing after the user obtains the editing authority", wherein the offline editing synchronization process can be suspended at the moment. That is, if the file is deleted by other collaborators during offline or editing rights for the file are lost, the user is prompted before synchronization while pausing synchronization and retaining data.
If the file is not deleted and the user has editing authority, further judging whether the version of the file can synchronize data. Because the file may continue to be edited by other collaborators during the user's offline period, multiple versions of the file may be generated when the number of other collaborators edits is large. If the current file version is far away from the file version edited by the user, the fact that the difference between the current file version and the latest version is too large is prompted through a popup frame, and synchronization on the original file cannot be achieved. The method can establish copy synchronization or give up synchronization according to the history version, inquire whether the history file version of the file exists in the server, and if the history file version does not exist, prompt that the synchronization fails, namely that the data cannot be synchronized currently, and pause the offline editing synchronization flow. If the file has a history file version and a version which is closer to the version of the file edited by the user exists, the user can be prompted to select the latest history file version to establish a copy, offline editing is synchronized into the copy, if the user selects the history file version to synchronize, a new copy is tried to be established based on the history file version selected by the user, the copy is opened for editing, if the copy can be successfully established and opened, a subsequent editing operation is executed, after editing is completed, the user can be prompted to complete 'synchronization through a popup frame', and the offline editing of the user is synchronized on the latest history version before the user is offline.
If no other version of the file is generated during offline, then data synchronization is performed on the original version of the file.
When data synchronization is required for a certain file version, it is determined whether the data amount of the editing operation data to be synchronized is greater than a preset value, for example, the preset value may be set to 30MB or 50MB, etc., and may be set according to actual requirements. If the editing operation data to be synchronized is less, namely the data quantity is not greater than the preset value, the subsequent synchronization flow is carried out without prompting. If the editing operation data to be synchronized is more, namely the data quantity is larger than a preset value, prompting that ' you have offline editing data and can synchronize through a popup frame ', and comparing the history version with the state before and after synchronization ', simultaneously prompting a user to confirm whether to synchronize the data or not, and waiting for the user to confirm before and after the user confirms, carrying out subsequent flow. If the user selects unsynchronized data, the offline editing synchronization process is paused. If the user confirms the synchronous data, the subsequent flow is carried out, before the synchronous offline editing, a history version API is called, a history version is created according to the latest file version of the file, namely the current file version, and if the collaborators find that the difference is large after the synchronous offline editing of the file, the file can be restored through restoring the history version. After the synchronization is completed, a user can prompt that the synchronization is completed through a popup box, if the version difference between the user and other collaborators is large, the user can go to a historical version to check and restore the state before the synchronization, and the user can prompt that the "collaborators" XXX "in the pages of the other collaborators just upload offline editing through the popup box, so that the current file is updated, if the change is too large, the version before the synchronization can be checked by the historical version.
In the synchronization process of the editing operation data, the editing operation data in the local storage can be called, the editing operation data is uploaded to the server, and in the uploading process, the fact that the asynchronous offline editing exists is prompted through a popup frame in a front-end page, and the cloud is synchronized. And deleting the uploaded editing operation data in the local storage after receiving the receipt of the server. Before synchronization is finished, monitoring whether a user closes the page, if the user closes the page, prompting that the offline editing is synchronous through a popup frame, closing the page possibly causes data loss, suggesting that the page is left after the synchronization is finished, and if the user still selects to close the page, suspending the offline editing synchronization flow. After the synchronization process is completed, judging whether the synchronized editing operation data is successfully merged into the file, and synchronizing the editing operation data to the server to merge the editing into the file, namely editing the file. The merging result can be determined specifically through the processing receipt of the server. If the combination is successful, the offline editing synchronization flow is ended, and the front-end page is provided with an elastic frame for prompting that the offline editing synchronization is completed and the current version is the latest version. The processed file version is the latest version of the file.
In the method provided by the embodiment of the invention, when the offline editing synchronization process is paused, the editing operation data can be reserved in the local database, the process is restarted for the next time, meanwhile, the user can be prompted to discard the data synchronization, and if the user selects to discard the data synchronization, the editing operation data generated in the local database when offline is deleted.
In the method provided by the embodiment of the invention, the data storage is needed to be realized by combining with the IndexdDB database, so whether the data is effective depends on the state of the IndexdDB of the user equipment. When the indixedb is not available, the editing operation of the user during WS disconnection is blocked. When the user uninstalls the browser or cleans the content of the hard disk, the data stored in the indeeddb is lost, and at this time, the data cannot be edited offline synchronously. If the user uses the browser and opens the traceless mode of the browser, the offline editing data cannot be synchronized.
It should be noted that, the specific frame prompting content and the specific data volume setting mentioned in the method provided by the embodiment of the present invention are only for better explaining the specific embodiment provided by the method of the present invention, and in the specific implementation process, the specific embodiment may be set according to actual requirements, without affecting the implementation function of the method provided by the embodiment of the present invention.
According to the method provided by the embodiment of the invention, after WS recovery, other cooperators can be ensured to carry out compatibility and adaptation on file generated changes and offline editing through a series of logic control and popup frame prompting operations, and meanwhile, users and other cooperators of offline editing can be ensured to perceive the changes, so that unnecessary disputes are avoided, and data loss caused by data coverage is avoided. In a file editing scene of multi-person collaboration, the problems of asynchronous editing, contradiction of editing, different versions and the like caused by offline can be effectively solved.
Based on the method provided by the embodiment of the invention, when a user uses the SaaS service of the product design tool, the user can continue editing and operating like using a local program when encountering a network problem, and data loss is not worried. When the user has local editing data to be synchronized to the server, the user does not need to worry that the synchronization can influence the latest version of the file and influence other collaborators, so that the normal use of the file by all the collaborators is ensured.
Corresponding to a collaborative file editing method shown in fig. 1, an embodiment of the present invention further provides a collaborative file editing apparatus, which is configured to implement the method shown in fig. 1, and a schematic structural diagram of the collaborative file editing apparatus is shown in fig. 8, where the collaborative file editing apparatus includes:
A first judging unit 301, configured to judge whether a user needs to edit data offline synchronously when the user switches from an offline state to an online state;
a second judging unit 302, configured to determine a target collaborative file corresponding to the user if the user needs to edit data offline synchronously, and judge whether the target collaborative file meets a preset editing condition;
a first determining unit 303, configured to determine a file version to be edited corresponding to the target collaborative file if the target collaborative file meets the editing condition;
a second determining unit 304, configured to determine, in a preset local database, an edit operation set corresponding to the user; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
a third judging unit 305, configured to judge whether the editing operation set meets a preset automatic synchronization condition;
and the editing unit 306 is configured to perform file editing processing on the file version to be edited according to the editing operation set if the editing operation set meets the automatic synchronization condition, and take the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
By applying the device provided by the embodiment of the invention, the editing operation data generated by the user in the off-line state can be stored in the local database, and when the user is switched to the on-line state, namely the network is normal, the collaborative file can be edited based on the pre-stored editing operation data, so that the synchronization of the off-line editing operation data is realized. The user can continuously edit the collaborative file when the network is abnormal, thereby being beneficial to meeting the offline editing requirement of the user and improving the use experience of the user.
The device provided by the embodiment of the present invention may further extend a plurality of units on the basis of the device shown in fig. 8, and the functions of each unit may be referred to in the foregoing description of each embodiment provided by the collaborative file editing method, which is not further illustrated herein.
The embodiment of the invention also provides a storage medium, which comprises stored instructions, wherein the equipment where the storage medium is located is controlled to execute the collaborative file editing method when the instructions run.
The embodiment of the present invention further provides an electronic device, whose structural schematic diagram is shown in fig. 9, specifically including a memory 401, and one or more instructions 402, where the one or more instructions 402 are stored in the memory 401, and configured to be executed by the one or more processors 403 to perform the following operations by the one or more instructions 402:
When a user is switched from an offline state to an online state, judging whether the user needs to edit data offline synchronously;
if the user needs to edit the data offline synchronously, determining a target collaborative file corresponding to the user, and judging whether the target collaborative file accords with preset editing conditions;
if the target collaborative file accords with the editing condition, determining a file version to be edited corresponding to the target collaborative file;
determining an editing operation set corresponding to the user in a preset local database; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
judging whether the editing operation set accords with a preset automatic synchronization condition or not;
and if the editing operation set accords with the automatic synchronization condition, carrying out file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A collaborative file editing method, comprising:
when a user is switched from an offline state to an online state, judging whether the user needs to edit data offline synchronously;
if the user needs to edit the data offline synchronously, determining a target collaborative file corresponding to the user, and judging whether the target collaborative file accords with preset editing conditions;
if the target collaborative file accords with the editing condition, determining a file version to be edited corresponding to the target collaborative file;
determining an editing operation set corresponding to the user in a preset local database; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
judging whether the editing operation set accords with a preset automatic synchronization condition or not;
and if the editing operation set accords with the automatic synchronization condition, carrying out file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
2. The method of claim 1, wherein said determining whether the user desires to synchronize offline editing data comprises:
judging whether editing data corresponding to the user exists in the local database;
if the editing data corresponding to the user exists in the local database, judging whether the user exits from the editing page of the target collaborative file when the user is in an offline state;
and if the user does not exit the editing page of the target collaborative file in an offline state, determining that the user needs to edit data offline synchronously.
3. The method as recited in claim 2, further comprising:
if the user exits the editing page of the target collaborative file in an offline state, prompting the user to select whether to synchronize offline editing data;
and if the instruction for selecting the synchronous offline editing data by the user is received, determining that the user needs to synchronize the offline editing data.
4. The method of claim 1, wherein the determining whether the target collaborative file meets a preset editing condition comprises:
judging whether the target collaborative file is deleted currently or not;
If the target collaborative file is not deleted currently, judging whether the user currently has the editing authority of the target collaborative file;
if the user currently has the editing authority of the target collaborative file, determining the current file version of the target collaborative file and the offline operation file version corresponding to the user;
judging whether the current file version is matched with the offline operation file version or not;
and if the current file version is matched with the offline operation file version, determining that the target collaborative file accords with the editing condition.
5. The method as recited in claim 4, further comprising:
if the current file version is not matched with the offline operation file version, judging whether the target collaborative file accords with a preset historical version editing condition or not;
if the target collaborative file accords with the historical version editing condition, determining a historical version set corresponding to the target collaborative file; the history version set comprises history file versions of at least one target collaborative file;
prompting the user to select whether to synchronize offline editing data on a history file version in the history version set;
And if an instruction of the user for selecting to synchronize offline editing data on the historical file version in the historical version set is received, determining that the target collaborative file meets the editing condition.
6. The method of claim 1, wherein determining whether the set of editing operations meets a preset auto-sync condition comprises:
determining the operation data amount corresponding to the editing operation set;
judging whether the operation data volume is smaller than a preset data volume threshold value or not;
and if the operation data amount is smaller than the data amount threshold value, determining that the editing operation set meets the automatic synchronization condition.
7. The method as recited in claim 1, further comprising:
if the editing operation set does not accord with the automatic synchronization condition, prompting the user to select whether to synchronize the editing operation set;
when receiving an instruction for synchronizing the editing operation set, performing file editing processing on the file version to be edited according to the editing operation set, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
8. A collaborative file editing apparatus, comprising:
the first judging unit is used for judging whether the user needs to edit data offline synchronously or not when the user is switched from an offline state to an online state;
the second judging unit is used for determining a target collaborative file corresponding to the user if the user needs to edit data offline synchronously, and judging whether the target collaborative file accords with preset editing conditions or not;
the first determining unit is used for determining a file version to be edited corresponding to the target collaborative file if the target collaborative file accords with the editing condition;
the second determining unit is used for determining an editing operation set corresponding to the user in a preset local database; the editing operation set comprises a plurality of editing operation data stored in advance, wherein each editing operation data is operation data generated by editing the target collaborative file by the user in an offline state;
a third judging unit, configured to judge whether the editing operation set meets a preset automatic synchronization condition;
and the editing unit is used for carrying out file editing processing on the file version to be edited according to the editing operation set if the editing operation set accords with the automatic synchronization condition, and taking the file version to be edited after the file editing processing is completed as the latest file version of the target collaborative file.
9. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device in which the storage medium is located to perform the collaborative file editing method of any one of claims 1-7.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the collaborative file editing method of any of claims 1-7.
CN202310936360.1A 2023-07-28 2023-07-28 Collaborative file editing method and device, storage medium and electronic equipment Pending CN116663504A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310936360.1A CN116663504A (en) 2023-07-28 2023-07-28 Collaborative file editing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310936360.1A CN116663504A (en) 2023-07-28 2023-07-28 Collaborative file editing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116663504A true CN116663504A (en) 2023-08-29

Family

ID=87713960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310936360.1A Pending CN116663504A (en) 2023-07-28 2023-07-28 Collaborative file editing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116663504A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660623A (en) * 2013-11-18 2015-05-27 北大方正集团有限公司 Method and system for network file offline editing
US20190294687A1 (en) * 2018-03-23 2019-09-26 Microsoft Technology Licensing, Llc Smart versioning for files
CN111881150A (en) * 2020-09-24 2020-11-03 深圳市互联工场科技有限公司 Web application program offline data processing method and device
CN114139503A (en) * 2021-11-30 2022-03-04 平安科技(深圳)有限公司 Document content processing method, device, equipment and storage medium
CN114443314A (en) * 2022-04-11 2022-05-06 广东睿江云计算股份有限公司 Lock mechanism processing method for local and online editing of document file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660623A (en) * 2013-11-18 2015-05-27 北大方正集团有限公司 Method and system for network file offline editing
US20190294687A1 (en) * 2018-03-23 2019-09-26 Microsoft Technology Licensing, Llc Smart versioning for files
CN111881150A (en) * 2020-09-24 2020-11-03 深圳市互联工场科技有限公司 Web application program offline data processing method and device
CN114139503A (en) * 2021-11-30 2022-03-04 平安科技(深圳)有限公司 Document content processing method, device, equipment and storage medium
CN114443314A (en) * 2022-04-11 2022-05-06 广东睿江云计算股份有限公司 Lock mechanism processing method for local and online editing of document file

Similar Documents

Publication Publication Date Title
CN103107905B (en) Abnormality eliminating method, device and client
CN105407117B (en) The methods, devices and systems of distributed backup data
CN105204743A (en) Interaction control method and device for speech and video communication
CN102468989B (en) The method and system of network data
CN104468521B (en) Online moving method, device and system
CN109446178A (en) A kind of Hadoop object storage high availability method, system, device and readable storage medium storing program for executing
CN104243285A (en) Message pushing method and server
CN100581165C (en) Client system and service system data synchronizing method and system
CN102215266A (en) Implementation method of persistency services and persistency service system
CN107688489A (en) A kind of method and system of scheduler task
CN108829402A (en) The more extractions of root and system of application program, storage medium and processor
CN112564990B (en) Management method for switching audio management server
CN116663504A (en) Collaborative file editing method and device, storage medium and electronic equipment
CN105528221B (en) Electronic equipment reset processing method and device
CN108984602B (en) Database control method and database system
CN101072182B (en) Network content update synchronizing method, device and system
CN110519346A (en) A kind of method, terminal, server and the computer readable storage medium of data switching
CN110233791A (en) Data duplicate removal method and device
CN105577525A (en) Converged communication interaction method, device and system
CN102137058B (en) A kind of page access method and apparatus based on tab page
CN110740154A (en) streaming media service upgrading method, device and equipment
CN104967641B (en) A kind of method and device for realizing active and standby meta server data syn-chronization
CN111209051B (en) Optimization acceleration method and device based on domestic operating system
CN112667944A (en) Http protocol-based file online processing method and system
CN113055499B (en) Data transmission method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20230915

Address after: Room 5, Room 324201, 42nd Floor, Unit 2, Building 5, Courtyard 1, Futong East Street, Chaoyang District, Beijing, 100102

Applicant after: Beijing Creative Beautiful Technology Co.,Ltd.

Address before: Room 324201, 42nd floor, unit 2, building 5, courtyard 1, Futong East Street, Chaoyang District, Beijing 100102

Applicant before: Beijing Jinwei Zhiguang Information Technology Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20230829

RJ01 Rejection of invention patent application after publication