File previewing method, front-end device, back-end server and storage medium
By requesting data on demand and obtaining file fragments concurrently, the problem of slow loading of large files in the archive system is solved, efficient file preview is achieved under limited bandwidth, and user experience and system performance are improved.
Patent Information
- Application Number
- CN202510649092.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-09-19
AI Technical Summary
Under limited bandwidth conditions, online loading of large files in existing archive systems takes too long, affecting user experience and system efficiency.
By requesting data on demand, the data volume and file segment size of the target archive file are obtained, the rendering area is determined based on the data volume, file segment size and page size, and the preview range is determined when the page scrolling event stops. Multiple file acquisition requests are sent to the back-end server in parallel to display the file stream data asynchronously.
It improves the efficiency of file preview under limited bandwidth, reduces data transmission and loading time, and improves user experience and system performance.
Smart Images

Figure CN120671634A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of digital technology, and in particular to a preview method for archive files, a front-end device, a back-end server, and a storage medium. Background Art
[0002] With the widespread application of digital technology, various enterprises and institutions are gradually advancing the digitalization of archives to improve the efficiency and utilization of archives management. Using archive management systems, they manage the entire process of collecting, managing, storing, and using archival images and electronic archives. These systems systematically organize archival data by managing archive catalog information and its associated attachments (the original archive text). Attachments are often stored in the Portable Document Format (PDF) format.
[0003] However, in actual archive management business scenarios, due to the complexity and integrity requirements of archived content, PDF files with huge amounts of data are often generated. The overall size of these files often exceeds 1G, and the number of pages can reach more than a thousand pages. At the same time, due to the limitations of network infrastructure conditions, the network bandwidth resources allocated to the archive system are extremely limited, and the common bandwidth specification is only 10M. In this network environment, the online loading of the above-mentioned large files usually takes more than 20 minutes, which significantly reduces the real-time access efficiency of the archive system, seriously affects the user's online use experience of archives, and restricts the full utilization of the effectiveness of archive digital management. Therefore, it is urgent to propose an effective solution to solve the problem of fast loading of large files under limited bandwidth conditions and improve the performance of the archive system. Summary of the Invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a preview method, front-end device, back-end server and storage medium for archive files, which can avoid loading the entire large file at one time, clearly know the need to load and display file segments, and efficiently preview files under limited bandwidth.
[0005] In order to achieve the above objectives, the technical solutions provided by the embodiments of the present disclosure are as follows:
[0006] In a first aspect, the present disclosure provides a preview method for an archive file, which is applied to a front-end device, comprising: in response to a user's preview operation on a target archive file in a page, sending a preview request for the target archive file to a back-end server to obtain the data volume and file segment size of the target archive file returned by the back-end server; determining a rendering area for the target archive file based on the data volume, file segment size and page size; determining a preview range of the target archive file when a page scrolling event is detected to stop; concurrently sending multiple file acquisition requests corresponding to the preview range to the back-end server to obtain file stream data corresponding to the preview range returned by the back-end server; the file stream data includes multiple target file segments corresponding to the preview range; and displaying the file stream data in the rendering area.
[0007] As an optional implementation provided by an embodiment of the present disclosure, the data volume includes the actual height, actual width, and single-page specifications of the target archive file; the page size includes the effective height and effective width of the page display area; the rendering area of the target archive file is determined based on the data volume, file segment size, and page size, including: calculating the total number of pages of the target archive file based on the actual height, actual width, and single-page specifications; calculating the actual area of the target archive file based on the total number of pages and the single-page specifications; calculating the width ratio based on the width of the actual area and the effective width; calculating the height of the rendering area based on the width ratio and the height of the actual area; wherein the width of the rendering area is the effective width.
[0008] As an optional implementation provided by an embodiment of the present disclosure, when a page scrolling event stops being monitored, after determining the preview range of the target archive file, multiple file acquisition requests corresponding to the preview range are concurrently sent to the back-end server to obtain file stream data corresponding to the preview range returned by the back-end server, and the method also includes: obtaining the user's access behavior record to the target archive file; analyzing the access behavior record to obtain user preference information; and generating multiple file acquisition requests based on the user preference information and the preview range of the target archive file.
[0009] As an optional implementation provided by an embodiment of the present disclosure, displaying file stream data in a rendering area includes: determining a rendering order based on fragment index information of multiple target file fragments; and asynchronously displaying multiple target file fragments in the rendering area according to the rendering order.
[0010] In a second aspect, the present disclosure provides a preview method for archive files, which is applied to a back-end server, including: responding to a preview request for a target archive file sent by a front-end device, determining the data volume of the target archive file; slicing the target archive file to determine the file slicing size; sending the data volume and the file slicing size to the front-end device; responding to multiple concurrent file acquisition requests from the front-end device, determining the file stream data corresponding to the preview range, and sending the file stream data to the front-end device; wherein the multiple file acquisition requests are used to request the file stream data corresponding to the preview range.
[0011] As an optional implementation provided by an embodiment of the present disclosure, slicing the target archive file and determining the file slicing size includes: monitoring the network bandwidth of the current network environment; slicing the target archive file according to the network bandwidth and determining the file slicing size.
[0012] As an optional implementation provided by an embodiment of the present disclosure, a file acquisition request includes shard index information; in response to multiple concurrent file acquisition requests from a front-end device, file stream data corresponding to a preview range is determined, and the file stream data is sent to the front-end device, including: in response to multiple concurrent file acquisition requests from the front-end device, a target offset position corresponding to the shard index information is determined based on multiple shard index information and a cross-reference table of a target archive file; the cross-reference table is used to record the offset position of each object in the target archive file in the file; based on the target offset position, the target file shards corresponding to the multiple shard index information are determined from the target archive file to obtain the file stream data corresponding to the preview range; and the file stream data is sent to the front-end device.
[0013] In a third aspect, the present disclosure provides a front-end device, including:
[0014] An interactive module, configured to respond to a user's preview operation on a target archive file on a page by sending a preview request for the target archive file to a backend server, and obtain the data volume and file segment size of the target archive file returned by the backend server;
[0015] A rendering area determination module is used to determine the rendering area of the target archive file based on the data volume, file segment size and page size;
[0016] The monitoring module is used to determine the preview range of the target archive file when the page scrolling event stops being monitored;
[0017] The interaction module is further configured to concurrently request multiple files corresponding to the preview range from the backend server to obtain file stream data corresponding to the preview range returned by the backend server; the file stream data includes multiple target file segments corresponding to the preview range;
[0018] The rendering module is used to display the file stream data in the rendering area.
[0019] In a fourth aspect, the present disclosure provides a backend server, comprising:
[0020] a data volume determination module, configured to determine the data volume of the target archive file in response to a preview request of the target archive file sent by the front-end device;
[0021] The segmentation module is used to segment the target archive file and determine the file segment size;
[0022] The interaction module is used to send data volume and file segment size to the front-end device; in response to multiple concurrent file acquisition requests from the front-end device, determine the file stream data corresponding to the preview range and send the file stream data to the front-end device; wherein the multiple file acquisition requests are used to request the file stream data corresponding to the preview range.
[0023] In a fifth aspect, the present disclosure provides a computer-readable storage medium, comprising: a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the preview method of the archive file as described in the first aspect or any one of its optional embodiments.
[0024] In a sixth aspect, the present disclosure provides a computer program product, comprising: the computer program product comprises a computer program, which, when the computer program runs on a computer, enables the computer to implement the archive file preview method as described in the first aspect or any one of its optional embodiments.
[0025] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:
[0026] The disclosed embodiments provide a preview method, electronic device, storage medium and program product for archive files, wherein the method, in response to a user preview operation, first obtains the data volume and file segment size of the target archive file from the back-end server. This on-demand data request method avoids loading the entire large file at one time and only obtains the portion of data that currently needs to be previewed, thereby reducing the amount of data transmitted and reducing the loading time under limited bandwidth. The rendering area is determined based on the data volume, file segment size and page size, and the preview range is determined when the page scrolling event stops. This method allows the front-end device to clearly know which parts of the data need to be loaded and displayed, rationally plan resources, avoid unnecessary data loading, and more efficiently perform file previews under limited bandwidth, solving the problem of slow loading of large files affecting online use. Concurrently sending multiple file acquisition requests corresponding to the preview range to the back-end server can make full use of limited bandwidth resources and obtain data of multiple file segments at the same time, thereby improving the efficiency of data acquisition, accelerating the acquisition speed of file stream data, and thereby shortening the loading time of the preview file and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0028] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0029] Figure 1 A schematic diagram of a preview method for archive files provided in an embodiment of the present disclosure Figure 1 ;
[0030] Figure 2 A schematic diagram of a preview method for archive files provided in an embodiment of the present disclosure Figure 2 ;
[0031] Figure 3 An interactive schematic diagram of a preview method for archive files provided by an embodiment of the present disclosure;
[0032] Figure 4 A schematic diagram of the structure of a front-end device provided in an embodiment of the present disclosure;
[0033] Figure 5 This is a schematic diagram of the structure of a back-end server described in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0035] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0036] To address some or all of the technical issues in the related art, the present disclosure provides a preview method, electronic device, storage medium, and program product for archive files. In response to a user preview operation, the method first obtains the data volume and file segment size of the target archive file from a backend server. This on-demand data request method avoids loading the entire large file at once and only obtains the portion of data currently required for preview, thereby reducing data transmission and shortening loading time under limited bandwidth. The rendering area is determined based on the data volume, file segment size, and page size, and the preview range is determined when the page scrolling event stops. This method allows the front-end device to clearly know which parts of the data need to be loaded and displayed, rationally plans resources, avoids unnecessary data loading, and enables more efficient file preview under limited bandwidth, resolving the problem of slow large file loading affecting online use. Concurrently sending multiple file acquisition requests corresponding to the preview range to the backend server can fully utilize limited bandwidth resources and simultaneously obtain data for multiple file segments, improving data acquisition efficiency, accelerating the acquisition of file stream data, and thereby shortening the loading time of the preview file and improving the user experience.
[0037] A preview method for an archive file provided in an embodiment of the present disclosure can be implemented by a preview device or electronic device for the archive file, and the electronic device includes but is not limited to a personal computer, a laptop computer, a tablet computer, a smart phone, etc. The operating system of the electronic device may include Android, a mobile operating system (iOS) developed by Apple, an operating system (Windows) developed by Microsoft Corporation of the United States, etc., and the embodiment of the present disclosure does not limit this. The electronic device can be operated alone to implement the present disclosure, or it can be connected to a network and implement the present disclosure through interactive operations with other computer devices in the network. Among them, the network in which the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
[0038] It should be noted that the protection scope of the preview method for archive files described in the embodiment of the present disclosure is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing, or replacing steps in the existing technology based on the principles of the present disclosure are included in the protection scope of the present disclosure.
[0039] like Figure 1 As shown, Figure 1 A schematic diagram of a preview method for archive files according to an embodiment of the present disclosure Figure 1 The method can be executed by a preview device for archive files, wherein the device can be implemented using software and / or hardware and can generally be integrated into a front-end device. The method mainly includes the following steps S101 to S105:
[0040] S101. In response to a user's preview operation on a target archive file in a page, a preview request for the target archive file is sent to a backend server to obtain the data volume and file segment size of the target archive file returned by the backend server.
[0041] The data volume includes the actual height, actual width, and single-page specifications of the target file. The single-page specifications include a fixed width and a fixed height.
[0042] In some embodiments, the front-end device receives a user's preview operation on a target archive file on a web page, first determines basic information of the target archive file, including an identification (ID) of the target archive file, then generates a preview request for the target archive file based on the basic information, and then sends the preview request to the back-end server.
[0043] For example, a user clicks on a credit business file they want to view on a page. In response to the user's click, the ID of the credit business file clicked by the user is first determined, and a preview request is generated based on the ID. The preview request is then sent to the backend server.
[0044] In response to the user's preview operation, the above embodiment first obtains the data volume and file segment size of the target archive file from the back-end server. This allows the front-end device to understand the overall situation of the file before starting to process the file.
[0045] S102: Determine the rendering area of the target archive file according to the data volume, file segment size, and page size.
[0046] The page size includes the effective height and effective width of the page display area. The effective width of the page display area is the width of the area on the front-end page used to display file content. It is a fixed value, such as the width of the area used to display files in a browser window.
[0047] The front-end device receives the data volume, file segment size, and page size returned by the back-end server, and determines the rendering area of the target archive file based on these data.
[0048] In some embodiments, when executing step S102, the total number of pages of the target archive file is first calculated based on the actual height, actual width, and single-page specifications. The actual area of the target archive file is then calculated based on the total number of pages and single-page specifications. Furthermore, the width ratio is calculated based on the width of the actual area and the effective width. Furthermore, the height of the rendering area of the target archive file is calculated based on the width ratio and the height of the actual area. The width of the rendering area is equal to the effective width of the page display area.
[0049] When calculating the total number of pages in the target archive based on the actual height, actual width, and single-page specifications, which include a fixed single-page width and a fixed single-page height, the number of pages along the width direction is first calculated based on the target archive's actual width and the fixed single-page width. The number of pages along the height direction is then calculated based on the actual height and the fixed single-page height. Finally, the total number of pages in the target archive is calculated based on the number of pages along the width and the number of pages along the height.
[0050] For example, assuming the target archive file has an actual width of file_width, an actual height of file_height, a fixed width of a single page of page_width, and a fixed height of a single page of page_height, the math.ceil function is used to calculate the number of pages along the width direction: width_pages = math.ceil(file_width / page_width). For example, if the target archive file has an actual width of 105 units and a fixed width of 100 units, then two pages are required along the width direction. Furthermore, the number of pages along the height direction: height_pages = math.ceil(file_height / page_height). The number of pages in the width and height directions of the file together constitutes the complete number of pages, and the total number of pages in the entire target archive file is then calculated: total_pages = width_pages*height_pages.
[0051] When calculating the actual area of the target archive based on the total number of pages and the specifications of a single page, the total width of the target archive is first calculated based on the number of pages along the width direction and the fixed width of a single page. The total height of the target archive is then calculated based on the number of pages along the height direction and the fixed height of a single page. Finally, the actual area of the target archive is determined based on the total width and height of the target archive. This determines the overall size of the target archive without considering the page display area.
[0052] For example, following the previous example, based on the number of pages width_pages and the fixed width of a single page, page_width, the total width of the target archive file is calculated as total_width = width_pages * page_width. Based on the number of pages height_pages and the fixed height of a single page, page_height, the total height of the target archive file is calculated as total_height = height_pages * page_height. The actual area of the target archive file is a rectangular area with a width of total_width and a height of total_height.
[0053] When calculating the page height of the rendering area based on the width ratio and the actual area height, the width ratio is the ratio between the actual width of the target file and the effective width of the page display area. For example, using the previous example, width ratio = total_width / page_width. Since the width and height of the rendering area need to be scaled proportionally, the height of the rendering area is calculated using the following formula:
[0054] The width of the rendering area of the target archive file is the effective width of the page display area.
[0055] The above embodiment calculates the total number of pages of the target archive file based on the actual height, actual width and single-page specifications, so as to accurately know the scale of the archive file and provide basic data for subsequent processing. The actual area is calculated based on the total number of pages and the single-page specifications, and then the height of the rendering area is calculated based on the relationship between the actual area and the page display area, and the width of the rendering area is the same as the effective width of the page display area. In this way, it can be ensured that the archive file can be reasonably and accurately presented on the page, so that the file content is displayed to the user in an appropriate proportion and size, thereby improving the visual experience and convenience of the user viewing the archive file. At the same time, accurate calculation of the rendering area is also conducive to improving the efficiency of file rendering, avoiding problems such as redrawing and jamming caused by unreasonable rendering area, and improving the performance and stability of the system.
[0056] S103: When the page scrolling event stops being monitored, determine the preview range of the target archive file.
[0057] The front-end device will load the first page of data of the target archive file and monitor the page scrolling event. When the page scrolling event stops, the preview range of the target archive file is determined.
[0058] For example, a user can scroll the page or drag the scroll bar to browse the target archive file. The front-end device uses an anti-shake function to monitor page scrolling events. This prevents frequent page changes (rapid mouse movement, scrolling, page size changes) from consuming computing resources and causing the front-end page to freeze or crash.
[0059] When scrolling stops, the front-end device determines the preview range of the target archive file based on the current page and adjacent page positions, as well as the scroll height corresponding to the page scroll event. Specifically, the front-end device can determine which page or pages of the target archive file are currently displayed based on information such as the rendering area height, the file's paging, and the initial page position. After determining the current page position, the adjacent pages are determined based on the scroll direction and the file's paging logic. If scrolling is downward, the adjacent page may be the next page or pages below the current page; if scrolling is upward, the adjacent page may be the previous page or pages above the current page. The preview range is further refined based on the scroll height corresponding to the recorded page scroll event. If the scroll height is small, only the current page and some adjacent pages may need to be loaded; if the scroll height is large, more adjacent pages may need to be loaded. The preview range of the target archive file is ultimately determined by combining the page loading requirements determined by the current page position, adjacent page positions, and scroll height. The preview range can be represented by a range of file segment numbers.
[0060] In some embodiments, after determining the preview range of the target archive file, the front-end device first queries its cache to see whether file stream data corresponding to the preview range exists. If not, step S104 is executed (concurrently requesting multiple files corresponding to the preview range from the back-end server to obtain the file stream data corresponding to the preview range returned by the back-end server). If file stream data corresponding to the preview range exists in the front-end device's cache, step S105 is executed (displaying the file stream data in the rendering area).
[0061] The above embodiment first queries the cache. If the required file stream data exists in the cache, it can be directly retrieved and displayed from the cache, avoiding the network delay of requesting data from the backend server again. If the required data is available in the cache, there is no need to send a request to the backend server, reducing the server's processing pressure and data transmission volume. This reduces unnecessary network requests and reduces network bandwidth usage. In unstable network environments or when bandwidth is limited, network congestion caused by frequent data requests can be effectively avoided, ensuring system stability and smoothness.
[0062] In some embodiments, the front-end device determines multiple shard index information corresponding to the preview range based on the current page and the position of adjacent pages, as well as the scroll height corresponding to the page scroll event. The shard index information includes: file identifier (FileID), chunk identifier (Chunk ID), chunk number (Chunk Number), chunk size (Chunk Size), chunk group (Chunk Group), etc. Multiple file acquisition requests are generated based on the multiple shard index information.
[0063] In some embodiments, after executing step S103, the front-end device further includes: first determining the user's access behavior record for the target archive file, then analyzing the access behavior record to obtain user preference information, and further generating multiple file acquisition requests based on the user preference information and the preview range of the target archive file. Optionally, multiple file acquisition requests are generated based on the user preference information and multiple shard index information corresponding to the preview range.
[0064] The above embodiment obtains user preference information by analyzing the user's access behavior records to the target archive files, and can understand the user's previous browsing habits, focus, etc. Based on this preference information and the current preview range, multiple file acquisition requests are generated, so that the acquired data can be more in line with user needs. Based on the user's historical behavior, the content that the user may be interested in is predicted, and relevant file segments are requested in a targeted manner. This not only reduces unnecessary data transmission, but also improves the accuracy and effectiveness of data acquisition, saves network bandwidth and system resources, and improves overall performance. It meets the needs of a specific group of users to view only certain archive files, thereby optimizing the file acquisition request logic and improving the user browsing experience.
[0065] S104: Concurrently send multiple file acquisition requests corresponding to the preview range to the backend server to obtain file stream data corresponding to the preview range returned by the backend server.
[0066] The file stream data includes multiple target file segments corresponding to the preview range.
[0067] The front-end device may concurrently send multiple file acquisition requests corresponding to the preview range to the back-end server in a multi-threaded manner, so as to request the back-end server for multiple target file segments corresponding to the preview range.
[0068] In some embodiments, the front-end device sends multiple file acquisition requests to the back-end server in sequence according to the fragment sequence numbers included in the multiple fragment index information.
[0069] The above embodiment can make full use of limited bandwidth resources through concurrent requests and obtain data of multiple file segments at the same time. Compared with sequential requests, it greatly improves the efficiency of data acquisition and speeds up the acquisition of file stream data, thereby shortening the loading time of preview files and improving user experience.
[0070] S105: Display the file stream data in the rendering area.
[0071] In some embodiments, after receiving the file stream data corresponding to the preview range returned by the backend server, the front-end device first caches the file stream data. When the user previews the corresponding file segment, the corresponding file segment is retrieved from the cache for rendering.
[0072] For cached file stream data, set up a timed cleanup mechanism to cache only the file stream data of the target archive file. In addition, perform cleanup operations and clean up the cache when closing the preview page and exiting the system to prevent page freezes and crashes caused by excessive front-end page data caching.
[0073] In some embodiments, the file stream data includes multiple target file segments corresponding to the preview range, and the rendering order is determined based on the corresponding segment index information of the multiple target segments. Then, the multiple file segments are asynchronously displayed in the rendering area according to the rendering order.
[0074] The above embodiment determines the rendering order based on the fragment index information, which enables the system to clearly understand the display priority and order of each file fragment, avoids the confusion and errors that may be caused by disordered rendering, and makes the rendering process more orderly and efficient. The asynchronous display method will not block other operations of the page. The user can perform other interactions during the rendering of the file fragments, such as scrolling the page, zooming in and out, etc., which improves the response speed of the system and the smoothness of user operations, and reduces user waiting time and anxiety. The asynchronous display of multiple file fragments can make full use of the multi-threading capabilities of the browser, and load and render the file fragments in the background thread without affecting the operation of the main thread, avoiding page freezes and pseudo-death phenomena, and improving the stability and reliability of the system. Especially when processing large or complex archive files, this method can better adapt to the allocation and utilization of system resources and improve overall performance.
[0075] In some embodiments, after the file stream data is displayed in the rendering area, the user's access behavior is recorded, including but not limited to the user ID, shard index information and access time.
[0076] Through steps S101 to S105, the front-end device reduces network traffic and shortens the time it takes to load large files by implementing on-demand requests, concurrent retrieval, and cache query strategies. For example, it requests only preview-range data, avoiding full file loading. Concurrent requests fully utilize bandwidth, and cache hits directly retrieve data, significantly improving loading efficiency. The rendering area and preview range are accurately calculated based on file parameters and page specifications, allowing for optimal allocation of system resources. This not only avoids performance losses caused by inappropriate rendering areas but also enables on-demand data loading, reducing server load and network bandwidth usage, and improving overall system performance and concurrent processing capabilities. It enables personalized data retrieval, predicting user preferences based on user access behavior and prioritizing content of interest, saving search time. Ordered rendering and asynchronous display of file segments ensure smooth page operation, reduce waiting anxiety, and improve user satisfaction and usage frequency. By reducing unnecessary data transmission and requests, server processing pressure and the risk of network congestion are reduced. Furthermore, asynchronous rendering fully utilizes system resources, avoiding page lags and significantly improving system stability and reliability when processing large archive files.
[0077] like Figure 2 As shown, Figure 2 A schematic diagram of a preview method for archive files provided in an embodiment of the present disclosure Figure 1 The method can be executed by a preview device for archive files, wherein the device can be implemented using software and / or hardware and can generally be integrated into a backend server. The method mainly includes the following steps S201 to S204:
[0078] S201. In response to a preview request for a target archive file sent by a front-end device, determine the data volume of the target archive file.
[0079] The back-end server responds to the preview request of the target archive file sent by the front-end device and determines the data volume of the target archive file based on the basic information of the target archive file contained therein, including the actual height, actual width, and single-page specifications of the target archive file.
[0080] S202: Slice the target archive file and determine the file slice size.
[0081] In some embodiments, the backend server segments the target archive file according to a default segment size, which may be the size of the resource that can be downloaded by the network within 1 second.
[0082] In other embodiments, the backend server first monitors the network bandwidth of the current network environment, and then slices the target archive file according to the network bandwidth to determine the file slice size. Optionally, if the network bandwidth of the current network environment is greater than a preset bandwidth threshold, the file slice size is determined to be greater than a default slice size; if the network bandwidth is equal to the preset bandwidth threshold, the file slice size is determined to be equal to the default slice size; if the network bandwidth is less than the preset bandwidth threshold, the file slice size is determined to be less than the default slice size.
[0083] By monitoring network bandwidth in real time, the above-described embodiment allows the backend server to dynamically adjust file segment size based on actual network conditions. When bandwidth is sufficient, the file segment size is appropriately increased, reducing the number of transmissions and thus improving transmission efficiency. When bandwidth is limited, the file segment size is reduced, reducing the amount of data transferred each time and avoiding transmission interruptions or delays caused by network congestion. Segmenting based on network bandwidth maximizes bandwidth utilization while ensuring transmission stability.
[0084] In some embodiments, the backend server calculates the number of shards of the target archive file based on the data volume of the target archive file and the file shard size.
[0085] Exemplarily, the number of slices is calculated according to the following formula: Number of slices = Math.ceil (actual file size / file slice size). It can be understood that the total number of slices is equal to the total file size divided by the size of a single slice, rounded up.
[0086] After the above embodiment calculates the number of shards, the back-end server can clearly know how many parts the file needs to be divided into for storage and transmission. This helps to organize and manage data in an orderly manner, ensure that each shard can be accurately processed and transmitted, and avoid data loss or confusion. By calculating the number of shards, the back-end server and the front-end device can track the processing progress of the file in real time, such as how many shards have been transmitted and how many shards are left to be transmitted. This is very important for providing accurate progress feedback to users, so that users can understand the progress of file preview or download, and enhance the user experience. Clarifying the number of shards helps to achieve concurrent processing. The back-end server can process multiple shards at the same time according to its own number of threads and resource conditions, thereby speeding up the processing speed of the file. Multiple shards can perform operations such as transmission and decoding simultaneously in different threads or processes, making full use of the multi-core processor and network bandwidth resources of the back-end server, and improving the overall performance and response speed of the system.
[0087] S203: Send the data volume and file segment size to the front-end device.
[0088] S204. In response to multiple concurrent file acquisition requests from the front-end device, determine file stream data corresponding to the preview range, and send the file stream data to the front-end device; wherein the multiple file acquisition requests are used to request file stream data corresponding to the preview range.
[0089] In some embodiments, a file retrieval request includes shard index information. In response to multiple file retrieval requests sent by a front-end device, the back-end server determines target offset positions corresponding to the multiple shard index information based on the multiple shard index information and a cross-reference table of the target archive file, where the cross-reference table is used to record the offset positions of various objects in the target archive file. Based on the target offset positions, the back-end server determines the target file shards corresponding to the multiple shard index information from the target archive file to obtain file stream data corresponding to the preview range, which is then sent to the front-end device.
[0090] Based on the shard index information included in each file retrieval request, the backend server first queries the target archive file's cross-reference table for the target offset corresponding to the shard index information. It then determines the target file shard corresponding to the target offset from the target archive file. This response operation repeats for each file retrieval request until all file retrieval requests have been responded to. The resulting file stream data corresponding to the preview range consisting of multiple target file shards is then sent to the frontend device.
[0091] The above-described embodiment determines the target offset position by using a cross-reference table and fragment index information, enabling precise location of the desired file fragment within the target archive file, avoiding blind searches and improving the efficiency and accuracy of data acquisition. The back-end server only sends the file stream data corresponding to the preview range, avoiding the transmission of irrelevant data, reducing network bandwidth usage and data transmission time. This is crucial for improving system performance and responsiveness, especially when processing large archive files or when network bandwidth is limited. It effectively reduces network load, enabling front-end devices to receive and preview data more quickly, and improving the user experience.
[0092] In summary, the disclosed embodiment provides a preview method for archive files, which is applied to a back-end server. The method responds to the preview request of the front end and determines the data volume of the target archive file, which helps to formulate a reasonable processing strategy based on the actual size of the file, such as determining a suitable fragmentation scheme, to avoid low processing efficiency or waste of resources due to insufficient or excessive estimation of the file size. Splitting a large file into multiple small fragments facilitates more efficient organization and storage of data on the storage device, and also provides convenience for subsequent data transmission and processing. The target archive file is fragmented according to the network bandwidth of the current network environment, and the appropriate file fragment size is determined, thereby making full use of the network bandwidth and improving data transmission efficiency. The server can process and transmit files in sequence according to the order of the fragments, which improves the response speed and processing capacity of the server and enhances the stability of the system. Through efficient data processing and transmission, the front-end device can obtain the file stream data required for preview more quickly, thereby speeding up the preview speed of the archive file and reducing the waiting time for users.
[0093] like Figure 3 As shown, Figure 3 Schematic diagram of an interactive method for previewing an archive file according to an embodiment of the present disclosure. The method includes the following steps S301 to S309:
[0094] S301. In response to a user's preview operation on a target archive file on a web page, the front-end device sends a preview request for the target archive file to a back-end server.
[0095] The front-end device receives the user's preview operation on the target archive file on the page, first determines the basic information of the target archive file, the basic information includes the target archive file ID, and then generates a preview request for the target archive file based on the basic information, and then sends the preview request to the back-end server.
[0096] S302. The back-end server determines the data volume of the target archive file in response to the preview request of the target archive file sent by the front-end device.
[0097] In response to the preview request for the target archive file sent by the front-end device, the back-end server determines the data volume of the target archive file based on the target archive file ID contained therein, including the actual height, actual width, and single-page specifications of the target archive file. The single-page specifications include a fixed single-page width and a fixed single-page height.
[0098] S303: The back-end server segments the target archive file and determines the file segment size.
[0099] The backend server monitors the current network bandwidth and then segments the target archive file into segments based on the network bandwidth, determining the segment size. The segment size is dynamically adjusted based on actual network conditions. When bandwidth is sufficient, the segment size is increased to reduce the number of transfers, thereby improving transmission efficiency. When bandwidth is limited, the segment size is reduced to reduce the amount of data transferred each time, thus avoiding transmission interruptions or delays caused by network congestion.
[0100] S304: The backend server sends the data volume and file segment size to the frontend device.
[0101] S305. The front-end device determines the rendering area of the target archive file based on the data volume, file segment size, and page size.
[0102] The front-end device receives the data volume, file segment size, and page size returned by the back-end server. It first calculates the total number of pages in the target archive file based on the actual height, actual width, and single-page specifications. It then calculates the actual area of the target archive file based on the total number of pages and single-page specifications. It then calculates the width ratio based on the width of the actual area and the effective width. Furthermore, based on the width ratio and the height of the actual area, it calculates the height of the target archive file's rendering area. The width of the rendering area is equal to the effective width of the page display area. This ensures that the archive file is presented reasonably and accurately on the page, displaying the file content to the user at the appropriate proportion and size.
[0103] S306: When the front-end device detects that the page scrolling event stops, it determines the preview range of the target archive file.
[0104] The front-end device will load the first page data of the target archive file and listen to the page scrolling event. When the page scrolling event stops, the preview range of the target archive file is determined based on the position of the current page and the adjacent page, as well as the scrolling height corresponding to the page scrolling event.
[0105] S307: The front-end device queries the cache to see whether there is file stream data corresponding to the preview range.
[0106] If not, the front-end device determines multiple chunk index information corresponding to the preview range based on the current page and adjacent page positions, as well as the scroll height corresponding to the page scroll event. The chunk index information includes: file identifier (FileID), chunk identifier (Chunk ID), chunk number (Chunk Number), chunk size (Chunk Size), chunk group (Chunk Group), etc. Based on the multiple chunk index information, multiple file acquisition requests are generated. Step S308 is executed to concurrently send multiple file acquisition requests corresponding to the preview range to the back-end server.
[0107] If so, step S310 is executed to display the file stream data in the rendering area.
[0108] S308: The front-end device concurrently sends multiple file acquisition requests corresponding to the preview range to the back-end server; the file stream data includes multiple target file segments corresponding to the preview range.
[0109] The front-end device may concurrently send multiple file acquisition requests corresponding to the preview range to the back-end server in a multi-threaded manner, so as to request the back-end server for multiple target file segments corresponding to the preview range.
[0110] S309: The backend server determines the file stream data corresponding to the preview range in response to the multiple concurrent file acquisition requests from the frontend device, and sends the file stream data to the frontend device.
[0111] Based on the shard index information included in each file retrieval request, the backend server first queries the target archive file's cross-reference table for the target offset corresponding to the shard index information. It then determines the target file shard corresponding to the target offset from the target archive file. This response operation repeats for each file retrieval request until all file retrieval requests have been responded to. The resulting file stream data corresponding to the preview range consisting of multiple target file shards is then sent to the frontend device.
[0112] S310: The front-end device displays the file stream data in the rendering area.
[0113] After the front-end device receives the file stream data corresponding to the preview range returned by the back-end server, it determines the rendering order according to the corresponding fragment index information of the multiple target fragments, and then asynchronously displays the multiple file fragments in the rendering area according to the rendering order.
[0114] The specific implementation of each step in the above interaction process can refer to the specific implementation of the preview of the aforementioned archive file, and this disclosure will not elaborate on it here.
[0115] like Figure 4 As shown, Figure 4 A schematic diagram of the structure of a front-end device provided in an embodiment of the present disclosure, the front-end device includes:
[0116] Interaction module 401 is used to respond to a user's preview operation on a target archive file on a page by sending a preview request of the target archive file to a backend server, and obtain the data volume and file segment size of the target archive file returned by the backend server;
[0117] A rendering area determination module 402 is used to determine a rendering area of a target archive file based on the data volume, file segment size, and page size;
[0118] The monitoring module 403 is used to determine the preview range of the target archive file when the page scrolling event stops being monitored;
[0119] The interaction module 401 is further configured to concurrently request the backend server to obtain multiple files corresponding to the preview range, so as to obtain file stream data corresponding to the preview range returned by the backend server; the file stream data includes multiple target file segments corresponding to the preview range;
[0120] The rendering module 404 is configured to display the file stream data in the rendering area.
[0121] As an optional implementation provided by the embodiment of the present disclosure, the data volume includes the actual height, actual width, and single page specifications of the target archive file; the page size includes the effective height and effective width of the page display area;
[0122] The rendering area determination module 402 is specifically used to: calculate the total number of pages of the target archive file based on the actual height, actual width and single-page specifications; calculate the actual area of the target archive file based on the total number of pages and single-page specifications; calculate the width ratio based on the width of the actual area and the effective width; calculate the height of the rendering area based on the width ratio and the height of the actual area; wherein the width of the rendering area is the effective width.
[0123] As an optional implementation provided by the embodiment of the present disclosure, the front-end device also includes a file acquisition request generation module, which is used to: obtain the user's access behavior records to the target archive file; analyze the access behavior records to obtain user preference information; and generate multiple file acquisition requests based on the user preference information and the preview range of the target archive file.
[0124] As an optional implementation provided by the embodiment of the present disclosure, the rendering module 404 is specifically configured to: determine a rendering order according to the fragment index information of the multiple target file fragments; and asynchronously display the multiple target file fragments in the rendering area according to the rendering order.
[0125] like Figure 5 As shown, Figure 5 A schematic diagram of the structure of a backend server provided in an embodiment of the present disclosure, the backend server comprising:
[0126] The data volume determination module 501 is configured to determine the data volume of the target archive file in response to a preview request of the target archive file sent by the front-end device;
[0127] A segmentation module 502 is used to segment the target archive file and determine the file segment size;
[0128] Interaction module 503 is used to send data volume and file segment size to the front-end device; in response to multiple concurrent file acquisition requests from the front-end device, determine the file stream data corresponding to the preview range and send the file stream data to the front-end device; wherein the multiple file acquisition requests are used to request the file stream data corresponding to the preview range.
[0129] As an optional implementation provided by the embodiment of the present disclosure, the segmentation module 502 is specifically used to: monitor the network bandwidth of the current network environment; segment the target archive file according to the network bandwidth, and determine the file segment size.
[0130] As an optional implementation provided by an embodiment of the present disclosure, the file acquisition request includes shard index information;
[0131] The interactive module 503 is specifically used to: respond to multiple concurrent file acquisition requests from the front-end device, determine the target offset position corresponding to the slice index information based on multiple slice index information and a cross-reference table of the target archive file; the cross-reference table is used to record the offset position of each object in the target archive file; according to the target offset position, determine the target file slice corresponding to the multiple slice index information from the target archive file to obtain the file stream data corresponding to the preview range; and send the file stream data to the front-end device.
[0132] The specific limitations of the front-end device or back-end server can be found in the limitations of the archive file preview method above and will not be repeated here. Each module in the front-end device or back-end server can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the modules.
[0133] In one embodiment, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by the computer program, implements the following steps:
[0134] In response to the user's preview operation on the target archive file in the page, a preview request for the target archive file is sent to the back-end server to obtain the data volume and file segment size of the target archive file returned by the back-end server; the rendering area of the target archive file is determined according to the data volume, file segment size and page size; when the page scrolling event stops being monitored, the preview range of the target archive file is determined; multiple file acquisition requests corresponding to the preview range are concurrently sent to the back-end server to obtain file stream data corresponding to the preview range returned by the back-end server; the file stream data includes multiple target file segments corresponding to the preview range; and the file stream data is displayed in the rendering area.
[0135] In one embodiment, the computer program further implements the following steps when executing the computer program: the data volume includes the actual height, actual width, and single-page specifications of the target archive file; the page size includes the effective height and effective width of the page display area; the rendering area of the target archive file is determined based on the data volume, file segment size, and page size, including: calculating the total number of pages of the target archive file based on the actual height, actual width, and single-page specifications; calculating the actual area of the target archive file based on the total number of pages and the single-page specifications; calculating the width ratio based on the width of the actual area and the effective width; calculating the height of the rendering area based on the width ratio and the height of the actual area; wherein the width of the rendering area is the effective width.
[0136] In one embodiment, when the computer program executes the computer program, the following steps are also implemented: when the page scrolling event stops being monitored, after determining the preview range of the target archive file, multiple file acquisition requests corresponding to the preview range are concurrently sent to the back-end server to obtain the file stream data corresponding to the preview range returned by the back-end server, and the method also includes: obtaining the user's access behavior record to the target archive file; analyzing the access behavior record to obtain user preference information; and generating multiple file acquisition requests based on the user preference information and the preview range of the target archive file.
[0137] In one embodiment, when the computer program is executed, the computer program further implements the following steps: displaying file stream data in a rendering area, including: determining a rendering order based on fragment index information of multiple target file fragments; and asynchronously displaying multiple target file fragments in the rendering area according to the rendering order.
[0138] When the computer program in the computer-readable storage medium provided by the present disclosure executes the computer program, it first responds to the user's preview operation and first obtains the data volume and file segment size of the target archive file from the back-end server. This method of requesting data on demand avoids loading the entire large file at one time and only obtains the part of the data that needs to be previewed, thereby reducing the amount of data transmitted and reducing the loading time under limited bandwidth. The rendering area is determined according to the data volume, file segment size and page size, and the preview range is determined when the page scrolling event stops. This method allows the front-end device to clearly know which parts of the data need to be loaded and displayed, reasonably plans resources, avoids unnecessary data loading, and can more efficiently perform file previews under limited bandwidth, solving the problem of slow loading of large files affecting online use. Concurrently sending multiple file acquisition requests corresponding to the preview range to the back-end server can make full use of limited bandwidth resources and obtain data of multiple file segments at the same time, thereby improving the efficiency of data acquisition, accelerating the acquisition speed of file stream data, and thus shortening the loading time of the preview file and improving the user experience.
[0139] In one embodiment, the present disclosure provides another computer-readable storage medium having a computer program stored thereon, which, when executed by the computer program, implements the following steps:
[0140] In response to a preview request for a target archive file sent by a front-end device, determine the data volume of the target archive file; segment the target archive file to determine the file segment size; send the data volume and file segment size to the front-end device; in response to multiple concurrent file acquisition requests from the front-end device, determine the file stream data corresponding to the preview range, and send the file stream data to the front-end device; wherein the multiple file acquisition requests are used to request the file stream data corresponding to the preview range.
[0141] In one embodiment, when the computer program is executed, the computer program further implements the following steps: slicing the target archive file and determining the file slicing size, including: monitoring the network bandwidth of the current network environment; slicing the target archive file according to the network bandwidth and determining the file slicing size.
[0142] In one embodiment, when the computer program executes the computer program, the following steps are further implemented: a file acquisition request includes segment index information; in response to multiple concurrent file acquisition requests from the front-end device, file stream data corresponding to the preview range is determined, and the file stream data is sent to the front-end device, including: in response to multiple concurrent file acquisition requests from the front-end device, a target offset position corresponding to the segment index information is determined based on multiple segment index information and a cross-reference table of the target archive file; the cross-reference table is used to record the offset position of each object in the target archive file in the file; based on the target offset position, the target file segments corresponding to the multiple segment index information are determined from the target archive file to obtain the file stream data corresponding to the preview range; and the file stream data is sent to the front-end device.
[0143] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0144] In the several embodiments provided by the present disclosure, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0145] In the present disclosure, a processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0146] In this disclosure, memory may include non-permanent memory 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. Memory is an example of a computer-readable medium.
[0147] In this disclosure, computer-readable media includes permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the 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 disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic 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 transitory media such as modulated data signals and carrier waves.
[0148] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0149] The above are merely specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to these embodiments, but is to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A preview method for archive files, characterized in that: Applied to front-end equipment, including: In response to a user's preview operation on a target archive file on a page, sending a preview request for the target archive file to a backend server to obtain a data volume and a file segment size of the target archive file returned by the backend server; Determining a rendering area of the target archive file according to the data volume, the file slice size, and the page size; When the page scrolling event stops being monitored, determining the preview range of the target archive file; Concurrently sending multiple file acquisition requests corresponding to the preview range to the backend server to obtain file stream data corresponding to the preview range returned by the backend server; the file stream data includes multiple target file fragments corresponding to the preview range; The file stream data is displayed in the rendering area.
2. The method according to claim 1, characterized in that The data volume includes the actual height, actual width, and single page specifications of the target archive file; the page size includes the effective height and effective width of the page display area; The determining of the rendering area of the target archive file according to the data volume, the file segment size, and the page size includes: Calculating the total number of pages of the target archive file according to the actual height, the actual width and the single page specification; Calculating the actual area of the target archive file according to the total number of pages and the single page specifications; Calculating a width ratio according to the width of the actual area and the effective width; The height of the rendering area is calculated according to the width ratio and the height of the actual area; wherein the width of the rendering area is the effective width.
3. The method according to claim 1, characterized in that After determining the preview range of the target archive file when the page scrolling event stops being monitored, and before concurrently sending multiple file acquisition requests corresponding to the preview range to the back-end server to obtain file stream data corresponding to the preview range returned by the back-end server, the method further includes: Obtaining user access behavior records for the target archive file; Analyzing the access behavior records to obtain user preference information; The multiple file acquisition requests are generated according to the user preference information and the preview range of the target archive file.
4. The method according to claim 1, wherein Displaying the file stream data in the rendering area includes: Determining a rendering order according to the fragment index information of the plurality of target file fragments; In the rendering area, the plurality of target file segments are asynchronously displayed according to the rendering order.
5. A preview method for archive files, characterized in that: Applicable to backend servers, including: In response to a preview request for a target archive file sent by a front-end device, determining a data volume of the target archive file; Slice the target archive file and determine the file slice size; Sending the data volume and the file segment size to the front-end device; In response to multiple concurrent file acquisition requests from a front-end device, file stream data corresponding to a preview range is determined, and the file stream data is sent to the front-end device; wherein the multiple file acquisition requests are used to request the file stream data corresponding to the preview range.
6. The method according to claim 5, characterized in that The step of slicing the target archive file and determining the file slicing sizes includes: Monitor the network bandwidth of the current network environment; The target archive file is segmented according to the network bandwidth to determine the file segment size.
7. The method according to claim 5, characterized in that The file acquisition request includes fragment index information; The step of determining file stream data corresponding to a preview range in response to multiple concurrent file acquisition requests from a front-end device, and sending the file stream data to the front-end device, includes: In response to multiple concurrent file acquisition requests from a front-end device, determining a target offset position corresponding to the slice index information based on the multiple slice index information and a cross-reference table of the target archive file; the cross-reference table is used to record the offset position of each object in the target archive file; Determining, from the target archive file, a plurality of target file fragments corresponding to the fragment index information according to the target offset position, so as to obtain file stream data corresponding to the preview range; The file stream data is sent to the front-end device.
8. A front-end device, characterized in that: include: an interaction module, configured to, in response to a user's preview operation on a target archive file on a webpage, send a preview request for the target archive file to a backend server, and obtain data volume and file segment size of the target archive file returned by the backend server; A rendering area determination module, configured to determine a rendering area of the target archive file based on the data volume, the file segment size, and the page size; A monitoring module, configured to determine a preview range of the target archive file when a page scrolling event stops being monitored; The interaction module is further configured to concurrently send multiple file acquisition requests corresponding to the preview range to the backend server, so as to obtain file stream data corresponding to the preview range returned by the backend server; the file stream data includes multiple target file segments corresponding to the preview range; A rendering module is used to display the file stream data in the rendering area.
9. A back-end server, characterized in that: include: a data volume determination module, configured to determine the data volume of the target archive file in response to a preview request of the target archive file sent by the front-end device; A segmentation module, configured to segment the target archive file and determine the file segment size; An interaction module, configured to send the data volume and the file segment size to the front-end device; In response to multiple concurrent file acquisition requests from a front-end device, file stream data corresponding to a preview range is determined, and the file stream data is sent to the front-end device; wherein the multiple file acquisition requests are used to request the file stream data corresponding to the preview range.
10. A computer-readable storage medium, characterized in that include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for previewing an archive file according to any one of claims 1 to 4 is implemented, or the method for previewing an archive file according to any one of claims 5 to 7 is implemented.