Table export preview method and device

By introducing DPI correction factor, zoom reverse compensation factor and viewport offset correction factor into the table export preview method, combined with multi-dimensional environmental perception and content rule library, the adaptability problem of table export images on different devices and screen sizes is solved, and adaptive table preview is realized, which improves user experience and efficiency.

CN120781797APending Publication Date: 2025-10-14BEIJING HUAHANG WEISHI IND SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510719787.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

Existing technologies lack dynamic adaptability when exporting images from tables and cannot adapt to different screen sizes and devices, resulting in a poor user experience and low information transmission efficiency.

Method used

By introducing the DPI correction factor, the zoom inverse compensation factor, and the viewport offset correction factor, the window width percentage formula is weightedly corrected. Combined with multi-dimensional environmental perception technology, the user operating environment parameters are obtained. Based on the table mixed content rule library, row height requirement conflicts are compensated and the content density factor is adjusted to determine the table row height and number of rows, thereby achieving adaptive table preview.

Benefits of technology

Improves the user experience and efficiency of table preview, ensures that tables are adaptively displayed on different devices and screen sizes, avoids content overflow and deformation, and improves the consistency and aesthetics of image export.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781797A_ABST
    Figure CN120781797A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a table export preview method and device. The method comprises the following steps: carrying out weighted correction on a window width percentage formula by introducing a DPI correction factor, a scaling reverse compensation factor and a viewport offset correction factor; inputting the user operation environment parameters into a weighted window width weighting calculation formula obtained after weighting to obtain the width of the preview picture, and obtaining the height of the preview picture according to the width of the preview picture and a preset general picture proportion standard; the method comprises the following steps: extracting row height requirements of each element in a table content style based on a table mixed content rule base, carrying out conflict compensation on the row height requirements according to a preset conflict resolution mechanism, carrying out proportion constraint compensation on basic row heights according to a content density factor, and determining corresponding table row heights and table row numbers, and performing picture preview display on the table according to the width, the height and the line number of the preview picture. The method and the device can improve user experience and table preview efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data processing, in particular to a table export preview method and device. BACKGROUND

[0002] In the current digital era, the function of exporting table pictures is becoming increasingly common in various application systems, which provides users with intuitive and convenient data visualization means. However, with the popularity of mobile devices and the diversification of screen sizes, the traditional picture export technology gradually exposes its limitations. Specifically, the existing technology mainly has the following two problems:

[0003] Firstly, the fixed-size picture export method lacks dynamic adaptability. This method usually directly sets the fixed size of the picture, and on low-resolution or unconventional size devices, such fixed-size pictures often cause horizontal overflow, i.e., the picture width exceeds the screen width, thereby forcing the appearance of a scroll bar. This not only affects the user's browsing experience, but also makes the picture unable to adjust itself according to the user's real-time changing screen state, reducing the efficiency of information transmission.

[0004] Secondly, although the basic responsive layout technology improves the picture adaptation problem to some extent, its limitations are still obvious. Responsive layout usually adapts to part of the resolution through limited CSS (Cascading Style Sheets) media queries, which requires pre-setting a large number of breakpoints to cope with different screen sizes. However, this method cannot adapt to new devices or unconventional size screens that may appear in the future, such as folding screens and page-turning screens, and as the number of devices continues to increase, the subsequent maintenance cost will increase significantly. In addition, responsive layout mainly focuses on layout adjustment, and when exporting pictures, it often cannot guarantee the consistency of the exported picture and the preview picture, further affecting the user's experience.

[0005] In summary, the existing technology has obvious shortcomings in the adaptive preview of table picture export, and a new technical solution is needed to solve these problems to improve user experience and table preview efficiency. SUMMARY

[0006] In view of the problems in the prior art, the present application provides a table export preview method and device, which can improve user experience and table preview efficiency.

[0007] In order to solve at least one of the above problems, the present application provides the following technical solutions:

[0008] In a first aspect, the present application provides a table export preview method, comprising:

[0009] According to the preset window width percentage formula, a preset window width fixed value is replaced, a DPI correction factor, a zoom reverse compensation factor and a viewport offset correction factor are introduced into the replaced window width percentage formula to perform weighted correction on the window width percentage formula, and a corresponding window width weighted calculation formula is determined.

[0010] A table preview request of a user is accepted, corresponding user operation environment parameters are obtained based on multi-dimensional environment perception technology, the user operation environment parameters are input into the window width weighted calculation formula to determine a corresponding preview picture width, and according to the preview picture width and a preset general picture ratio standard, a corresponding preview picture height is determined.

[0011] A table content style is obtained, the table content style is analyzed based on a table mixed content rule library, the line height requirement of each element in the table content style is determined, when the line height requirements of the elements conflict, the line height requirements are compensated according to a preset conflict resolution mechanism, a corresponding basic line height is determined, the content density of the table is detected, a corresponding content density factor is determined, the basic line height is proportionally constrained and compensated according to the content density factor, a corresponding table line height is determined, the table line height is down-rounded based on the preview picture height according to a down-rounding function, a corresponding table line number is determined, and the table is displayed in a picture preview according to the preview picture width, the preview picture height and the table line number.

[0012] Further, before introducing the DPI correction factor, the zoom reverse compensation factor and the viewport offset correction factor into the replaced window width percentage formula to determine the corresponding window width weighted calculation formula, the method further comprises:

[0013] A DPI reference value is defined, and a corresponding DPI correction factor is determined based on the ratio of a real-time DPI detection value to the DPI reference value.

[0014] A real-time browser zoom ratio is obtained, and a corresponding zoom reverse compensation factor is determined by reverse compensating the zoom ratio.

[0015] According to a real-time browser viewport width and a browser UI shielding correction value, a shielding area is calculated to determine a corresponding viewport offset correction factor.

[0016] Further, the method of analyzing the table content style based on the table mixed content rule library and determining the line height requirement of each element in the table content style comprises:

[0017] analyzing the table content style based on a table mixed content rule library, to determine a corresponding table content style element, wherein the table content style element includes at least one of a table cell, a text paragraph, an embedded chart, and a formula code block;

[0018] determining a line height requirement of each element according to the table content style element and a preset element adaptation rule.

[0019] Further, when the line height requirements of the elements conflict, the line height requirements are compensated according to a preset conflict resolution mechanism to determine a corresponding basic line height, including:

[0020] When the line height requirements of the elements conflict, it is determined whether a conflict difference is greater than a conflict threshold value;

[0021] If not, the line height requirements are compensated based on a soft conflict optimization strategy to determine a corresponding basic line height;

[0022] If yes, the line height requirements are compensated based on a priority conflict algorithm to determine a corresponding basic line height.

[0023] Further, the line height requirements are compensated based on the soft conflict optimization strategy to determine a corresponding basic line height, including:

[0024] The preset table cell line height requirement and the preset text paragraph line height requirement are compensated according to an average compromise strategy to determine a corresponding basic line height;

[0025] The preset embedded chart line height requirement and the preset table cell line height requirement are compensated according to a content elasticity expansion strategy to determine a corresponding basic line height;

[0026] The preset text paragraph line height requirement and the preset formula code block line height requirement are compensated according to a font size fine-tuning strategy to determine a corresponding basic line height.

[0027] Further, the line height requirements are compensated based on the priority conflict algorithm to determine a corresponding basic line height, including:

[0028] The elements in the table style are set with a priority order;

[0029] The line height requirements are re-distributed according to the order of the priority order to determine a corresponding basic line height.

[0030] Further, the content density of the table is detected to determine a corresponding content density factor, and the basic line height is proportionally compensated according to the content density factor to determine a corresponding table line height, including:

[0031] The content density of the table is detected, the proportion of the number of characters in the table is counted, the content density ratio is calculated, and the basic line height is proportionally compensated based on the content density ratio;

[0032] A minimum readable line height is set, and it is judged whether the basic line height after the line height compensation is greater than the minimum readable line height. If yes, the basic line height is determined as the table line height. If no, the minimum readable line height is determined as the table line height.

[0033] In a second aspect, the present application provides a table export preview device, comprising:

[0034] The preview window width weighting module is configured to replace a preset window width fixed value according to a preset window width percentage formula, and introduce a DPI correction factor, a zoom reverse compensation factor and a viewport offset correction factor into the window width percentage formula after the replacement to perform weighted correction on the window width percentage formula, so as to determine a corresponding window width weighted calculation formula. The historical form usage data includes at least one of historical form performance data and historical form structure change data.

[0035] The preview window length and width determination module is configured to accept a table preview request of a user, obtain corresponding user operation environment parameters based on multi-dimensional environment perception technology, input the user operation environment parameters into the window width weighted calculation formula to determine a corresponding preview picture width, and determine a corresponding preview picture height according to the preview picture width and a preset general picture proportion standard.

[0036] The preview window row number determination and display module is configured to obtain a table content style, analyze the table content style based on a table mixed content rule library, determine line height requirements of each element in the table content style, perform conflict compensation on the line height requirements according to a preset conflict resolution mechanism when the line height requirements of the elements conflict, determine a corresponding basic line height, perform content density detection on the table to determine a corresponding content density factor, perform proportional constraint compensation on the basic line height according to the content density factor to determine a corresponding table line height, perform down rounding on the table line height based on the preview picture height according to a down rounding function to determine a corresponding table row number, and perform picture preview display on the table according to the preview picture width, the preview picture height and the table row number.

[0037] In a third aspect, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the table export preview method are implemented.

[0038] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the table export preview method.

[0039] In a fifth aspect, the present application provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the steps of the table export preview method.

[0040] According to the above technical solution, the present application provides a table export preview method and device, which introduces a DPI correction factor, a scaling reverse compensation factor and a viewport offset correction factor to weight and correct a window width percentage formula; inputs a user operation environment parameter into the weighted window width weighting calculation formula to obtain a preview picture width, and obtains a preview picture height according to the preview picture width and a preset general picture ratio standard; extracts a line height requirement of each element in a table content style based on a table mixed content rule library, compensates for conflicts in the line height requirement according to a preset conflict resolution mechanism, proportionally restricts and compensates for a basic line height according to a content density factor, determines corresponding table line heights and table line numbers, and displays a table in a picture preview mode according to the preview picture width, height and line number, thereby improving user experience and table preview efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0042] Figure 1 One of the flowcharts of the table export preview method in the embodiments of the present application;

[0043] Figure 2 The second flowchart of the table export preview method in the embodiments of the present application;

[0044] Figure 3 The third flowchart of the table export preview method in the embodiments of the present application;

[0045] Figure 4 The fourth flowchart of the table export preview method in the embodiments of the present application;

[0046] Figure 5 The fifth flowchart of the table export preview method in the embodiments of the present application;

[0047] Figure 6Fig. 6 is a flowchart of a seventh schematic diagram of a table export preview method according to an embodiment of the present application;

[0048] Figure 7 Fig. 7 is a flowchart of a seventh schematic diagram of a table export preview method according to an embodiment of the present application;

[0049] Figure 8 Fig. 8 is a structural diagram of a table export preview device according to an embodiment of the present application;

[0050] Figure 9 Fig. 9 is a structural schematic diagram of an electronic device according to an embodiment of the present application.

[0051] Reference signs:

[0052] Electronic device 9600, central processor 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION

[0053] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings of the embodiments of the present application to make a clear and complete description of the technical solutions of the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0054] The acquisition, storage, use, processing, etc. of data in the technical solutions of the present application all comply with relevant provisions of national laws and regulations.

[0055] In view of the obvious problems of the prior art in adaptive preview of table export pictures, the present application provides a table export preview method and device, which introduces a DPI correction factor, a scaling reverse compensation factor, and a viewport offset correction factor to perform weighted correction on a window width percentage formula; inputs a user operation environment parameter into the weighted window width weighted calculation formula to obtain a preview picture width, and obtains a preview picture height according to the preview picture width and a preset general picture ratio standard; extracts a line height requirement of each element in a table content style based on a table mixed content rule library, compensates for conflicts in the line height requirement according to a preset conflict resolution mechanism, proportionally constrains and compensates for a basic line height according to a content density factor, determines corresponding table line heights and table line numbers, and performs picture preview display on the table according to the preview picture width, height, and line number, thereby improving user experience and table preview efficiency.

[0056] In order to improve user experience and table preview efficiency, an embodiment of a table export preview method is provided, as shown in Figure 1 , which specifically includes the following contents:

[0057] First, background art, current table preview display and picture export face the following problems.

[0058] Fixed size: directly set the picture size, which is prone to horizontal overflow (forced to appear scroll bar) on low-resolution devices, lacks dynamic adaptability, the output picture size is irrelevant to the real environment, and cannot be adjusted according to the user's real-time changing screen state.

[0059] Basic responsive layout: adapt to part of the resolution through limited CSS media queries, but need to preset breakpoints, which cannot adapt to new devices or irregular size screens that may appear in the future, and the subsequent maintenance cost is high.

[0060] The two core innovations are as follows: first, based on multi-dimensional browser environment parameter perception, the proportion formula of the original fixed proportion export picture is corrected through DPI correction factor, zoom reverse compensation factor and viewport offset correction factor, and the width and height parameters of the export picture are dynamically adapted to the user's browser and device parameters, which can be adjusted according to the user's real-time changing screen state, improving user experience;

[0061] Second, based on the joint layout technology across content types, the content density factor is introduced to determine the line height of the table picture that needs to be previewed and exported, so that the exported table is beautiful and the user experience is improved.

[0062] Step S101: replace the preset window width fixed value according to the preset window width percentage formula, introduce the DPI correction factor, the zoom reverse compensation factor and the viewport offset correction factor into the window width percentage formula after replacement, and weight correct the window width percentage formula to determine the corresponding window width weighted calculation formula;

[0063] Optionally, in the present embodiment, in view of the lack of dynamic adaptability of current web table preview, the present embodiment proposes a multi-dimensional perception-based web table picture preview method.

[0064] Specifically, the present embodiment constructs a web table preview picture width calculation formula based on multi-dimensional perception:

[0065] Actual width = (windowWidth-viewportOffset) x preset percentage x (dpi / baselineDPI) x (1 / osZoom)

[0066] windowWidth: Current browser viewport width (px)

[0067] viewportOffset: Browser UI obscuring correction value (e.g. mobile address bar height)

[0068] presetPercentage: Predefined image-to-screen ratio (e.g. 80%)

[0069] dpi: Device physical pixel density (e.g. 2.0 for Retina screen)

[0070] baselineDPI: Baseline DPI (usually 96dpi)

[0071] osZoom: Operating system zoom scale (e.g. 1.25 for Windows 125% zoom)

[0072] Firstly, in the above formula, the present application solves the "DPI blind area" problem of traditional solutions based on the DPI correction factor (dpi / baselineDPI).

[0073] For example, traditional solutions only rely on CSS width:80%, ignoring the physical pixel difference of high DPI devices (such as 4K screens), resulting in too small actual physical size of images (logical pixels 80% x high DPI = physical size reduction) and blurred text (not matching device rendering capabilities).

[0074] The present application dynamically enlarges physical pixels by (dpi / baselineDPI) to ensure that if dpi=2.0, the calculated width is automatically x2, and the physical size of the image is consistent with the logical size.

[0075] Secondly, the present application offsets the system zoom effect based on the zoom reverse compensation factor (1 / osZoom).

[0076] For example, browsers enlarge CSS pixels by system zoom scale by default, resulting in actual occupation of 80% x 1.25 (zoom) = 100% when the user sets width:80%, triggering horizontal scroll bar.

[0077] The present application offsets the system zoom effect by (1 / osZoom). If osZoom=1.25, the calculated width x(1 / 1.25)=0.8, offsetting the system zoom effect.

[0078] Then, the present application performs dynamic correction of viewport offset based on the viewport offset correction factor (windowWidth-viewportOffset).

[0079] For example, to solve the problem that media queries cannot perceive dynamic changes in browser UI.

[0080] This application deducts the occlusion area in real time by the viewport offset correction factor (windowWidth-viewportOffset). If the address bar height = 50px, the actual available width = screenWidth-50px. Reduce the content truncation rate.

[0081] This embodiment is specifically applied to scenario one:

[0082] The traditional scheme media query preset breakpoint cannot cover the folding state (such as the width of the folding state suddenly decreasing by 50%), resulting in layout disorder. This application dynamically calculates the real-time changes with the window width, and automatically compresses the picture width in the folding state.

[0083] Folding state: windowWidth = 600px → actual width = (600-0) × 80% × (3.5 / 96) × (1 / 1) = 17.5px (physical pixels);

[0084] Expanded state: windowWidth = 1200px → actual width = (1200-0) × 80% × (3.5 / 96) × (1 / 1) = 35px.

[0085] This embodiment is specifically applied to scenario two:

[0086] The traditional scheme exports the picture to be displayed as 50% of the logical size on a 4K screen (dpi = 2.0), which needs to be manually enlarged by the user. This application automatically compensates for DPI to ensure that the exported size is consistent with the preview.

[0087] Exported width = (dynamically calculated width / dpi) × 72 = (100px / 2.0) × 72 = 3600 physical pixels (matching 4K screen).

[0088] This embodiment is specifically applied to scenario three:

[0089] The user displays a table on the left screen and previews the exported picture on the right screen, and the proportions of the two screens are inconsistent (left screen 4:3, right screen 3:2), which will cause the right picture to stretch and deform in the traditional scheme.

[0090] This application detects the independent resolution of the dual screen (left screen 1920×1440, right screen 2160×1440); automatically identifies the split screen mode, and determines that the picture preview is located on the right screen through the window.screenLeft API;

[0091] Right screen actual width = (2160-0) × 70% × (2.5 / 96) × (1 / 1.1) = 284px (physical pixels);

[0092] The height is calculated as 284 × (2 / 3) = 189px according to the 3:2 ratio of the right screen.

[0093] Synchronize the left table row height to 80% to avoid content overflow.

[0094] On the basis of the basic browser viewport width-based calculation of the preview picture width, the window width weighted calculation formula is constructed, the DPI correction factor, the scaling reverse compensation factor and the viewport offset correction factor are introduced, and through multi-dimensional perception, different device parameters are dynamically adapted to increase the efficiency of picture preview export.

[0095] Step S102: Accepting the table preview request of the user, obtaining the corresponding user operation environment parameters based on multi-dimensional environment perception technology, inputting the user operation environment parameters into the window width weighted calculation formula to determine the corresponding preview picture width, and determining the corresponding preview picture height according to the preview picture width and the preset general picture ratio standard;

[0096] Optionally, in the embodiment, it is assumed that the user uses the table export picture function on a three-screen folding device, the device can be switched between the folded state (narrow screen), the unfolded state (landscape screen) and the split screen state (multi-task mode), and needs to adapt to different viewports in real time.

[0097] The application obtains real-time browser data when the user issues a preview export request through a browser API: current viewport width, device DPI, operating system scaling ratio, and browser viewport correction. Based on the window width weighted calculation formula constructed in step S101, the width of the table export picture is calculated to determine the width of the table to be exported.

[0098] Next, after determining the picture width, the preview picture height is calculated in reverse according to the industry general 16:9 picture ratio standard.

[0099] The preview picture width and height of the adaptive web page and the user screen calculated through this step lay the foundation for subsequent calculation of the number of rows of the preview picture.

[0100] Step S103: Obtain the table content style, analyze the table content style based on the table mixed content rule library, determine the line height requirement of each element in the table content style, when the line height requirements of the elements conflict, compensate for the conflict according to the preset conflict resolution mechanism, determine the corresponding basic line height, detect the content density of the table, determine the corresponding content density factor, proportionally constrain and compensate the basic line height according to the content density factor, determine the corresponding table row height, down round the table row height based on the preview picture height according to the down round function, determine the corresponding number of table rows, and display the table in a picture according to the preview picture width, the preview picture height and the number of table rows.

[0101] Optionally, after calculating the width and height of the preview export picture based on the user's multi-dimensional browsing parameters in the previous step, this step needs to calculate the optimal display content, row height, and row number of the table in the export table picture in order to improve the preview export effect.

[0102] Optionally, in this embodiment, the base row height of the preview export table picture is first obtained based on the table mixed content rule library.

[0103] Specifically, the mixed content adaptation rule library includes the mapping relationship between table content types and adaptation rules. It includes but is not limited to:

[0104] Table cell: When the row height is expanded, the cross-row height of the merged cell is adjusted synchronously to avoid content misplacement;

[0105] Text paragraph: automatically adjust the paragraph spacing according to the row height (such as 120% of the row height) to maintain visual continuity;

[0106] Embedded chart: reserve a safe area for axis labels (fixed width + dynamic height) to avoid overlapping with the table;

[0107] Formula / code block: enable proportional font and disable row height compression to ensure symbol alignment.

[0108] The system traverses the table content, analyzes the row height requirements of each type of table content based on the adaptation rule library, and determines multiple row height requirements. When the row height requirements of different content types conflict (such as table compression row height and formula expansion row height), calculate the conflict difference, when the conflict difference exceeds the threshold, use the hard conflict optimization strategy, when the conflict difference does not exceed the threshold, use the soft conflict optimization strategy.

[0109] Specifically, soft conflict optimization is based on a rule-based mapping mode, and the optimization rules include but are not limited to:

[0110] Text and table conflict, adopt the mean compromise strategy, take the arithmetic mean of the row height of both parties in conflict;

[0111] Chart label and table row height conflict, adopt the content elasticity stretching strategy, allow non-critical content (such as blank margin) to dynamically compress 1-3px to bridge the difference;

[0112] Text paragraph and formula row height conflict, adopt the font size fine-tuning strategy, adjust the font size ±0.5pt within the minimum readable font size range to match the row height (such as 10pt→10.5pt);

[0113] Lazy rendering: mark the conflict area, and dynamically adjust when the user scrolls to this area.

[0114] Specifically, hard conflict optimization, based on priority arbitration algorithm for conflict arbitration.

[0115] The priority arbitration algorithm first sets a static priority table as follows:

[0116] Content Type Priority Weight Coefficient Minimum Line Height Protection Mathematical Formula 1 1.5 25px Chart Label 2 1.2 20px Table Cell 3 1.0 15px Text Paragraph 4 0.8 12px

[0117] Secondly, a dynamic weight adjustment formula is set, and if the same content type triggers arbitration multiple times, the weight coefficient is dynamically increased according to the following rules:

[0118] W_new = W_old x (1 + number of conflicts x 0.1)

[0119] Next, the line height is allocated. First, the line height is allocated in order based on the priority order of the static priority table, and if there is still remaining height, it is allocated to low-priority content in proportion to the weight, and finally the basic line height is obtained.

[0120] Next, when the table preview picture content is displayed based on the basic line height, the density value of the table preview picture content is monitored based on the content density factor.

[0121] Specifically, the content density factor counts the number of characters, the number of line breaks, and the proportion of special symbols (such as formulas) in the cell, and calculates the content density value (Density = number of characters / cell area). When the content density is too high, the basic line height is compensated based on the content density factor, and the formula is as follows:

[0122] Final line height = max (basic line height x (1 + density factor), minimum line height)

[0123] Among them, the system pre-sets the font size lower limit and the line height lower limit to ensure the readability of the content. The minimum line height is the lower limit of the line height.

[0124] After the above line height calculation, the optimal line height based on the display content is obtained, the height of the preview picture obtained in step S102 is divided by the line height, and the floor function is used to ensure that the calculation result is a complete number of lines, so that the picture can display the content such as text and table completely, avoid content truncation, and optimize the preview experience of the user. On this basis, the height, width and number of lines of the preview table picture are determined to display the picture preview thumbnail in a simple form for the user to quickly browse.

[0125] This example shows how the present embodiment determines the width and height of the preview picture according to the multi-dimensional environment perception technology, determines the content line height of the preview picture based on the cross-content type joint layout technology and the content density factor, and finally displays the picture preview thumbnail based on the width and height of the preview picture, the content line height of the preview picture, and the number of content lines of the preview picture.

[0126] From the above description, the table export preview method provided by the embodiment of the present application can introduce a DPI correction factor, a zoom reverse compensation factor and a viewport offset correction factor to perform weighted correction on the window width percentage formula; input the user operation environment parameters into the weighted window width weighted calculation formula to obtain a preview picture width, and obtain a preview picture height according to the preview picture width and a preset general picture ratio standard; extract the line height requirement of each element in the table content style based on a table mixed content rule library, compensate for the conflict of the line height requirement according to a preset conflict resolution mechanism, proportionally constrain and compensate the basic line height according to a content density factor, determine the corresponding table line height and table line number, and perform picture preview display on the table according to the preview picture width, height and line number, so as to improve the user experience and table preview efficiency.

[0127] In an embodiment of the table export preview method of the present application, referring to Figure 2 , the following content can also be specifically included:

[0128] Step S201: defining a DPI reference value, determining a corresponding DPI correction factor based on the ratio of a real-time DPI detection value to the DPI reference value;

[0129] Step S202: obtaining a real-time browser zoom ratio, performing reverse compensation on the zoom ratio to determine a corresponding zoom reverse compensation factor;

[0130] Step S203: performing occlusion area calculation according to a real-time browser viewport width and a browser UI occlusion correction value to determine a corresponding viewport offset correction factor.

[0131] Optionally, in the embodiment, a webpage table preview picture width calculation formula based on multi-dimensional perception is constructed:

[0132] Actual width = (windowWidth-viewportOffset) x preset percentage x (dpi / baselineDPI) x (1 / osZoom)

[0133] windowWidth: current browser viewport width (px)

[0134] viewportOffset: browser UI occlusion correction value (such as the height of the address bar of a mobile terminal)

[0135] Preset percentage: predefined picture-to-screen ratio (such as 80%)

[0136] dpi: device physical pixel density (such as 2.0 for a Retina screen)

[0137] baselineDPI: reference DPI (usually 96 dpi)

[0138] osZoom: operating system zoom scale (e.g. 1.25 for Windows 125% zoom)

[0139] Firstly, in the above formula, the present application solves the "DPI blind area" problem of the traditional scheme based on the DPI correction factor (dpi / baselineDPI).

[0140] For example, the traditional scheme only relies on CSS width: 80%, ignoring the physical pixel difference of high DPI devices (such as 4K screens), resulting in too small actual physical size of pictures (logical pixels 80% x high DPI = physical size reduction) and blurred text (not matching device rendering capability).

[0141] The present application dynamically magnifies physical pixels by (dpi / baselineDPI) to ensure that if dpi=2.0, the calculated width is automatically x2, and the physical size of the picture is consistent with the logical size.

[0142] Secondly, the present application offsets the system zoom effect based on the zoom reverse compensation factor (1 / osZoom).

[0143] For example, the browser magnifies CSS pixels by the system zoom scale by default, resulting in actual occupation of 80% x 1.25 (zoom) = 100% when the user sets width: 80%, triggering horizontal scroll bar.

[0144] The present application offsets the system zoom effect by (1 / osZoom). If osZoom=1.25, the calculated width x (1 / 1.25)=0.8, offsetting the system zoom effect.

[0145] Then, the present application dynamically corrects the viewport offset based on the viewport offset correction factor (windowWidth-viewportOffset).

[0146] For example, to solve the problem that media queries cannot perceive the dynamic changes of browser UI.

[0147] The present application real-time deducts the occluded area by the viewport offset correction factor (windowWidth-viewportOffset). If the address bar height=50px, the actual available width=screenWidth-50px. Reduces the content truncation rate.

[0148] The first specific application scenario of the present embodiment is:

[0149] The traditional media query preset breakpoint cannot cover the folded state (e.g. the width suddenly drops by 50% after folding), resulting in layout disorder. The present application dynamically calculates the real-time changes with the window width, and automatically compresses the picture width in the folded state.

[0150] Folded state: windowWidth = 600px → actual width = (600-0) x 80% x (3.5 / 96) x (1 / 1) = 17.5px (physical pixels);

[0151] Unfolded state: windowWidth = 1200px → actual width = (1200-0) x 80% x (3.5 / 96) x (1 / 1) = 35px.

[0152] This embodiment is specifically applied to scenario two:

[0153] The traditional solution exports the picture to be displayed on a 4K screen (dpi = 2.0) as 50% of the logical size, which needs to be manually enlarged by the user. The present application automatically compensates for DPI to ensure that the exported size is consistent with the preview.

[0154] Exported width = (dynamically calculated width / dpi) x 72 = (100px / 2.0) x 72 = 3600 physical pixels (matching 4K screen).

[0155] This embodiment is specifically applied to scenario three:

[0156] The user displays a table on the left screen and previews the exported picture on the right screen, and the proportions of the two screens are inconsistent (4:3 on the left screen and 3:2 on the right screen), which will cause the right picture to be stretched and deformed in the traditional solution.

[0157] The present application detects the independent resolution of the dual screens (1920x1440 on the left screen and 2160x1440 on the right screen), automatically identifies the split screen mode, and determines that the picture preview is located on the right screen through the window.screenLeft API.

[0158] Actual width of the right screen = (2160-0) x 70% x (2.5 / 96) x (1 / 1.1) = 284px (physical pixels)

[0159] The height is calculated as 284x(2 / 3) = 189px according to the 3:2 ratio of the right screen.

[0160] Synchronously compress the row height of the left table to 80% to avoid content overflow.

[0161] Through step S203, the present embodiment constructs a preview picture width calculation formula based on the DPI correction factor, the scaling reverse compensation factor, and the viewport offset correction factor, laying a foundation for subsequent flexible display of the preview picture.

[0162] In an embodiment of the table export preview method of the present application, referring to Figure 3 The method can further include the following content:

[0163] Step S301: Analyzing the table content style based on the table mixed content rule library to determine the corresponding table content style elements, wherein the table content style elements include at least one of table cells, text paragraphs, embedded charts, and formula code blocks.

[0164] Step S302: Determining the line height requirements of each element according to the table content style elements and the preset element adaptation rules.

[0165] Optionally, in the embodiment, the joint layout technology across content types is applied in this step. The base line height of the preview exported table picture is obtained based on the table mixed content rule library.

[0166] Specifically, the mixed content adaptation rule library includes but is not limited to:

[0167] Table cells: The cross-line height of merged cells is adjusted synchronously when the line height is expanded to avoid content misplacement;

[0168] Text paragraphs: The paragraph spacing is automatically adjusted according to the line height (such as 120% of the line height) to maintain visual continuity;

[0169] Embedded charts: A safety area (fixed width + dynamic height) is reserved for axis labels to avoid overlapping between the labels and the table;

[0170] Formula / code blocks: Enable the fixed-width font and disable line height compression to ensure symbol alignment.

[0171] The system traverses the table content, analyzes the line height requirements of each table content based on the adaptation rule library, and determines multiple line height requirements.

[0172] Through step S302, the joint layout technology across content types is applied to improve the user experience of table content display.

[0173] In an embodiment of the table export preview method of the present application, referring to Figure 4 The method can further include the following content:

[0174] Step S401: When the line height requirements of each element conflict, determining whether the conflict difference is greater than a conflict threshold;

[0175] Step S402: If not, compensating for the conflict of the line height requirements based on a soft conflict optimization strategy to determine the corresponding base line height;

[0176] Step S403: If yes, compensating for the conflict of the line height requirements based on a priority conflict algorithm to determine the corresponding base line height.

[0177] Optionally, in the embodiment, when the line height requirements of different content types conflict (for example, the table needs to compress the line height, while the formula needs to expand the line height), the conflict difference is calculated, when the conflict difference exceeds the threshold, the hard conflict optimization strategy is adopted, and when the conflict difference does not exceed the threshold, the soft conflict optimization strategy is adopted.

[0178] It can be understood that when the conflict threshold is not exceeded, the system realizes fine processing through the hierarchical strategy, which guarantees efficiency and avoids excessive intervention.

[0179] When the conflict threshold is exceeded, it means that the conflict is large and cannot be balanced, and then an arbitration algorithm is needed, and the system determines which line height requirement is the optimal choice.

[0180] Through step S403, the conflict threshold is introduced in the embodiment, and two processing schemes are decomposed for different conflict modes, which guarantees conflict processing efficiency and avoids excessive intervention.

[0181] In an embodiment of the table export preview method of the present application, referring to Figure 5 It can also specifically include the following content:

[0182] Step S501: compensating for the conflict between the preset table cell line height requirement and the preset text paragraph line height requirement according to the mean compromise strategy, and determining the corresponding basic line height;

[0183] Step S502: compensating for the conflict between the preset embedded chart line height requirement and the preset table cell line height requirement according to the content elastic stretching strategy, and determining the corresponding basic line height;

[0184] Step S503: compensating for the conflict between the preset text paragraph line height requirement and the preset formula code block line height requirement according to the font size fine-tuning strategy, and determining the corresponding basic line height.

[0185] Optionally, in the embodiment, the soft conflict optimization is based on a rule mapping mode, and the optimization rules include but are not limited to:

[0186] The mean compromise strategy is adopted for the conflict between the text and the table, and the arithmetic mean of the line heights of the two conflicting parties is taken;

[0187] The content elastic stretching strategy is adopted for the conflict between the chart label and the table line height, and the non-key content (such as the blank margin) is dynamically compressed by 1-3px to bridge the difference;

[0188] The font size fine-tuning strategy is adopted for the conflict between the text paragraph and the formula line height, and the font size is adjusted by ±0.5pt within the minimum readable font size range to match the line height (such as 10pt→10.5pt);

[0189] Lazy rendering: mark the conflict area, and dynamically adjust when the user scrolls to the area.

[0190] Through the step S503, the embodiment successfully balances the conflicts not exceeding the threshold through the soft conflict strategy, ensures that the balance between the display contents meets the optimal content layout, and improves the user browsing experience.

[0191] In an embodiment of the table export preview method of the present application, referring to Figure 6 It can also specifically include the following content:

[0192] Step S601: setting priority order for elements in the table style;

[0193] Step S602: re-distributing line height demand according to the order of the priority order to determine the corresponding basic line height.

[0194] Optionally, in the embodiment, the hard conflict optimization is based on the priority arbitration algorithm to arbitrate the conflict.

[0195] The priority arbitration algorithm first sets a static priority table as follows:

[0196] Content Type Priority Weight Coefficient Minimum Line Height Protection Mathematical Formula 1 1.5 25px Chart Label 2 1.2 20px Table Cell 3 1.0 15px Text Paragraph 4 0.8 12px

[0197] Secondly, a dynamic weight adjustment formula is set, and if the same content type triggers arbitration multiple times, the weight coefficient is dynamically increased according to the following rules:

[0198] W_new = W_old x (1 + conflict times x 0.1)

[0199] Next, the line height is allocated. First, the line height is allocated in the order of the priority order based on the static priority table, and if there is still remaining height, it is allocated to low-priority content in proportion to the weight, and finally the basic line height is obtained.

[0200] Through the step S602, in the hard conflict stage, the system will judge and select a best table line height based on the priority rules combined with the weight factor to lay the foundation for the table preview display.

[0201] In an embodiment of the table export preview method of the present application, referring to Figure 7 It can also specifically include the following content:

[0202] Step S701: performing content density detection on the table, counting the character number proportion in the table, calculating the content density ratio, and compensating the basic line height in proportion based on the content density ratio;

[0203] Step S702: setting a minimum readable line height, judging whether the basic line height after the line height compensation is greater than the minimum readable line height, if yes, determining the basic line height as the table line height, and if no, determining the minimum readable line height as the table line height.

[0204] Optionally, in the embodiment, when the table preview picture content is previewed and displayed according to the base line height, the density value of the table preview picture content is monitored based on the content density factor.

[0205] Specifically, the content density factor is used to count the number of characters, the number of line breaks, and the proportion of special symbols (such as formulas) in a cell, and to calculate the content density value (Density = number of characters / cell area). When the content density is too high, the base line height is compensated based on the content density factor, and the formula is as follows:

[0206] Final line height = max (base line height x (1 + density factor), minimum line height)

[0207] The system predefines the lower limit of the font size and the lower limit of the line height to ensure the readability of the content. The minimum line height is the lower limit of the line height.

[0208] After the above line height calculation, the optimal line height based on the display content is obtained. The height of the preview picture obtained in step S102 is divided by the line height, and the floor function is used to ensure that the calculation result is a complete number of lines, so that the content such as text and table in the picture arrangement can be displayed completely, avoiding content truncation and optimizing the preview experience of the user. On this basis, the height, width and number of lines of the determined preview table picture are used to display the picture preview thumbnail, so that the user can quickly browse in a simple form.

[0209] Through step S702, the base line height is successfully compensated for content density based on the content density factor, and the user browsing experience is improved.

[0210] In order to improve the user experience and the efficiency of table preview, the present application provides an embodiment of a table export preview device for implementing all or part of the content of the table export preview method, as shown in Figure 8 The table export preview device specifically includes the following content:

[0211] The preview window width weighting module 10 is used to replace the preset window width fixed value according to the preset window width percentage formula, and introduce the DPI correction factor, the scaling reverse compensation factor and the viewport offset correction factor into the window width percentage formula after replacement to weight and correct the window width percentage formula, and determine the corresponding window width weighting calculation formula;

[0212] The preview window length and width determination module 20 is configured to receive a user's form preview request, obtain corresponding user operating environment parameters based on multi-dimensional environment perception technology, input the user operating environment parameters into the window width weighted calculation formula to determine the corresponding preview image width, and determine the corresponding preview image height based on the preview image width and a preset general screen ratio standard;

[0213] The preview window row number determination and display module 30 is used to obtain the table content style, analyze the table content style based on the table mixed content rule library, determine the row height requirements of each element in the table content style, and when there is a conflict in the row height requirements of each element, compensate the row height requirements according to a preset conflict resolution mechanism, determine the corresponding basic row height, perform content density detection on the table, determine the corresponding content density factor, perform proportional constraint compensation on the basic row height according to the content density factor, determine the corresponding table row height, round down the table row height based on the preview image height according to a rounding down function, determine the corresponding number of table rows, and perform image preview and display of the table according to the preview image width, the preview image height and the number of table rows.

[0214] From the above description, it can be seen that the table export preview device provided in the embodiment of the present application can perform weighted correction on the window width percentage formula by introducing a DPI correction factor, a scaling reverse compensation factor, and a viewport offset correction factor; the window width weighted calculation formula obtained after the user operating environment parameters are input and weighted is used to obtain the preview image width, and the preview image height is obtained according to the preview image width and the preset general screen ratio standard; based on the table mixed content rule library, the row height requirements of each element in the table content style are extracted, and the row height requirements are conflict compensated according to the preset conflict resolution mechanism, and the basic row height is proportionally constrained and compensated according to the content density factor, and the corresponding table row height and number of table rows are determined. The table is previewed and displayed according to the preview image width, height, and number of rows, thereby improving user experience and table preview efficiency.

[0215] From a hardware perspective, in order to improve user experience and table preview efficiency, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the table export preview method. The electronic device specifically includes the following contents:

[0216] The processor, the memory, the communications interface and the bus; wherein the processor, the memory, the communications interface complete the communication between each other through the bus; the communications interface is used for realizing the information transmission between the table export preview method and the core business system, the user terminal and the related database and other related devices; the logic controller can be a desktop computer, a tablet computer and a mobile terminal and the like, and the embodiment is not limited thereto. In the embodiment, the logic controller can be implemented by referring to the embodiment of the table export preview method and the embodiment of the table export preview method, the contents of which are incorporated herein, and the repeated parts will not be described herein.

[0217] It can be understood that the user terminal can include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device and the like. The smart wearable device can include smart glasses, a smart watch, a smart bracelet and the like.

[0218] In actual application, part of the table export preview method can be executed on the electronic device as described above, or all operations can be completed in the client device. Specifically, the selection can be made according to the processing capacity of the client device and the limitation of the user's use scene, and the like. The present application is not limited thereto. If all operations are completed in the client device, the client device can further include a processor.

[0219] The above-mentioned client device can have a communication module (i.e. a communication unit) and can be communicatively connected with a remote server to realize data transmission with the server. The server can include a server of the task scheduling center side, and the server of the intermediate platform can also be included in other implementation scenarios, for example, the server of the third-party server platform which is communicatively connected with the task scheduling center server. The server can include a single computer device, or a server cluster composed of multiple servers, or a server structure of a distributed device.

[0220] Figure 9 A schematic block diagram of the system configuration of the electronic device 9600 of the embodiment of the present application is shown in FIG. 9. As shown in FIG. 9, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that the structure shown in FIG. 9 is exemplary; other types of structures can also be used to supplement or replace the structure to realize telecommunication functions or other functions. Figure 9 Figure 9

[0221] ​​In an embodiment, the table export preview method function can be integrated into the central processor 9100. The central processor 9100 can be configured to control as follows:

[0222] Step S101: Replace the preset window width fixed value according to the preset window width percentage formula, introduce the DPI correction factor, the zoom reverse compensation factor and the viewport offset correction factor into the window width percentage formula after replacement, and weight and correct the window width percentage formula to determine the corresponding window width weighted calculation formula;

[0223] Step S102: Accept the table preview request of the user, obtain the corresponding user operation environment parameters based on multi-dimensional environment perception technology, input the user operation environment parameters into the window width weighted calculation formula to determine the corresponding preview picture width, and determine the corresponding preview picture height according to the preview picture width and the preset general picture ratio standard;

[0224] Step S103: Obtain the table content style, analyze the table content style based on the table mixed content rule library, determine the line height requirement of each element in the table content style, when the line height requirements of the elements conflict, compensate for the conflict according to the preset conflict resolution mechanism, determine the corresponding basic line height, detect the content density of the table, determine the corresponding content density factor, proportionally constrain and compensate the basic line height according to the content density factor, determine the corresponding table line height, and down round the table line height based on the preview picture height according to the down round function, determine the corresponding table row number, and display the table in a picture preview according to the preview picture width, the preview picture height and the table row number.

[0225] From the above description, it can be seen that the electronic device provided by the embodiments of the present application introduces the DPI correction factor, the zoom reverse compensation factor and the viewport offset correction factor to weight and correct the window width percentage formula, inputs the user operation environment parameters into the window width weighted calculation formula obtained after weighting to obtain the preview picture width, obtains the preview picture height according to the preview picture width and the preset general picture ratio standard, extracts the line height requirement of each element in the table content style based on the table mixed content rule library, compensates for the conflict according to the preset conflict resolution mechanism, proportionally constrains and compensates the basic line height according to the content density factor, determines the corresponding table line height and table row number, and displays the table in a picture preview according to the preview picture width, height and row number, thereby improving the user experience and table preview efficiency.

[0226] In another embodiment, the table export preview method can be configured separately from the central processing unit 9100. For example, the table export preview method can be configured as a chip connected to the central processing unit 9100, and the table export preview method function can be implemented under the control of the central processing unit.

[0227] like Figure 9 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 9 In addition, the electronic device 9600 may also include all components shown in Figure 9 For components not shown, reference may be made to the prior art.

[0228] like Figure 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0229] Memory 9140 can be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It can store the aforementioned failure-related information and also store programs that execute the relevant information. The CPU 9100 can execute the programs stored in memory 9140 to implement information storage or processing.

[0230] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 may be, for example, a keypad or touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.

[0231] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), or a SIM card. Alternatively, it may be a memory that retains information even when power is off, can be selectively erased, and is provided with more data. Examples of such memory are sometimes referred to as EPROMs. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 by the central processing unit 9100.

[0232] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various driver programs for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0233] The communication module 9110 is a transmitter / receiver that transmits and receives signals via the antenna 9111. The communication module 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0234] Based on different communication technologies, multiple communication modules 9110 can be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module. The communication module 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing common telecommunication functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor 9130 is also coupled to the central processing unit 9100, enabling local recording via the microphone 9132 and playback of stored audio via the speaker 9131.

[0235] Embodiments of the present application also provide a computer-readable storage medium capable of implementing all steps of the table export preview method in the above-mentioned embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the computer program implements all steps of the table export preview method in the above-mentioned embodiment, where the execution subject is a server or a client. For example, when the processor executes the computer program, the following steps are implemented:

[0236] Step S101: replacing a preset window width fixed value according to a preset window width percentage formula, introducing a DPI correction factor, a zoom inverse compensation factor, and a viewport offset correction factor into the replaced window width percentage formula to perform weighted correction on the window width percentage formula, and determining a corresponding window width weighted calculation formula;

[0237] Step S102: accepting a user's form preview request, obtaining corresponding user operating environment parameters based on multi-dimensional environment perception technology, inputting the user operating environment parameters into the window width weighted calculation formula to determine a corresponding preview image width, and determining a corresponding preview image height based on the preview image width and a preset general screen ratio standard;

[0238] In step S103, the table content style is obtained, the table content style is analyzed based on a table mixed content rule library, line height requirements of each element in the table content style are determined, when the line height requirements of the elements conflict, the line height requirements are compensated according to a preset conflict resolution mechanism, a corresponding basic line height is determined, content density of the table is detected, a corresponding content density factor is determined, the basic line height is proportionally compensated according to the content density factor, a corresponding table line height is determined, the table line height is down-rounded based on the preview picture height according to a down-rounding function, a corresponding table line number is determined, and the table is displayed in a picture preview according to the preview picture width, the preview picture height and the table line number.

[0239] As can be seen from the above description, the computer readable storage medium provided by the embodiments of the present application introduces a DPI correction factor, a scaling reverse compensation factor and a viewport offset correction factor to weight and correct a window width percentage formula; a preview picture width is obtained by inputting user operation environment parameters into the weighted window width weighting calculation formula, and a preview picture height is obtained according to the preview picture width and a preset general picture proportion standard; line height requirements of each element in a table content style are extracted based on a table mixed content rule library, the line height requirements are compensated according to a preset conflict resolution mechanism, a basic line height is proportionally compensated according to a content density factor, a corresponding table line height and table line number are determined, and a table is displayed in a picture preview according to the preview picture width, height and line number, thereby improving user experience and table preview efficiency.

[0240] The embodiments of the present application also provide a computer program product capable of implementing all steps of the table export preview method in the above-mentioned embodiments, wherein the execution subject is a server or a client. The computer program / instruction is executed by a processor to implement the steps of the table export preview method, for example, the computer program / instruction implements the following steps:

[0241] In step S101, a preset window width percentage formula is replaced with a preset window width fixed value, a DPI correction factor, a scaling reverse compensation factor and a viewport offset correction factor are introduced into the window width percentage formula to weight and correct the window width percentage formula, and a corresponding window width weighting calculation formula is determined.

[0242] In step S102, a table preview request of a user is accepted, corresponding user operation environment parameters are obtained based on multi-dimensional environment perception technology, the user operation environment parameters are input into the window width weighting calculation formula to determine a corresponding preview picture width, and a corresponding preview picture height is determined according to the preview picture width and a preset general picture proportion standard.

[0243] In step S103, the table content style is acquired, the table content style is analyzed based on a table mixed content rule library, line height requirements of each element in the table content style are determined, when the line height requirements of the elements conflict, the line height requirements are compensated according to a preset conflict resolution mechanism, a corresponding basic line height is determined, content density of the table is detected, a corresponding content density factor is determined, the basic line height is proportionally compensated according to the content density factor, a corresponding table line height is determined, the table line height is down-rounded based on the preview picture height according to a down-rounding function, a corresponding table line number is determined, and the table is displayed in a picture preview according to the preview picture width, the preview picture height and the table line number.

[0244] From the above description, the computer program product provided by the embodiments of the present application introduces a DPI correction factor, a scaling reverse compensation factor and a viewport offset correction factor to weight and correct the window width percentage formula; the preview picture width is obtained by inputting the user operation environment parameter into the weighted window width weighting calculation formula, and the preview picture height is obtained according to the preview picture width and a preset general picture proportion standard; the line height requirements of each element in the table content style are extracted based on the table mixed content rule library, the line height requirements are compensated according to the preset conflict resolution mechanism, the basic line height is proportionally compensated according to the content density factor, the corresponding table line height and table line number are determined, and the table is displayed in a picture preview according to the preview picture width, height and line number, so that the user experience and table preview efficiency can be improved.

[0245] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0246] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (apparatuses), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions described in the flowcharts and / or block diagrams.Figure 1 apparatuses that implement the functions specified in the flowchart Figure 1 block or blocks.

[0247] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flowchart Figure 1 apparatuses that implement the functions specified in the flowchart Figure 1 block or blocks.

[0248] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that are executed on the computer or other programmable apparatus provide steps for implementing the flowchart Figure 1 apparatuses that implement the functions specified in the flowchart Figure 1 block or blocks.

[0249] The principles and implementations of the present application are described in the specific embodiments, the above description of the embodiments is only for the purpose of helping to understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation and application range, and the above description of the present application should not be understood as a limitation.

Claims

1. A table export preview method, characterized in that: The method comprises: The preset window width fixed value is replaced according to the preset window width percentage formula, and the DPI correction factor, the zoom inverse compensation factor, and the viewport offset correction factor are introduced into the replaced window width percentage formula to perform weighted correction on the window width percentage formula to determine the corresponding window width weighted calculation formula; Accepting a user's form preview request, obtaining corresponding user operating environment parameters based on multi-dimensional environment perception technology, inputting the user operating environment parameters into the window width weighted calculation formula to determine a corresponding preview image width, and determining a corresponding preview image height based on the preview image width and a preset general screen ratio standard; Obtain a table content style, analyze the table content style based on a table mixed content rule library, determine the row height requirements of each element in the table content style, and when there is a conflict in the row height requirements of each element, perform conflict compensation on the row height requirements according to a preset conflict resolution mechanism to determine the corresponding basic row height, perform content density detection on the table to determine the corresponding content density factor, perform proportional constraint compensation on the basic row height according to the content density factor to determine the corresponding table row height, round down the table row height based on the preview image height according to a rounding down function to determine the corresponding number of table rows, and perform image preview display of the table according to the preview image width, the preview image height, and the number of table rows.

2. The table export preview method according to claim 1, characterized in that: Before introducing the DPI correction factor, the scaling inverse compensation factor, and the viewport offset correction factor into the replaced window width percentage formula to perform weighted correction on the window width percentage formula and determining the corresponding window width weighted calculation formula, the method includes: Define a DPI baseline value and determine the corresponding DPI correction factor based on the ratio of the real-time DPI detection value to the DPI baseline value; Obtaining a real-time browser zoom ratio, performing reverse compensation on the zoom ratio, and determining a corresponding zoom reverse compensation factor; The occlusion area is calculated based on the real-time browser viewport width and the browser UI occlusion correction value, and the corresponding viewport offset correction factor is determined.

3. The table export preview method according to claim 1, characterized in that: The analyzing the table content style based on the table mixed content rule library to determine the row height requirement of each element in the table content style includes: Analyzing the table content style based on a table mixed content rule library to determine a corresponding table content style element, wherein the table content style element includes at least one of a table cell, a text paragraph, an embedded chart, and a formula code block; The row height requirement of each corresponding element is determined according to the table content style element and the preset element adaptation rule.

4. The table export preview method according to claim 1, characterized in that: When the row height requirements of the elements conflict, conflict compensation is performed on the row height requirements according to a preset conflict resolution mechanism to determine a corresponding basic row height, including: When there is a conflict in the row height requirements of the elements, determine whether the conflict difference is greater than the conflict threshold; If not, perform conflict compensation on the row height requirement based on a soft conflict optimization strategy to determine the corresponding basic row height; If it is greater, conflict compensation is performed on the row height requirement based on a priority clipping algorithm to determine the corresponding basic row height.

5. The table export preview method according to claim 4, characterized in that: The step of performing conflict compensation on the row height requirement based on the soft conflict optimization strategy to determine the corresponding basic row height includes: Compensate for conflicts between the preset table cell row height requirements and the preset text paragraph row height requirements based on the mean compromise strategy, and determine the corresponding base row height. Compensate for conflicts between the preset embedded chart row height requirements and the preset table cell row height requirements based on the content elastic scaling strategy, and determine the corresponding base row height. Based on the font size fine-tuning strategy, conflicts between the preset text paragraph line height requirements and the preset formula code block line height requirements are compensated to determine the corresponding basic line height.

6. The table export preview method according to claim 4, characterized in that: The priority-based blanking algorithm is used to perform conflict compensation on the row height requirements to determine the corresponding basic row height, including: Setting a priority order for elements in the table style; The row height requirements are redistributed according to the order of the priority sorting to determine a corresponding basic row height.

7. The table export preview method according to claim 1, characterized in that: The performing content density detection on the table to determine a corresponding content density factor, performing proportional constraint compensation on the basic row height according to the content density factor to determine a corresponding table row height, includes: Performing content density detection on the table, counting the percentage of characters in the table, calculating a content density ratio, and proportionally compensating the basic row height based on the content density ratio; Set the minimum readable row height, determine whether the basic row height after the row height compensation is greater than the minimum readable row height, if greater, determine the basic row height as the table row height, if not greater, determine the minimum readable row height as the table row height.

8. A table export preview device, characterized in that: The device comprises: A preview window width weighting module is used to replace a preset window width fixed value according to a preset window width percentage formula, introduce a DPI correction factor, a zoom inverse compensation factor, and a viewport offset correction factor into the replaced window width percentage formula to perform weighted correction on the window width percentage formula, and determine a corresponding window width weighted calculation formula; A preview window length and width determination module is configured to receive a user's form preview request, obtain corresponding user operating environment parameters based on multi-dimensional environment perception technology, input the user operating environment parameters into the window width weighted calculation formula to determine the corresponding preview image width, and determine the corresponding preview image height based on the preview image width and a preset general screen ratio standard; A preview window row number determination and display module is used to obtain a table content style, analyze the table content style based on a table mixed content rule library, determine the row height requirements of each element in the table content style, and when there is a conflict in the row height requirements of each element, compensate for the conflict in the row height requirements according to a preset conflict resolution mechanism, determine the corresponding basic row height, perform content density detection on the table, determine the corresponding content density factor, perform proportional constraint compensation on the basic row height according to the content density factor, determine the corresponding table row height, round down the table row height based on the preview image height according to a rounding down function, determine the corresponding number of table rows, and perform image preview and display of the table according to the preview image width, the preview image height, and the number of table rows.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the table export preview method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the table export preview method according to any one of claims 1 to 7 are implemented.