A method, device and storage medium supporting multiple types of browsers to preview files

By using multiple file conversion algorithms and preset conversion tables in the browser plug-in, optimizing the plug-in according to the browser type and version, identifying and correcting file suffixes, solving the problem of preview file compatibility in different browsers, and realizing multi-type File preview capability.

CN117453307BActive Publication Date: 2024-10-15浪潮智慧科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311415398.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2024-10-15
Estimated Expiration
2043-10-27

AI Technical Summary

Technical Problem

Existing browser plug-ins usually only support the preview of one file type, resulting in compatibility issues when opening different types of preview files in different types of browsers.

Method used

By building browser plug-ins, loading and matching browser plug-ins, using multiple file conversion algorithms and preset conversion tables, optimizing plug-ins according to browser type and version, identifying and modifying file suffixes to determine and preview whether the file can be converted to Page file, and correct it through the suffix modification algorithm when it cannot be previewed.

Benefits of technology

It enables opening different types of preview files in different types of browsers, solves browser plug-in compatibility issues, and improves the flexibility and usability of file previews.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117453307B_ABST
    Figure CN117453307B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium that supports previewing files in multiple types of browsers, and belongs to the technical field of browser plug-ins. The method includes: constructing a browser plug-in and starting a browser, loading and matching the browser plug-in based on the browser; selecting a file to be previewed, and obtaining the name of the file to be previewed; processing the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; when the file to be previewed cannot be converted into a page file, modifying the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determining whether the file to be previewed can be converted into a page file; when the file to be previewed can be converted into a page file, previewing the file to be previewed based on a preset preview algorithm. The present application achieves the effect of opening different types of preview files in different types of browsers through the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of browser plug-ins, and more particularly to a method, device and storage medium for supporting file preview in multiple types of browsers. Background Art

[0002] Browser plug-ins are programs that have their own running processes and methods, and their plug-ins are just programs that supplement them.

[0003] In the prior art, the way to implement browser page file preview is to convert the file into a format that the browser can display through a plug-in, but these plug-ins usually only support preview of one file type. If you want to preview multiple types of files at one function point, you need to call multiple plug-ins, but these plug-ins have compatibility issues to a certain extent.

[0004] Therefore, how to open different types of preview files in different types of browsers becomes a problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a method, device and storage medium for supporting preview files in multiple types of browsers, so as to solve the following technical problem: how to open preview files of different types in different types of browsers.

[0006] In a first aspect, an embodiment of the present application provides a method for supporting preview of files in multiple types of browsers, characterized in that the method includes: constructing a browser plug-in and starting a browser, loading and matching the browser plug-in based on the browser; wherein the browser plug-in includes multiple file conversion algorithms that can convert different types of files into page files, and the page file is a file that can be viewed in the browser; selecting a file to be previewed, and obtaining the name of the file to be previewed; wherein the name of the file to be previewed includes the name of the file to be previewed and the suffix of the file to be previewed; processing the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; when the file to be previewed cannot be converted into a page file, modifying the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determining whether the file to be previewed can be converted into a page file; when the file to be previewed can be converted into a page file, previewing the file to be previewed based on a preset preview algorithm.

[0007] In one implementation of the present application, loading and matching a browser plug-in based on a browser specifically includes: loading a browser plug-in by a browser; wherein the browser plug-in includes multiple file conversion algorithms; querying the type and version of the browser based on a query algorithm preset in the browser plug-in; matching a preset first browser conversion table based on the type and version of the browser to determine a first file conversion algorithm set and a second browser conversion table; matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set; replacing the file conversion algorithm of the browser plug-in with the second file conversion algorithm set, and matching the browser and the browser plug-in.

[0008] In one implementation of the present application, a preset first browser conversion table is matched based on the type and version of the browser to determine a first file conversion algorithm set and a second browser conversion table, specifically including: matching a preset function query table according to the type and version of the browser to determine the file type that the browser can preview; matching the file conversion algorithm of the browser plug-in based on the file type that the browser can preview, and deleting the file conversion algorithm whose file type after conversion is not a file type that the browser can preview, to obtain the first file conversion algorithm set.

[0009] In one implementation of the present application, a preset second browser conversion table is matched based on the type and version of the browser to determine a second file conversion algorithm set, specifically including: matching a preset algorithm query table according to the type and version of the browser to determine the file conversion algorithm included in the browser; matching the file conversion algorithm of the browser plug-in based on the file conversion algorithm included in the browser, and deleting the file conversion algorithm of the browser plug-in that is different from the file conversion algorithm included in the browser to obtain a second file conversion algorithm set.

[0010] In one implementation of the present application, a suffix of a file to be previewed is processed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file, specifically including: matching the suffix of the file to be previewed with a suffix registry, and determining whether the suffix registry contains the suffix of the file to be previewed; wherein the suffix registry is a table consisting of suffixes of files to be previewed that can be converted into page files; when the suffix registry contains the suffix of the file to be previewed, the file to be previewed can be converted into a page file; when the suffix registry does not contain the suffix of the file to be previewed, processing the suffix of the file to be previewed based on a preset natural language algorithm to modify the file suffix to a corrected file suffix, and determining whether the file to be previewed can be converted into a page file.

[0011] In one implementation of the present application, a suffix of a file to be previewed is processed based on a preset natural language algorithm to modify the file suffix to a correction file suffix, and a judgment is made as to whether the file to be previewed can be converted into a page file, specifically including: matching the suffix of the file to be previewed with a correction file suffix comparison table, and determining a correction file suffix set; wherein; the correction file suffix set is a collection of correction file suffixes with the highest similarity to the suffix of the file to be previewed, and the correction file suffix comparison table includes a plurality of correction file suffixes; when the number of correction file suffixes in the correction file suffix set is one, the suffix of the file to be previewed is modified to a correction file suffix in the correction file suffix set, and a judgment is made as to whether the file to be previewed can be converted into a page file; when the number of suffixes in the suffix set is greater than one, the suffix of the file to be previewed is modified to the correction file suffixes in the correction file suffix set in sequence, and a judgment is made as to whether the file to be previewed can be converted into a page file.

[0012] In one implementation of the present application, when the file to be previewed cannot be converted into a page file, the suffix of the file to be previewed is modified based on a preset suffix modification algorithm, and it is determined whether the file to be previewed can be converted into a page file, specifically including: obtaining the attributes of the file to be previewed; determining the file header identifier of the file to be previewed based on the attributes of the file to be previewed; matching the file header comparison table based on the file header identifier of the file to be previewed to determine the modified suffix name of the file to be previewed; modifying the file suffix of the file to be previewed to the modified suffix name; processing the modified suffix name based on the file conversion algorithm to determine whether the file to be previewed can be converted into a page file.

[0013] In one implementation of the present application, when the file to be previewed can be converted into a page file, the file to be previewed is previewed based on a preset preview algorithm, specifically including: determining a file conversion algorithm based on a suffix name that matches the file to be previewed and a suffix name that can be displayed by the browser that is preset in the preview algorithm; processing the file to be previewed based on the file conversion algorithm to preview the file to be previewed.

[0014] In a second aspect, an embodiment of the present application also provides a device that supports previewing files in multiple types of browsers, characterized in that the device includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: build a browser plug-in and start the browser, and load and match the browser plug-in based on the browser; wherein the browser plug-in includes multiple file conversion algorithms that can convert different types of files into page files, and the page file is a file that can be viewed in the browser; select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the name of the file to be previewed and the suffix of the file to be previewed; process the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; when the file to be previewed cannot be converted into a page file, modify the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determine whether the file to be previewed can be converted into a page file; when the file to be previewed can be converted into a page file, preview the file to be previewed based on a preset preview algorithm.

[0015] In a third aspect, an embodiment of the present application further provides a non-volatile computer storage medium that supports previewing files of multiple types of browsers, storing computer executable instructions, characterized in that the computer executable instructions are configured to: construct a browser plug-in and start the browser, load and match the browser plug-in based on the browser; wherein the browser plug-in includes multiple file conversion algorithms that can convert different types of files into page files, and the page file is a file that can be viewed in the browser; select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the name of the file to be previewed and the suffix of the file to be previewed; process the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; when the file to be previewed cannot be converted into a page file, modify the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determine whether the file to be previewed can be converted into a page file; when the file to be previewed can be converted into a page file, preview the file to be previewed based on a preset preview algorithm.

[0016] The embodiments of the present application provide a method, device and storage medium for supporting file preview in multiple types of browsers. By loading a browser plug-in in a browser, the browser plug-in can be optimized according to the type and version of the browser during the browser plug-in matching process, so that the browser plug-in matches the browser, and the file to be previewed can be previewed in the browser. By identifying the suffix of the file to be previewed, it can be determined whether the file to be previewed can be previewed in the browser, and when the preview cannot be performed, the suffix of the file to be previewed is modified by a suffix modification algorithm. In this way, different types of preview files can be opened in different types of browsers. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 A flowchart of a method for supporting file preview in multiple browser types provided in an embodiment of the present application;

[0019] Figure 2 A schematic diagram of the internal structure of a device that supports previewing files in multiple browser types provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0021] The embodiments of the present application provide a method, device and storage medium for supporting preview files in multiple types of browsers, so as to solve the following technical problem: how to open preview files of different types in different types of browsers.

[0022] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0023] Figure 1 A flowchart of supporting multiple types of browsers to preview files is provided in the embodiment of the present application. Figure 1 As shown, the embodiment of the present application provides a method for supporting multiple types of browsers to preview files, which specifically includes the following steps:

[0024] Step 1: Build a browser plug-in and start the browser, load and match the browser plug-in based on the browser.

[0025] The browser plug-in includes multiple file conversion algorithms that can convert different types of files into page files, which are files that can be viewed in the browser. For example, in the browser, the staff found the solution to the problem through query, but the solution is a document in docx format, which cannot be directly viewed in the browser and needs to be downloaded to the computer disk. If the content of the file is not the answer to the staff's question, it will waste a lot of time for the staff, so it is necessary to preview the file in the browser. The preview method is the file conversion algorithm.

[0026] A browser is an application used to retrieve, display, and transmit Web information resources. Web information resources are marked by Uniform Resource Identifier (URI), which is a web page, a picture, a video, or any content presented on the Web. Users can browse interrelated information through a browser with the help of hyperlinks.

[0027] The user first needs to open the browser that needs to use the browser plug-in, and install and load the browser plug-in in the browser.

[0028] The specific installation and loading process is as follows:

[0029] Step 11. The browser loads the browser plug-in.

[0030] The browser plug-in includes multiple file conversion algorithms, which are downloaded and recorded through the browser.

[0031] Step 12: Query the type and version of the browser based on the query algorithm preset in the browser plug-in.

[0032] In order to make the browser plug-in adapt to different types and versions of browsers, the browser plug-in is equipped with multiple file conversion algorithms. Some browsers do not need some of the file conversion algorithms in the browser plug-in. In order to reduce the specifications of the browser plug-in, this part of the unnecessary file conversion algorithm is deleted. The type and version of the browser can be queried by querying the algorithm.

[0033] Step 13: Match the preset first browser conversion table based on the type and version of the browser to determine the first file conversion algorithm set and the second browser conversion table.

[0034] The first browser conversion table is a set of all file conversion algorithms in the browser plug-in.

[0035] The first file conversion algorithm set is a set of file conversion algorithms not required by the browser plug-in, and the second browser conversion table is a set of the first browser conversion table without the first file conversion algorithm set.

[0036] The specific process is as follows: according to the type and version of the browser, a preset function query table is matched to determine the file types that the browser can preview. Based on the file types that the browser can preview, the file conversion algorithm of the browser plug-in is matched, and the file conversion algorithm whose file type after conversion is not the file type that the browser can preview is deleted to obtain the first file conversion algorithm set.

[0037] Step 14: Match a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set.

[0038] The second file conversion algorithm set is a set of file conversion algorithms not required by the browser plug-in, and the second browser conversion table is a set of the first browser conversion table minus the first file conversion algorithm set.

[0039] According to the type and version of the browser, a preset algorithm query table is matched to determine the file conversion algorithm included in the browser. Based on the file conversion algorithm included in the browser, the file conversion algorithm of the browser plug-in is matched, and the file conversion algorithm included in the browser is deleted from the file conversion algorithm of the browser plug-in to obtain a second file conversion algorithm set.

[0040] Step 15: Replace the file conversion algorithm of the browser plug-in with the second file conversion algorithm set, and match the browser and the browser plug-in.

[0041] After the second file conversion algorithm set is determined, the second file conversion algorithm can be used to replace the file conversion algorithm in the browser plug-in, thereby reducing the specification of the browser plug-in and reducing the operating burden of the browser.

[0042] Step 2: Select the file to be previewed and obtain the name of the file to be previewed.

[0043] The name of the file to be previewed includes the file name to be previewed and the file suffix to be previewed. In a specific example, the user selects a file on the page with a mouse pointer, which is to select the file to be previewed.

[0044] In the specific example, the file to be previewed is: daan.docx.

[0045] The name of the file to be previewed is: daan, and the suffix of the file to be previewed is docx.

[0046] Step 3: Process the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file.

[0047] In the preview file, the type of the file to be previewed can usually be determined by the suffix of the file to be previewed. At this time, the file conversion algorithm is determined according to the type of the file to be previewed and the file types supported by the browser for previewing, so that the file to be previewed can be previewed on the browser.

[0048] However, among the files to be previewed on the browser, there are files whose publishers deliberately publish wrong suffixes so that users can view them after downloading. For example, there are files to be previewed whose suffixes are incorrectly written by publishers, for example, there are files to be previewed whose suffixes are incorrectly written by publishers, for example, there are files to be previewed whose suffixes are daan.cocx.

[0049] In order to avoid the above problem, it is necessary to process the suffix of the file to be previewed through a file conversion algorithm preset in the browser plug-in to prevent the user from downloading the file to be previewed.

[0050] The suffix of the file to be previewed is matched with the suffix registry, and it is determined whether the suffix registry contains the suffix of the file to be previewed. The suffix registry is a table composed of the suffixes of the file to be previewed that can be converted into page files.

[0051] For example, the suffix registry includes: docx, excel.

[0052] It can be determined whether the file to be previewed can be previewed by the browser according to the suffix registry.

[0053] When the suffix registry contains the suffix of the file to be previewed, the file to be previewed can be converted into a page file. At this time, the file to be previewed can be converted by a file conversion algorithm.

[0054] When the suffix registry does not contain the suffix of the file to be previewed, the suffix of the file to be previewed is processed based on a preset natural language algorithm to modify the file suffix to a correction file suffix, and a judgment is made as to whether the file to be previewed can be converted into a page file. The suffix of the file to be previewed is matched with the correction file suffix comparison table, and a correction file suffix set is determined. Among them. The correction file suffix set is a collection of correction file suffixes with the highest similarity to the suffix of the file to be previewed, and the correction file suffix comparison table includes a plurality of correction file suffixes. When the number of correction file suffixes in the correction file suffix set is one, the suffix of the file to be previewed is modified to a correction file suffix in the correction file suffix set, and a judgment is made as to whether the file to be previewed can be converted into a page file. When the number of suffixes in the suffix set is greater than one, the suffixes of the file to be previewed are modified to the correction file suffixes in the correction file suffix set in sequence, and a judgment is made as to whether the file to be previewed can be converted into a page file.

[0055] Step 4: When the file to be previewed cannot be converted into a page file, the suffix of the file to be previewed is modified to a modified file suffix based on a preset suffix modification algorithm, and it is determined whether the file to be previewed can be converted into a page file.

[0056] When the suffix of the file to be previewed cannot be modified through the natural language algorithm, it may be that the uploader of the file to be previewed wants to prevent users from previewing the file to be previewed. For example, the file to be previewed is named: daan.docx.excel, and the file is a docx file, but the suffix is ​​an excel file. At this time, the file to be previewed cannot be opened. In this case, the real suffix of the file to be previewed can be determined through the file header of the file to be previewed and modified.

[0057] Step 41: Get the properties of the file to be previewed.

[0058] First, the browser caches the file to be previewed, and obtains the properties of the file to be previewed, in which the file header identifier of the file to be previewed is recorded. Then, the file header identifier of the file to be previewed is determined through the properties of the file to be previewed.

[0059] Step 42: Match the file header comparison table based on the file header identifier of the file to be previewed to determine the modified suffix name of the file to be previewed.

[0060] After obtaining the file header identifier of the file to be previewed, the file header comparison table can be matched according to the file header identifier of the file to be previewed to obtain the file suffix name corresponding to the file header identifier.

[0061] In the example, the file name to be previewed is: daan.docx.excel, and its file header is identified as a format corresponding to docx, so the file to be previewed is a docx file.

[0062] Step 43: modify the file suffix of the file to be previewed to the modified suffix name.

[0063] Referring to the above example, the modified file to be previewed is: daan.docx.docx.

[0064] Step 44: Modify the suffix name based on the file conversion algorithm to determine whether the file to be previewed can be converted into a page file.

[0065] At this time, it is repeated according to step 3 to determine whether the file to be previewed can be converted into a page file.

[0066] Step 5: When the file to be previewed can be converted into a page file, the file to be previewed is previewed based on a preset preview algorithm.

[0067] After it is determined that the file to be previewed can be previewed, the file to be previewed is previewed using a preview algorithm.

[0068] The preview algorithm is described in detail from step 51 to step 52.

[0069] Step 51: Determine a file conversion algorithm based on the preset matching of the suffix of the file to be previewed and the browser in the preview algorithm.

[0070] Through the suffix of the file to be previewed, the suffix of the file to be previewed can eventually be converted into the suffix of the page file. At this time, according to the suffix and the suffix that the browser can display, the suffix name that the browser can display is matched, and the file conversion algorithm can be determined.

[0071] Step 52: Process the file to be previewed based on the file conversion algorithm to preview the file to be previewed.

[0072] The file to be previewed is processed according to the file conversion algorithm and converted into a page file, so that the file to be previewed can be directly viewed in the browser.

[0073] For example, convert the daan.docx file to daan.html file for preview.

[0074] The above is an embodiment of the method proposed by the present application. Based on the same inventive concept, the present application embodiment also provides a device that supports multiple types of browsers to preview files, and its structure is as follows: Figure 2 shown.

[0075] Figure 2 A schematic diagram of the internal structure of a device that supports multiple types of browser preview files provided in an embodiment of the present application. Figure 2 As shown, the device includes: at least one processor 201; and a memory 202 in communication with the at least one processor; wherein the memory 202 stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor 201 so that the at least one processor 201 can:

[0076] Build a browser plug-in and start the browser, load and match the browser plug-in based on the browser; wherein the browser plug-in includes multiple file conversion algorithms that can convert different types of files into page files, and the page file is a file that can be viewed in the browser; select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the name of the file to be previewed and the suffix of the file to be previewed; process the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; when the file to be previewed cannot be converted into a page file, modify the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determine whether the file to be previewed can be converted into a page file; when the file to be previewed can be converted into a page file, preview the file to be previewed based on a preset preview algorithm.

[0077] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium supporting preview files of multiple types of browsers stores computer executable instructions, wherein the computer executable instructions are set as follows:

[0078] Build a browser plug-in and start the browser, load and match the browser plug-in based on the browser; wherein the browser plug-in includes multiple file conversion algorithms that can convert different types of files into page files, and the page file is a file that can be viewed in the browser; select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the name of the file to be previewed and the suffix of the file to be previewed; process the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; when the file to be previewed cannot be converted into a page file, modify the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determine whether the file to be previewed can be converted into a page file; when the file to be previewed can be converted into a page file, preview the file to be previewed based on a preset preview algorithm.

[0079] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0080] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.

[0081] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0082] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0085] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0086] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0087] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0088] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0089] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for supporting file preview in multiple types of browsers, characterized in that: The method comprises: Building a browser plug-in and starting a browser, and loading and matching the browser plug-in based on the browser; wherein the browser plug-in includes a plurality of file conversion algorithms capable of converting different types of files into page files, and the page files are files that can be viewed in the browser; Select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the file name to be previewed and the file suffix to be previewed; Processing the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; When the file to be previewed cannot be converted into a page file, modifying the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determining whether the file to be previewed can be converted into a page file; When the file to be previewed can be converted into a page file, previewing the file to be previewed based on a preset preview algorithm; Loading and matching the browser plug-in based on the browser specifically includes: The browser loads the browser plug-in; wherein the browser plug-in includes multiple file conversion algorithms; Querying the type and version of the browser based on a query algorithm preset in the browser plug-in; Matching a preset first browser conversion table based on the type and version of the browser to determine a first file conversion algorithm set and a second browser conversion table; Matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set; Replace the file conversion algorithm of the browser plug-in with the second file conversion algorithm set, and match the browser and the browser plug-in; Based on the type and version of the browser, a preset first browser conversion table is matched to determine a first file conversion algorithm set and a second browser conversion table, specifically including: Matching a preset function query table according to the type and version of the browser to determine the file types that the browser can preview; Matching the file conversion algorithm of the browser plug-in based on the file type that the browser can preview, and deleting the file conversion algorithm whose file type after conversion is not the file type that the browser can preview, so as to obtain a first file conversion algorithm set; The method further comprises: matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set. Matching a preset algorithm query table according to the type and version of the browser to determine the file conversion algorithm included in the browser; Matching the file conversion algorithm of the browser plug-in based on the file conversion algorithm included in the browser, and deleting the file conversion algorithm of the browser plug-in that matches the file conversion algorithm included in the browser, so as to obtain a second file conversion algorithm set; The first browser conversion table is a set of all file conversion algorithms in the browser plug-in; the second browser conversion table is a set of the first browser conversion table minus the first file conversion algorithm set.

2. A method for supporting multiple types of browsers to preview files according to claim 1, characterized in that: Processing the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file, specifically including: Match the suffix of the file to be previewed with a suffix registry, and determine whether the suffix registry contains the suffix of the file to be previewed; wherein the suffix registry is a table composed of suffixes of the file to be previewed that can be converted into a page file; When the suffix registration table contains the suffix of the file to be previewed, the file to be previewed can be converted into a page file; When the suffix registry does not contain the suffix of the file to be previewed, the suffix of the file to be previewed is processed based on a preset natural language algorithm to modify the file suffix to a corrected file suffix, and determine whether the file to be previewed can be converted into a page file.

3. The method for supporting multiple types of browsers to preview files according to claim 2, characterized in that: Processing the file suffix to be previewed based on a preset natural language algorithm to modify the file suffix to a modified file suffix, and determining whether the file to be previewed can be converted into a page file, specifically includes: Match the file suffix to be previewed with the correction file suffix comparison table, and determine a correction file suffix set; wherein the correction file suffix set is a set of correction file suffixes with the highest similarity to the file suffix to be previewed, and the correction file suffix comparison table includes multiple correction file suffixes; When the number of the correction file suffixes in the correction file suffix set is one, modifying the suffix of the file to be previewed to the correction file suffix in the correction file suffix set, and determining whether the file to be previewed can be converted into a page file; When the number of suffixes in the suffix set is greater than one, the suffixes of the files to be previewed are modified to the corrected file suffixes in the corrected file suffix set in sequence, and it is determined whether the files to be previewed can be converted into page files.

4. The method for supporting multiple types of browsers to preview files according to claim 1, characterized in that: When the file to be previewed cannot be converted into a page file, modifying the suffix of the file to be previewed based on a preset suffix modification algorithm, and determining whether the file to be previewed can be converted into a page file, specifically includes: Obtaining the properties of the file to be previewed; Determine a file header identifier of the file to be previewed based on the attribute of the file to be previewed; Matching the file header comparison table based on the file header identifier of the file to be previewed to determine the modified suffix name of the file to be previewed; Modify the file suffix of the file to be previewed to the modified suffix name; The modified suffix name is processed based on the file conversion algorithm to determine whether the file to be previewed can be converted into a page file.

5. The method for supporting multiple types of browsers to preview files according to claim 1, characterized in that: When the file to be previewed can be converted into a page file, previewing the file to be previewed based on a preset preview algorithm specifically includes: Determine a file conversion algorithm based on a preset match in the preview algorithm between the suffix of the file to be previewed and the suffix that can be displayed by the browser; The file to be previewed is processed based on the file conversion algorithm to preview the file to be previewed.

6. A device that supports multiple types of browsers to preview files, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Building a browser plug-in and starting a browser, and loading and matching the browser plug-in based on the browser; wherein the browser plug-in includes a plurality of file conversion algorithms capable of converting different types of files into page files, and the page files are files that can be viewed in the browser; Select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the file name to be previewed and the file suffix to be previewed; Processing the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; When the file to be previewed cannot be converted into a page file, modifying the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determining whether the file to be previewed can be converted into a page file; When the file to be previewed can be converted into a page file, previewing the file to be previewed based on a preset preview algorithm; Loading and matching the browser plug-in based on the browser specifically includes: The browser loads the browser plug-in; wherein the browser plug-in includes multiple file conversion algorithms; Querying the type and version of the browser based on a query algorithm preset in the browser plug-in; Matching a preset first browser conversion table based on the type and version of the browser to determine a first file conversion algorithm set and a second browser conversion table; Matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set; Replace the file conversion algorithm of the browser plug-in with the second file conversion algorithm set, and match the browser and the browser plug-in; Based on the type and version of the browser, a preset first browser conversion table is matched to determine a first file conversion algorithm set and a second browser conversion table, specifically including: Matching a preset function query table according to the type and version of the browser to determine the file types that the browser can preview; Matching the file conversion algorithm of the browser plug-in based on the file type that the browser can preview, and deleting the file conversion algorithm whose file type after conversion is not the file type that the browser can preview, so as to obtain a first file conversion algorithm set; The method further comprises: matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set. Matching a preset algorithm query table according to the type and version of the browser to determine the file conversion algorithm included in the browser; Matching the file conversion algorithm of the browser plug-in based on the file conversion algorithm included in the browser, and deleting the file conversion algorithm of the browser plug-in that matches the file conversion algorithm included in the browser, so as to obtain a second file conversion algorithm set; The first browser conversion table is a set of all file conversion algorithms in the browser plug-in; the second browser conversion table is a set of the first browser conversion table minus the first file conversion algorithm set.

7. A non-volatile computer storage medium supporting preview files of multiple types of browsers, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Building a browser plug-in and starting a browser, and loading and matching the browser plug-in based on the browser; wherein the browser plug-in includes a plurality of file conversion algorithms capable of converting different types of files into page files, and the page files are files that can be viewed in the browser; Select a file to be previewed, and obtain the name of the file to be previewed; wherein the name of the file to be previewed includes the file name to be previewed and the file suffix to be previewed; Processing the suffix of the file to be previewed based on a preset file conversion algorithm to determine whether the file to be previewed can be converted into a page file; When the file to be previewed cannot be converted into a page file, modifying the suffix of the file to be previewed to a modified file suffix based on a preset suffix modification algorithm, and determining whether the file to be previewed can be converted into a page file; When the file to be previewed can be converted into a page file, previewing the file to be previewed based on a preset preview algorithm; Loading and matching the browser plug-in based on the browser specifically includes: The browser loads the browser plug-in; wherein the browser plug-in includes multiple file conversion algorithms; Querying the type and version of the browser based on a query algorithm preset in the browser plug-in; Matching a preset first browser conversion table based on the type and version of the browser to determine a first file conversion algorithm set and a second browser conversion table; Matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set; Replace the file conversion algorithm of the browser plug-in with the second file conversion algorithm set, and match the browser and the browser plug-in; Based on the type and version of the browser, a preset first browser conversion table is matched to determine a first file conversion algorithm set and a second browser conversion table, specifically including: Matching a preset function query table according to the type and version of the browser to determine the file types that the browser can preview; Matching the file conversion algorithm of the browser plug-in based on the file type that the browser can preview, and deleting the file conversion algorithm whose file type after conversion is not the file type that the browser can preview, so as to obtain a first file conversion algorithm set; The method further comprises: matching a preset second browser conversion table based on the type and version of the browser to determine a second file conversion algorithm set. Matching a preset algorithm query table according to the type and version of the browser to determine the file conversion algorithm included in the browser; Matching the file conversion algorithm of the browser plug-in based on the file conversion algorithm included in the browser, and deleting the file conversion algorithm of the browser plug-in that matches the file conversion algorithm included in the browser, so as to obtain a second file conversion algorithm set; The first browser conversion table is a set of all file conversion algorithms in the browser plug-in; The second browser conversion table is a set of the first browser conversion table minus the first file conversion algorithm set.