CN107704576B - Data display optimization method and device, terminal equipment and storage medium - Google Patents

Data display optimization method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN107704576B
CN107704576B CN201710918445.1A CN201710918445A CN107704576B CN 107704576 B CN107704576 B CN 107704576B CN 201710918445 A CN201710918445 A CN 201710918445A CN 107704576 B CN107704576 B CN 107704576B
Authority
CN
China
Prior art keywords
data
row
visible area
column
table row
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710918445.1A
Other languages
Chinese (zh)
Other versions
CN107704576A (en
Inventor
冯志民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XIAMEN HYMAKE TECHNOLOGY Co Ltd
Original Assignee
XIAMEN HYMAKE TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XIAMEN HYMAKE TECHNOLOGY Co Ltd filed Critical XIAMEN HYMAKE TECHNOLOGY Co Ltd
Priority to CN201710918445.1A priority Critical patent/CN107704576B/en
Publication of CN107704576A publication Critical patent/CN107704576A/en
Application granted granted Critical
Publication of CN107704576B publication Critical patent/CN107704576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Abstract

The invention discloses a data display optimization method, a data display optimization device, terminal equipment and a storage medium. According to the technical scheme of the embodiment of the invention, when a user initially uses the form to check the data in the form, only the data in the current visible area is loaded and filled, so that the data volume filled currently is reduced, the problems of long form response time and interface blockage are avoided, the speed and the smoothness of data display are improved, and the user has better experience.

Description

Data display optimization method and device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data display optimization method and apparatus, a terminal device, and a storage medium.
Background
A user may generate a large amount of tree data in the process of operating cost project budget software, as shown in fig. 1, the tree data mainly includes three types of data, i.e., chapters, lists, and quotations, and the structural relationship among the three types of data is as follows: a chapter is a parent, a chapter can nest a chapter, a chapter can contain a listing, and a listing contains a quota. The user needs to display and operate (such as adding, deleting, modifying and checking) the tree data through the table.
Engineering budget software is mostly developed based on an Eclipse RCP framework, the development language supported by the Eclipse RCP framework is Java, control packages developed by Java client sides are few, and the commonly used control packages are SWT control packages provided by the authorities and control packages in the Nebula project of Eclipse. The data structure generated in the software is tree data, so the Table needs to be displayed through a Table type control, and common Table controls in JAVA are an SWT Table control and a Grid control under Nebula. Because software has special requirements on the form style (a plurality of rows of form heads, the form heads can be dragged, the forms are colored, and cells are merged) and a form editor, Nebula Grid can meet business requirements through transformation, so Grid controls under Nebula are commonly used in software to display data.
Using Grid controls to expose data according to the example provided by eclipse's Nebula project authority involves mainly the following steps:
1. newly building a table;
2. circularly creating a table column;
3. the table row data is cyclically filled.
Eclipse to simplify the use of tables, the JFace toolkit in Eclipse provides view Viewer, content manager ContentProvider, and label provider LabelProvider for simplifying the creation and data population of tables. The ContentProvider has the main function of converting data into a data model required by a table, wherein the data model is converted into an array; the LabelProvider has the main function of setting the text and the picture displayed by each cell; the main function of setInput is to set the data source that the table needs to display.
Then, creating a table by gridtree viewer may mainly include the following processes:
1. creating a gridtree viewer (newgridtree viewer) Grid;
2. creating gridcolumnvewer (girdccolumnviewr gcv ═ new gridcolumnvewer (gridcreeviewer, style));
3. LabelProvider (column-viewer.setlabelprovider) of the table column is set;
4. set the data source (gridtree view.
According to the above process of displaying table data, the following problems can be found: in practical application, if table data of 35 columns and rows such as 1w needs to be displayed, the table loading speed is low, the cells enter the cell editing and then exit a cell editing and refreshing interface, the interface is blocked, the tree-shaped table unfolding and folding node response is slow, and the response time is long. The Grid is tested once, the display (refresh) time is about 10s-15s, and the interface pause caused by the form refresh process influences the user experience. For the above problem of large-scale data display, analyzing 35 columns of Gird display 1W records by using a performance analysis tool requires 35 columns of cells × 1W to be filled, and most of the initialization table time is required to fill the contents of 35W cells, which is a main reason for interface stuck.
At present, two main solutions for displaying mass data are provided, namely paging and delayed loading, in the process of applying engineering budget software, data to be displayed is in a tree structure, paging is not suitable for a tree form, and in addition, tree data to be displayed in the software exists in a memory, so that a Grid data source does not need to be subjected to delayed loading.
In summary, a data display optimization method based on Grid is needed to solve the problems of slow loading speed, long response time and interface blockage of the existing data display.
Disclosure of Invention
The embodiment of the invention provides a data display optimization method, a data display optimization device, terminal equipment and a storage medium, which are used for solving the problems of low loading speed, long response time and interface blockage of the existing data display.
The embodiment of the invention provides a data display optimization method, which comprises the following steps:
acquiring a current visible area of the initial state of the form;
acquiring data corresponding to each row of cells in the current visible area of the initial state of the table, and filling display data;
acquiring a newly added visible area after the scroll bar is scrolled;
and acquiring data corresponding to each row of cells in the newly added visible area, and filling display data.
Therefore, as the user only sees the data in the current visible area, the embodiment of the invention only loads and fills the data in the current visible area when displaying the form data, thereby reducing the data volume filled currently, avoiding the problems of long form response time and interface blockage, improving the speed and fluency of data display, and leading the user to have better experience.
Further, as an executable scheme, acquiring a current visible area of the initial state of the table specifically includes:
the starting table row and column coordinates, the table row and column numbers, and the ending table row and column coordinates of the currently visible area of the initial state of the table are obtained.
By acquiring the initial row-column coordinates of the form, the range of the current visible area of the form can be accurately acquired, and then data filling display can be accurately performed.
Further, as an executable solution, after obtaining the starting table row and column coordinates, the table row and column numbers, and the ending table row and column coordinates of the currently visible area of the initial state of the table, the method further includes:
the start table row and column coordinates, the table row and column numbers, and the end table row and column coordinates are saved to the snapshot.
And storing the initial row-column coordinates of the table into the snapshot for subsequent table updating comparison so as to fill the updated table data accurately.
Further, as an executable scheme, before obtaining the current visible area of the table, the method further comprises the following steps:
step S1: acquiring data A with the hierarchy of N according to a data source in a memory, newly establishing a row in a table according to the data A, and binding row data A of the table, wherein N is a positive integer;
step S2: traversing each piece of data in the data A, and judging whether the data A has a sub-item A or notiIf yes, all sub items A of the data A are obtainediInserting the table row of the sub item after the table row of the data A, and binding the row data A of the tableiWherein i is a positive integer;
step S3: judgment data AiThe folding and unfolding states of the nodes, if the nodes are folded, the table rows are not continuously created; if so, repeating the operation of step S2 until the form creation is completed;
step S4: the total number of rows in the table is calculated and the scroll bar is notified.
Further, as an executable scheme, the acquiring a new added visible area after the scroll bar is scrolled specifically includes:
acquiring initial table row and column coordinates, table row and column numbers and ending table row and column coordinates of a current visible area after the table is rolled according to the scroll bar, and storing the initial table row and column coordinates, the table row and column numbers and the ending table row and column coordinates into a snapshot;
and comparing the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area after the table in the snapshot is rolled with the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area in the initial state of the table to determine a new added visible area after the scroll bar is rolled.
Further, an embodiment of the present invention further provides a data display optimization apparatus, where the apparatus includes:
the first acquisition unit is used for acquiring a current visible area of a table initial state and acquiring data corresponding to each row of cells in the current visible area of the table initial state;
the first data display unit is used for filling and displaying data corresponding to each row of cells in the current visible area of the initial state of the table;
the second acquisition unit is used for acquiring a newly added visible area after the scroll bar rolls and acquiring data corresponding to each row of cells in the newly added visible area;
and the second data display unit is used for filling and displaying data of the acquired data corresponding to each row of cells in the newly added visible area.
Further, an embodiment of the present invention further provides a data presentation optimization terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method when executing the computer program.
Further, an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method of the above method.
The invention has the following beneficial effects:
the embodiment of the invention provides a data display optimization method, a data display optimization device, terminal equipment and a storage medium. According to the technical scheme of the embodiment of the invention, when a user initially uses the form to check the data in the form, only the data in the current visible area is loaded and filled, so that the data volume filled currently is reduced, the problems of long form response time and interface blockage are avoided, the speed and the smoothness of data display are improved, and the user has better experience.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a table interface diagram illustrating a large amount of tree data generated during the process of the conventional cost-engineering budgeting software;
fig. 2 is a schematic flow chart illustrating a data display optimization method according to a first embodiment of the present invention;
FIG. 3 is a table configuration diagram according to a first embodiment of the present invention;
fig. 4 is a filling effect diagram of a newly added visible region according to a first embodiment of the present invention;
FIG. 5 is a diagram illustrating interaction between a user and form processing according to a first embodiment of the present invention;
fig. 6 is a schematic structural diagram of a data display optimization apparatus according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention mainly aims to solve the performance problem existing when massive tree data in a Grid display memory are displayed, and provides a novel Nebula Gird-based delay display data technology. The method mainly comprises the following steps that no matter how large the data size needs to be displayed and what structure the data is (tree-shaped hierarchical structure or List type data) when Grid displays the data, the Grid only fills data of table cells in an interface visible area during initialization, and draws the styles (fonts, word sizes, foreground colors and background colors) of the currently filled cells to display to a user. And (4) rolling the scroll bar on the interface, gradually filling the newly added table rows and table columns, and finally finishing the delay filling drawing of the whole Grid. By the technical scheme, the problem of interface blockage caused by large data in the Grid display memory is solved. Assuming that 35 columns by 1W rows of data need to be displayed and the visible range of the interface area is 10 columns by 40 rows, the initialization of the table only fills 400 cells, which greatly reduces the time for initializing the table.
The first embodiment is as follows:
an embodiment of the present invention provides a data display optimization method, as shown in fig. 1, which is a schematic flow chart of the data display optimization method according to the embodiment of the present invention, and the method may include the following steps:
step 201: the currently visible area of the initial state of the form is obtained.
Step 202: and acquiring data corresponding to each row of cells in the current visible area of the initial state of the table, and filling display data.
Step 203: and acquiring a newly-added visible area after the scroll bar is scrolled.
Step 204: and acquiring data corresponding to each row of cells in the newly added visible area, and filling display data.
Therefore, as the user only sees the data in the current visible area, the embodiment of the invention only loads and fills the data in the current visible area when displaying the form data, thereby reducing the data volume filled currently, avoiding the problems of long form response time and interface blockage, improving the speed and fluency of data display, and leading the user to have better experience.
Further, for step 201, obtaining the current visible area of the initial state of the table may be specifically performed as:
the starting table row and column coordinates, the table row and column numbers, and the ending table row and column coordinates of the currently visible area of the initial state of the table are obtained.
Further, as an executable scheme, after the obtaining of the starting table row and column coordinates, the table row and column numbers, and the ending table row and column coordinates of the currently visible area of the initial state of the table, the method may further include:
the start table row and column coordinates, the table row and column numbers, and the end table row and column coordinates are saved to the snapshot.
And storing the initial row-column coordinates of the table into the snapshot for subsequent table updating comparison so as to fill the updated table data accurately.
It should be noted that, the visible row and the visible column number of the initialization table are calculated, and the size of the visible area of the table of the client interface is obtained according to the following rule: the number of actual drawable table rows is (height of visible area-height of table row head)/height of table row; the number of table columns i, Σ (column i) >, which is the width of the visible area-the width of the head of the table column, can actually be drawn.
According to the above rules, the table row and table column ranges to be filled for initializing Grid are calculated and recorded into the snapshot (the snapshot mainly stores the coordinates of the starting table row and table column of the current visible area, the number of the drawn table rows and table columns, and/or the coordinates of the ending table row and table column). And then, filling the data of each row of cells in the visible area according to the data bound by each table row, thereby finishing drawing the cell data of the current filling area and showing the cell data to a user.
By acquiring the initial row-column coordinates of the form, the range of the current visible area of the form can be accurately acquired, and then data filling display can be accurately performed.
Further, as an executable solution, before obtaining the currently visible area of the table in step 201, the method may further include the following steps:
step S1: and acquiring data A with the hierarchy of N according to a data source in the memory, newly establishing a row in the table according to the data A, and binding the row data A of the table, wherein N is a positive integer.
It should be noted that, before configuring the table and binding the cell data, all data to be filled and displayed in each cell in the table is stored in a memory (storage medium) of the terminal device, which is not described in detail in this embodiment of the present invention.
In addition, in step S1, table lines and data are simply associated, and cell data is not filled.
Step S2: traversing each piece of data in the data A, and judging whether the data A has a sub-item A or notiIf yes, all sub items A of the data A are obtainediInserting the table row of the sub item after the table row of the data A, and binding the row data A of the tableiWherein i is a positive integer.
Step S3: judgment data AiThe folding and unfolding states of the nodes, if the nodes are folded, the table rows are not continuously created; if expanded, the operation of step S2 is repeated until the form creation is completed.
It should be noted that, until the table creation is completed, it can be understood that all data sources required by the corresponding table in the memory are bound, that is, the table creation is completed.
Step S4: the total number of rows in the table is calculated and the scroll bar is notified.
That is, when a new row is created in the table according to the data stored in the memory, each piece of data in the data a is traversed, and it is determined whether the data a has the sub-entry aiThen insert the table row of the child directly after the table row of data A, it can be understood that A is the parent node, AiIs a child node, and then continues to judge the child item AiIf collapsed, does not continue to create table rows (here the child item A is judged to be)iBecause the collapsed sub-items do not create table rows when the table is drawn, the interface does not need to display the collapsed sub-items. And if the interface clicks on the parent, such as child A1There are also children so that the background will automatically be at parent A1Add child items down and notify the interface to redraw the newly added parentItem A1Table row of the child following the table row of (a); accordingly, if the sub item AiAnd expanding, and repeating the operation of the step S2 until the table creation is completed.
More specifically, grid creates data of a first layer when creating a table row, and then traverses the data of the first layer to judge whether a child item exists, and if the child item exists, the data of the first layer displays tree-shaped +, and if the child item does not exist, the data of the first layer does not have a tree-shaped mark. The first layer of table row controls whether the current row is unfolded or not according to the unfolding and folding mark of the binding data, if so, a sub item of the current table row is created, and the tree mark is displayed as-; if collapsed, no child item is created. In order to better present the technical solution described in the embodiment of the present invention, a table configuration diagram is provided in the first embodiment of the present invention, and specifically, it can be shown in fig. 3.
It should be noted that, the total row number of the table is calculated, and the purpose of notifying the scroll bar is that the table notifies the scroll bar of the total row number of the current table, and the scroll bar can draw the scroll bar according to the total row number, if the row number is less than the total number of steps of the scroll bar, the number of steps with more rows is more, and the interface is embodied in that the row number of the table is less, the area where the vertical scroll bar can scroll is less, and the area is larger if the row number is more, which is not described in detail herein in the embodiments of the present invention.
Further, for step 203, the acquiring a new added visible area after the scroll bar is scrolled specifically includes:
acquiring initial table row and column coordinates, table row and column numbers and ending table row and column coordinates of a current visible area after the table is rolled according to the scroll bar, and storing the initial table row and column coordinates, the table row and column numbers and the ending table row and column coordinates into a snapshot;
and comparing the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area after the table in the snapshot is rolled with the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area in the initial state of the table to determine a new added visible area after the scroll bar is rolled.
And delaying to fill the data of the cells in the invisible area of the table, namely temporarily not filling the data in the current invisible area, and refilling the newly added visible area after the scroll bar is scrolled and a newly added visible area after the scroll bar is scrolled is acquired after the scroll bar is scrolled, so that the problems of slow table response speed, interface blockage and the like caused by overlarge table data loading amount are solved.
Specifically, when the user scrolls the vertical scroll bar on the interface, the index position of the initial row of the new form can be obtained according to the vertical scroll bar, and the size of the visible area of the current form is recalculated. The index of the last line, i.e. the index of the current line + the number of table lines calculated in the current visible area in the initialized table-1 can actually be drawn. The number of table columns of the actual drawable columns is the same as in the currently visible area in the initialization table. A new table visible area can be obtained through recalculation, a new table snapshot (comprising the initial table row and column coordinates, the table row and column numbers and the termination table row and column coordinates of the new table visible area) is generated, the newly added table row is calculated through comparison with the initial table row and column coordinates, the table row and column numbers and the termination table row and column coordinates of the current visible area in the initialization table stored in the snapshot, and data is filled.
Similarly, when the user drags the horizontal scroll bar on the interface, the subscript position of the initial column of the new form can be obtained according to the horizontal scroll bar, and the size of the visible area of the current form is recalculated. The index of the last column can actually be drawn-the current column index + the number of columns of the table calculated in the current visible area in the initialized table-1. The number of actual drawable rows is the same as in the currently visible area in the initialization table. A new visible area of the table can be obtained through recalculation, a new table snapshot (comprising the initial table row and column coordinates, the table row and column numbers and the termination table row and column coordinates of the new visible area of the table) is generated, the newly added table column is calculated through comparison with the initial table row and column coordinates, the table row and column numbers and the termination table row and column coordinates of the current visible area in the initialization table stored in the snapshot, and data is filled.
In order to better present the technical solution described in the embodiment of the present invention, a filling effect map of the newly added visible region is provided in the first embodiment of the present invention, which can be specifically shown in fig. 4.
In addition, the embodiment of the invention also provides an interaction diagram of a user and form processing, as shown in fig. 5.
Further, in order to better explain the technical solution of the embodiment of the present invention, an example is provided as follows:
for example: the client interface size is 500 x 400 pixels, the table row header height is 50 pixels, the table column header height is 50 pixels, the height of each table row is set to 50 pixels, and the width of each table column is 90 pixels.
At the time of initialization, the number of rows of the table can be drawn as (400-50)/50 as 9 rows, and the number of columns of the table can be drawn as (500-50)/90 as 5 columns. That initialises the table to fill with data for only 5 x 9, 9 rows, 5 columns and 45 cells. The current snapshot of the table is (start row 0, start column 0, end row 9, end column 5, row 9, column 5).
Dragging the vertical scroll bar to the 3 rd row of the table, the number of rows of the table which can be drawn at this time is 9, the number of columns of the table which can be drawn is 5, the initial row of the table is 3, the initial column is 0, at this time, the snapshot of the table is (initial row 3, initial column 9, end row 3+9-1(11), end column 5, row 9, and column 5), the newly added cell is the 10 th row and the 11 th row, and at this time, the data which needs to be filled is 5 × 2 and has 10 cells.
According to specific experiments, Grid is reconstructed by using the technical scheme of the invention, the initial display time can be reduced from 10s to 2s by using performance analysis tool analysis and using data of 1 ten thousand rows and 35 columns, and the time required by table data display is greatly reduced.
When the specific configuration is realized, the invention adds an event GridRangeChangeEvent for recording the snapshot information when the form is filled and drawn; newly added interception GridVisibleRangeListener generates newly added row and column information to fill table cell data according to snapshot comparison; and adding a Paint event, wherein the Paint event generates the change information of the rows and columns of the Grid by recording the comparison between the snapshot displayed last time by the Grid and the table snapshot of the current table, and stores the change information into the GridRangeChangeEvent. The Paint event forwards information to the GridVisibleRangeListener, and newly added table cell data is filled according to the change of the table row and column, which is not described in detail in the embodiment of the present invention.
According to the data display optimization method, the data of the current visible area in the initial state of the form and each corresponding cell are obtained, the display data are filled, the data of the newly added visible area after the scroll bar is rolled and each corresponding cell are obtained, and the display data are filled. According to the technical scheme of the embodiment of the invention, when a user initially uses the form to check the data in the form, only the data in the current visible area is loaded and filled, so that the data volume filled currently is reduced, the problems of long form response time and interface blockage are avoided, the speed and the smoothness of data display are improved, and the user has better experience.
Example two
Based on the same inventive concept as the first embodiment of the present invention, the second embodiment of the present invention further provides a data display optimization apparatus, as shown in fig. 6, the data display optimization apparatus according to the second embodiment of the present invention, the apparatus includes:
the first obtaining unit 61 may be configured to obtain a current visible area in an initial state of a table, and obtain data corresponding to each row of cells in the current visible area in the initial state of the table;
the first data display unit 62 may be configured to perform data filling and display on the acquired data corresponding to each row of cells in the current visible area in the initial state of the table;
a second obtaining unit 63, configured to obtain a new visible region after the scroll bar is scrolled, and obtain data corresponding to each row of cells in the new visible region;
the second data display unit 64 may be configured to perform data filling and display on the acquired data corresponding to each row of cells in the newly added visible area.
Further, the first obtaining unit 61 may be specifically configured to obtain a starting table row and column coordinate, a table row and column number, and an ending table row and column coordinate of the currently visible area in the initial state of the table.
Further, the apparatus further comprises a storage unit 65;
the storage unit 65 is configured to save the start table row and column coordinates, the table row and column coordinates, and the end table row and column coordinates of the current visible region in the initial state of the table into the snapshot after the first obtaining unit 62 obtains the start table row and column coordinates, the table row and column coordinates, and the end table row and column coordinates of the current visible region in the initial state of the table.
Further, the apparatus further comprises a configuration unit 66;
the configuration unit 66 is configured to, before the first obtaining unit 61 obtains the current visible area of the table, obtain data a with a hierarchy N according to a data source in the memory, and newly build a row in the table according to the data a, and bind row data a of the table, where N is a positive integer; traversing each piece of data A in the data AiJudgment data AiIf the sub item exists, acquiring the data A if the sub item existsiAll sub-items B of and in data AiInserting a table row of the sub item behind the table row, and binding the row data B of the table, wherein i is a positive integer; judgment data AiThe folding and unfolding states of the nodes, if the nodes are folded, the table rows are not continuously created; if so, repeating the operation of step S2 until the form creation is completed; the total number of rows in the table is calculated and the scroll bar is notified.
Further, the second obtaining unit 63 may be specifically configured to obtain, according to the scroll bar, a starting table row and column coordinate, a table row and column number, and an ending table row and column coordinate of the current visible area after the table is scrolled, and store the starting table row and column coordinate, the table row and column coordinate, and the ending table row and column coordinate in the snapshot; and comparing the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area after the table in the snapshot is rolled with the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area in the initial state of the table to determine a new added visible area after the scroll bar is rolled.
The data display optimization device according to the second embodiment of the present invention obtains the current visible region in the table initial state and the data of each corresponding cell, fills the display data, obtains the newly added visible region after the scroll bar is scrolled and the data of each corresponding cell, and fills the display data. According to the technical scheme of the embodiment of the invention, when a user initially uses the form to check the data in the form, only the data in the current visible area is loaded and filled, so that the data volume filled currently is reduced, the problems of long form response time and interface blockage are avoided, the speed and the smoothness of data display are improved, and the user has better experience.
Further, an embodiment of the present invention further provides a data presentation optimization terminal device, which includes a memory, a processor, and a computer program that is stored in the memory and is executable on the processor, where the processor executes the computer program to implement the steps in the foregoing method embodiments of the present invention, for example, the method steps such as step 201 and step 204 shown in fig. 2. Alternatively, the processor implements the functions of the modules/units in the above-described device embodiments when executing the computer program, for example, implements the functions of the units such as the first acquiring unit 61, the first data displaying unit 62, the second acquiring unit 63, and the second data displaying unit 64.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program in the data presentation optimization terminal device. For example, the computer program may be divided into a first acquiring unit 61, a first data displaying unit 62, a second acquiring unit 63, a second data displaying unit 64, and the like, and the specific functions of the modules are as follows:
the first obtaining unit 61 may be configured to obtain a current visible area in an initial state of a table, and obtain data corresponding to each row of cells in the current visible area in the initial state of the table;
the first data display unit 62 may be configured to perform data filling and display on the acquired data corresponding to each row of cells in the current visible area in the initial state of the table;
a second obtaining unit 63, configured to obtain a new visible region after the scroll bar is scrolled, and obtain data corresponding to each row of cells in the new visible region;
the second data display unit 64 may be configured to perform data filling and display on the acquired data corresponding to each row of cells in the newly added visible area.
Further, as an executable scheme, the data display optimization terminal device may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The data presentation optimization terminal device may include, but is not limited to, a processor, a memory. It is understood by those skilled in the art that the above-mentioned composition structure of the data presentation optimization terminal device is only an example of the data presentation optimization terminal device, and does not constitute a limitation on the data presentation optimization terminal device, and may include more or less components than the above, or combine some components, or different components, for example, the data presentation optimization terminal device may further include an input/output device, a network access device, a bus, and the like, which is not limited by the embodiment of the present invention.
Further, as an executable solution, the processor may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor is a control center of the data presentation optimization terminal device, and various interfaces and lines are used for connecting various parts of the whole data presentation optimization terminal device.
The memory can be used for storing the computer program and/or the module, and the processor can realize various functions of the data presentation optimization terminal equipment by running or executing the computer program and/or the module stored in the memory and calling the data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Further, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the above-mentioned method according to the embodiment of the present invention.
The integrated module/unit of the data presentation optimization terminal device may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
That is to say, in the embodiment of the present invention, the data of the current visible region and each corresponding cell in the initial state of the table are obtained and the display data is filled, and the data of the newly added visible region and each corresponding cell after the scroll bar is scrolled are obtained and the display data is filled. According to the technical scheme of the embodiment of the invention, when a user initially uses the form to check the data in the form, only the data in the current visible area is loaded and filled, so that the data volume filled currently is reduced, the problems of long form response time and interface blockage are avoided, the speed and the smoothness of data display are improved, and the user has better experience.
It should be noted that while the preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (6)

1. A method for optimizing presentation of data, the method comprising:
acquiring a current visible area of the initial state of the form;
acquiring data corresponding to each row of cells in the current visible area of the initial state of the table, and filling display data;
acquiring a newly added visible area after the scroll bar is scrolled;
acquiring data corresponding to each row of cells in the newly added visible area, and filling display data;
the acquiring of the newly added visible area after the scroll bar is scrolled specifically includes:
acquiring initial table row and column coordinates, table row and column numbers and ending table row and column coordinates of a current visible area after the table is rolled according to the scroll bar, and storing the initial table row and column coordinates, the table row and column numbers and the ending table row and column coordinates into a snapshot;
comparing the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area after the table in the snapshot is rolled with the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area in the initial state of the table to determine a new added visible area after the scroll bar is rolled;
before the current visible area of the initial state of the table is obtained, the method further comprises the following steps:
step S1: acquiring data A with the hierarchy of N according to a data source in a memory, newly establishing a row in a table according to the data A, and binding row data A of the table, wherein N is a positive integer;
step S2: traversing each piece of data in the data A, and judging whether the data A has a sub-item A or notiIf yes, all sub items A of the data A are obtainediInserting the table row of the sub item after the table row of the data A, and binding the row data A of the tableiWherein i is a positive integer;
step S3: judgment data AiThe folding and unfolding states of the nodes, if the nodes are folded, the table rows are not continuously created; if so, repeating the operation of step S2 until the form creation is completed;
step S4: the total number of rows in the table is calculated and the scroll bar is notified.
2. The method of claim 1, wherein obtaining the current visible region of the initial state of the form specifically comprises:
the starting table row and column coordinates, the table row and column numbers, and the ending table row and column coordinates of the currently visible area of the initial state of the table are obtained.
3. The method of claim 2, wherein after obtaining the starting table row and column coordinates, the table row and column numbers, and the ending table row and column coordinates of the currently visible area of the table initial state, the method further comprises:
the start table row and column coordinates, the table row and column numbers, and the end table row and column coordinates are saved to the snapshot.
4. An apparatus for optimizing presentation of data, the apparatus comprising:
the first acquisition unit is used for acquiring a current visible area of a table initial state and acquiring data corresponding to each row of cells in the current visible area of the table initial state;
the first data display unit is used for filling and displaying data corresponding to each row of cells in the current visible area of the initial state of the table;
the second acquisition unit is used for acquiring a newly added visible area after the scroll bar rolls and acquiring data corresponding to each row of cells in the newly added visible area;
the second data display unit is used for filling and displaying data of the acquired data corresponding to each row of cells in the newly added visible area;
the second obtaining unit is further configured to obtain, according to the scroll bar, a starting table row and column coordinate, a table row and column number, and an ending table row and column coordinate of the current visible area after the table is scrolled, and store the starting table row and column coordinate, the table row and column coordinate, and the ending table row and column coordinate in the snapshot;
comparing the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area after the table in the snapshot is rolled with the starting table row and column coordinates, the table row and column numbers and the ending table row and column coordinates of the current visible area in the initial state of the table to determine a new added visible area after the scroll bar is rolled;
the apparatus further comprises a configuration unit;
the configuration unit may be configured to, before the first obtaining unit obtains the current visible area in the initial state of the table, obtain, according to a data source in the memory, data a with a hierarchy of N, and newly build a row in the table according to the data a, and bind row data a of the table, where N is a positive integer; traversing each data Ai in the data A, judging whether the data Ai has sub items, if so, acquiring all sub items B of the data Ai, inserting table rows of the sub items after the table rows where the data Ai is located, and binding the row data B of the table, wherein i is a positive integer; judging the folding and unfolding states of the data Ai nodes, and if the data Ai nodes are folded, not continuously creating table rows; if so, repeating the operation of step S2 until the form creation is completed; the total number of rows in the table is calculated and the scroll bar is notified.
5. A data presentation optimization terminal device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the method according to any of claims 1 to 3 when executing said computer program.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN201710918445.1A 2017-09-30 2017-09-30 Data display optimization method and device, terminal equipment and storage medium Active CN107704576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710918445.1A CN107704576B (en) 2017-09-30 2017-09-30 Data display optimization method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710918445.1A CN107704576B (en) 2017-09-30 2017-09-30 Data display optimization method and device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN107704576A CN107704576A (en) 2018-02-16
CN107704576B true CN107704576B (en) 2020-03-31

Family

ID=61184335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710918445.1A Active CN107704576B (en) 2017-09-30 2017-09-30 Data display optimization method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN107704576B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108959206A (en) * 2018-07-02 2018-12-07 浪潮软件股份有限公司 A kind of method and system of the optimization front end Vue form component rendering performance
CN109299449A (en) * 2018-10-10 2019-02-01 拉扎斯网络科技(上海)有限公司 Form processing method, device, electronic equipment and readable storage medium storing program for executing
CN110244993A (en) * 2018-12-25 2019-09-17 蔚来汽车有限公司 Front end page loading method, device, controller and medium
CN110989907B (en) * 2019-11-27 2021-06-15 浙江大华技术股份有限公司 Data display method and device, electronic equipment and storage medium
CN111898049B (en) * 2020-06-16 2021-04-13 广州市玄武无线科技股份有限公司 Table implementation method and device, computer terminal equipment and storage medium
CN111931093A (en) * 2020-07-09 2020-11-13 北京皮尔布莱尼软件有限公司 Display method of table in page and mobile terminal
CN111723560A (en) * 2020-07-15 2020-09-29 金蝶软件(中国)有限公司 Dynamic adjustment method, system and related equipment for table parallel display area
CN112731885A (en) * 2020-12-29 2021-04-30 浙江中控技术股份有限公司 Form display method and system for distributed control system
CN112784529B (en) * 2021-02-03 2022-10-21 叮当快药科技集团有限公司 Mobile terminal sorting table based on BetterScroll and construction method thereof
CN113297313B (en) * 2021-06-07 2023-11-07 平安证券股份有限公司 Table data display method and device, electronic equipment and storage medium
CN113393294A (en) * 2021-06-11 2021-09-14 北京沃东天骏信息技术有限公司 Page display method and device, equipment and storage medium
CN113504901A (en) * 2021-06-28 2021-10-15 东莞市小精灵教育软件有限公司 Tree form control generation method, device, equipment and storage medium
CN113778306A (en) * 2021-09-07 2021-12-10 上海浦东发展银行股份有限公司 Table data processing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740967A (en) * 2004-08-23 2006-03-01 华为技术有限公司 Method for reducing holding of internal memory in using table
CN103164401A (en) * 2011-12-08 2013-06-19 航天信息软件技术有限公司 Page tabular display method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9659050B2 (en) * 2013-08-06 2017-05-23 Sybase, Inc. Delta store giving row-level versioning semantics to a non-row-level versioning underlying store

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740967A (en) * 2004-08-23 2006-03-01 华为技术有限公司 Method for reducing holding of internal memory in using table
CN103164401A (en) * 2011-12-08 2013-06-19 航天信息软件技术有限公司 Page tabular display method

Also Published As

Publication number Publication date
CN107704576A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
CN107704576B (en) Data display optimization method and device, terminal equipment and storage medium
US11344806B2 (en) Method for rendering game, and method, apparatus and device for generating game resource file
CN109614424B (en) Page layout generation method, device, computing equipment and medium
CN105045645B (en) Webpage loading method, Apparatus and system
CN102915297B (en) The animation of underlying network lattice structure and table
CN109408764B (en) Page area dividing method, device, computing equipment and medium
US20160098250A1 (en) Application prototyping tool
US20070033518A1 (en) Computer-implemented method, system, and program product for hiding columns in an electronic table
KR20080107444A (en) Two dimensional trees to edit graph-like diagrams
CN106095437A (en) The implementation method of the layout type of user interface RTL from right to left and device
CN112667330A (en) Page display method and computer equipment
CN112711418A (en) Front-end interface layout method and device for multiple components, electronic equipment and storage medium
WO2022116936A1 (en) Interface layout method, electronic device, and computer-readable storage medium.
CN106294301B (en) Report generation method and device
CN112272109A (en) Network topological graph generation method, equipment and system
CN112799670B (en) Method and system for unified multi-terminal logic development
CN103049430A (en) Page display method based on IDF (interactive document format) files
CN107621951B (en) View level optimization method and device
US10289388B2 (en) Process visualization toolkit
CN109800039B (en) User interface display method and device, electronic equipment and storage medium
CN106354449B (en) A kind of online demenstration method of document and client
US9443441B1 (en) View port resolution independent network pages
CN111782309B (en) Method and device for displaying information and computer readable storage medium
CN106548501B (en) Image drawing method and device
CN113297313A (en) Table data display method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant