CN116028136A - File previewing method and device, electronic equipment and storage medium - Google Patents

File previewing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116028136A
CN116028136A CN202310059820.7A CN202310059820A CN116028136A CN 116028136 A CN116028136 A CN 116028136A CN 202310059820 A CN202310059820 A CN 202310059820A CN 116028136 A CN116028136 A CN 116028136A
Authority
CN
China
Prior art keywords
file
preview
target
loading
system platform
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
CN202310059820.7A
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.)
Shenzhen Coocaa Network Technology Co Ltd
Original Assignee
Shenzhen Coocaa Network 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 Shenzhen Coocaa Network Technology Co Ltd filed Critical Shenzhen Coocaa Network Technology Co Ltd
Priority to CN202310059820.7A priority Critical patent/CN116028136A/en
Publication of CN116028136A publication Critical patent/CN116028136A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a file previewing method, a file previewing device, electronic equipment and a storage medium. The method comprises the following steps: when the file preview program embedded in the triggering target application program is detected, configuring a file preview component in the current page; the file preview component is used for loading and displaying a target preview file, and comprises at least one file loading tool kit; determining a to-be-used loading toolkit corresponding to the system platform type from the file preview component according to the system platform type to which the file preview program belongs; when the triggering of the file to be previewed is detected, determining a target preview file, and loading the target preview file based on the to-be-used loading tool kit; based on the file preview component, the target preview file is displayed, the technical problems of low file preview efficiency and limited application scene in the file preview process are solved, the convenience of previewing the file is improved, the efficiency of loading the target preview file is enhanced, and the use experience of a user is improved.

Description

File previewing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a file previewing method, a device, an electronic apparatus, and a storage medium.
Background
With the rapid development of internet technology, developers develop a large number of application programs, and many application programs can be embedded with other functional units, i.e. a plurality of applets can be embedded in the application programs. For example, an applet that can preview office files may be embedded in a social application, through which a user can preview specific content in the file.
In the prior art, two implementation modes for previewing files in a small program are mainly included, and one mode is as follows: the application program is provided with a component capable of realizing file previewing, when the file is previewed in the applet, the file is loaded and displayed by the previewing component in the application program, and the other mode is that the applet jumps to the third party file previewing application program, and the file is loaded and displayed by the third party file previewing application program.
However, the first approach has the problem that: the application program itself is required to support the document preview function, the basic configuration of the application program is strongly dependent when previewing the file, and the application program is limited in practical application. The second approach has the disadvantage: the third party file preview application program needs to be installed in advance, and the interaction process is inconvenient. Based on the above, when the file is previewed through the applet, the file previewing efficiency is low, the application scene is limited, and the use experience of the user is affected.
Disclosure of Invention
The invention provides a file previewing method, a file previewing device, electronic equipment and a storage medium, which improve the convenience of previewing files, enhance the efficiency of loading target previewing files and improve the use experience of users.
In a first aspect, the present invention provides a file previewing method, which includes:
when the file preview program embedded in the triggering target application program is detected, configuring a file preview component in the current page; the file preview component is used for loading and displaying a target preview file, and comprises at least one file loading tool kit;
determining a to-be-used loading toolkit corresponding to the system platform type from a file preview component according to the system platform type to which the file preview program belongs;
when the triggering of the file to be previewed is detected, determining a target preview file, and loading the target preview file based on the to-be-used loading tool kit;
based on the file preview component, the target preview file is exposed.
In a second aspect, the present invention provides a file previewing apparatus, comprising:
the preview component configuration module is used for configuring a file preview component in a current page when detecting a file preview program embedded in a trigger target application program; the file preview component is used for loading and displaying a target preview file, and comprises at least one file loading tool kit;
The loading tool kit determining module is used for determining a to-be-used loading tool kit corresponding to the system platform type from the file previewing component according to the system platform type to which the file previewing program belongs;
the preview file loading module is used for determining a target preview file when the triggering of the file to be previewed is detected, and loading the target preview file based on the loading tool kit to be used;
and the preview file display module is used for displaying the target preview file based on the file preview component.
In a third aspect, the present invention provides a data processing electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file preview method of any of the embodiments of the present invention.
In a fourth aspect, the present invention provides a computer readable storage medium storing computer instructions for causing a processor to perform a file previewing method according to any of the embodiments of the present invention.
In a fifth aspect, the present invention provides a computer program product comprising a computer program which, when executed by a processor, implements the file preview method of any of the embodiments of the present invention.
According to the technical scheme provided by the embodiment of the invention, when the file preview program embedded in the trigger target application program is detected, the file preview component is configured in the current page, wherein the file preview component is used for loading and displaying the target preview file, the file preview component comprises at least one file loading tool kit, further, according to the system platform type of the file preview program, the loading tool kit to be used corresponding to the system platform type is determined from the file preview component, further, when the trigger target preview file is detected, the target preview file is determined, the target preview file is loaded based on the loading tool kit to be used, and then the target preview file is displayed based on the file preview component. The technical scheme provided by the embodiment of the invention solves the technical problems of low file previewing efficiency and limited application scene in the file previewing process, improves the file previewing convenience, enhances the target file loading efficiency and improves the user experience.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for previewing a document according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a relationship between a mobile terminal device and an applet according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a file to be previewed in a user display page according to an embodiment of the present invention;
FIG. 4 is a flowchart of a file previewing method according to a second embodiment of the present invention;
fig. 5 is a schematic diagram illustrating implementation steps of a file previewing method according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a file previewing device according to a third embodiment of the present invention;
Fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that, in the description and claims of the present invention and the above figures, the terms "first preset condition", "second preset condition", and the like are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Before the present technical solution is introduced, an application scenario may be illustrated. Along with the rapid development of internet technology, in real life, a user can preview office files through an applet embedded in an application program, the invention provides a convenient, high-efficiency and cross-platform file preview component, when the office files are previewed based on the applet, the application program does not need to support a file preview function and jump to a third party file preview application program, and when the user is detected to open the file preview program embedded in a target application program, the file preview component is configured in a current page, so that previewing of loading various types of files can be supported.
Fig. 1 is a flowchart of a file previewing method according to an embodiment of the present invention, where the embodiment is applicable to situations of previewing office files conveniently and efficiently based on small programs. The method may be performed by a file previewing means, which may be implemented in hardware and/or software, which may be configured on a computer device, which may be a notebook, desktop computer, smart tablet, or the like. As shown in fig. 1, the method includes:
S110, when the file preview program embedded in the triggering target application program is detected, configuring a file preview component in the current page.
The target application may be any application program, and other functional units may be embedded in the target application program, and these other embedded functional units may be called applets. These applets are applications that can be used without downloading an installation, and the user can open the application by sweeping or searching. The file preview program is an applet that can realize an office file preview function. For a user, the display page corresponding to the carrying file preview program is the current page.
The file preview component is used for loading and displaying the target preview file, and the file preview component comprises at least one file loading tool kit. The target preview file is a file that the user will preview, and the type of target preview file includes, but is not limited to, a doc, docx, xls, xlsx, ppt, pptx, pdf format type file. The file preview component comprises a first loading tool package and a second loading tool package. The first loading tool package is used for loading files to be loaded corresponding to the first system platform, and the second loading tool package is used for loading files to be loaded corresponding to the second system platform.
The operating system corresponding to the mobile terminal device used by the user at present comprises an Android system and an iOS system, the first loading toolkit can be a file loading toolkit determined based on a messenger browsing service (TencentBrowsingService, TBS), and the second loading toolkit can be a file loading toolkit determined based on WKWebView. The first loading tool package determined based on the TBS can load a file to be loaded for the mobile terminal equipment of the Android system by the operating system; the second loading toolkit determined based on the WKWebView may load the file to be loaded for the mobile terminal device of the iOS system for the operating system. Based on the above, the mobile pile end device corresponding to the Android system is a first system platform, and the mobile pile end device corresponding to the iOS system is a second system platform. The file to be loaded is the file to be loaded and previewed by the user.
Based on the above embodiment, the determining manner of the file preview component may be: the first loading toolkit and the second loading toolkit are packaged into a file preview component based on the target programming language.
The target programming language is a code program for packaging the first loading tool package and the second loading tool package in a combined way, and for example, javaScript programming language, python programming language and Dart programming language can be used as the target programming language.
In this embodiment, for a developer, both the first loading toolkit and the second loading toolkit may be characterized by a section of program code, and in order to combine the first loading toolkit and the second loading toolkit into a directly available component, the program codes corresponding to the first loading toolkit and the second loading toolkit may be spliced and integrated based on the target programming language, so as to package the first loading toolkit and the second loading toolkit into a file preview component capable of implementing cross-platform preview files. The file preview component can also be used for judging an operating system corresponding to the current user on the basis of packaging the first loading tool package and the second loading tool package, and loading and displaying the target preview file.
Specifically, the file preview component can be used as a directly available component, when a user triggers the file preview program through a control in a target application program of the mobile terminal device, an instruction for triggering the file preview program to be opened can be detected at this time, and the file preview component can be added into a current implementation page so as to load and display a target preview file based on the file preview component.
S120, determining a to-be-used loading toolkit corresponding to the system platform type from the file preview component according to the system platform type to which the file preview program belongs.
The system platform types may include a first system platform and a second system platform. The first system platform corresponds to an Android operating system, and the second system platform corresponds to an iOS operating system. The load toolkit to be used is a file load toolkit to be used for loading the target preview file.
In this embodiment, the file preview program is a applet embedded in the target application program, so the target application program is a carrier of the file preview program, and the target application program is downloaded and installed onto the mobile terminal device, that is, the mobile terminal device is a carrier of the target application program. For an example, a schematic diagram of the relationship between a mobile terminal device and an applet is shown in fig. 2. As shown in fig. 2, for various mobile terminal devices, the file preview component provided in the embodiment of the present invention may be used, and the mobile terminal device is taken as a mobile phone, where the mobile phone may be an Android operating system or an iOS operating system, and a plurality of application programs may be downloaded in the mobile phone. For an application program, a plurality of applets can be embedded, if a function corresponding to one of the applets is previewing an office file, a file previewing component can be configured in the applet when the applet is opened, and a target preview file can be loaded and previewed based on the file previewing component.
It will be appreciated that the operating system of the mobile terminal device is different when the target application is downloaded for the same target application, and the downloaded target application is different, and the target application corresponds to the operating system of the mobile terminal device. Based on the above, the system platform type of the file previewing program can be determined according to the system platform type of the mobile terminal device, and further the to-be-used loading toolkit corresponding to the system platform type is determined.
On the basis of the above embodiment, determining a to-be-used loading toolkit corresponding to a system platform type includes: judging the type of a system platform corresponding to the file previewing program based on the file previewing component; if the system platform type is the first system platform, determining the first loading tool kit as a loading tool kit to be used; and if the system platform type is the second system platform, determining the second loading tool kit as the loading tool kit to be used.
In this embodiment, after the file preview component is configured in the current page of the user, the file preview component may determine, according to the operating system of the mobile terminal device, a system platform type to which the file preview program belongs. And further, according to the type of the system platform, determining a to-be-used loading toolkit corresponding to the type of the system platform.
On the basis of the above example, if the mobile terminal device currently used by the user is an Android operating system, it may be determined that the system platform type is a first system platform, then the first loading toolkit is determined to be a loading toolkit to be used, and further, the tbsreaterview may be returned and the TBS kernel may be initialized; if the mobile terminal device currently used by the user is an iOS operating system, the system platform type can be determined to be a second system platform, the second loading tool package is determined to be the loading tool package to be used, and further the WKWebView can be returned and initialized.
And S130, when the triggering of the file to be previewed is detected, determining the target preview file, and loading the target preview file based on the loading tool kit to be used.
The files to be previewed are a plurality of files displayed in a user display page. The user can select a file to be previewed, which is desired to be previewed, from a plurality of files to be previewed as a target preview file.
In this embodiment, the user may determine, in the display page, the target preview file by triggering a control corresponding to each file to be previewed. After determining the target preview document, the target preview document may be loaded using the loading toolkit determined based on the above steps.
On the above exemplary basis, a schematic illustration of the file to be previewed in the user display page is shown in fig. 3. As shown in fig. 3, 6 files to be previewed are displayed in the user display page, if the user wants to look at the file 5 to be previewed, the control 5 may be triggered, and at this time, the file 5 to be previewed may be used as the target preview file. If the mobile terminal device currently used by the user is an Android operating system, the target preview file can be loaded based on the first loading tool kit.
And S140, displaying the target preview file based on the file preview component.
In this embodiment, after loading the target preview file is completed, the file preview component may find the target preview file according to the storage address of the target preview file, further open the target preview file, and render the target preview file to the user display page for display.
Based on the embodiment, the target preview file is displayed based on the file preview component, which specifically comprises the following steps: calling a file opening tool package based on the file preview component; and opening the target preview file based on the file opening tool package and displaying the target preview file in a display page.
The file opening tool package is a tool package written in advance and can be directly called. The file opening tool package is used for opening and displaying the target preview file according to the storage address corresponding to the target preview file.
In this embodiment, the file opening toolkit may be preconfigured in the file preview component, for example, the file opening toolkit may be an openFile toolkit. After loading the target preview file, the target preview file can be stored in a storage unit of the mobile terminal device, and then a file opening tool kit in the file preview component can be directly called so as to open the target preview file according to a storage path by using the file opening tool kit, and the target preview file is rendered into a user display page for display.
According to the technical scheme provided by the embodiment of the invention, when the file preview program embedded in the trigger target application program is detected, the file preview component is configured in the current page, wherein the file preview component is used for loading and displaying the target preview file, the file preview component comprises at least one file loading tool kit, further, according to the system platform type of the file preview program, the loading tool kit to be used corresponding to the system platform type is determined from the file preview component, further, when the trigger target preview file is detected, the target preview file is determined, the target preview file is loaded based on the loading tool kit to be used, and then the target preview file is displayed based on the file preview component. The technical scheme provided by the embodiment of the invention solves the technical problems of low file previewing efficiency and limited application scene in the file previewing process, improves the file previewing convenience, enhances the target file loading efficiency and improves the user experience.
Example two
Fig. 4 is a flowchart of a file previewing method according to a second embodiment of the present invention, where, based on the foregoing embodiments, the step S130 of the embodiment of the present invention is further refined, and the embodiment of the present invention may be combined with each alternative in one or more embodiments. As shown in fig. 4, the method includes:
s210, when the file preview program embedded in the triggering target application program is detected, configuring a file preview component in the current page.
S220, determining a to-be-used loading toolkit corresponding to the system platform type from the file preview component according to the system platform type to which the file preview program belongs.
S230, determining a target preview file from the files to be previewed based on the triggering operation of the target user.
In this embodiment, the user may determine, in the display page, the target preview file by triggering a control corresponding to each file to be previewed.
S240, judging the file type corresponding to the target preview file.
The file types may include local files and online files, among others. The local file is a file already stored in a storage unit of the mobile terminal device; on-line files refer to files that a user can log into a file system through a network and perform file-related operations, wherein the files can be stored locally or in a remote device.
In this embodiment, a processing unit for determining a file type may be preconfigured in the file preview component, and is configured to determine a file type corresponding to the target preview file. After determining the target preview file, the file preview component can check that the target preview file is already downloaded to the hard disk of the current mobile terminal device, and if the target preview file is already downloaded to the hard disk of the current mobile terminal device, determining the type of the target preview file as a local file; and if the target preview file is not downloaded to the hard disk of the current mobile terminal device, determining the type of the target preview file as an online file.
S250, determining a storage path of the target preview file based on the file type corresponding to the target preview file.
Wherein the storage path is used for representing the storage position of the target preview file on the current mobile terminal device. The target preview file may be found from the storage path. For example, the storage path may be expressed as: d disk/a folder/S folder/H file ….
In this embodiment, the file types corresponding to the target preview file are different, and the manner in which the storage path is determined is different.
Based on the foregoing embodiment, determining the storage path of the target preview file based on the file type corresponding to the file to be previewed may specifically include: if the file type is the local file, calling a target selector to determine a storage path of the target preview file based on the target selector; and if the file type is an online file, calling a target buffer to determine a storage path of the target preview file based on the target buffer.
The target selector is used for determining a storage path of the local file in the current mobile terminal device, and for example, the target selector may be a filePicker selector. The target buffer is used for downloading the online file to the storage unit of the current mobile terminal device, and for example, the target buffer may be a FileDownloader buffer.
In this embodiment, the target selector and the target buffer may be preconfigured into the file preview component, and the target selector or the target buffer is directly invoked when determining the target preview file. For example, if the target preview document is a local document, a filePicker selector may be invoked, and the local document management page is jumped to by the filePicker selector to select the target preview document, thereby determining a storage path of the target preview document. If the target preview file is an online file, a FileDownloader buffer may be invoked, through which the storage path of the target preview file is determined.
On the basis of the above embodiment, determining the storage path of the target preview file based on the target buffer may specifically include: calling a target buffer; downloading the target preview file to the local platform based on the target buffer and the cloud address; and determining a storage path of the target preview file based on the target buffer.
In this embodiment, if the target preview file is an online file, the target preview file may be downloaded from another server according to the cloud address. The cloud address may be, for example, a web site link.
In this embodiment, if the target preview file is determined to be an online file, the target buffer is invoked, and the target buffer may download the target preview file to the storage unit of the current mobile terminal device according to the cloud address corresponding to the target preview file, so that the target buffer may jump to the local file management page to select the target preview file, thereby determining the storage path of the target preview file.
S260, loading the target preview file based on the to-be-used loading tool kit and the storage path.
In this embodiment, after determining the loading tool and the storage path to be used, the loading tool to be used may find the target preview file according to the storage path, and then load the target preview file into the file preview program embedded in the target application program.
S270, displaying the target preview file based on the file preview component.
According to the technical scheme provided by the embodiment of the invention, firstly, when the file preview program embedded in the trigger target application program is detected, a file preview component is configured in a current page, wherein the file preview component is used for loading and displaying a target preview file, the file preview component comprises at least one file loading tool package, and then the loading tool package to be used corresponding to the system platform type is determined from the file preview component according to the system platform type to which the file preview program belongs. And then determining a target preview file from the files to be previewed based on triggering operation of a target user, judging the file type corresponding to the target preview file, determining a storage path of the target preview file based on the file type corresponding to the target preview file, loading the target preview file based on a loading tool kit to be used and the storage path, and finally displaying the target preview file based on a file preview component, thereby solving the technical problems of low efficiency of file preview and limited application scene in the process of previewing the file, realizing convenient preview of local files and online files based on the file preview component, realizing cross-platform file preview, improving convenience of previewing the file, and further enhancing the efficiency of loading the target preview file.
As an alternative to the above embodiment, the implementation steps of the above method are shown in fig. 5. Can be summarized as: when the user triggers the file preview program, the file preview component is added to the currently displayed page. The file preview component can judge the type of the operating system of the current mobile terminal device, if the operating system is an Android operating system, the type of the system platform can be determined to be a first system platform, a first loading tool package is determined to be a loading tool package to be used, and further TBSReaderView can be returned and a TBS kernel is initialized; if the mobile terminal device currently used by the user is an iOS operating system, the system platform type can be determined to be a second system platform, the second loading tool package is determined to be the loading tool package to be used, and further the WKWebView can be returned and initialized. Then, the user can determine the target preview file by triggering a control corresponding to each file to be previewed, the file preview component further judges the file type of the target preview file, if the target preview file is a local file, a FilePicker selector can be called, and the target preview file is selected by jumping to a local file management page through the FilePicker selector, so that the storage path of the target preview file is determined; if the target preview file is an online file, a FileDownloader buffer may be invoked, through which the storage path of the target preview file is determined. And finally, the loading tool to be used can find the target preview file according to the storage path, and further load the target preview file into the file preview program embedded in the target application program and display the target preview file.
Example III
Fig. 6 is a schematic structural diagram of a file previewing device according to a third embodiment of the present invention, where the device may execute the file previewing method according to the embodiment of the present invention. The device comprises: a preview component configuration module 310, a loading toolkit determination module 320, a preview file loading module 330, and a preview file presentation module 340.
A preview component configuration module 310, configured to configure a file preview component in a current page when a file preview program embedded in a trigger target application program is detected; the file preview component is used for loading and displaying a target preview file, and comprises at least one file loading tool kit;
the loading tool kit determining module 320 is configured to determine, from the file preview component, a loading tool kit to be used corresponding to a system platform type according to the system platform type to which the file preview program belongs;
the preview file loading module 330 is configured to determine a target preview file when detecting that the file to be previewed is triggered, and load the target preview file based on the loading toolkit to be used;
the preview document displaying module 340 is configured to display the target preview document based on the document preview component.
On the basis of the technical schemes, the file previewing device is further used for packaging the first loading tool package and the second loading tool package into a file previewing component based on a target programming language; the first loading tool package is used for loading files to be loaded corresponding to the first system platform, and the second loading tool package is used for loading files to be loaded corresponding to the second system platform.
Based on the above technical solutions, the loading toolkit determining module 320 further includes: the system comprises a system platform type judging unit, a first tool kit determining unit and a second tool kit determining unit.
The system platform type judging unit is used for judging the system platform type corresponding to the file previewing program based on the file previewing component; the system platform type comprises a first system platform and a second system platform;
the first tool kit determining unit is used for determining the first loading tool kit as the loading tool kit to be used if the system platform type is the first system platform;
and the second tool kit determining unit is used for determining the second loading tool kit as the loading tool kit to be used if the system platform type is the second system platform.
Based on the above technical solutions, the preview file loading module 330 further includes: the file type determining unit is used for determining the file type of the file to be stored in the storage path determining unit.
The target file determining unit is used for determining a target preview file from files to be previewed based on triggering operation of a target user;
the file type judging unit is used for judging the file type corresponding to the target preview file; the file types comprise local files and online files;
the storage path determining unit is used for determining the storage path of the target preview file based on the file type corresponding to the target preview file;
and the preview file loading unit is used for loading the target preview file based on the to-be-used loading tool kit and the storage path.
On the basis of the above technical solutions, the storage path determining unit further includes: a local file determination subunit and an online file determination subunit.
A local file determining subunit, configured to invoke the target selector if the file type is a local file, so as to determine a storage path of the target preview file based on the target selector;
and the online file determining subunit is used for calling the target buffer to determine the storage path of the target preview file based on the target buffer if the file type is the online file.
On the basis of the technical schemes, the online file determining subunit is also used for calling the target buffer; downloading the target preview file to the local platform based on the target buffer and the cloud address; and determining a storage path of the target preview file based on the target buffer.
Based on the above technical solutions, the preview document display module 340 further includes: an opening tool calling unit and a preview file displaying unit.
The opening tool calling unit is used for calling a file opening tool package based on the file preview component;
and the preview file display unit is used for opening the target preview file based on the file opening tool kit and displaying the target preview file in the display page.
According to the technical scheme provided by the embodiment of the invention, when the file preview program embedded in the trigger target application program is detected, the file preview component is configured in the current page, wherein the file preview component is used for loading and displaying the target preview file, the file preview component comprises at least one file loading tool kit, further, according to the system platform type of the file preview program, the loading tool kit to be used corresponding to the system platform type is determined from the file preview component, further, when the trigger target preview file is detected, the target preview file is determined, the target preview file is loaded based on the loading tool kit to be used, and then the target preview file is displayed based on the file preview component. The technical scheme provided by the embodiment of the invention solves the technical problems of low file previewing efficiency and limited application scene in the file previewing process, improves the file previewing convenience, enhances the target file loading efficiency and improves the user experience.
The file previewing device provided by the embodiment of the disclosure can execute the file previewing method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the executing method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Example IV
Fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM12 and the RAM13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the file preview method.
In some embodiments, the file preview method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM12 and/or the communication unit 19. When the computer program is loaded into RAM13 and executed by processor 11, one or more steps of the file preview method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the file preview method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable file previewing apparatus, such that the computer programs, when executed by the processor, cause the functions/operations specified in the flowchart and/or block diagram to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome. It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein. The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for previewing a file, comprising:
when the file preview program embedded in the triggering target application program is detected, configuring a file preview component in the current page; the file preview component is used for loading and displaying a target preview file, and comprises at least one file loading tool kit;
determining a to-be-used loading toolkit corresponding to the system platform type from a file preview component according to the system platform type to which the file preview program belongs;
when the triggering of the file to be previewed is detected, determining a target preview file, and loading the target preview file based on the to-be-used loading tool kit;
based on the file preview component, the target preview file is exposed.
2. The method according to claim 1, wherein the method further comprises:
packaging the first loading tool package and the second loading tool package into the file preview component based on a target programming language;
the first loading tool package is used for loading files to be loaded corresponding to the first system platform, and the second loading tool package is used for loading files to be loaded corresponding to the second system platform.
3. The method according to claim 1, wherein the determining, from the file preview component, a to-be-used loading toolkit corresponding to the system platform type according to the system platform type to which the file preview program belongs, includes:
Judging the type of the system platform corresponding to the file previewing program based on the file previewing component; the system platform type comprises a first system platform and a second system platform;
if the system platform type is the first system platform, determining a first loading tool package as the loading tool package to be used;
and if the system platform type is the second system platform, determining a second loading tool package as the loading tool package to be used.
4. The method of claim 1, wherein determining the target preview document based on the target preview document to be loaded using the loading toolkit when triggering the target preview document is detected comprises:
determining a target preview file from files to be previewed based on triggering operation of a target user;
judging the file type corresponding to the target preview file; wherein the file types comprise local files and online files;
determining a storage path of the target preview file based on the file type corresponding to the target preview file;
the target preview file is loaded based on the to-be-used loading toolkit and the storage path.
5. The method of claim 4, wherein the determining the storage path of the target preview file based on the file type corresponding to the file to be previewed comprises:
If the file type is the local file, calling a target selector to determine a storage path of a target preview file based on the target selector;
and if the file type is the online file, calling a target buffer to determine a storage path of a target preview file based on the target buffer.
6. The method of claim 5, wherein if the file type is the online file, invoking a destination buffer to determine a storage path of a destination preview file based on the destination buffer comprises:
invoking the target buffer;
downloading the target preview file to a local platform based on the target buffer and the cloud address;
and determining a storage path of the target preview file based on the target buffer.
7. The method of claim 1, wherein the exposing the target preview document based on the document preview component further comprises:
calling a file opening tool package based on the file preview component;
and opening the target preview file and displaying the target preview file in a display page based on the file opening tool kit.
8. A document previewing apparatus, comprising:
The preview component configuration module is used for configuring a file preview component in a current page when detecting a file preview program embedded in a trigger target application program; the file preview component is used for loading and displaying a target preview file, and comprises at least one file loading tool kit;
the loading tool kit determining module is used for determining a to-be-used loading tool kit corresponding to the system platform type from the file previewing component according to the system platform type to which the file previewing program belongs;
the preview file loading module is used for determining a target preview file when the triggering of the file to be previewed is detected, and loading the target preview file based on the loading tool kit to be used;
and the preview file display module is used for displaying the target preview file based on the file preview component.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file preview method of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the file preview method of any of claims 1-7.
CN202310059820.7A 2023-01-16 2023-01-16 File previewing method and device, electronic equipment and storage medium Pending CN116028136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310059820.7A CN116028136A (en) 2023-01-16 2023-01-16 File previewing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310059820.7A CN116028136A (en) 2023-01-16 2023-01-16 File previewing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116028136A true CN116028136A (en) 2023-04-28

Family

ID=86081001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310059820.7A Pending CN116028136A (en) 2023-01-16 2023-01-16 File previewing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116028136A (en)

Similar Documents

Publication Publication Date Title
CN112861057B (en) Page rendering method, device, equipment and storage medium based on applet
CN107832099B (en) Method and device for client version compatibility and storage medium
KR20190005855A (en) Page component dynamic layout
EP3324325A1 (en) Method, client, and system for testing application
CN112559086B (en) Applet page rendering method and device, electronic equipment and readable storage medium
CN111291374B (en) Application program detection method, device and equipment
CN107045546B (en) Webpage processing method and device and intelligent terminal
CN111694733A (en) API (application programming interface) testing method and device for software development kit SDK (software development kit)
CN111444453A (en) Page return data processing method and device
CN114035865A (en) Method, device and equipment for starting small program and storage medium
CN108345683B (en) Webpage display method, device, terminal and storage medium
CN114090118B (en) Method, device, equipment and storage medium for starting applet
CN110770720A (en) Resource searching method and related product
CN116028136A (en) File previewing method and device, electronic equipment and storage medium
CN108268298B (en) Desktop icon generation method and device, storage medium and electronic equipment
CN117742699A (en) Method, device, equipment and storage medium for generating functional module of application program
CN106155451B (en) Information processing method and electronic equipment
CN107409327B (en) Processing operation method and equipment
CN113805984B (en) Dynamic webpage screenshot method, terminal equipment and storage medium
CN114237752A (en) Display method and device of pushed page, electronic equipment and storage medium
CN114401300B (en) Cloud application control method, device, equipment, medium and program product
CN114428646B (en) Data processing method and device, electronic equipment and storage medium
CN108255918B (en) Method for acquiring pre-reading keyword set, webpage access equipment and electronic equipment
CN113094607B (en) Method and device for obtaining local resources
CN110785752A (en) Resource searching method and related product

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