A table online preview method, device and system

The table data is received and converted into a preset format through the server, and the table data is displayed using the online table component, which solves the problem of online preview destroying the original display method and realizes efficient online table preview.

CN114519037BActive Publication Date: 2025-09-19AGRICULTURAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210155474.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2025-09-19
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

The existing online preview method destroys the original display method of the table and cannot restore the original display effect of the table, which reduces the preview effect.

Method used

The server receives the online preview request of the table from the web page, obtains and converts the table file into table data in a preset data exchange format based on the target table identifier, and sends the link information of the target table data and the online table component to the web page. The online table component is used to display the table data on the preview page, completely restoring the original display method of the table.

Benefits of technology

It enables online preview of tables in the original display mode without installing plug-ins or presetting preview pages, greatly improving the preview effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114519037B_ABST
    Figure CN114519037B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a method, device, and system for online previewing a table. The method includes: receiving an online preview request for a table sent by a web page; obtaining a target table file to be previewed based on a target table identifier in the online preview request, converting the target table file, and determining target table data corresponding to a preset data exchange format; sending the target table data and a preview page containing link information corresponding to an online table component to the web page, so that the web page loads the online table component on the preview page based on the link information and displays the target table data through the online table component. Through the technical solution of the embodiment of the present invention, it is possible to avoid destroying the original display method of the table, perform online preview in the original display method of the table, and improve the preview effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to a table online preview method, device and system. Background Art

[0002] In the era of paperless office, people often use Excel spreadsheets to collect, summarize, and display information, which generates a large number of Excel spreadsheet files. The traditional preview method is to download the Excel spreadsheet file to the local computer and then use the spreadsheet software to preview it offline. However, with the trend of mobile office, people have more and more demands for online preview of Excel information. The current online preview method usually pre-sets the table data in different tables to a specific preview page, so that the table data can be previewed online using a specific display method. It can be seen that this online preview method destroys the original display method of the table, so that different tables can only be previewed online in the same specific display method. The original display method of the table cannot be restored, which reduces the preview effect. Summary of the Invention

[0003] Embodiments of the present invention provide a method, device, and system for online previewing of a table, so as to avoid destroying the original display mode of the table and improve the preview effect.

[0004] In a first aspect, an embodiment of the present invention provides a table online preview method, applied to a server, comprising:

[0005] Receive the form online preview request sent by the web page;

[0006] Based on the target table identifier in the table online preview request, obtaining the target table file to be previewed, and converting the target table file to determine the target table data corresponding to the preset data exchange format;

[0007] The target table data and a preview page containing link information corresponding to the online table component are sent to the web page, so that the web page loads the online table component based on the link information on the preview page and displays the target table data through the online table component.

[0008] In a second aspect, an embodiment of the present invention further provides a table online preview device, which is integrated into a server and includes:

[0009] The request receiving module is used to receive the form online preview request sent by the web page;

[0010] a data determination module, configured to obtain a target table file to be previewed based on a target table identifier in the table online preview request, convert the target table file, and determine target table data corresponding to a preset data exchange format;

[0011] A data display module is used to send the target table data and a preview page containing link information corresponding to the online table component to the web page, so that the web page loads the online table component on the preview page based on the link information and displays the target table data through the online table component.

[0012] In a third aspect, an embodiment of the present invention further provides a table online preview system, the system comprising: a web page and a server;

[0013] The server is used to implement the table online preview method described in any embodiment of the present invention.

[0014] The technical solution of the embodiment of the present invention is to receive a table online preview request sent by a web page through a server; based on the target table identifier in the table online preview request, obtain the target table file to be previewed, convert the target table file, and determine the target table data corresponding to the preset data exchange format; send the target table data and a preview page containing link information corresponding to the online table component to the web page, so that the web page can load the online table component based on the link information on the received preview page, and display the target table data through the online table component, so that the web page can use the online table component loaded on the preview page to display the target table data in the original display mode of the target table, and there is no need for the user to install plug-ins, preset preview pages, etc., and the original display mode of the target table is completely restored, so that the target table can be previewed online in the original display mode, which greatly improves the preview effect.

[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 This is a flowchart of a table online preview method provided in Example 1 of the present invention;

[0018] Figure 2 This is a flow chart of a table online preview method provided in the second embodiment of the present invention;

[0019] Figure 3 This is a flowchart of a table online preview method provided by the third embodiment of the present invention;

[0020] Figure 4 This is a schematic structural diagram of a table online preview device provided by a fourth embodiment of the present invention;

[0021] Figure 5 This is a structural diagram of a table online preview system provided in Example 5 of the present invention. DETAILED DESCRIPTION

[0022] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0023] Example 1

[0024] Figure 1 This is a flow chart of a table online preview method provided in the first embodiment of the present invention. This embodiment is applicable to the case of online previewing a table on a web page. The method can be executed by a table online preview device, which can be implemented by software and / or hardware and integrated into a server. Figure 1 As shown, the method specifically includes the following steps:

[0025] S110: Receive a form online preview request sent by a web page.

[0026] The web page end may refer to a user end for accessing a web page, such as a browser on a computer or mobile device or a built-in applet in a client. The form online preview request may refer to an instruction to perform an online preview of a form on a web page end without downloading the form to be previewed.

[0027] Specifically, the web page can generate a table online preview request based on a user-triggered online preview operation. For example, when a user wants to preview a table online, they can trigger the online preview operation by clicking the preview button corresponding to the table. When the user detects the online preview operation, it generates a table online preview request based on the table identifier corresponding to the table and sends the table online preview request to the server, so that the server can receive the table online preview request.

[0028] S120 : Based on the target table identifier in the table online preview request, obtain the target table file to be previewed, convert the target table file, and determine the target table data corresponding to the preset data exchange format.

[0029] The target table identifier may be identification information used to uniquely characterize the target table so as to distinguish different tables. For example, the target table identifier may refer to ID information pre-assigned to the target table, or may refer to a URL network address storing the target table file. The target table file may refer to the file of the target table requested for online preview by the web page. The preset data exchange format may be pre-set based on the data format supported by the online table component. For example, when the online table component is the Luckysheet component, the preset data exchange format may be in JSON format.

[0030] Specifically, the server may parse the table preview request to obtain a target table identifier and, based on the target table identifier, retrieve the target table file locally or remotely from a third-party server. For example, if the server locally stores a table file corresponding to each table identifier, the server may directly retrieve the target table file corresponding to the target table identifier locally. The server then converts the obtained target table file into target table data corresponding to a preset data exchange format, so that the online form component can open and import the target table data.

[0031] Exemplarily, "obtaining the target table file to be previewed based on the target table identifier in the table online preview request" in S120 may include: accessing the remote server based on the target network address in the table online preview request, and obtaining the target table file to be previewed returned by the remote server.

[0032] Specifically, when storing a table file on a third-party remote server, the target network address URL where the target table file is stored can be used as the target table identifier, so that the server can access the third-party remote server based on the target network address and obtain the target table file to be previewed returned by the remote server.

[0033] Exemplarily, "converting the target table file and determining the target table data corresponding to the preset data exchange format" in S120 may include: converting the target table file through the Luckyexcel table plug-in and determining the target table data corresponding to the preset data exchange format.

[0034] Among them, the Luckyexcel table plug-in is a plug-in in the online table component ecosystem similar to Excel. Through this plug-in, the online table component can realize the function of importing or exporting Excel files.

[0035] Specifically, the LuckyExcel spreadsheet plugin allows you to convert the acquired target spreadsheet file into target spreadsheet data in a pre-defined data exchange format supported by the online spreadsheet component, such as JSON. The LuckyExcel spreadsheet plugin offers strong concurrency and high conversion efficiency.

[0036] S130: Send the target table data and the preview page containing the link information corresponding to the online table component to the web page, so that the web page loads the online table component based on the link information on the preview page and displays the target table data through the online table component.

[0037] The online table component may refer to a component that supports online import of table data. For example, the online table component may include, but is not limited to, the Luckysheet component. The Luckysheet component is a pure front-end online table component similar to Excel. The preview page may refer to a page for online previewing of a table on a web page. The preview page includes link information corresponding to the online table component.

[0038] Specifically, the server adds the link information corresponding to the online table component to the preview page, and sends the preview page and the converted target table data to the web page, so that the web page can load the corresponding online table component based on the link information in the preview page, so that the loaded online table component can open the target table data in the original display method, and display the target table data in the original display method of the target table on the preview page, completely restoring the original display method of the target table, so that users can preview the target table in the original display method online, greatly improving the preview effect.

[0039] The technical solution of this embodiment is to receive a table online preview request sent by a web page through a server; based on the target table identifier in the table online preview request, obtain the target table file to be previewed, convert the target table file, and determine the target table data corresponding to the preset data exchange format; send the target table data and a preview page containing link information corresponding to the online table component to the web page, so that the web page can load the online table component based on the link information on the received preview page, and display the target table data through the online table component, so that the web page can use the online table component loaded on the preview page to display the target table data in the original display mode of the target table, and there is no need for the user to install plug-ins, preset preview pages, etc., and the original display mode of the target table is completely restored, so that the target table can be previewed online in the original display mode, which greatly improves the preview effect.

[0040] Example 2

[0041] Figure 2This is a flowchart of the table online preview method provided by the second embodiment of the present invention. Based on the above embodiments, this embodiment describes in detail the process of determining the target table data using the cache database. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 As shown, the online form preview method specifically includes the following steps:

[0042] S210: Receive a form online preview request sent by a web page.

[0043] S220 , based on the target table identifier in the table online preview request, detecting whether there is corresponding cache data in the cache database, if yes, proceeding to step S230 , if not, proceeding to step S240 .

[0044] The cache database can be used to cache table data in a preset data exchange format corresponding to tables that have been previewed online. The cache database may refer to, but is not limited to, a Redis cache database. Redis (Remote Dictionary Server), also known as the Remote Dictionary Server, is an open-source, network-enabled, log-based, key-value database that can be both in-memory and persistent.

[0045] Specifically, after receiving a form online preview request, the cache database may be checked to determine whether cache data corresponding to the target form to be previewed, i.e., target form data in a preset data exchange format, is currently stored. For example, the target form identifier in the form online preview request may be used as key information to query the cache database to determine whether the value information corresponding to the key information exists. If so, it indicates that the target form has been previewed before, and in this case, it can be determined that the cache database has cache data corresponding to the target form identifier. If not, it indicates that the target form is being previewed for the first time, and in this case, it can be determined that the corresponding cache data does not exist.

[0046] S230 , obtaining the target table data corresponding to the target table identifier from the cache database, and proceeding to step S250 .

[0047] Specifically, when cached data corresponding to a target table identifier exists in a cache database, a preset data acquisition method that matches the preset data storage method can be used to acquire the target table data in a preset data exchange format corresponding to the target table identifier from the cache database, thereby improving the efficiency of acquiring the target table data and, in turn, increasing the speed of online preview in scenarios with massive and highly concurrent requests, further enhancing the user experience. For example, in a cache database, when the table identifier is directly used as key information and the corresponding table data is stored as value information, for this data storage method, the value information obtained by directly querying the target table identifier as the target table data corresponding to the target table identifier can be used.

[0048] S240. Based on the target table identifier in the table online preview request, obtain the target table file to be previewed, convert the target table file, determine the target table data corresponding to the preset data exchange format, and store the target table identifier and the corresponding target table data in the cache database, and proceed to step S250.

[0049] Specifically, when the cache data corresponding to the target table identifier does not exist in the cache database, the target table file is obtained from the local or remote server based on the target table identifier and converted to obtain the target table data corresponding to the preset data exchange format, and based on the preset data storage method, the target table identifier and the corresponding target table data are stored in the cache database. For example, the target table identifier is directly used as the key information, and the target table data is directly stored as the value information in the cache database, so that when the target table needs to be previewed again in the future, the target table data can be quickly obtained directly from the cache database, which further improves the online preview speed and has the technical effect of fast response and meeting high concurrency scenarios.

[0050] S250: Send the target table data and the preview page containing the link information corresponding to the online table component to the web page, so that the web page loads the online table component based on the link information on the preview page and displays the target table data through the online table component.

[0051] The technical solution of this embodiment stores the target table data in a preset data exchange format corresponding to the target table previewed online for the first time in a cache database, so that when the target table is previewed online next time, the corresponding target table data can be quickly obtained directly from the cache database without the need for re-conversion and generation, thereby improving the efficiency of obtaining the target table data, and further improving the online preview speed in massive high-concurrency request scenarios, further improving the user experience, and having the technical effect of fast response and meeting high-concurrency scenarios.

[0052] Based on the above technical solution, "storing the target table identifier and the corresponding target table data in the cache database" in S240 may include: compressing and sharding the target table data to obtain the processed compressed data of each target shard; storing the target table identifier and the corresponding compressed data of each target shard in the cache database in the form of key-value pairs.

[0053] Specifically, the server can compress and slice the target table data based on a preset compression method, such as gzip, and obtain the compressed data of each target slice after processing. To ensure the cache and query performance of the cache database, the data size of each target slice compressed data can be set to less than 5KB. In this embodiment, the target table identifier and the corresponding compressed data of each target slice can be stored in the cache database in a nested key-value pair manner.

[0054] Exemplarily, "storing the target table identifier and the corresponding target shard compressed data in the cache database in the form of a key-value pair" may include: determining the target shard prefix identifier corresponding to the target table identifier; constructing a first key-value pair using the target table identifier as the first key information, and the target shard prefix identifier and the number of shards corresponding to the target shard compressed data as the first value information; constructing each second key-value pair using the target shard prefix identifier and each shard sequence number corresponding to the number of shards as the second key information, and the shard compressed data corresponding to the corresponding shard sequence number as the second value information; and storing the first key-value pair and each second key-value pair in the cache database.

[0055] The target shard prefix identifier may refer to the prefix information of the shard data identifier corresponding to the target shard compressed data. Each target shard compressed data has the same target shard prefix identifier. The shard data identifier corresponding to each target shard compressed data may be composed of the target shard prefix identifier and the corresponding shard sequence number. The first key-value pair is used to store the corresponding relationship between the target table identifier, the target shard prefix identifier, and the number of shards. The second key-value pair is used to store the corresponding relationship between the shard data identifier and the target shard compressed data.

[0056] Specifically, the server can convert the target table identifier based on an identifier generation method, such as a UUID (Universally Unique Identifier), such as converting the target network address, and generate a corresponding target shard prefix identifier. By using the target table identifier as the first key information, and the target shard prefix identifier and the number of shards as the first value information, a first key-value pair is constructed, so that the target shard prefix identifier and the number of shards corresponding to the target table identifier can be queried based on the first key-value pair. For each target shard compressed data, the target shard prefix identifier and the shard sequence number corresponding to the target shard compressed data can be spliced ​​to obtain the shard data identifier corresponding to the target shard compressed data, and the shard data identifier can be used as the second key information, and the shard compressed data can be used as the second value information to construct a second key-value pair corresponding to the target shard compressed data. The number of second key-value pairs is equal to the number of shards. Through this data storage method, data can be stored and queried more quickly, thereby ensuring the performance of the cache database in a high-concurrency scenario.

[0057] For example, if the target table data is compressed through sharding to obtain 10 target shard compressed data X1, X2, ..., X10, and the target table identifier A is converted to the target shard prefix identifier F, then A is used as the first key information, and F and 10 are used as the first value information to construct a first key-value pair. F1-F10 are used as the second key information, and the corresponding target shard compressed data X1, X2, ..., X10 are used as the second value information to construct 10 second key-value pairs.

[0058] Based on the above technical solution, illustratively, "obtaining target table data corresponding to the target table identifier from the cache database" in S230 may include: obtaining compressed data of each target slice in the cache database based on the target table identifier in the table online preview request; merging the compressed data of each target slice to obtain compressed data of the target table, and sending the compressed data of the target table as target table data to the web page end, so that the web page end decompresses the compressed data of the target table and displays the decompressed target table data through the online table component.

[0059] Specifically, the target table identifier can be used as the first key information, and the first value information corresponding to the key information, that is, the target shard prefix identifier and the number of shards, can be queried in the cache database. Each shard serial number corresponding to the target shard prefix identifier and the number of shards can be spliced, and each splicing result obtained can be used as the second key information. The second value information corresponding to each second key information can be queried in the cache database, that is, the target shard compressed data, so that the target shard compressed data of the number of shards can be obtained. When querying the second key information, this embodiment can obtain the compressed data of each target shard in batches by calling a batch query function, such as the multiGet function, thereby further improving the data query efficiency. It should be noted that, in order to ensure query performance, the number of second key information obtained by the batch query function in batches does not exceed the preset number, such as 10. If the number of second key information exceeds the preset number, the batch query function can be called multiple times to obtain the compressed data of all target shards. By merging all the target slice compressed data, the target table compressed data is obtained, and the target table compressed data is sent to the web page as the target table data. After receiving the target table compressed data, the web page can decompress the target table compressed data to obtain the target table data, so that the online table component can open and import the target table data and display the target table in the original display mode.

[0060] It should be noted that by compressing and sharding the target table data, the data size can be reduced, thereby improving data query efficiency. For example, approximately 100,000 read operations can be performed per second, which is much faster than the database and local file system. It is especially suitable for processing the storage and reading of massive Excel small files, and has the technical effect of fast response and meeting high concurrency scenarios.

[0061] Example 3

[0062] Figure 3 This is a flow chart of a table online preview method provided by embodiment 3 of the present invention. This embodiment is a preferred example of the above embodiments, and the explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 3 As shown, the online form preview method provided in this embodiment specifically includes the following steps:

[0063] S310: The web page sends a table online preview request to the HTTP server.

[0064] S320. The table acquisition module in the HTTP server receives a table online preview request from the web page, and when it detects that corresponding cache data exists in the Redis cache database based on the target network address in the table online preview request, obtains the compressed data of each target shard corresponding to the target table identifier from the cache database.

[0065] S330: The table acquisition module in the HTTP server merges the obtained compressed data of each fragment to obtain the target table compressed data.

[0066] S340. The table acquisition module in the HTTP server sends the target table compressed data and a preview page containing link information corresponding to the online table component to the web page, so that the web page loads the online table component based on the link information on the preview page, decompresses the target table compressed data, and displays the target table data obtained after decompression through the loaded online table component.

[0067] S350. When the table acquisition module in the HTTP server detects that there is no corresponding cache data in the cache database based on the target network address in the table online preview request, it sends the target network address to the file conversion module in the server to request downloading of the target table file and file conversion.

[0068] S360, the file conversion module in the HTTP server accesses the remote server based on the target network address and obtains the target table file returned by the remote server.

[0069] S370. The file conversion module in the HTTP server converts the returned target table file, determines the target table data corresponding to the preset data exchange format, and compresses and slices the target table data to obtain compressed data of each target slice.

[0070] S380. The file conversion module in the HTTP server stores the target table identifier and the corresponding compressed data of each target shard in the Redis cache database in the form of key-value pairs.

[0071] S380. The table acquisition module in the HTTP server merges the target segment compressed data obtained by the file conversion module to obtain target table compressed data.

[0072] S390. The table acquisition module in the HTTP server sends the target table compressed data and a preview page containing link information corresponding to the online table component to the web page, so that the web page loads the online table component based on the link information on the preview page, decompresses the target table compressed data, and displays the target table data obtained after decompression through the loaded online table component.

[0073] The technical solution of the embodiment of the present invention can completely restore the original display method of the target table by converting the target table file, so that the target table can be previewed online in the original display method, which greatly improves the preview effect. In addition, by utilizing the data cache database, the efficiency of obtaining the target table data can be improved, thereby increasing the online preview speed in massive high-concurrency request scenarios, further improving the user experience, and having the technical effect of fast response and meeting high-concurrency scenarios.

[0074] Example 4

[0075] Figure 4 This is a schematic diagram of the structure of a table online preview device provided by the fourth embodiment of the present invention. Figure 4 As shown, the device includes: a request receiving module 410, a data determining module 420 and a data display module 430.

[0076] Among them, the request receiving module 410 is used to receive a table online preview request sent by the web page; the data determination module 420 is used to obtain the target table file to be previewed based on the target table identifier in the table online preview request, and convert the target table file to determine the target table data corresponding to the preset data exchange format; the data display module 430 is used to send the target table data and the preview page containing the link information corresponding to the online table component to the web page, so that the web page loads the online table component based on the link information on the preview page, and displays the target table data through the online table component.

[0077] The technical solution of the embodiment of the present invention is to receive a table online preview request sent by a web page through a server; based on the target table identifier in the table online preview request, obtain the target table file to be previewed, convert the target table file, and determine the target table data corresponding to the preset data exchange format; send the target table data and a preview page containing link information corresponding to the online table component to the web page, so that the web page can load the online table component based on the link information on the received preview page, and display the target table data through the online table component, so that the web page can use the online table component loaded on the preview page to display the target table data in the original display mode of the target table, and there is no need for the user to install plug-ins, preset preview pages, etc., and the original display mode of the target table is completely restored, so that the target table can be previewed online in the original display mode, which greatly improves the preview effect.

[0078] Optionally, the data determination module 420 includes:

[0079] A cache data detection unit, configured to detect whether corresponding cache data exists in the cache database based on a target table identifier in the table online preview request;

[0080] a target table data acquisition unit, configured to acquire the target table data corresponding to the target table identifier from the cache database if the target table data exists;

[0081] The target table data cache unit is used to obtain the target table file to be previewed based on the target table identifier in the table online preview request, convert the target table file, determine the target table data corresponding to the preset data exchange format, and store the target table identifier and the corresponding target table data in the cache database if it does not exist.

[0082] Optionally, the target table data cache unit includes:

[0083] The compression and sharding subunit is used to compress and shard the target table data and obtain the compressed data of each target shard after processing;

[0084] The target shard compressed data storage subunit is used to store the target table identifier and the corresponding compressed data of each target shard in the cache database in the form of key-value pairs.

[0085] Optional target shard compression data storage subunit, specifically used for:

[0086] Determine the target shard prefix identifier corresponding to the target table identifier; use the target table identifier as the first key information, and the target shard prefix identifier and the number of shards corresponding to the target shard compression data as the first value information to construct a first key-value pair; use the target shard prefix identifier and each shard sequence number corresponding to the number of shards as the second key information, and the shard compression data corresponding to the corresponding shard sequence number as the second value information to construct each second key-value pair; store the first key-value pair and each second key-value pair in a cache database.

[0087] Optionally, the target table data acquisition unit is specifically used to:

[0088] Based on the target table identifier in the table online preview request, the compressed data of each target slice in the cache database is obtained; the compressed data of each target slice is merged to obtain the compressed data of the target table, and the compressed data of the target table is sent to the web page as the target table data, so that the web page decompresses the compressed data of the target table and displays the decompressed target table data through the online table component.

[0089] Optionally, the target table identifier is: a target network address where a target table file is stored;

[0090] The data determination module 420 is specifically configured to access a remote server based on a target network address in the table online preview request, and obtain a target table file to be previewed returned by the remote server.

[0091] Optionally, the data display module 430 is further specifically used to: convert the target table file through the Luckyexcel table plug-in to determine the target table data corresponding to the preset data exchange format.

[0092] Optionally, the preset data exchange format is JSON format; the online table component is the Luckysheet component.

[0093] The online table preview device provided in the embodiment of the present invention can execute the online table preview method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the online table preview method.

[0094] It is worth noting that in the embodiment of the above-mentioned table online preview device, the modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the present invention.

[0095] Example 5

[0096] Figure 5 This is a structural diagram of a table online preview system provided by Example 5 of the present invention. Figure 5 , the table online preview system includes: a web page 510 and a server 520;

[0097] The server 520 is used to implement the table online preview method provided in any of the above embodiments.

[0098] The online preview process of the system may be as follows: the server 520 receives a table online preview request sent by the web page 510, and based on the target table identifier in the table online preview request, obtains the target table file to be previewed, converts the target table file, and determines the target table data corresponding to the preset data exchange format; sends the target table data and a preview page containing link information corresponding to the online table component to the web page 510, and the web page 510 loads the online table component on the preview page based on the link information, and displays the target table data through the online table component.

[0099] In the table online preview system of this embodiment, the server receives a table online preview request sent by a web page; based on the target table identifier in the table online preview request, obtains the target table file to be previewed, converts the target table file, and determines the target table data corresponding to the preset data exchange format; sends the target table data and a preview page containing link information corresponding to the online table component to the web page, so that the web page can load the online table component based on the link information on the received preview page, and display the target table data through the online table component, so that the web page can use the online table component loaded on the preview page to display the target table data in the original display mode of the target table, and there is no need for the user to install plug-ins, preset preview pages, etc., and the original display mode of the target table is completely restored, so that the target table can be previewed online in the original display mode, which greatly improves the preview effect.

[0100] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A table online preview method, characterized in that: Applicable to servers, including: Receive the form online preview request sent by the web page; Based on the target table identifier in the table online preview request, obtaining the target table file to be previewed, and converting the target table file to determine the target table data corresponding to the preset data exchange format; Sending the target table data and a preview page containing link information corresponding to the online table component to the webpage, so that the webpage loads the online table component based on the link information on the preview page and displays the target table data in the original display mode of the target table through the online table component; The step of obtaining a target table file to be previewed based on a target table identifier in the table online preview request, converting the target table file, and determining target table data corresponding to a preset data exchange format includes: Based on the target table identifier in the table online preview request, detecting whether corresponding cache data exists in the cache database; If so, obtaining the target table data corresponding to the target table identifier from the cache database; If not, obtaining the target form file to be previewed based on the target form identifier in the form online preview request, converting the target form file, determining the target form data corresponding to the preset data exchange format, and storing the target form identifier and the corresponding target form data in the cache database; Storing the target table identifier and the corresponding target table data in the cache database includes: Compressing and slicing the target table data to obtain compressed data of each target slicing; The target table identifier and the corresponding compressed data of each target slice are stored in the cache database in the form of key-value pairs.

2. The method according to claim 1, characterized in that The storing of the target table identifier and the corresponding compressed data of each target slice in the cache database in the form of a key-value pair includes: Determine a target shard prefix identifier corresponding to the target table identifier; Using the target table identifier as first key information, and using the target shard prefix identifier and the number of shards corresponding to the target shard compressed data as first value information, to construct a first key-value pair; Using the target shard prefix identifier and each shard serial number corresponding to the shard quantity as second key information, and using the shard compressed data corresponding to the corresponding shard serial number as second value information, constructing each second key-value pair; The first key-value pair and each of the second key-value pairs are stored in the cache database.

3. The method according to claim 1, characterized in that The acquiring the target table data corresponding to the target table identifier from the cache database includes: Based on the target table identifier in the table online preview request, obtaining compressed data of each target slice in the cache database; The compressed data of each target slice are merged to obtain the target table compressed data, and the target table compressed data is sent to the web page as the target table data, so that the web page decompresses the target table compressed data and displays the decompressed target table data through the online table component.

4. The method according to claim 1, wherein The target table identifier is: a target network address where a target table file is stored; The step of obtaining a target table file to be previewed based on a target table identifier in the table online preview request includes: Based on the target network address in the table online preview request, a remote server is accessed to obtain a target table file to be previewed returned by the remote server.

5. The method according to claim 1, wherein The converting the target table file to determine the target table data corresponding to the preset data exchange format includes: The target table file is converted through the Luckyexcel table plug-in to determine the target table data corresponding to the preset data exchange format.

6. The method according to any one of claims 1 to 5, characterized in that The preset data exchange format is JSON format; the online form component is a Luckysheet component.

7. A table online preview device, integrated into a server, characterized in that: include: The request receiving module is used to receive the form online preview request sent by the web page; a data determination module, configured to obtain a target table file to be previewed based on a target table identifier in the table online preview request, convert the target table file, and determine target table data corresponding to a preset data exchange format; a data display module, configured to send the target table data and a preview page containing link information corresponding to the online table component to the web page, so that the web page loads the online table component based on the link information on the preview page and displays the target table data in the original display mode of the target table through the online table component; The data determination module includes: A cache data detection unit, configured to detect whether corresponding cache data exists in a cache database based on a target table identifier in the table online preview request; a target table data acquiring unit, configured to acquire the target table data corresponding to the target table identifier from the cache database if the target table identifier exists; a target table data caching unit, configured to, if the target table data does not exist, obtain a target table file to be previewed based on a target table identifier in the table online preview request, convert the target table file, determine target table data corresponding to a preset data exchange format, and store the target table identifier and the corresponding target table data in the cache database; The target table data cache unit includes: A compression and sharding subunit, configured to compress and shard the target table data and obtain the processed compressed data of each target shard; The target slice compressed data storage subunit is used to store the target table identifier and the corresponding target slice compressed data in the cache database in the form of key-value pairs.

8. A table online preview system, characterized in that: The system includes: a web page and a server; wherein the server is used to implement the table online preview method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • File online preview method and device, equipment and storage medium

    CN110688595A