CN114138729A - File processing method, device, equipment and storage medium - Google Patents

File processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114138729A
CN114138729A CN202111483352.3A CN202111483352A CN114138729A CN 114138729 A CN114138729 A CN 114138729A CN 202111483352 A CN202111483352 A CN 202111483352A CN 114138729 A CN114138729 A CN 114138729A
Authority
CN
China
Prior art keywords
shared file
metadata
data
file
shared
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
CN202111483352.3A
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.)
Nanjing Opper Software Technology Co ltd
Original Assignee
Nanjing Opper Software 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 Nanjing Opper Software Technology Co ltd filed Critical Nanjing Opper Software Technology Co ltd
Priority to CN202111483352.3A priority Critical patent/CN114138729A/en
Publication of CN114138729A publication Critical patent/CN114138729A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file processing method, a file processing device, file processing equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: responding to an access instruction of the shared file in the second equipment, and acquiring first metadata and second metadata of the shared file; in the case that the first metadata is the same as the second metadata, a shared file stored by the first device is accessed. In response to an access instruction for a shared file in the second device, the method does not directly acquire the shared file from the second device, but compares the latest first metadata of the shared file in the second device with the second metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest first metadata and the second metadata are the same, the shared file stored in the local device is indicated to be valid.

Description

File processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a file processing method, apparatus, device, and storage medium.
Background
In daily work, users often need to share files to other users due to work cooperation, and under the condition, the files in the equipment can be set as shared files, so that other equipment except the equipment can also access the shared files, and the use of the files is greatly facilitated. However, in the related art, when accessing a shared file in another device, the shared file needs to be acquired from the other device first, which results in a slow access speed of the shared file.
Disclosure of Invention
The embodiment of the application provides a file processing method, a file processing device, file processing equipment and a storage medium, and the access speed of shared files can be improved. The technical scheme is as follows:
according to an aspect of the embodiments of the present application, there is provided a file processing method, performed by a first device, the method including:
responding to an access instruction of a shared file in a second device, and acquiring first metadata and second metadata of the shared file, wherein the first metadata is the latest metadata of the shared file in the second device, and the second metadata is the metadata of the shared file acquired when the shared file in the second device is accessed last time;
accessing the shared file stored by the first device if the first metadata is the same as the second metadata.
According to another aspect of the embodiments of the present application, there is provided a document processing apparatus configured to a first device, the apparatus including:
a data obtaining module, configured to obtain first metadata and second metadata of a shared file in response to an access instruction for the shared file in a second device, where the first metadata is latest metadata of the shared file in the second device, and the second metadata is metadata of the shared file obtained when the shared file in the second device is accessed last time;
and the data access module is used for accessing the shared file stored by the first device under the condition that the first metadata is the same as the second metadata.
According to another aspect of embodiments of the present application, there is provided a computer device comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement the file processing method as described in the above aspect.
According to another aspect of embodiments of the present application, there is provided a computer-readable storage medium storing at least one program code for execution by a processor to implement the file processing method according to the above aspect.
According to another aspect of the embodiments of the present application, there is provided a chip, which includes a programmable logic circuit and/or program instructions, and when the chip runs on a terminal, is used to implement the file processing method according to the above aspect.
According to another aspect of embodiments of the present application, there is provided a computer program product storing at least one program code for execution by a processor to implement the file processing method of the above aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
in the embodiment of the application, in response to an access instruction for a shared file in the second device, the shared file is not directly acquired from the second device, but the latest metadata of the shared file in the second device is compared with the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest metadata of the shared file is the same as the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, the shared file stored in the local device is indicated to be valid.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 illustrates a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 2 illustrates a flow chart of a method of document processing provided by an exemplary embodiment of the present application;
FIG. 3 illustrates a flow chart of another method of document processing provided by an exemplary embodiment of the present application;
FIG. 4 illustrates a flowchart of yet another method of document processing provided by an exemplary embodiment of the present application;
FIG. 5 is a flowchart illustrating yet another method of document processing provided by an exemplary embodiment of the present application;
FIG. 6 is a diagram illustrating a document processing process provided by an exemplary embodiment of the present application;
FIG. 7 is a block diagram illustrating a document processing apparatus according to an exemplary embodiment of the present application;
fig. 8 is a block diagram illustrating a structure of a terminal according to an exemplary embodiment of the present application;
fig. 9 is a block diagram illustrating a structure of a server according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
As used herein, the term "at least one" refers to one or more, and "a plurality" refers to two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) referred to in the present application is information authorized by the user or sufficiently authorized by each party. Illustratively, the user personal information includes shared files, metadata of the shared files, and the like.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to fig. 1, the implementation environment includes a first device 101 and a second device 102. The first device 101 and the second device 102 are connected via a wireless or wired network. Illustratively, the first device 101 and the second device 102 are a mobile phone, a desktop computer, a notebook computer, a tablet computer, a smart television, a smart speaker, a vehicle-mounted terminal, a smart robot, or other devices.
Wherein the second device 102 has a shared file set therein, and the first device 101 can access the shared file in the second device 102. Since the first device 101 has accessed the shared file in the second device 102 before accessing the shared file in the second device 102 this time, the first device 101 stores therein the shared file obtained when the shared file was accessed last time and metadata of the shared file, and therefore, when accessing the shared file in the second device 102 this time, the first device 101 compares the metadata of the shared file obtained when the shared file was accessed last time with the latest metadata of the shared file in the second device 102, and if the metadata of the shared file is the same, it indicates that the shared file obtained when the shared file was accessed last time is still valid, in this case, the shared file stored in the first device 101 is directly accessed, so as to improve the access speed of the shared file.
Illustratively, the first device 101 has installed thereon a file access application that is capable of accessing shared files in other devices. Illustratively, the file access application is also capable of accessing local files. The file access application is any application, for example, a live application, a short video application, a gaming application, a music application, a text editing application, and the like. Illustratively, the application is an application in an operating system of the first device 101, or an application provided by a third party.
The method provided by the embodiment of the application can be applied to scenes of accessing the shared video in other equipment. For example, when the local device accesses a shared video in another device for the first time, the accessed shared video is stored, and when the shared video in the device is accessed again subsequently, the metadata of the shared video obtained by the previous access and the latest metadata of the shared video in the device are compared, and if the metadata are the same, it indicates that the shared video in the local device is still valid, in this case, the shared video stored in the local device is directly accessed.
The method provided by the embodiment of the application can be applied to scenes of accessing the shared audio in other equipment. For example, when the local device accesses the shared audio in another device for the first time, the accessed shared audio is stored, and when the shared audio in the device is accessed again subsequently, the metadata of the shared audio obtained by the previous access and the latest metadata of the shared audio in the device are compared, and if the metadata of the shared audio is the same as the metadata of the shared audio in the device, it indicates that the shared audio in the local device is still valid, and in this case, the shared audio stored in the local device is directly accessed.
The method provided by the embodiment of the application can be applied to scenes of accessing the shared text in other devices. For example, when the local device accesses the shared text in another device for the first time, the accessed shared text is stored, and when the shared text in the device is accessed again subsequently, the metadata of the shared text obtained by the previous access and the latest metadata of the shared text in the device are compared, and if the metadata are the same, the shared text in the local device is still valid, in this case, the shared text stored in the local device is directly accessed.
The application scenarios described above are merely exemplary illustrations, and the method provided in the embodiment of the present application can also be applied to other scenarios.
Fig. 2 shows a flowchart of a file processing method provided in an exemplary embodiment of the present application, and referring to fig. 2, the method includes:
201. the first device responds to an access instruction of the shared file in the second device, and obtains first metadata and second metadata of the shared file, wherein the first metadata is the latest metadata of the shared file in the second device, and the second metadata is the metadata of the shared file obtained when the shared file in the second device is accessed last time.
Optionally, the shared file is any type of file, for example, the shared file is a video file, an audio file, a text file, and the like, which is not limited in this embodiment of the application. The metadata of the shared file is used to record the characteristics of the shared file, such as the access authority of the shared file, the owner of the shared file, the version of the shared file, the update time of the shared file, the storage location of the shared file, the data amount of the shared file, and the like. For example, when the storage location of the shared file is updated, the storage location recorded by the metadata of the shared file is also updated. For another example, when the content of the shared file is updated, the update time of the shared file recorded by the metadata of the shared file is also updated, or the version of the shared file recorded by the metadata of the shared file is updated.
The first metadata is the latest metadata of the shared file in the second device, that is, the first metadata is the metadata of the shared file currently in the second device. The first device obtains the shared file and the metadata of the shared file when accessing the shared file in the second device last time, and the metadata is the second metadata.
Since the shared file in the second device may have changed since a period of time has elapsed between the last access and the current access, that is, the shared file obtained by the first device in the last access may have failed, when the shared file in the second device is accessed this time, it is determined whether the shared file in the first device has failed. In an embodiment of the application, it is determined whether the shared file stored by the first device is invalid by comparing the second metadata with the first metadata.
202. The first device accesses the shared file stored by the first device when the first metadata is the same as the second metadata.
The first metadata and the second metadata are the same, which indicates that the shared file in the second device is unchanged from the shared file stored by the first device, that is, the shared file stored by the first device is valid, in this case, the first device directly accesses the locally stored shared file.
Optionally, the implementation manner of the first device accessing the locally stored shared file is as follows: the first device reads the shared file and exposes the shared file.
In the embodiment of the application, in response to an access instruction for a shared file in the second device, the shared file is not directly acquired from the second device, but the latest metadata of the shared file in the second device is compared with the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest metadata of the shared file is the same as the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, the shared file stored in the local device is indicated to be valid.
Fig. 3 is a flowchart illustrating a file processing method according to an exemplary embodiment of the present application, in which a shared file already stored in a first device is accessed, and in which the shared file is retrieved from a second device and the retrieved shared file is accessed. Referring to fig. 3, the method includes:
301. the first device sends a metadata acquisition request to the second device in response to an access instruction to the shared file in the second device, wherein the metadata acquisition request is used for requesting the latest metadata of the shared file.
Optionally, the first device displays a file selection interface, where the file selection interface includes shared files in at least one other device, and when a user wants to browse which shared file, a selection operation may be performed on the shared file.
Optionally, the metadata obtaining request carries a file identifier of the shared file, so that the second device queries the metadata of the shared file based on the file identifier. Of course, the metadata obtaining request may also carry other information, for example, an account currently logged in by the first device, which is not limited in this embodiment of the application.
302. The first device receives first metadata returned by the second device based on the metadata obtaining request.
After receiving the metadata acquisition request sent by the first device, the second device queries the current metadata of the shared file based on the metadata acquisition request, and sends the metadata to the first device. Optionally, the metadata obtaining request carries a file identifier of the shared file, and correspondingly, the second device queries the metadata of the shared file based on the file identifier.
In the embodiment of the present application, since the shared file is a shared file belonging to the second device, and the second device records the latest metadata of the shared file, in response to an access instruction to the shared file, the first metadata is acquired from the second device by sending a metadata acquisition request to the second device, so that it can be ensured that the acquired first metadata is the latest metadata of the shared file.
Optionally, the metadata obtaining request carries an account currently logged in by the first device, after receiving the metadata obtaining request, the second device determines a shared account of the shared file, where the shared account is an account authorized to access the shared file, and sends the first metadata to the first device when determining that the account currently logged in by the first device is the shared account, so that the security of the shared file can be improved.
303. The first device obtains second metadata of the shared file, wherein the second metadata is metadata of the shared file obtained when the shared file in the second device is accessed last time.
Optionally, the first device queries the second metadata of the shared file locally. When the first device accesses the shared file in the second device last time, the obtained shared file and the metadata of the shared file are stored, and when the first device accesses the shared file in the second device again later, the second metadata of the shared file can be directly inquired from the local.
It should be noted that, in the embodiment of the present application, there is no limitation on the sequence of the first device acquiring the first metadata and the second metadata.
304. And the first device accesses the shared file stored by the first device under the condition that the second metadata is obtained and the first metadata is the same as the second metadata.
In one possible implementation, the first metadata includes a first update time point, and the second metadata includes a second update time point. Correspondingly, the first device accesses the shared file stored by the first device under the condition that the first metadata is the same as the second metadata, and the method comprises the following steps: and the first device accesses the shared file stored by the first device under the condition that the first updating time point is the same as the second updating time point.
In this embodiment of the application, the first update time point and the second update time point are the same, which means that the content of the shared file stored in the first device is the same as the content of the shared file in the second device, that is, the shared file stored in the first device is valid.
In one possible implementation, the first metadata includes a first version number and the second metadata includes a second version number. The method for accessing the shared file stored by the first device under the condition that the first metadata is the same as the second metadata comprises the following steps: and the first equipment accesses the shared file stored by the first equipment under the condition that the first version number is the same as the second version number.
In this embodiment of the application, the first version number is the same as the second version number, which indicates that the content of the shared file stored in the first device is the same as the content of the shared file in the second device, that is, the shared file stored in the first device is valid.
305. And the first device acquires the shared file from the second device under the condition that the second metadata is acquired, but the first metadata is different from the second metadata or the second metadata is not acquired.
The second metadata obtained by the first device is different from the first metadata, which indicates that the content of the shared file stored by the first device is different from the content of the shared file in the second device, that is, the shared file stored by the first device has failed, and in this case, the first device needs to obtain the shared file from the second device. The first device does not acquire the second metadata, which indicates that the first device accesses the shared file in the second device for the first time, in this case, the first device does not store the shared file, and therefore the first device acquires the shared file from the second device.
Optionally, the first device sends a file obtaining request to the second device, where the file obtaining request carries the file identifier of the shared file. After receiving the file acquisition request, the second device queries the shared file corresponding to the file identifier, sends the shared file to the first device, and then the first device receives the shared file.
In this embodiment of the application, the first device may not obtain the second metadata of the shared file, which indicates that the shared file is not stored by the first device, and the second metadata obtained by the first device is different from the first metadata, which indicates that the shared file stored by the first device has failed.
In one possible implementation manner, the acquiring, by a first device, a shared file from a second device when the first metadata is different from the second metadata includes: the first equipment deletes the shared file stored by the first equipment under the condition that the first metadata is different from the second metadata; the shared file is obtained from the second device.
In this embodiment of the application, since the first metadata is different from the second metadata, it is indicated that the shared file stored by the first device has failed, and in this case, the shared file stored by the first device is deleted, so that not only the occupation of the storage space of the first device by the failed shared file can be avoided, but also the access to the failed shared file can be avoided.
Optionally, in the case that the first metadata is different from the second metadata, the first device further deletes the second metadata to reduce occupation of the storage space of the first device by the metadata of the failed shared file.
306. The first device stores the acquired shared file and accesses the stored shared file.
Since the shared file acquired by the first device from the second device this time is valid, the first device stores the shared file, and can directly access the shared file stored by the first device if the shared file stored by the first device is not invalid when the shared file in the second device is accessed again after the stored shared file is accessed.
Optionally, the first device stores the acquired shared file in a memory space, and then accesses the shared file in the memory space, so that the access speed of the shared file can be increased due to the fast data reading speed of the memory space. Optionally, the first device, in response to the exit access instruction, transfers the shared file in the memory space to the hard disk space, so that the shared file is prevented from being lost in the case of power failure.
In one possible implementation manner, the storing, by the first device, the acquired shared file includes: the first device stores the acquired shared file and the first metadata. Optionally, the storage manner of the first metadata and the shared file is the same, and is not described herein again.
In the embodiment of the present application, the first metadata of the valid shared file obtained by the current access is stored, and when the shared file in the second device is accessed next time, whether the shared file stored in the first device is invalid or not can be determined based on the first metadata, so as to determine the manner of accessing the shared file.
In the embodiment of the application, in response to an access instruction for a shared file in the second device, the shared file is not directly acquired from the second device, but the latest metadata of the shared file in the second device is compared with the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest metadata of the shared file is the same as the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, the shared file stored in the local device is indicated to be valid.
Fig. 4 is a flowchart illustrating a file processing method according to an exemplary embodiment of the present application, where the embodiment describes a manner of accessing a shared file obtained in a last access when the shared file is stored in a hard disk space of a first device. Referring to fig. 4, the method includes:
401. the first device responds to an access instruction of the shared file in the second device, and obtains first metadata and second metadata of the shared file, wherein the first metadata is the latest metadata of the shared file in the second device, and the second metadata is the metadata of the shared file obtained when the shared file in the second device is accessed last time.
The implementation of this step is shown in the above steps 201 and 301-303.
402. And the first equipment transfers the shared file in the hard disk space to the memory space of the first equipment under the condition that the first metadata is the same as the second metadata.
In the embodiment of the present application, it is considered that the data reading speed of the memory space is high, and therefore, the shared file is transferred from the disk space to the memory space, the shared file in the memory space is accessed, and the access speed of the shared file can be improved.
Optionally, the first device obtains the shared file from the second device when the first metadata is different from the second metadata, stores the shared file in a memory space of the first device, and then accesses the shared file in the memory space. Optionally, in the case that the first metadata is different from the second metadata, the first device further deletes the shared file in the hard disk space to avoid occupation of the hard disk storage space by the failed shared file.
Optionally, the first device acquires the shared file from the second device, stores the shared file in a memory space of the first device, and then accesses the shared file in the memory space, when the second metadata is not acquired.
403. The first device accesses a shared file in the memory space.
Optionally, the implementation manner of the first device accessing the shared file in the memory space is as follows: the first device reads the shared file in the memory space and displays the shared file.
404. And the first equipment responds to the quit access instruction and transfers the shared file in the memory space to the hard disk space.
Optionally, when the first device accesses the shared file, if the user does not want to continue accessing the shared file, the first device may perform an exit access operation, and correspondingly, the first device generates an exit access instruction in response to the exit access operation. Optionally, the exit access operation comprises a close operation to the shared file.
In the embodiment of the application, data in the hard disk space can be stored persistently, so that the shared file in the memory space is transferred to the disk space when the access quits, and the loss of the shared file can be avoided.
In the embodiment of the application, in response to an access instruction for a shared file in the second device, the shared file is not directly acquired from the second device, but the latest metadata of the shared file in the second device is compared with the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest metadata of the shared file is the same as the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, the shared file stored in the local device is indicated to be valid.
Fig. 5 is a flowchart illustrating a file processing method according to an exemplary embodiment of the present application, which describes a manner of accessing the shared file in a case where part of data of the shared file is stored locally. Referring to fig. 5, the method includes:
501. the first device responds to an access instruction of the shared file in the second device, and obtains first metadata and second metadata of the shared file, wherein the first metadata is the latest metadata of the shared file in the second device, and the second metadata is the metadata of the shared file obtained when the shared file in the second device is accessed last time.
The implementation of this step is shown in the above steps 201 and 301-303.
502. The first device accesses a first portion of data stored by the first device if the first metadata is the same as the second metadata.
Wherein the first portion of data was obtained from the second device the last time the shared file in the second device was accessed. Optionally, a first part of data of the shared file is stored in a hard disk space of the first device, and accordingly, an implementation manner of accessing the first part of data by the first device is as follows: the first device transfers the first part of data in the hard disk space to the memory space of the first device, and accesses the first part of data in the memory space.
In the embodiment of the application, part of data of the shared file of the second device is stored in the first device, and the part of data in the first device is accessed under the condition that the first metadata is the same as the second metadata, so that the access speed of the shared file can be improved, and the occupation of the shared file on the storage space of the first device can be reduced.
Optionally, the first device obtains a first part of data of the shared file from the second device when the first metadata is different from the second metadata, stores the first part of data in a memory space of the first device, and then accesses the first part of data in the memory space. Optionally, in the case that the first metadata is different from the second metadata, the first device further deletes the first portion of data in the hard disk space to avoid occupation of the storage space by the data of the failed shared file.
Optionally, the first device acquires the first part of data of the shared file from the second device, stores the first part of data in a memory space of the first device, and then accesses the first part of data in the memory space, when the second metadata is not acquired.
503. And the first equipment acquires the second part of data of the shared file from the second equipment and stores the second part of data under the condition that the access progress of the first part of data reaches the reference access progress.
Optionally, the first device sends a data obtaining request to the second device, where the data obtaining request is used to request data other than the first part of data of the shared file. And the second device receives the data acquisition request and sends the second part of data of the shared file to the first device.
Optionally, the reference access progress is an arbitrary progress, for example, the reference access progress is 90%.
In the embodiment of the application, under the condition that the access progress of the first part of data reaches the reference access progress, the second part of data of the shared file is obtained from the second device, and the second part of data stored in the first device can be accessed immediately under the condition that the access of the first part of data is completed, so that the access speed of the shared file is improved.
504. And the first device accesses the second part of data stored by the first device under the condition that the first part of data access is completed.
In one possible implementation manner, in step 503, the first device stores the second part of data, including: the first device stores the second portion of data in the memory space. Correspondingly, the first device accesses the second part of data stored by the first device when the access of the first part of data is completed, and the method comprises the following steps: and the first device accesses the second part of data in the memory space under the condition that the first part of data is completely accessed.
In the embodiment of the application, since the data reading speed of the memory space is high, the second part of data of the shared file acquired from the second device is stored in the memory space, and the second part of data in the memory space can be directly accessed under the condition that the access of the first part of data of the shared file is completed, so that the access speed of the shared file is ensured.
Optionally, the first device obtains a third part of data of the shared file from the second device and stores the third part of data when the access progress of the second part of data reaches the reference access progress, and accesses the third part of data stored by the first device when the access of the second part of data is completed, and so on until exiting the access of the shared file.
Optionally, the first device, in response to the exit access operation, transfers the data of the shared file in the memory space to the hard disk space, so that when the subsequent first device accesses the shared file in the second device again, if the data of the shared file stored in the first device is not invalid, the data of the shared file stored in the first device can be directly accessed, so as to improve the access speed of the shared file.
Optionally, the first device, in response to the exit access operation, transfers all data of the shared file in the memory space to the hard disk space. Optionally, in order to reduce the occupation of the hard disk space of the first device, the first device may transfer the data of the shared file with the reference data size from the memory space to the hard disk space. The reference data amount is any data amount, for example, 4 megabits, and the embodiment of the present application does not limit this.
Fig. 6 is a schematic diagram of a file access process provided in an embodiment of the present application. Referring to fig. 6, the first device determines whether a locally stored shared file is valid in response to an access instruction to the shared file in the second device, and if so, reads the shared file locally to expose the shared file. And if the locally stored shared file is invalid, deleting the locally stored shared file, acquiring the shared file from the second equipment, storing the shared file, reading the shared file from the local equipment, and displaying the shared file.
Optionally, in this embodiment of the present application, the first device completes access to the shared file of the second device through cooperation of the file access application and the operating system. For example, the file access application configures a memory space for storing the shared file of the second device in response to an access instruction for the shared file in the second device. Then, the first device obtains the first metadata and the second metadata through the operating system, under the condition that the first metadata and the second metadata are the same, the shared file in the hard disk space is stored to the configured memory space, the shared file is read from the memory space, the read shared file is sent to the file access application, and then the file access application receives the shared file and displays the shared file. The method comprises the steps that a first device deletes a shared file stored in a hard disk space through an operating system under the condition that first metadata and second metadata are different, then obtains the shared file from a second device, stores the shared file in a configured memory space, then reads the shared file from the memory space, sends the read shared file to a file access application, and then the file access application receives the shared file and displays the shared file. Optionally, the first device notifies the operating system through the file access application in response to the exit access instruction, and then the operating system stops reading the shared file and unloads the shared file in the memory space to the hard disk space. Optionally, the operating system includes a shared file system for accessing shared files of other devices. Correspondingly, the first device is matched with a shared file system in the operating system through the file access application to finish access to the shared file of the second device.
In the embodiment of the application, in response to an access instruction for a shared file in the second device, the shared file is not directly acquired from the second device, but the latest metadata of the shared file in the second device is compared with the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest metadata of the shared file is the same as the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, the shared file stored in the local device is indicated to be valid.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, a block diagram of a document processing apparatus according to an exemplary embodiment of the present application is shown. The document processing apparatus is configured on a first device, and the document processing apparatus includes:
a data obtaining module 701, configured to, in response to an access instruction for a shared file in a second device, obtain first metadata and second metadata of the shared file, where the first metadata is latest metadata of the shared file in the second device, and the second metadata is metadata of the shared file obtained when the shared file in the second device is accessed last time;
a data access module 702, configured to access a shared file stored by the first device if the first metadata is the same as the second metadata.
In the embodiment of the application, in response to an access instruction for a shared file in the second device, the shared file is not directly acquired from the second device, but the latest metadata of the shared file in the second device is compared with the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, and if the latest metadata of the shared file is the same as the metadata of the shared file acquired when the local device accesses the shared file in the second device last time, the shared file stored in the local device is indicated to be valid.
In one possible implementation, the first metadata includes a first update time point, and the second metadata includes a second update time point;
and a data access module 702, configured to access the shared file stored in the first device when the first update time point is the same as the second update time point.
In one possible implementation, the first metadata includes a first version number, and the second metadata includes a second version number;
and a data access module 702, configured to access the shared file stored by the first device when the first version number is the same as the second version number.
In a possible implementation manner, the data obtaining module 701 is configured to send a metadata obtaining request to the second device, where the metadata obtaining request is used to request for the latest metadata of the shared file; and receiving first metadata returned by the second device based on the metadata acquisition request.
In a possible implementation manner, the shared file is stored in a hard disk space of the first device, and the data access module 702 is configured to forward the shared file in the hard disk space to a memory space of the first device;
a data access module 702, configured to access a shared file in a memory space.
In a possible implementation manner, the data access module 702 is further configured to, in response to the exit access instruction, dump the shared file in the memory space into the hard disk space.
In a possible implementation manner, the first device stores a first part of data of the shared file, and the data access module 702 is configured to access the first part of data stored by the first device.
In one possible implementation, the data access module 702 includes:
a data acquisition unit configured to acquire a second part of data of the shared file from the second device in a case where the access progress of the first part of data reaches the reference access progress;
a data storage unit for storing the second part of data;
and the data access unit is used for accessing the second part of data stored by the first device under the condition that the first part of data is completely accessed.
In a possible implementation manner, the data storage unit is configured to store the second part of data in the memory space;
and the data access unit is used for accessing the second part of data in the memory space under the condition that the first part of data is completely accessed.
In a possible implementation manner, the data obtaining module 701 is further configured to obtain the shared file from the second device if the second metadata is not obtained, or obtain the shared file from the second device if the first metadata is different from the second metadata;
the device still includes:
the data storage module is used for storing the acquired shared file;
and a data access module 702 for accessing the stored shared file.
In a possible implementation manner, the data storage module is configured to store the acquired shared file and the first metadata.
In one possible implementation, the apparatus further includes:
the file deleting module is used for deleting the shared file stored in the first equipment under the condition that the first metadata is different from the second metadata; the shared file is obtained from the second device.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the computer device may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The embodiment of the application provides computer equipment, which comprises a processor and a memory; the memory stores at least one program code for execution by the processor to implement the file processing method provided by the various method embodiments described above.
In some embodiments, the computer device is a terminal, please refer to fig. 8, which shows a block diagram of a terminal according to an exemplary embodiment of the present application. In some embodiments, the terminal 800 is a smartphone, tablet, wearable device, or the like capable of accessing a wireless local area network as a wireless station. The terminal 800 in the present application includes at least one or more of the following components: a processor 810, a memory 820, and at least two wireless links 830.
In some embodiments, processor 810 includes one or more processing cores. The processor 810 connects various parts within the entire terminal 800 using various interfaces and lines, performs various functions of the terminal 800 and processes data by operating or executing program codes stored in the memory 820 and calling data stored in the memory 820. In some embodiments, the processor 810 is implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 810 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-Network Processing Unit (NPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the NPU is used for realizing an Artificial Intelligence (AI) function; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 810, but may be implemented by a single chip.
In some embodiments, the processor 810 is configured to control the operation of at least two Wireless links 830, and accordingly, the processor 810 is a processor integrated with a Wireless Fidelity (Wi-Fi) chip. Wherein, the Wi-Fi chip is a chip with double Wi-Fi processing capacity. For example, the Wi-Fi chip is a Dual Band Dual Current (DBDC) chip, a Dual Band Simultaneous (DBS) chip, or the like.
In some embodiments, Memory 820 comprises a Random Access Memory (RAM), and in some embodiments, Memory 820 comprises a Read-Only Memory (ROM). In some embodiments, the memory 820 includes a non-transitory computer-readable medium. Memory 820 may be used to store program code. The memory 820 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the storage data area may store data (such as audio data, a phonebook) created according to the use of the terminal 800, and the like.
In some embodiments, memory 820 stores different reception schemes for receiving beacon frames for wireless link 830. And the identity of the access node to which the different radio link 830 is connected, the identity of the radio link 830, etc.
The at least two wireless links 830 are used to connect different Access Points (APs). And receiving downlink data issued by the AP. Wherein, the different access nodes are the access nodes in the same router or the access nodes in different routers.
In some embodiments, a display screen is also included in terminal 800. A display screen is a display component for displaying a user interface. In some embodiments, the display screen is a display screen with a touch function, and a user can perform a touch operation on the display screen by using any suitable object such as a finger, a touch pen, and the like. In some embodiments, the display is typically provided on the front panel of the terminal 800. In some embodiments, the display screen is designed as a full-face screen, curved screen, contoured screen, double-face screen, or folded screen. In some embodiments, the display screen is further designed to be a combination of a full-face screen and a curved-face screen, a combination of a special-shaped screen and a curved-face screen, and the like, which is not limited by the embodiment.
In addition, those skilled in the art will appreciate that the configuration of terminal 800 illustrated in the above-described figures is not meant to be limiting with respect to terminal 800, as terminal 800 may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components. For example, the terminal 800 further includes a microphone, a speaker, an input unit, a sensor, an audio circuit, a module, a power supply, a bluetooth module, and other components, which are not described herein again.
In some embodiments, the computer device is a server, please refer to fig. 9, which shows a block diagram of a server provided in an exemplary embodiment of the present application, and the server 900 may generate a large difference due to different configurations or performances, and may include one or more processors (CPUs) 901 and one or more memories 902, where the memories 902 store at least one program code, and the at least one program code is loaded and executed by the processors 901 to implement the methods provided by the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The present application also provides a computer-readable storage medium storing at least one program code, which is loaded and executed by the processor to implement the file processing method as shown in the above embodiments.
The present application also provides a chip comprising programmable logic circuits and/or program instructions for implementing the file processing method as shown in the above embodiments when the chip is run on a terminal.
The present application also provides a computer program product having at least one program code stored therein for execution by a processor to implement the file processing method as shown in the various embodiments above.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps in the file processing method for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc. The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (16)

1. A method of file processing, performed by a first device, the method comprising:
responding to an access instruction of a shared file in a second device, and acquiring first metadata and second metadata of the shared file, wherein the first metadata is the latest metadata of the shared file in the second device, and the second metadata is the metadata of the shared file acquired when the shared file in the second device is accessed last time;
accessing the shared file stored by the first device if the first metadata is the same as the second metadata.
2. The method of claim 1,
the first metadata comprises a first update time point, and the second metadata comprises a second update time point;
the accessing the shared file stored by the first device in the case that the first metadata is the same as the second metadata includes:
and accessing the shared file stored by the first device under the condition that the first updating time point is the same as the second updating time point.
3. The method of claim 1,
the first metadata comprises a first version number and the second metadata comprises a second version number;
the accessing the shared file stored by the first device in the case that the first metadata is the same as the second metadata includes:
and accessing the shared file stored by the first device under the condition that the first version number is the same as the second version number.
4. The method of claim 1, wherein obtaining the first metadata of the shared file comprises:
sending a metadata obtaining request to the second device, wherein the metadata obtaining request is used for requesting the latest metadata of the shared file;
receiving the first metadata returned by the second device based on the metadata obtaining request.
5. The method of claim 1, wherein the shared file is stored in a hard disk space of the first device, and wherein the accessing the shared file stored by the first device comprises:
transferring the shared file in the hard disk space to a memory space of the first device;
the accessing the shared file stored by the first device includes:
and accessing the shared file in the memory space.
6. The method of claim 5, further comprising:
and responding to an exit access instruction, and transferring the shared file in the memory space to the hard disk space.
7. The method of claim 1, wherein the first device stores a first portion of data of the shared file, and wherein the accessing the shared file stored by the first device comprises:
accessing the first portion of data stored by the first device.
8. The method of claim 7, further comprising:
under the condition that the access progress of the first part of data reaches a reference access progress, acquiring a second part of data of the shared file from the second equipment;
storing the second portion of data;
and accessing the second part of data stored by the first device when the first part of data is completely accessed.
9. The method of claim 8, wherein the storing the second portion of data comprises:
storing the second part of data in a memory space;
the accessing the second part of data stored by the first device in the case that the accessing of the first part of data is completed comprises:
and accessing the second part of data in the memory space under the condition that the first part of data is completely accessed.
10. The method according to any one of claims 1-9, further comprising:
acquiring the shared file from the second device if the second metadata is not acquired, or acquiring the shared file from the second device if the first metadata is different from the second metadata;
storing the acquired shared file;
accessing the stored shared file.
11. The method of claim 10, wherein the storing the obtained shared file comprises:
and storing the acquired shared file and the first metadata.
12. The method according to claim 10, wherein the obtaining the shared file from the second device if the first metadata is different from the second metadata comprises:
deleting the shared file stored by the first device if the first metadata is different from the second metadata;
and acquiring the shared file from the second device.
13. A document processing apparatus, provided in a first device, the apparatus comprising:
a data obtaining module, configured to obtain first metadata and second metadata of a shared file in response to an access instruction for the shared file in a second device, where the first metadata is latest metadata of the shared file in the second device, and the second metadata is metadata of the shared file obtained when the shared file in the second device is accessed last time;
and the data access module is used for accessing the shared file stored by the first device under the condition that the first metadata is the same as the second metadata.
14. A computer device, wherein the computer device comprises a processor and a memory; the memory stores at least one program code for execution by the processor to implement the file processing method of any of claims 1 to 12.
15. A computer-readable storage medium, characterized in that the storage medium stores at least one program code for execution by a processor to implement the file processing method according to any one of claims 1 to 12.
16. A chip comprising programmable logic circuits and/or program instructions for implementing a file processing method as claimed in any one of claims 1 to 12 when said chip is run on a terminal.
CN202111483352.3A 2021-12-07 2021-12-07 File processing method, device, equipment and storage medium Pending CN114138729A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111483352.3A CN114138729A (en) 2021-12-07 2021-12-07 File processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111483352.3A CN114138729A (en) 2021-12-07 2021-12-07 File processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114138729A true CN114138729A (en) 2022-03-04

Family

ID=80384793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111483352.3A Pending CN114138729A (en) 2021-12-07 2021-12-07 File processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114138729A (en)

Similar Documents

Publication Publication Date Title
JP7397094B2 (en) Resource configuration method, resource configuration device, computer equipment, and computer program
CN110674624B (en) Method and system for editing graphics context
US11232066B2 (en) Method for data migration and terminal
WO2020088681A1 (en) Management method for model files and terminal device
US10642817B2 (en) Index table update method, and device
CN114637703B (en) Data access device, method, readable medium and electronic equipment
CN113163255B (en) Video playing method, device, terminal and storage medium
WO2024120355A1 (en) Association information display method and apparatus, device, storage medium, and program product
CN111367561B (en) Remote development method and device for software program
CN114138729A (en) File processing method, device, equipment and storage medium
CN115150829B (en) Network access authority management method and device
CN107168648B (en) File storage method and device and terminal
CN111767345B (en) Modeling data synchronization method, modeling data synchronization device, computer equipment and readable storage medium
CN112286947B (en) Method and device for keeping data consistency of different storage systems
JP2023539879A (en) Methods and electronic devices for reusing shared libraries
CN111090530A (en) Distributed cross-interprocess communication bus system
CN104753969A (en) Method and device for synchronizing clipboard content information
US11763528B2 (en) Avatar mobility between virtual reality spaces
CN112783860B (en) Method, device, storage medium and computer equipment for constructing mirror image database
CN117112044B (en) Instruction processing method, device, equipment and medium based on network card
CN110855539B (en) Device discovery method, device and storage medium
WO2024109388A1 (en) Feature synchronization method and apparatus, and computer device, storage medium and program product
CN115878179A (en) Information processing method, information processing device, computer equipment and storage medium
WO2023216730A1 (en) Privacy protection method and apparatus for social network, electronic device, computer readable storage medium, and computer program product
CN117519581A (en) First electronic device and processing method

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