CN117149727A - File processing method, device, equipment and storage medium - Google Patents
File processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117149727A CN117149727A CN202311204265.9A CN202311204265A CN117149727A CN 117149727 A CN117149727 A CN 117149727A CN 202311204265 A CN202311204265 A CN 202311204265A CN 117149727 A CN117149727 A CN 117149727A
- Authority
- CN
- China
- Prior art keywords
- file
- cloud
- local
- client
- archive
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/178—Techniques for file synchronisation in file systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/194—Calculation of difference between files
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a file processing method, a file processing device, file processing equipment and a storage medium. The method comprises the following steps: if a state change event of the client is detected, determining a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information; comparing the local table, the archive table and the cloud table to determine a changed target file and an offline operation type of the target file before the state of the client is changed; generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end. According to the technical scheme, after the state of the client is changed, the files of the client and the cloud can be more comprehensively analyzed, and the operation of a user on the files is identified, so that the synchronization of the cloud and the client is realized.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a file.
Background
With the popularity of electronic documents, electronic documents are becoming increasingly important in work and life. The cloud storage is greatly increased and popularized, more and more personal users, enterprises and organizations turn data storage to the cloud, and synchronous software is deployed at the client end to realize the synchronization with cloud files so as to meet the requirements of data volume increase, expandability and convenience, and therefore, the operation behaviors of the users on the files in an offline state need to be accurately identified.
However, in the offline mode of software, the operation behavior of the user file cannot be tracked in real time. Therefore, how to analyze the files of the client and the cloud more comprehensively after the state of the client is changed, and identify the operation of the user on the files, so that the synchronization of the cloud and the client is realized, which is a problem to be solved urgently at present.
Disclosure of Invention
The invention provides a file processing method, a device, equipment and a storage medium, which can more comprehensively analyze files of a client and a cloud after the state of the client is changed, and identify the operation of a user on the files, so that the synchronization of the cloud and the client is realized.
According to an aspect of the present invention, there is provided a file processing method including:
If a state change event of the client is detected, determining a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information;
comparing the local table, the archive table and the cloud table to determine a changed target file and an offline operation type of the target file before the state of the client is changed;
generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end.
According to another aspect of the present invention, there is provided a document processing apparatus including:
the first determining module is used for determining a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information if a state change event of the client is detected;
the second determining module is used for comparing the local table, the filing table and the cloud table to determine the changed target file and the offline operation type of the target file before the state of the client is changed;
the sending module is used for generating a file operation request according to the target file and the offline operation category and sending the file operation request to the cloud end so as to instruct the cloud end to perform file operation and realize file synchronization of the client and the cloud end.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file processing method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a file processing method according to any embodiment of the present invention.
According to the technical scheme, if the state change event of the client is detected, a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information are determined; comparing the local table, the archive table and the cloud table to determine a changed target file and an offline operation type of the target file before the state of the client is changed; generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end. Through the mode, after the state of the client is changed, the files of the client and the cloud can be more comprehensively analyzed, and the operation of a user on the files is identified, so that the synchronization of the cloud and the client is realized.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for processing a file according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a file processing method according to a second embodiment of the present invention;
FIG. 3 is a block diagram of a document processing apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," "candidate," "alternative," and the like in the description and claims of the invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, the file renaming operation, the file moving operation, the folder renaming operation, the folder moving operation and the like in the offline mode cannot be corresponding to the existing files and folders in the cloud, so that the history version of the file is disconnected and history tracking cannot be performed. Aiming at the problems, the invention provides a scheme for accurately identifying the operation of a user on a file by integrating local table, cloud table and archive table information, and the specific process is described in detail in the following embodiment.
Example 1
FIG. 1 is a flowchart of a method for processing a file according to a first embodiment of the present invention; the method can be applied to the situation that after the state of the client is changed, the files of the local and cloud sides of the client are synchronized, and is particularly applicable to the situation that after the state of the client is changed from offline to online, the operation of a user on the files in the offline state is detected to synchronize the files on the client and the cloud sides. As shown in fig. 1, the file processing method includes:
s101, if a state change event of a client is detected, determining a local table for storing local file information, an archive table generated after synchronization is completed, and a cloud table for storing cloud file information.
The state change event refers to a change event of the running state of the client, and the state change event may be, for example, a transition of the running state of the client from an offline state to an online state. The local table refers to a data table storing local history file information, and may include at least one of the following: file name, file path, file size, file modification time, unique identity ID of the file in the file system (denoted FID), etc. The archive table is a data table of a file information data table generated after the completion of file synchronization of the client and the cloud, namely, archive file information, is a result set after the last synchronization of the client and the cloud, and is also a basis for next file identification operation. The information in the archive table is derived from a local table (FID) and a cloud table (DODIC), and comprises the information of the archive file stored locally after the last offline time synchronization is completed. The archive table may contain the following field information: the unique identification ID of the file at the cloud (denoted as DOCID), the unique identification ID of the file in the client local file system (denoted as FID), the file name, the file path, the file size, the file version number, the file modification time, etc. The cloud table may be a data table storing file information acquired from the cloud. The client can locally generate the cloud list on the client by pulling file information of the cloud file. The cloud table may include at least one of the following: DOCID of the file, file name, file path, file size, file version number, and file modification time.
The unique ID (FID) of the file may be generated by combining the ID (SID) of the disk on which the file is located and the ID of the file generated by the file on the disk, according to the characteristics of the system. The FID does not change with file renaming, moving, updating.
Optionally, when the client is in an offline state, the user may perform an operation on the file, for example, file renaming, file moving, file newly creating, file updating and file deleting may be performed, and accordingly, when the client detects that the client detects a network connection, that is, changes from the offline state to the online state, the local table, the archive table and the cloud table may be respectively determined based on a preset rule.
It should be noted that, the offline state indicates that the client software is not logged in, i.e. is not connected with the cloud, and the online meaning is that the connection is established, so that the communication between the client and the cloud can be completed.
It should be noted that, file information stored in the local table by the client in an offline state will not change, but the entity file stored in the local will change when operated by the user, when the client changes to an online state, the original local table can be obtained, and the local table is updated by scanning the local file, so as to obtain a new local table.
Optionally, determining the local table storing the local file information, the archive table generated after synchronization is completed, and the cloud table storing the cloud file information includes: according to the identification information of the pre-designated folder, a local table for storing local file information and an archive table generated after synchronization is completed are obtained, file information under the designated folder is obtained from a cloud, and a cloud table for storing cloud file information is generated.
The identification information of the designated folder may be, for example, an ID number that can uniquely identify the designated folder, or may be the name of the folder.
Optionally, if a state change event of the client is detected, a local file scanning module may be adopted, based on identification information of a pre-specified folder, scanning work on the specified folder is started locally, all files under the folder and subfolders thereof are acquired layer by layer in a horizontal scanning manner from outside to inside according to a hierarchy, names, paths, sizes of scanned files and FIDs of the files are extracted, and a local table is determined according to the scanned file information.
Alternatively, the file information under the folder can be pulled from the cloud according to the identification information of the pre-designated folder, all the files under the folder and the subfolders thereof are pulled layer by layer from outside to inside according to the hierarchy, the name, path, size and DOCID number of the pulled file are extracted, and the information is sequentially stored in the cloud table, so that the cloud table is generated.
S102, comparing the local table, the archive table and the cloud table, and determining the changed target file and the offline operation type of the target file before the state of the client is changed.
The offline operation category refers to an operation category of a file performed by a user before the state of the client is changed. The offline operation categories may be, for example, file update, file creation, file renaming, file movement, and file deletion.
Optionally, comparing the local table, the archive table and the cloud table to determine a changed target file, including: comparing the local table with the archive table according to the first identification of the file in the local table and the archive table, and determining a first target file which changes according to a comparison result; and comparing the cloud table with the archive table according to the second identification of the files in the cloud table and the archive table, and determining a changed second target file according to a comparison result.
The first identifier may be, for example, a FID number, and the first target file may be a file in which the local table and the archive table intersect and are concentrated. The second identifier may be, for example, a docd number, and the second target file may be a file in which the cloud table and the archive table intersect.
It should be noted that, different files can be distinguished through the first identifier in the local table, different files can be distinguished through the second identifier in the cloud table, and different files can be distinguished through the first identifier and the second identifier in the archive table.
Optionally, determining the first target file and the second target file that are changed includes: according to first identifications of files in the local table and the archive table, carrying out intersection operation on the local table and the archive table, determining a local difference set, a local archive difference set and a local intersection set, and taking the local difference set, the local archive difference set and the files in the local intersection set as first target files; according to the second identification of the files in the cloud table and the archive table, performing intersection operation on the cloud table and the archive table, determining a cloud difference set, a cloud archive difference set and a cloud intersection, and taking the files in the cloud difference set, the cloud archive difference set and the cloud intersection as second target files.
For example, the local table and the archive table may be subjected to a cross operation, and since the local FID of the file is not changed, the file information under the same FID is queried by using the FID of the file as a key. The local difference set of the generation set that exists in the local table and does not exist in the archive table, the local archive difference set of the generation set that exists in the local table, the local table and the local intersection set of the generation set that also exists in the archive table.
For example, the cloud table and the archive table may be subjected to an intersection operation, and since the docd of the file does not change in the cloud, the docd of the file is used as a keyword, and the file information under the same docd is queried by the continuous table. The cloud end list is used for generating a cloud end difference set which is not stored in the archive file list, the cloud end list is not stored in the archive file list, the cloud end archive difference set is generated in the archive file list, and the cloud end intersection set is generated in the cloud end list and the archive file list.
Optionally, comparing the local table, the archive table and the cloud table to determine an offline operation type of the target file before the state of the client is changed, including: according to the comparison result of the local table and the filing table, primarily determining the upward operation type of the target file, and according to the comparison result of the cloud table and the filing table, primarily determining the downward operation type of the target file; and determining the offline operation category of the file before the state change of the client according to the upward operation category and the downward operation category.
The upward operation refers to an operation of updating a local file to the cloud. The downward operation refers to merging and synchronizing the states of the cloud files to the client. The upward operation category may be, for example, newly created upward, deleted upward, updated upward, renamed upward, and moved upward. The down operation category may be, for example, down new, down delete, down update, down rename, and down move.
Optionally, the upward operation category may be determined according to the set category to which the first target file belongs, and the downward operation category may be determined according to the set category to which the second target file belongs. For example, if the aggregate category to which the first target file belongs is a local difference set, since the local difference set is a file that exists locally and is not archived, the file needs to be transmitted to the cloud and file information is written into the archive table, and is identified as an upwardly newly created file. The upward operation category thus determined is newly created upward. Similarly, the local archive difference set, i.e. the local table, does not exist, but exists in the archive table, the file needs to initiate a delete operation to the cloud, and is identified as an upward delete file, i.e. the determined upward operation category is upward delete.
Optionally, the local intersection, that is, files existing in the local table and the archive table, may further compare, for the first target file in the local intersection, an update time of the first target file, a name of the file, and a path where the file is located. If the update times are different, a request for updating the file needs to be initiated to the cloud, and the file is identified as an upward update, namely the determined upward operation type is upward update. If the file names are different, a renaming request needs to be sent to the cloud end, and the file is identified as an upward renaming file, namely the determined upward operation type is the upward renaming. If the file paths are different, a request for moving the file needs to be initiated to the cloud, and the file which is identified as moving upwards, namely the determined upward operation type is moving upwards.
Optionally, the second target file corresponding to the cloud difference set needs to be transmitted to the local, and is identified as a file newly created downwards, that is, the determined downward operation category is newly created downwards. The second target file corresponding to the cloud archive difference set needs to be deleted locally, and is identified as a downward-deleted file, namely the determined downward operation type is downward deletion.
Optionally, for the second target file in the cloud intersection, the version number, the file name and the file path information of the file need to be determined. If the file version numbers are different, a downward updated file is identified, i.e., the determined downward operation category is downward update. If the file names are different, a downward renamed file is identified, i.e., the determined downward operation category is downward renamed. If the file paths are different, a downward moving file is identified, i.e., the determined downward operation category is downward movement.
Optionally, determining the offline operation category of the file before the change of the client state according to the upward operation category and the downward operation category includes: if the upward operation category is newly established upward, and the downward operation category is newly established downward, determining that the offline operation category of the file before the state change of the client is file update; if the upward operation category is newly established upward, the downward operation category is deleted downward, and the offline operation category of the file before the state change of the client is determined to be file deletion; if the upward operation category is upward update and the downward operation category moves downward, determining that the offline operation category of the file before the state change of the client is file update and file movement.
It should be noted that, the upward operation category and the downward operation category may have 14 combinations of the upward new creation and downward new creation (1), the upward new creation and downward deletion (2), the upward deletion and downward update (3), the upward deletion and downward renaming (4), the upward deletion and downward movement (5), the upward update and downward update (6), the upward update and downward renaming (7), the upward update and downward movement (8), the upward renaming and downward update (9), the upward renaming and downward renaming (10), the upward renaming and downward movement (11), the upward movement and downward update (12), the upward movement and downward renaming (13), and the upward movement and downward movement (14).
Optionally, for the combination manner of the upward operation category and the downward operation category in the above 14, a final offline operation category may be determined, and specifically, the offline operation category corresponding to the combination of the upward operation category and the downward operation category in the above 14 is as follows: (1) identify file updates, (2) identify file new, (3) (4) (5) identify file deletions, (6) identify file updates, (7) identify file updates and file renames, (8) identify file updates and file moves, (9) identify file updates and file renames, (10) identify file renames, (11) identify file renames and file moves, (12) identify file moves and file updates, (13) identify file moves and file renames, and (14) identify file moves.
And S103, generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end.
Optionally, generating the file operation request according to the target file and the offline operation category includes: if the offline operation type is file update, generating a file update request according to the target file and the identification information of the target file; if the offline operation type is file renaming, generating a file renaming request according to the identification information and the new name of the target file.
For example, if the offline operation type is file update, the client may initiate a file operation request for file update, send the DOCID and the file content of the file to the cloud, instruct the cloud to match the file stored in the cloud according to the DOCID, update the stored file content and the stored corresponding file information, and may also update the cloud table.
If the offline operation type is file creation, the client may initiate a file operation request for file creation, send file information and file content to the cloud, instruct the cloud to create a DOCID, store the received file content and file information in the created file, and finally return the DOCID to the client, where the client stores the DOCID, the FID, and the corresponding file information in the file archive table.
For example, if the offline operation type is file renaming, the client may initiate a file renaming file operation request, send the DOCID of the file and the new name of the file to the cloud, instruct the cloud to match the received DOCID to the corresponding file, modify the name of the file, and update the stored file information.
If the offline operation type is file movement, the client may initiate a file operation request for file movement, send the DOCID of the file and the new path of the file to the cloud, instruct the cloud to match the corresponding file according to the received DOCID, move the file to the new path, and update the stored file information.
For example, if the offline operation type is file deletion, the client may initiate a file operation request for file deletion, send the DOCID of the file to the cloud, and the cloud matches the corresponding file according to the received DOCID, deletes the file and deletes the stored file information.
Optionally, the changed file may be synchronized to the cloud end to instruct the cloud end to update the cloud end table, so as to achieve file synchronization between the client and the cloud end.
The file FID is generated when the client scans the file, and is stored in the local table. The file DOCID is generated by the cloud, the file DOCID is stored in a cloud table when the cloud file information is pulled, after the file synchronization is completed, the FID and the DOCID of the file are stored in an archiving table, namely the FID and the DOCID exist in one record of the archiving table, when the file operation is identified by the intersection operation, the local table uses the FID, and the cloud table uses the DOCID, so that different codes identify the same file.
According to the technical scheme, if the state change event of the client is detected, a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information are determined; comparing the local table, the archive table and the cloud table to determine a changed target file and an offline operation type of the target file before the state of the client is changed; generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end. By the method, the scheme of analyzing the change condition of the file in offline after the client is online so as to realize the synchronization of the client and the cloud file is provided, the files of the client and the cloud can be more comprehensively analyzed after the state of the client is changed, and the operation of a user on the files is identified, so that the synchronization of the cloud and the client is realized, the accuracy of file synchronization is improved, and the problem of data loss caused by error coverage of the file in synchronous operation is avoided.
Example two
FIG. 2 is a flowchart of a file processing method according to a second embodiment of the present invention; the present embodiment provides a preferred example on the basis of the above-described embodiment.
As shown in fig. 2, the method comprises the following specific steps:
s201, acquiring a local table storing local file information according to the identification information of the pre-designated folder.
S202, determining an archiving table according to the last synchronization result of the client and the cloud.
S203, acquiring file information under the designated folder from the cloud according to the identification information of the designated folder in advance, and generating a cloud table.
S204, comparing the local table with the archive table according to the first identification of the file in the local table and the archive table, and determining a first target file which changes according to the comparison result.
S205, comparing the cloud table with the archive table according to the second identification of the files in the cloud table and the archive table, and determining a changed second target file according to a comparison result.
S206, primarily determining the upward operation type of the target file according to the comparison result of the local table and the archiving table, and primarily determining the downward operation type of the target file according to the comparison result of the cloud table and the archiving table.
S207, determining the offline operation category of the file before the state change of the client according to the upward operation category and the downward operation category.
S208, generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client end and the cloud end.
According to the technical scheme, after the user operates the file offline at the client (for example, after the user operates the file on the PC), when the client state is changed from the offline state to the online state, the operation condition of the user on the file offline at the client can be accurately identified, and therefore synchronization of the cloud end and the client file is achieved.
Example III
FIG. 3 is a block diagram of a document processing apparatus according to a third embodiment of the present invention; the embodiment is applicable to the situation that after the state of the client is changed, the files of the client local and cloud are synchronized, and is particularly applicable to the situation that after the state of the client is changed from offline to online, the operation of a user on the files in the offline state is detected so as to synchronize the files on the client and the cloud. As shown in fig. 3, the document processing apparatus specifically includes:
the first determining module 301 is configured to determine a local table storing local file information, an archive table generated after synchronization is completed, and a cloud table storing cloud file information if a state change event of a client is detected;
The second determining module 302 is configured to compare the local table, the archive table, and the cloud table, and determine a changed target file and an offline operation type of the target file before the client state is changed;
the sending module 303 is configured to generate a file operation request according to the target file and the offline operation category, and send the file operation request to the cloud end to instruct the cloud end to perform file operation, so as to realize file synchronization between the client and the cloud end.
According to the technical scheme, if the state change event of the client is detected, a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information are determined; comparing the local table, the archive table and the cloud table to determine a changed target file and an offline operation type of the target file before the state of the client is changed; generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end. Through the mode, after the state of the client is changed, the files of the client and the cloud can be more comprehensively analyzed, and the operation of a user on the files is identified, so that the synchronization of the cloud and the client is realized.
Further, the first determining module 301 is specifically configured to:
according to the identification information of the pre-designated folder, a local table for storing local file information and an archive table generated after synchronization is completed are obtained, file information under the designated folder is obtained from a cloud, and a cloud table for storing cloud file information is generated.
Further, the second determining module 302 is specifically configured to:
comparing the local table with the archive table according to the first identification of the file in the local table and the archive table, and determining a first target file which changes according to a comparison result;
and comparing the cloud table with the archive table according to the second identification of the files in the cloud table and the archive table, and determining a changed second target file according to a comparison result.
Further, the second determining module is further configured to:
according to first identifications of files in the local table and the archive table, carrying out intersection operation on the local table and the archive table, determining a local difference set, a local archive difference set and a local intersection set, and taking the local difference set, the local archive difference set and the files in the local intersection set as first target files;
according to the second identification of the files in the cloud table and the archive table, performing intersection operation on the cloud table and the archive table, determining a cloud difference set, a cloud archive difference set and a cloud intersection, and taking the files in the cloud difference set, the cloud archive difference set and the cloud intersection as second target files.
Further, the second determining module may include:
the preliminary determining unit is used for preliminarily determining the upward operation type of the target file according to the comparison result of the local table and the filing table, and preliminarily determining the downward operation type of the target file according to the comparison result of the cloud table and the filing table;
and the category determining unit is used for determining the offline operation category of the file before the state change of the client according to the upward operation category and the downward operation category.
Further, the category determining unit is specifically configured to:
if the upward operation category is newly established upward, and the downward operation category is newly established downward, determining that the offline operation category of the file before the state change of the client is file update;
if the upward operation category is newly established upward, the downward operation category is deleted downward, and the offline operation category of the file before the state change of the client is determined to be file deletion;
if the upward operation category is upward update and the downward operation category moves downward, determining that the offline operation category of the file before the state change of the client is file update and file movement.
Further, the sending module 303 is specifically configured to:
if the offline operation type is file update, generating a file update request according to the target file and the identification information of the target file;
If the offline operation type is file renaming, generating a file renaming request according to the identification information and the new name of the target file.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various kinds of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as a file processing method.
In some embodiments, the file processing method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the file processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the file processing method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A document processing method, comprising:
if a state change event of the client is detected, determining a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information;
comparing the local table, the archive table and the cloud table to determine a changed target file and an offline operation type of the target file before the state of the client is changed;
Generating a file operation request according to the target file and the offline operation category, and sending the file operation request to the cloud end to instruct the cloud end to perform file operation so as to realize file synchronization of the client and the cloud end.
2. The method of claim 1, wherein determining the local table storing the local file information, the archive table generated after synchronization is completed, and the cloud table storing the cloud file information comprises:
according to the identification information of the pre-designated folder, a local table for storing local file information and an archive table generated after synchronization is completed are obtained, file information under the designated folder is obtained from a cloud, and a cloud table for storing cloud file information is generated.
3. The method of claim 1, wherein comparing the local table, the archive table, and the cloud table to determine the changed target file comprises:
comparing the local table with the archive table according to the first identification of the file in the local table and the archive table, and determining a first target file which changes according to a comparison result;
and comparing the cloud table with the archive table according to the second identification of the files in the cloud table and the archive table, and determining a changed second target file according to a comparison result.
4. A method according to claim 3, wherein determining the changed first target file and second target file comprises:
according to first identifications of files in the local table and the archive table, carrying out intersection operation on the local table and the archive table, determining a local difference set, a local archive difference set and a local intersection set, and taking the local difference set, the local archive difference set and the files in the local intersection set as first target files;
according to the second identification of the files in the cloud table and the archive table, performing intersection operation on the cloud table and the archive table, determining a cloud difference set, a cloud archive difference set and a cloud intersection, and taking the files in the cloud difference set, the cloud archive difference set and the cloud intersection as second target files.
5. The method of claim 1, wherein comparing the local table, the archive table, and the cloud table to determine the offline operation category of the target file before the client state change comprises:
according to the comparison result of the local table and the filing table, primarily determining the upward operation type of the target file, and according to the comparison result of the cloud table and the filing table, primarily determining the downward operation type of the target file;
And determining the offline operation category of the file before the state change of the client according to the upward operation category and the downward operation category.
6. The method of claim 5, wherein determining the offline operation category for the file prior to the change in the client state based on the up operation category and the down operation category comprises:
if the upward operation category is newly established upward, and the downward operation category is newly established downward, determining that the offline operation category of the file before the state change of the client is file update;
if the upward operation category is newly established upward, the downward operation category is deleted downward, and the offline operation category of the file before the state change of the client is determined to be file deletion;
if the upward operation category is upward update and the downward operation category moves downward, determining that the offline operation category of the file before the state change of the client is file update and file movement.
7. The method of claim 1, wherein generating a file operation request based on the target file and the offline operation category comprises:
if the offline operation type is file update, generating a file update request according to the target file and the identification information of the target file;
If the offline operation type is file renaming, generating a file renaming request according to the identification information and the new name of the target file.
8. A document processing apparatus, comprising:
the first determining module is used for determining a local table for storing local file information, an archive table generated after synchronization is completed and a cloud table for storing cloud file information if a state change event of the client is detected;
the second determining module is used for comparing the local table, the filing table and the cloud table to determine the changed target file and the offline operation type of the target file before the state of the client is changed;
the sending module is used for generating a file operation request according to the target file and the offline operation category and sending the file operation request to the cloud end so as to instruct the cloud end to perform file operation and realize file synchronization of the client and the cloud end.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file processing method of any one of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement the file processing method of any one of claims 1-7 when executed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311204265.9A CN117149727B (en) | 2023-09-18 | 2023-09-18 | File processing method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311204265.9A CN117149727B (en) | 2023-09-18 | 2023-09-18 | File processing method, device, equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117149727A true CN117149727A (en) | 2023-12-01 |
| CN117149727B CN117149727B (en) | 2024-07-16 |
Family
ID=88886783
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311204265.9A Active CN117149727B (en) | 2023-09-18 | 2023-09-18 | File processing method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117149727B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2026020997A1 (en) * | 2024-07-25 | 2026-01-29 | 腾讯科技(深圳)有限公司 | File synchronization method and related apparatus |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104685485A (en) * | 2012-04-23 | 2015-06-03 | 谷歌公司 | Sharing and synchronizing electronically stored files |
| DE202013012504U1 (en) * | 2012-04-23 | 2017-01-30 | Google Inc. | Share and synchronize electronically stored files |
| CN107332918A (en) * | 2017-07-07 | 2017-11-07 | 上海斐讯数据通信技术有限公司 | A kind of high in the clouds local file synchronization realizing method and system |
| CN107426309A (en) * | 2017-07-17 | 2017-12-01 | 北京深思数盾科技股份有限公司 | A kind of information synchronization method, apparatus and system |
| CN112948340A (en) * | 2021-02-04 | 2021-06-11 | 北京金山云网络技术有限公司 | Data synchronization method and device, electronic equipment and readable storage medium |
| CN114328428A (en) * | 2021-12-30 | 2022-04-12 | 北京百度网讯科技有限公司 | File synchronization method and device, electronic equipment and storage medium |
-
2023
- 2023-09-18 CN CN202311204265.9A patent/CN117149727B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104685485A (en) * | 2012-04-23 | 2015-06-03 | 谷歌公司 | Sharing and synchronizing electronically stored files |
| DE202013012504U1 (en) * | 2012-04-23 | 2017-01-30 | Google Inc. | Share and synchronize electronically stored files |
| CN107332918A (en) * | 2017-07-07 | 2017-11-07 | 上海斐讯数据通信技术有限公司 | A kind of high in the clouds local file synchronization realizing method and system |
| CN107426309A (en) * | 2017-07-17 | 2017-12-01 | 北京深思数盾科技股份有限公司 | A kind of information synchronization method, apparatus and system |
| CN112948340A (en) * | 2021-02-04 | 2021-06-11 | 北京金山云网络技术有限公司 | Data synchronization method and device, electronic equipment and readable storage medium |
| CN114328428A (en) * | 2021-12-30 | 2022-04-12 | 北京百度网讯科技有限公司 | File synchronization method and device, electronic equipment and storage medium |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2026020997A1 (en) * | 2024-07-25 | 2026-01-29 | 腾讯科技(深圳)有限公司 | File synchronization method and related apparatus |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117149727B (en) | 2024-07-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN115454971A (en) | Data migration method, device, electronic device and storage medium | |
| CN115510058A (en) | A search method, device, equipment and storage medium for address book information | |
| CN117149727B (en) | File processing method, device, equipment and storage medium | |
| CN117149907B (en) | Data synchronization methods, devices, equipment and media | |
| CN118296076A (en) | Data synchronization method, device, equipment and storage medium | |
| CN117171296B (en) | Information acquisition methods, devices and electronic equipment | |
| CN117082046A (en) | Data upload methods, devices, equipment and storage media | |
| CN112714163A (en) | Data transmission method, data transmission device, electronic equipment, medium and computer program product | |
| CN115543691B (en) | Data backup method, device, equipment and medium for cloud native application | |
| CN118467631A (en) | Data synchronization method, device, equipment and storage medium | |
| CN114579059A (en) | File data migration method, device, equipment and storage medium | |
| CN110996124B (en) | Original video determination method and related equipment | |
| CN115329150A (en) | Method, apparatus, electronic device and storage medium for generating search condition tree | |
| CN115630123A (en) | Cross-system tree structure data synchronization method and related equipment | |
| CN114416040A (en) | A page construction method, apparatus, device and storage medium | |
| US12493586B2 (en) | Resolving conflicts during synchronization of document objects | |
| CN119669157B (en) | Method, device, equipment, and medium for file system operation processing | |
| CN117609209B (en) | Data recovery method, data recovery device, data recovery equipment, and storage medium | |
| CN113569144B (en) | Promotion content retrieval methods, devices, equipment, storage media and program products | |
| CN119002763B (en) | A content delivery method, apparatus, device, and storage medium | |
| US20230281009A1 (en) | Managing artifact information including finding a searched artifact information item | |
| CN117592449A (en) | Form generation method and device, electronic equipment and storage medium | |
| CN120670376A (en) | File sorting method and device | |
| CN115687282A (en) | File synchronization method and device, electronic equipment and storage medium | |
| CN119938785A (en) | Data breakpoint resuming transmission method, device and electronic device |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |