CN115878676B - Method, device, equipment and medium for previewing file - Google Patents

Method, device, equipment and medium for previewing file Download PDF

Info

Publication number
CN115878676B
CN115878676B CN202310077586.0A CN202310077586A CN115878676B CN 115878676 B CN115878676 B CN 115878676B CN 202310077586 A CN202310077586 A CN 202310077586A CN 115878676 B CN115878676 B CN 115878676B
Authority
CN
China
Prior art keywords
file
previewed
target
local cache
preview
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.)
Active
Application number
CN202310077586.0A
Other languages
Chinese (zh)
Other versions
CN115878676A (en
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.)
Chengdu Shulian Cloud Computing Technology Co ltd
Original Assignee
Chengdu Shulian Cloud Computing 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 Chengdu Shulian Cloud Computing Technology Co ltd filed Critical Chengdu Shulian Cloud Computing Technology Co ltd
Priority to CN202310077586.0A priority Critical patent/CN115878676B/en
Publication of CN115878676A publication Critical patent/CN115878676A/en
Application granted granted Critical
Publication of CN115878676B publication Critical patent/CN115878676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application discloses a method, a device, equipment and a medium for previewing a file, and relates to the field of file previewing. The method comprises the steps of receiving target operation of a user on file link; generating a preview request based on the target operation; searching whether a target file to be previewed corresponding to the target hash value exists in a local cache based on the target hash value; and if the target file to be previewed exists in the local cache, opening the target file to be previewed from the local cache so as to preview the target file to be previewed. That is, the method pre-downloads the files to the local cache simultaneously in advance, so that the files are directly opened from the local when the files are previewed, and the time for previewing the files is obviously saved. And in the request process, the accuracy of the preview is ensured by uniquely determining the hash value.

Description

Method, device, equipment and medium for previewing file
Technical Field
The present disclosure relates to the field of file previewing technologies, and in particular, to a method, an apparatus, a device, and a medium for previewing a file.
Background
In an operating system (e.g., android) of an electronic device, previewing cloud files through links is often encountered within some applications. For example, in a meeting APP, previews are often opened directly through links within the application in order not to jump out of the application open file. In the existing method, after clicking a file, a user directly starts downloading the file, displays progress bar downloading, and calls a supported application to open the file preview after the downloading is completed.
It can be seen that the existing method for browsing files has long waiting time for users and low previewing efficiency.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for previewing files, which solve the technical problems of longer waiting time and lower previewing efficiency of users in the existing method for browsing files.
In one aspect, an embodiment of the present application provides a method for previewing a file, including:
receiving target operation of a user on file link;
generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed;
searching whether a target file to be previewed corresponding to the target hash value exists in a local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed;
and if the target file to be previewed exists in the local cache, opening the target file to be previewed from the local cache so as to preview the target file to be previewed.
Optionally, before the step of receiving the preview operation of the file link by the user, the method further includes:
downloading a plurality of files to be previewed from a server;
generating a plurality of corresponding hash values based on file information of the files to be previewed;
and carrying out local caching on the downloaded files to be previewed and the corresponding hash values.
In this embodiment, the download is improved, so that the file can be directly opened from the local when in preview request, and the preview request time of the file is remarkably saved.
Optionally, before the step of downloading the plurality of files to be previewed from the server, the method further includes:
acquiring a first file list to be downloaded from a server, wherein the first file list comprises file information of a plurality of files to be previewed;
the step of downloading a plurality of files to be previewed from the server comprises the following steps:
and downloading a plurality of files to be previewed from a server through multiple threads based on the first file list.
In this embodiment, the purpose of maintaining the first file list is to facilitate download management, and in this embodiment, based on the first file list, the downloading efficiency may be improved through multi-thread parallel downloading.
Optionally, after the step of locally caching the downloaded files to be previewed and the corresponding hash values, the method further includes:
acquiring a second file list to be downloaded from a server, wherein the second file list at least comprises unknown file information of unknown preview files;
generating an unknown hash value based on the unknown file information;
judging whether the unknown hash value is the same as the hash value corresponding to the file information in the files to be previewed;
and if not, downloading the unknown preview file from the server based on the second file list.
In this embodiment, only when the position preview file corresponding to the unknown hash value does not exist in the local cache, the unknown preview file is downloaded from the server based on the second file list, otherwise, the unknown preview file is not downloaded any more, so that resources can be saved, and the limited local storage space is prevented from being occupied.
Optionally, if not, the step of downloading the unknown preview file from the server based on the second file list includes:
if not, outputting a confirmation request for downloading the unknown preview file;
and after receiving the confirmation downloading operation of the user, downloading the unknown preview file from the server based on the second file list.
In this embodiment, even in applications, different application scenarios and different time periods, the demands for files are different, so in order to ensure efficient local storage space utilization to the maximum extent, the method of this embodiment performs user reconfirmation before downloading.
Optionally, after the step of outputting a confirmation request of whether to download the unknown preview file, the method further includes:
and after receiving the confirmation preview operation of the user, directly loading and opening the unknown preview file from the server.
Optionally, after the step of determining whether the unknown hash value is the same as the hash value corresponding to the file information in the files to be previewed, the method further includes:
and if the unknown file information is the same as the file information in the files to be previewed, discarding downloading the unknown preview file.
Optionally, the method further comprises:
acquiring a third file list from a server; the third file list comprises file information of files to be downloaded in the server;
generating a plurality of corresponding verification hash values based on the file information in the third file list;
judging whether the file to be previewed which does not exist in the third file list exists in the local cache or not based on the verification hash value and the hash value stored in the local cache;
if yes, deleting the file to be previewed which does not exist in the third file list in the local cache.
In this embodiment, if there is no file already present in the server that is present in the local cache, it is representative that the preview file may not have been worth previewing. The files to be previewed which are not in the third file list in the local cache are deleted, specifically, the files to be previewed may be screened periodically according to the method of the embodiment, or may be screened when downloading each time, so as to see whether redundant previewed files exist locally. Further reduces the storage pressure of the local equipment and improves the operation smoothness.
Optionally, if the target file to be previewed exists in the local cache, the step of opening the target file to be previewed from the local cache further includes:
and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using a target plug-in the application program where the file link is located.
In the embodiment, the target file to be previewed is opened directly in the same application, and when the target file to be previewed needs to be jumped between applications without calling other programs, the smoothness and efficiency of file previewing are further improved.
Optionally, the application program is a conference application program, and the format of the target file to be previewed is an office file format; and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using a target plug-in an application program where the file link is located, wherein the step comprises the following steps:
and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using an office plug-in the conference application program.
In this embodiment, the target file to be previewed is opened directly in the same application, so that the application needs to jump when the target file to be previewed is caused without calling other programs, and the smoothness and efficiency of file previewing are further improved.
In still another aspect, an embodiment of the present application provides an apparatus for previewing a document, including:
the operation receiving module is used for receiving target operation of the file link by a user;
the request generation module is used for generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed;
the file searching module is used for searching whether a target file to be previewed corresponding to the target hash value exists in the local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed;
and the file previewing module is used for opening the target file to be previewed from the local cache if the target file to be previewed exists in the local cache, so as to preview the target file to be previewed.
In yet another aspect, an embodiment of the present application provides an electronic device, including: the device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to realize the method.
In yet another aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, the processor executing the computer program to implement the foregoing method.
The embodiment of the application provides a method, a device, equipment and a medium for previewing a file, wherein the method receives target operation of a user on file link; generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed; searching whether a target file to be previewed corresponding to the target hash value exists in a local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed; and if the target file to be previewed exists in the local cache, opening the target file to be previewed from the local cache so as to preview the target file to be previewed. That is, the method pre-downloads the files to the local cache simultaneously in advance, so that the files are directly opened from the local when the files are previewed, and the time for previewing the files is obviously saved. And in the request process, the accuracy of the preview is ensured by uniquely determining the hash value.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for previewing documents according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for downloading a preview document according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another method for downloading a preview document according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus for previewing documents according to an embodiment of the present application.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The main solutions of the embodiments of the present application are: receiving target operation of a user on file link; generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed; searching whether a target file to be previewed corresponding to the target hash value exists in a local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed; and if the target file to be previewed exists in the local cache, opening the target file to be previewed from the local cache so as to preview the target file to be previewed.
In the prior art, online downloading and preview opening in an application of an intelligent terminal device (for example, an Android system) is a common situation, such as clicking a link for downloading, and it is common practice to wait until a user clicks to download, and after downloading, the application is opened in other applications through supported applications. For example, in a meeting APP, previews are often opened directly through links within the application in order not to jump out of the application open file. In the existing method, after clicking a file, a user directly starts downloading the file, displays progress bar downloading, and calls a supported application to open the file preview after the downloading is completed. It can be seen that the existing method for browsing files has long waiting time for users and low previewing efficiency.
Therefore, the method and the device provide a solution for simultaneously pre-downloading multiple files to a local cache on equipment in advance, so that the files are directly opened from the local when in preview request, and the preview request time of the files is remarkably saved. And in the requesting process, the accuracy of calling the preview file is ensured by uniquely determining the hash value.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device in a hardware running environment according to an embodiment of the present application.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
As shown in fig. 1, an operating system, a data storage module, a network communication module, a user interface module, and an electronic program may be included in the memory 1005 as one type of storage medium.
In the electronic device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention may be provided in the electronic device, where the electronic device calls, through the processor 1001, the device for previewing files stored in the memory 1005, and executes the method for previewing files provided in the embodiment of the present application.
Referring to fig. 2, an embodiment of the present application provides a method for previewing a file, which is used in the electronic device in the foregoing embodiment, where the electronic device may be a terminal device, for example, a mobile phone, a tablet computer, or the like. The electronic device may be an Android system, or may be another common operating system, which is not particularly limited in this embodiment. The method of the present embodiment is used for an application program in an operating system, for example, a browser, a conference program, or the like.
The method comprises the following steps:
s20, receiving target operation of a user on file link;
in the implementation process, the file link may be a website link, or any symbol, picture, etc. with a link, which is not particularly limited in this embodiment. The target operation refers to an action of a user on the file link, for example, a click operation on the file link by using a mouse; for the electronic equipment with the touch function, clicking operation of a file link by directly utilizing a finger or a touch pen can be also adopted; of course, other path actions are also possible, and are not illustrated here.
The file links are correspondingly associated with the local file to be previewed in the existing link mode, and after target operation of a user on the file links is received, previewing is triggered.
S40, generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed;
in a specific implementation process, the file information refers to identification information of the file to be previewed, for example, file name, type, size, etc. Since the target operation is based on the operation on the file link, and the file link is correspondingly associated with the local file to be previewed through the existing link mode, the information in the preview request generated based on the target operation is related to the target file to be previewed corresponding to the file link. Specifically, in order to realize unique identification of the preview file, in this embodiment, a hash algorithm is used to generate a target hash value from file information of the target file to be previewed, and the target hash value is used to search the target file to be previewed in the local cache.
S60, searching whether a target file to be previewed corresponding to the target hash value exists in a local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed;
in an implementation process, the target file to be previewed may be already stored in the local cache, but may not be already cached locally. Thus requiring a local search. The local cache refers to the local storage of the electronic device of the execution subject of the method of the present embodiment. The local cache stores the file to be previewed downloaded from the server in advance and the hash value generated based on the file to be previewed, and it can be understood that the hash value in the local cache is generated based on the same hash algorithm as the above and by using the file information of the file to be previewed, so that the key value pair formed by the file to be previewed and the hash value can be stored in the local cache. Therefore, the search process here is a process of hash value matching, and as long as there is a hash value identical to the target hash value, there is a target file to be previewed corresponding to the target hash value in the local.
And S80, if the target file to be previewed exists in the local cache, opening the target file to be previewed from the local cache so as to preview the target file to be previewed.
In the specific implementation process, the method of opening the target file to be previewed from the local cache may be various, for example, calling other programs to open, or may also be opened by using an applet or plug-in the application executing the method of this embodiment, which is not limited in this embodiment, so long as the target file to be previewed can be directly opened locally, so as to achieve the purpose of previewing the target file to be previewed.
Therefore, the existing preview method needs to be opened after being downloaded from the cloud or other equipment ends each time, namely, the broadband is occupied, the time is delayed, the preview efficiency is poor, and finally, the use experience of a user is poor. The method of the embodiment simultaneously pre-downloads the files to the local cache in advance, so that the files are directly opened from the local when the files are previewed, and the previewing request time of the files is obviously saved. And in the request process, the accuracy of the preview is ensured by uniquely determining the hash value.
As an optional embodiment, the step of opening the target file to be previewed from the local cache if the target file to be previewed exists in the local cache further includes:
and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using a target plug-in the application program where the file link is located.
In the implementation process, the application program where the file link is located may be a common application program such as a browser and a conference APP, and the target plug-in may be a plug-in of common office software. As an optional implementation manner, the application program is a conference application program, and the format of the target file to be previewed is an office file format; and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using a target plug-in an application program where the file link is located, wherein the step comprises the following steps: and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using an office plug-in the conference application program.
In this embodiment, the target file to be previewed is opened directly in the same application, so that the application needs to jump when the target file to be previewed is caused without calling other programs, and the smoothness and efficiency of file previewing are further improved.
As an alternative embodiment, referring to fig. 3, before the step of receiving the preview operation of the file link by the user, the method further includes:
s102, downloading a plurality of files to be previewed from a server;
in a specific implementation process, in order to buffer the file to be previewed in advance, downloading is required in advance. The server refers to a cloud or other device-side server. In general, in order to reduce occupation of local device resources and improve operation efficiency of the local device, files that are not commonly used are stored in the cloud or other device sides, so in the server in this embodiment, preview files used by the application program are stored.
S104, respectively generating a plurality of corresponding hash values based on file information of a plurality of files to be previewed;
in a specific implementation process, the file information refers to identification information of the file to be previewed, for example, file name, type, size, etc. Based on the existing hash algorithm, a unique hash value can be generated according to the file information.
S106, carrying out local caching on the downloaded files to be previewed and the corresponding hash values.
In the implementation process, the downloaded files to be previewed and the corresponding hash values can be stored locally in the form of key value pairs.
Further, in order to improve the downloading efficiency, before the step of downloading the plurality of files to be previewed from the server, the method further includes:
acquiring a first file list to be downloaded from a server, wherein the first file list comprises file information of a plurality of files to be previewed;
in a specific implementation process, in order to buffer the file to be previewed in advance, downloading is required in advance. The server refers to a cloud or other device-side server. In general, in order to reduce occupation of local device resources, improve operation efficiency of the local device, and store unusual files and the like in a cloud end or other device ends, so in the server in this embodiment, preview files used by an application program are stored, where a first file list including the preview files is also maintained, and the list includes file information of a plurality of files to be previewed.
The step of downloading a plurality of files to be previewed from the server comprises the following steps:
and downloading a plurality of files to be previewed from a server through multiple threads based on the first file list.
In a specific implementation process, the purpose of maintaining the first file list is to facilitate download management, and in this embodiment, based on the first file list, the downloading efficiency can be improved through multi-thread parallel downloading.
As an optional embodiment, after the step of locally caching the downloaded files to be previewed and the corresponding hash values, the method further includes:
acquiring a second file list to be downloaded from a server, wherein the second file list at least comprises unknown file information of unknown preview files;
generating an unknown hash value based on the unknown file information;
judging whether the unknown hash value is the same as the hash value corresponding to the file information in the files to be previewed;
and if not, downloading the unknown preview file from the server based on the second file list.
In a specific implementation process, the second file list is similar to the first file list, the unknown preview file is also similar to the preview file, and the unknown file information is similar to the file information. The second file list in this embodiment is a list obtained by accessing the server when the preview file is downloaded again after the file to be previewed has been locally cached. The corresponding unknown hash value generation algorithm is the same as that described above, so if the generated unknown hash value is the same as the locally cached hash value, it represents that the file already exists in the plurality of files to be previewed, so as to save resources, avoid occupation of limited local storage space, and at this time, no repeated downloading is performed. And downloading the unknown preview file from the server based on the second file list only when the position preview file corresponding to the unknown hash value does not exist in the local cache.
As an alternative embodiment, if not, the step of downloading the unknown preview file from the server based on the second file list includes:
if not, outputting a confirmation request for downloading the unknown preview file;
and after receiving the confirmation downloading operation of the user, downloading the unknown preview file from the server based on the second file list.
In a specific implementation process, the confirmation request includes information for requesting the user to confirm, and the form is not limited, for example, a prompt box for outputting a request to select whether to download, a voice prompt, and the like may be used. Correspondingly, the confirmation downloading operation can be a selection operation of a user for the prompt box, or a voice confirmation operation of the user. Specifically, the downloading is performed after the confirmation operation of the user is obtained, and the user can be given a choice for temporarily deciding whether to download according to the need. Because the demands for files are different even in different application scenarios and different time periods within the application, the method of the present embodiment performs user reconfirmation before downloading in order to ensure efficient local storage space utilization to the maximum extent.
As an alternative embodiment, if only a temporary word preview is performed without subsequent repeated previews, the unknown preview file may be loaded and opened directly from the server after receiving a user confirmation preview operation.
As an alternative embodiment, referring to fig. 4, the method further comprises:
s200, acquiring a third file list from a server; the third file list comprises file information of files to be downloaded in the server;
in a specific implementation process, the third file list is similar to the first file list, and is a list obtained by accessing the server when the preview file is downloaded again after the file to be previewed has been locally cached.
S400, respectively generating a plurality of corresponding verification hash values based on the file information in the third file list;
in the specific implementation process, the corresponding verification hash value generation algorithm is the same as that described above.
S600, judging whether the file to be previewed which does not exist in the third file list exists in the local cache or not based on the verification hash value and the hash value stored in the local cache;
in the implementation process, therefore, if the generated verification hash value is the same as the locally cached hash value, it represents that the file already exists in the plurality of files to be previewed, otherwise, the locally cached hash value may not exist in the server.
And S800, if yes, deleting the file to be previewed which does not exist in the third file list in the local cache.
In an implementation, if there is no file already present in the server that is present in the local cache, then there may be no value representing that preview file already has been previewed. The files to be previewed which are not in the third file list in the local cache are deleted, specifically, the files to be previewed may be screened periodically according to the method of the embodiment, or may be screened when downloading each time, so as to see whether redundant previewed files exist locally. Further reduces the storage pressure of the local equipment and improves the operation smoothness.
Referring to fig. 5, based on the same inventive concept, an embodiment of the present application further provides an apparatus for previewing a file, including:
the operation receiving module is used for receiving target operation of the file link by a user;
the request generation module is used for generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed;
the file searching module is used for searching whether a target file to be previewed corresponding to the target hash value exists in the local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed;
and the file previewing module is used for opening the target file to be previewed from the local cache if the target file to be previewed exists in the local cache, so as to preview the target file to be previewed.
It should be noted that, each module in the device for previewing files in this embodiment corresponds to each step in the method for previewing files in the foregoing embodiment, so specific implementation manners and achieved technical effects of this embodiment may refer to implementation manners of the foregoing method for previewing files, and will not be described herein in detail.
Furthermore, in an embodiment, the present application also provides a computer storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the method in the previous embodiment.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories. The computer may be a variety of computing devices including smart terminals and servers.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read-only memory/random-access memory, magnetic disk, optical disk), comprising several instructions for causing a multimedia terminal device (which may be a mobile phone, a computer, a television receiver, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing disclosure is merely a partial embodiment of the present application, and it is not intended to limit the scope of the claims of the present application.

Claims (12)

1. A method for previewing a document, comprising:
receiving target operation of a user on file link;
generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed;
searching whether a target file to be previewed corresponding to the target hash value exists in a local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed;
if the target file to be previewed exists in the local cache, opening the target file to be previewed from the local cache so as to preview the target file to be previewed;
acquiring a third file list from a server; the third file list comprises file information of files to be downloaded in the server;
generating a plurality of corresponding verification hash values based on the file information in the third file list;
judging whether the file to be previewed which does not exist in the third file list exists in the local cache or not based on the verification hash value and the hash value stored in the local cache;
if yes, deleting the file to be previewed which does not exist in the third file list in the local cache.
2. The method of claim 1, wherein prior to the step of receiving a preview operation of the file link by the user, further comprising:
downloading a plurality of files to be previewed from a server;
generating a plurality of corresponding hash values based on file information of the files to be previewed;
and carrying out local caching on the downloaded files to be previewed and the corresponding hash values.
3. The method of claim 2, wherein prior to the step of downloading the plurality of files to be previewed from the server, further comprising:
acquiring a first file list to be downloaded from a server, wherein the first file list comprises file information of a plurality of files to be previewed;
the step of downloading a plurality of files to be previewed from the server comprises the following steps:
and downloading a plurality of files to be previewed from a server through multiple threads based on the first file list.
4. The method according to claim 3, further comprising, after the step of locally caching the downloaded plurality of files to be previewed and the corresponding hash values:
acquiring a second file list to be downloaded from a server, wherein the second file list at least comprises unknown file information of unknown preview files;
generating an unknown hash value based on the unknown file information;
judging whether the unknown hash value is the same as the hash value corresponding to the file information in the files to be previewed;
and if not, downloading the unknown preview file from the server based on the second file list.
5. The method of claim 4, wherein the step of downloading the unknown preview document from the server based on the second document list if not, comprises:
if not, outputting a confirmation request for downloading the unknown preview file;
and after receiving the confirmation downloading operation of the user, downloading the unknown preview file from the server based on the second file list.
6. The method of claim 5, further comprising, after the step of outputting a confirmation request of whether to download the unknown preview document:
and after receiving the confirmation preview operation of the user, directly loading and opening the unknown preview file from the server.
7. The method of claim 4, wherein after the step of determining whether the unknown hash value is the same as a hash value corresponding to file information in the plurality of files to be previewed, further comprising:
and if the unknown file information is the same as the file information in the files to be previewed, discarding downloading the unknown preview file.
8. The method according to any one of claims 1-7, wherein the step of opening the target file to be previewed from the local cache if the target file to be previewed exists in the local cache, further comprises:
and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using a target plug-in the application program where the file link is located.
9. The method of claim 8, wherein the application is a conference application and the format of the target file to be previewed is an office file format; and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using a target plug-in an application program where the file link is located, wherein the step comprises the following steps:
and if the target file to be previewed exists in the local cache, opening the target file to be previewed by using an office plug-in the conference application program.
10. An apparatus for previewing documents, comprising:
the operation receiving module is used for receiving target operation of the file link by a user;
the request generation module is used for generating a preview request based on the target operation; the preview request comprises a target hash value generated based on file information of a target file to be previewed;
the file searching module is used for searching whether a target file to be previewed corresponding to the target hash value exists in the local cache based on the target hash value; the local cache stores a file to be previewed, which is downloaded from a server in advance, and a hash value generated based on the file to be previewed;
the file previewing module is used for opening the target file to be previewed from the local cache if the target file to be previewed exists in the local cache, so as to preview the target file to be previewed; acquiring a third file list from a server; the third file list comprises file information of files to be downloaded in the server; generating a plurality of corresponding verification hash values based on the file information in the third file list; judging whether the file to be previewed which does not exist in the third file list exists in the local cache or not based on the verification hash value and the hash value stored in the local cache; if yes, deleting the file to be previewed which does not exist in the third file list in the local cache.
11. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor executing the computer program to implement the method of any of claims 1-9.
12. A computer readable storage medium, having stored thereon a computer program, the computer program being executable by a processor to implement the method of any of claims 1-9.
CN202310077586.0A 2023-02-08 2023-02-08 Method, device, equipment and medium for previewing file Active CN115878676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310077586.0A CN115878676B (en) 2023-02-08 2023-02-08 Method, device, equipment and medium for previewing file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310077586.0A CN115878676B (en) 2023-02-08 2023-02-08 Method, device, equipment and medium for previewing file

Publications (2)

Publication Number Publication Date
CN115878676A CN115878676A (en) 2023-03-31
CN115878676B true CN115878676B (en) 2023-05-05

Family

ID=85760871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310077586.0A Active CN115878676B (en) 2023-02-08 2023-02-08 Method, device, equipment and medium for previewing file

Country Status (1)

Country Link
CN (1) CN115878676B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103401931A (en) * 2013-08-05 2013-11-20 天闻数媒科技(湖南)有限公司 Method and system for downloading file
CN109756581A (en) * 2019-03-06 2019-05-14 珠海金山网络游戏科技有限公司 A kind of document transmission system and method, a kind of calculating equipment and storage medium
CN111930740A (en) * 2020-06-28 2020-11-13 腾讯科技(成都)有限公司 Game data processing method and device, server and storage medium
CN112637343A (en) * 2020-12-23 2021-04-09 中国建设银行股份有限公司 File transmission method, device and system
CN112751899A (en) * 2019-10-31 2021-05-04 北京沃东天骏信息技术有限公司 File downloading method and device, storage medium and electronic equipment
CN114528813A (en) * 2022-01-26 2022-05-24 山东浪潮通软信息科技有限公司 File conversion management method, device, equipment and medium for online preview
WO2022267018A1 (en) * 2021-06-25 2022-12-29 新华三技术有限公司 Packet matching method and apparatus, network device, and medium
CN115544283A (en) * 2022-09-22 2022-12-30 北京车智赢科技有限公司 Picture detection method and device, computing equipment and storage medium
CN115567539A (en) * 2022-09-28 2023-01-03 北京天融信网络安全技术有限公司 Session holding method, device, equipment and storage medium
JP2023006090A (en) * 2021-06-30 2023-01-18 弁護士ドットコム株式会社 Program, information processing apparatus, and method
CN115686663A (en) * 2022-09-14 2023-02-03 国信证券股份有限公司 Online file preview method and device and computer equipment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9286293B2 (en) * 2008-07-30 2016-03-15 Microsoft Technology Licensing, Llc Populating and using caches in client-side caching
CN101719936A (en) * 2009-12-09 2010-06-02 成都市华为赛门铁克科技有限公司 Method, device and cache system for providing file downloading service
CN102096712A (en) * 2011-01-28 2011-06-15 深圳市五巨科技有限公司 Method and device for cache-control of mobile terminal
CN102693305B (en) * 2012-05-24 2016-01-13 惠州Tcl移动通信有限公司 A kind of fileinfo method for previewing and system
CN105897911A (en) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 File downloading method and device and user terminal
CN108574686B (en) * 2017-05-17 2021-08-06 北京金山云网络技术有限公司 Method and device for previewing file online
CN108055302B (en) * 2017-12-05 2020-10-20 竞技世界(北京)网络技术有限公司 Picture caching processing method and system and server
CN108256114B (en) * 2018-02-09 2021-02-02 金蝶软件(中国)有限公司 Document online preview method and device, computer equipment and storage medium
CN111787115B (en) * 2020-07-06 2023-05-09 聚好看科技股份有限公司 Server, display device and file transmission method
CN113765968A (en) * 2020-09-17 2021-12-07 北京沃东天骏信息技术有限公司 File transmission method, device and system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103401931A (en) * 2013-08-05 2013-11-20 天闻数媒科技(湖南)有限公司 Method and system for downloading file
CN109756581A (en) * 2019-03-06 2019-05-14 珠海金山网络游戏科技有限公司 A kind of document transmission system and method, a kind of calculating equipment and storage medium
CN112751899A (en) * 2019-10-31 2021-05-04 北京沃东天骏信息技术有限公司 File downloading method and device, storage medium and electronic equipment
CN111930740A (en) * 2020-06-28 2020-11-13 腾讯科技(成都)有限公司 Game data processing method and device, server and storage medium
CN112637343A (en) * 2020-12-23 2021-04-09 中国建设银行股份有限公司 File transmission method, device and system
WO2022267018A1 (en) * 2021-06-25 2022-12-29 新华三技术有限公司 Packet matching method and apparatus, network device, and medium
JP2023006090A (en) * 2021-06-30 2023-01-18 弁護士ドットコム株式会社 Program, information processing apparatus, and method
CN114528813A (en) * 2022-01-26 2022-05-24 山东浪潮通软信息科技有限公司 File conversion management method, device, equipment and medium for online preview
CN115686663A (en) * 2022-09-14 2023-02-03 国信证券股份有限公司 Online file preview method and device and computer equipment
CN115544283A (en) * 2022-09-22 2022-12-30 北京车智赢科技有限公司 Picture detection method and device, computing equipment and storage medium
CN115567539A (en) * 2022-09-28 2023-01-03 北京天融信网络安全技术有限公司 Session holding method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115878676A (en) 2023-03-31

Similar Documents

Publication Publication Date Title
CN105843815B (en) Page comment processing method and device and browser
CN108038134B (en) Page display method and device, storage medium and electronic equipment
US8983935B2 (en) Methods for utilizing a javascript emulator in a web content proxy server and devices thereof
CN104049991A (en) Method and system for converting network applications into mobile applications
CN107276842B (en) Interface test method and device and electronic equipment
CN110941779B (en) Page loading method and device, storage medium and electronic equipment
CN110147476A (en) Data crawling method, terminal device and computer readable storage medium based on Scrapy
CN112612982A (en) Webpage preloading method and device and computer equipment
CN113536185A (en) Application page loading method, storage medium and related equipment thereof
CN111723314B (en) Webpage display method and device, electronic equipment and computer readable storage medium
CN110321504A (en) A kind of page processing method and device
CN112346944B (en) Method, equipment and storage medium for monitoring operation experience of webpage user
CN101876998A (en) Method and system for editing data
CN115878676B (en) Method, device, equipment and medium for previewing file
CN111880952A (en) Application program jumping method and device, electronic equipment and storage medium
CN114816637B (en) Application display method, device and system embedded in applet
CN103258055A (en) Device and method for file downloading
CN113315829B (en) Client offline H5 page loading method and device, computer equipment and medium
CN111338928A (en) Chrome-based browser testing method and device
CN114489603A (en) Code generation method, apparatus, electronic device, medium, and product
CN113626392A (en) Method and device for updating document data, electronic equipment and storage medium
US20140237133A1 (en) Page download control method, system and program for ie core browser
US7451191B2 (en) System and method for downloading a document from a server computer to a client computer
CN109002335A (en) Page file playing method and device
CN117520021A (en) Java system message pushing method, device, equipment and medium

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