Nothing Special   »   [go: up one dir, main page]

CN111191162B - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN111191162B
CN111191162B CN201911073021.5A CN201911073021A CN111191162B CN 111191162 B CN111191162 B CN 111191162B CN 201911073021 A CN201911073021 A CN 201911073021A CN 111191162 B CN111191162 B CN 111191162B
Authority
CN
China
Prior art keywords
column
list
width
limit
text type
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
CN201911073021.5A
Other languages
Chinese (zh)
Other versions
CN111191162A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911073021.5A priority Critical patent/CN111191162B/en
Publication of CN111191162A publication Critical patent/CN111191162A/en
Application granted granted Critical
Publication of CN111191162B publication Critical patent/CN111191162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application discloses a data processing method and equipment, wherein the method comprises the following steps: acquiring a text type of at least one form column to which a form to be displayed belongs, and acquiring a column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table; determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute; generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed; and generating a table according to the column width information of each table list column. By adopting the application, the rationality of the table layout can be ensured, and the readability of the table can be improved.

Description

Data processing method and device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a data processing method and apparatus.
Background
The management console of the messenger cloud is used as a cloud resource management platform, and relates to resource management under various scenes of various businesses, and forms are widely applied to almost all businesses as a very common form. The handling of the column width of a form has been a very tricky problem due to the complex demands and the use of the user.
The existing table layout scheme mainly comprises an automatic width layout technology and a fixed width layout technology, the widths of tables and cells in the automatic width layout depend on contents contained in the cells, and the column width of the table can be adaptively changed according to the contents. The width of the table in the fixed width layout is determined by the width of all columns in the first row set by the table, and one column of the other rows is determined by the cells in the first row of the column only, so that a fixed width value or percentage needs to be assigned to each column, but after the width value or percentage of each column is fixed in the scheme, when different users browse with displays with different resolutions, the situation that the width allocation is unreasonable often occurs, and the readability of the table is poor.
Disclosure of Invention
The embodiment of the application provides a data processing method and device, which can ensure the rationality of the table layout and improve the readability of the table.
In one aspect, an embodiment of the present application provides a data processing method, which may include:
acquiring a text type of at least one form column to which a form to be displayed belongs, and acquiring a column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table;
Determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute;
Generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed;
and generating a table according to the column width information of each table list column.
The method for obtaining the text type of at least one form column of the form to be displayed comprises the following steps before obtaining the column attribute corresponding to the form column according to the text type:
acquiring a text type of a form column, and setting column properties of the form column according to the text type;
And performing association storage on the column attribute of the form column and the text type corresponding to the form column.
Wherein the determining the allocation weight of each form column according to the width lower limit and the width upper limit of each column attribute comprises:
When a target form column in the at least one form column corresponds to a text type, determining a difference value between an upper width limit and a lower width limit of a column attribute corresponding to the target form column as an allocation weight of the target form column; the target form list is any form list to which the form to be displayed belongs;
And when the target form list in the at least one form list corresponds to at least two text types, determining the maximum value of the width lower limit in a plurality of list attributes corresponding to the target form list and the maximum value of the width upper limit in the plurality of list attributes, and determining the difference value between the maximum value of the width upper limit and the maximum value of the width lower limit as the distribution weight of the target form list.
The generating the column width information corresponding to each form list column according to the distribution weight of each form list column and the total width of the form to be displayed includes:
determining the sum of the distribution weights of each table list column as the total distribution weight;
Determining the ratio of the distribution weight of each form column to the total distribution weight as the weight proportion of each form column;
determining the width of the form to be allocated according to the total width of the form to be displayed, the lower limit of the width of each form column and the column spacing between the form columns; the width of the to-be-allocated form is smaller than the total width of the to-be-displayed form;
Distributing the to-be-distributed form widths according to the weight proportion of each form column to generate the distribution width corresponding to each form column;
and determining the sum of the distribution width and the width lower limit corresponding to each form column as column width information corresponding to each form column.
Wherein, still include:
And determining the upper limit of the width of each table list column as the column width information of each table list column when the column width information of the table list column is larger than the upper limit of the width of the table list column.
The obtaining the text type of at least one form column to which the form to be displayed belongs, and obtaining the column attribute corresponding to the form column according to the text type includes:
When the sum of the width lower limits of all the list columns of the to-be-displayed list is larger than the total width information of the to-be-displayed list, determining at least one list column according to the priority order of all the list columns;
and acquiring the text type of the at least one form column, and acquiring the column attribute corresponding to the form column according to the text type.
The obtaining the text type of at least one form column to which the form to be displayed belongs, and obtaining the column attribute corresponding to the form column according to the text type includes:
When a list self-defining instruction is obtained, displaying all the list columns to which the to-be-displayed list belongs according to the list self-defining instruction;
Determining the maximum value of the list columns of the list to be displayed according to the column properties of all the list columns;
Determining at least one selected form column, the number of the at least one selected form column being less than the maximum value;
and acquiring the text type of the at least one form column, and acquiring the column attribute corresponding to the form column according to the text type.
In one aspect, an embodiment of the present application provides a data processing apparatus, which may include:
The attribute acquisition unit is used for acquiring the text type of at least one form column to which the form to be displayed belongs, and acquiring the column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table;
a weight determining unit for determining the allocation weight of each form column according to the lower width limit and the upper width limit of each column attribute;
the column width generation unit is used for generating column width information corresponding to each form list column according to the distribution weight of each form list column and the total width of the form to be displayed;
and the table generating unit is used for generating a table according to the column width information of each table list column.
Wherein, still include:
The storage unit is used for acquiring the text type of the list column and setting the column attribute of the list column according to the text type; and performing association storage on the column attribute of the form column and the text type corresponding to the form column.
Wherein, the weight determining unit is specifically configured to:
When a target form column in the at least one form column corresponds to a text type, determining a difference value between an upper width limit and a lower width limit of a column attribute corresponding to the target form column as an allocation weight of the target form column; the target form list is any form list to which the form to be displayed belongs;
And when the target form list in the at least one form list corresponds to at least two text types, determining the maximum value of the width lower limit in a plurality of list attributes corresponding to the target form list and the maximum value of the width upper limit in the plurality of list attributes, and determining the difference value between the maximum value of the width upper limit and the maximum value of the width lower limit as the distribution weight of the target form list.
The column width generation unit is specifically configured to:
determining the sum of the distribution weights of each table list column as the total distribution weight;
Determining the ratio of the distribution weight of each form column to the total distribution weight as the weight proportion of each form column;
determining the width of the form to be allocated according to the total width of the form to be displayed, the lower limit of the width of each form column and the column spacing between the form columns; the width of the to-be-allocated form is smaller than the total width of the to-be-displayed form;
Distributing the to-be-distributed form widths according to the weight proportion of each form column to generate the distribution width corresponding to each form column;
and determining the sum of the distribution width and the width lower limit corresponding to each form column as column width information corresponding to each form column.
Wherein, still include:
and the column width determining unit is used for determining the upper limit of the width of each table list column as the column width information of each table list column when the column width information of the table list column is larger than the upper limit of the width of the table list column.
The attribute obtaining unit is specifically configured to:
When the sum of the width lower limits of all the list columns of the to-be-displayed list is larger than the total width information of the to-be-displayed list, determining at least one list column according to the priority order of all the list columns;
and acquiring the text type of the at least one form column, and acquiring the column attribute corresponding to the form column according to the text type.
The attribute obtaining unit is specifically configured to:
When a list self-defining instruction is obtained, displaying all the list columns to which the to-be-displayed list belongs according to the list self-defining instruction;
Determining the maximum value of the list columns of the list to be displayed according to the column properties of all the list columns;
Determining at least one selected form column, the number of the at least one selected form column being less than the maximum value;
and acquiring the text type of the at least one form column, and acquiring the column attribute corresponding to the form column according to the text type.
In one aspect, embodiments of the present application provide a computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In one aspect, a computer device is provided, including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
In the embodiment of the application, the text type of at least one list column of a list to be displayed is acquired, and the column attribute corresponding to the list column is determined by the text type; determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute; generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed; and generating a table according to the column width information of each table list column. By distributing the weight to each single column in the table, the situation that the column width of the table is too large or unreasonable is avoided, the reasonable distribution of the width of each column of the table is ensured when different users browse the table by using displays with different resolutions, and the readability of the table is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a system architecture diagram for data processing according to an embodiment of the present application;
Fig. 1b is a schematic view of a scenario of a data processing method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a data processing method according to an embodiment of the present application;
figure 3a is an exemplary diagram of a long text column attribute provided for an embodiment of the present application,
Figure 3b is an exemplary diagram of a combined field column attribute provided for an embodiment of the present application,
FIG. 4 is a schematic flow chart of a data processing method according to an embodiment of the present application;
FIG. 5 is an exemplary diagram of a custom form column provided by an embodiment of the present application;
FIG. 6a is a schematic diagram illustrating a data processing method according to an embodiment of the present application;
FIG. 6b is a schematic diagram illustrating a data processing method according to an embodiment of the present application;
FIG. 6c is a schematic diagram illustrating a data processing method according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
Fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1a is a system architecture diagram for data processing according to an embodiment of the present invention. The server 10f establishes a connection with a cluster of user terminals via a communication bus 10d, which may comprise: user terminal 10a, user terminal 10b, user terminal 10c. The database 10g stores therein column attributes of a plurality of form columns and text types corresponding to the form columns. The server 10f obtains the text type of at least one form column to which the form to be displayed belongs, and obtains the column attribute corresponding to the form column according to the text type, wherein the column attribute comprises the width lower limit and the width upper limit of the form column; the at least one table list column may be all table list columns to which the table to be displayed belongs, or may be part of table list columns to which the table to be displayed belongs, and the server 10f determines an allocation weight of each table list column according to a lower width limit and an upper width limit of each column attribute, generates column width information corresponding to each table list column according to the allocation weight of each table list column and the total width of the table to be displayed, and generates a table according to the column width information of each table list column.
The server according to the embodiment of the application can comprise a server with data transmission and storage, and the user terminal comprises: terminal devices such as tablet computers, smart phones, personal Computers (PCs), notebook computers, palm computers, and the like.
The following will describe a specific implementation scenario provided for an embodiment of the present application with reference to fig. 1b, as shown in fig. 1 b. The method comprises the steps that a server obtains text types of at least one table list column to which a table to be displayed belongs, wherein the at least one table list column comprises a table list column 1, a table list column 2 and a table list column n, the text types comprise a text type 1 corresponding to the table list column 1, a text type 2 corresponding to the table list column 2, the first name, the second name and the text type n corresponding to the table list column n, column attributes corresponding to the table list columns, namely column attribute 1 corresponding to the text type 1, column attribute 2 corresponding to the text type 2 and column attribute n corresponding to the text type n, the database comprises a plurality of table list column attributes and table list column corresponding text types, the server determines an allocation weight of each table list column according to the lower width limit and the upper width limit of each table attribute, namely the allocation weight 1 corresponding to the table list column 1, the allocation weight 2 corresponding to the table list column, the first name, the table list column n corresponding to the allocation weight n, and the table list column width, and the table list information corresponding to the table list column 1, the table information corresponding to the table list column width, the table list column information corresponding to the table list column 2, and the table information list width.
Referring to fig. 2, a flow chart of a data processing method is provided in an embodiment of the application. As shown in fig. 2, the method according to the embodiment of the present application may include the following steps S101 to S104.
S101, acquiring a text type of at least one form column to which a form to be displayed belongs, and acquiring a column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table;
In particular, the data processing device obtains the text type of at least one list column to which the to-be-displayed list belongs, and obtains the column attribute corresponding to the list column according to the text type, it is to be understood that the data processing device may be a server in the embodiment of fig. 1a, the to-be-displayed list is a list which is not yet generated, the list is generated according to at least one list column and the column attribute of the list column, the list column is any one column composing the list, the to-be-displayed list includes at least one list column, the column attribute is the width range of the list column displayed in the list, the column attribute includes a width lower limit and a width upper limit, the width lower limit is the minimum value of the width range, the width upper limit is the maximum value of the width range, the column attribute is preset, usually, the column attribute is set according to the text type of the form column, the text type is the data type stored in the form column, the text type comprises short text, long text, combined field, icon, graph and the like, the text length of the short text is within a certain range, the text with fixed format and preset text provided by the system are included, the text with fixed format comprises date, ID information, IP address and the like, the preset text provided by the system comprises hard disk type, attribute, host type and the like, the field of the long text is the content allowing the user to fill in a self-defining manner, such as name, description, remark, description and the like, therefore, the text length range is large, please refer to fig. 3a, and an exemplary schematic diagram of the column attribute of the long text is provided for the embodiment of the application. The minimum width in the figure is the lower width limit of the list column, the maximum width is the upper width limit of the list column, the column attributes of a plurality of long texts are listed in the figure, for example, the lower width limit corresponding to the list column 'host name' is 3, and the upper width limit is 50; the combined field is a text type corresponding to a form column including a plurality of fields, for example: the "IP address" table list may include 2 fields, i.e., intranet IP and public IP, and the text type of the "IP address" table list is a combined field, please refer to fig. 3b, an exemplary schematic diagram of a combined field list attribute is provided for an embodiment of the present application, and various data, e.g., "model", "system disk", "data disk", etc., are included in the "configuration" of the table list in the figure; the form list column corresponding to the icon text type is composed of icons, so that the operation can be facilitated, the identifiability can be improved, for example, a monitoring icon, a log icon, a switch button and the like; the list column of the table corresponding to the text type of the graph is composed of the graph. And the data processing equipment acquires the column attribute corresponding to the list column of the form according to the text type.
S102, determining the distribution weight of each form list column according to the lower width limit and the upper width limit of each column attribute;
Specifically, the data processing apparatus determines the allocation weight of each table list column according to the lower width limit and the upper width limit of each column attribute, and it is understood that the allocation weight is used for determining the width of the table list column in the table, the larger the allocation weight is, the larger the allocable width of the table list column is, the allocation weight is determined by the lower width limit and the upper width limit of the column attribute, the lower width limit and the upper width limit of each column attribute determine the allocation weight of the table list column, and specifically, the allocation weight of the table list column can be determined according to the difference value of the lower width limit and the upper width limit.
S103, generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed;
Specifically, the data processing device generates the column width information corresponding to each form column according to the allocation weight of each form column and the total width of the form to be displayed, and it is understood that the total width of the form to be displayed is the maximum width of the form to be displayed, and the total width of the form to be displayed may be a fixed width or may be associated with an attribute of the display device, for example, the total width may be the same as the width of the display device; the column width information is the width of the display of the list columns in the table, the data processing equipment distributes the total width of the table to be displayed according to the distribution weight of each list column, and the column width information corresponding to each list column is generated, wherein the larger the distribution weight is, the larger the width of the list column is.
S104, generating a table according to the column width information of each table list column.
Specifically, the data processing device generates a table according to the column width information of each table column, and it is understood that the data processing device performs typesetting according to the column width information of each table column in at least one table column and the display sequence of the table column, where the display sequence may be determined according to the priority sequence of the table column, or determine the display sequence of the table column according to a preset sequence, and add the data corresponding to the table column to each cell of the table column to generate a table including at least one table column.
In the embodiment of the application, the text type of at least one list column of a list to be displayed is acquired, and the column attribute corresponding to the list column is determined by the text type; determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute; generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed; and generating a table according to the column width information of each table list column. By distributing the weight to each single column in the table, the situation that the column width of the table is too large or unreasonable is avoided, the reasonable distribution of the width of each column of the table is ensured when different users browse the table by using displays with different resolutions, and the readability of the table is improved.
Referring to fig. 4, a flow chart of a data processing method is provided in an embodiment of the present application. As shown in fig. 4, the method according to the embodiment of the present application may include the following steps S201 to S206.
S201, acquiring a text type of a form column, and setting column properties of the form column according to the text type; and performing association storage on the column attribute of the form column and the text type corresponding to the form column.
Specifically, the data processing device obtains a text type of a table list column, sets the column attribute of the table list column according to the text type, and it can be understood that the text type is a data type stored in the table list column, the text type includes a short text, a long text, a combined field, an icon, a graph and the like, sets the column attribute of the table list column according to the text type, specifically, the data processing device may set the column attribute of the table list column according to a text length corresponding to the text type, or obtain column attribute information set by a user, and the data processing device stores the column attribute of the table list column and the text type corresponding to the table list column in an associated manner.
S202, acquiring a text type of at least one form column to which a form to be displayed belongs, and acquiring a column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table; the step S202 of the embodiment of the present application may be performed under the following several conditions.
First case: the list column of the form to be displayed is determined by the priority;
specifically, when the sum of the width lower limits of all the form columns to which the form to be displayed belongs is larger than the total width information of the form to be displayed, determining at least one form column according to the priority order of all the form columns;
It may be understood that, the total width information of the to-be-displayed table is the maximum width of the to-be-displayed table, when the sum of the width lower limits of all the table columns to which the to-be-displayed table belongs is greater than the total width information of the to-be-displayed table, the width lower limit is the minimum width of the table columns, that is, all the table columns generate the table according to the minimum width, and the table cannot be completely displayed, in order to ensure that the table is completely displayed, at least one table column is determined according to the priority order of all the table columns, specifically, the number of the table columns that can be displayed can be estimated according to the total width information of the to-be-displayed table and the width lower limit of the table columns, and the estimated number of the table columns can be selected according to the priority order; the list column of the list with the priority higher than the priority threshold value can be determined as the list column of the list to be displayed; the priorities of the individual columns of the tables are listed in the following table, as shown in Table 1;
table 1 list priority
Fields Priority level
ID/name 1
Operation of 2
Status of 3
Monitoring 4
IP address 5
Configuration of 6
Host billing mode 7
Network charging mode 8
Host type 9
Usable area 10
Project 11
Label (Label) 12
It should be noted that the priority of each list column may be determined by the user according to the importance of the list column in combination with the service characteristics. The smaller the priority value of each column, the higher the priority.
And when at least one form list column is determined, acquiring the text type of the at least one form list column, and acquiring the column attribute corresponding to the form list column according to the text type.
Second case: a list of forms to be displayed is selected and determined by a user;
When a list self-defining instruction is obtained, displaying all the list columns to which the to-be-displayed list belongs according to the list self-defining instruction; determining the maximum value of the list columns of the list to be displayed according to the column properties of all the list columns; determining at least one selected form column, the number of the at least one selected form column being less than the maximum value;
It can be understood that the list customization instruction is an instruction for performing list customization display by a user, specifically may be a click instruction or a touch screen instruction, when the list customization instruction is acquired, the data processing device displays all the list columns to which the to-be-displayed form belongs, determines the maximum value of the displayable list columns according to the lower width limit of the list columns and the total width information of the to-be-displayed form, and displays the maximum value of the list columns on the display device; the user selects at least one of the list columns on the display device, prompts the user to re-select when the user selected list column is greater than the maximum value of the list columns, and the data processing device determines the at least one of the list columns selected by the user as the list column for display when the user selected list column is less than the maximum value of the list columns.
When at least one list column for display is determined, acquiring the text type of the at least one list column, and acquiring the column attribute corresponding to the list column according to the text type.
Referring to fig. 5, an exemplary schematic diagram of a custom form column is provided in an embodiment of the present application. As shown in fig. 5, the custom list field in the figure includes a plurality of list columns, a user can check the list columns to be displayed in the list through check boxes, meanwhile, the list columns which can be checked by the user at most are displayed in the display interface, when the total width of the list is determined, the maximum column number of the list can be fixed, but the maximum column numbers of the list with different total widths can only be approximately solved, according to experience, we set the following conditions to solve: the total width of the table is W and the total number of columns is n.
The table contains 2 long text columns with the width of D 1、D2 and the values of 12 and 6 respectively, the table contains 1 operation column with the width of D 3 and the value of 8, and other columns are short text columns with the width of D 4 and the value of 5 and the column interval of D;
for small screens, the screen resolution width is below 1440px, d takes 1, for large screens, the screen resolution width is above 1440px, d takes 2;
the above parameters satisfy: d1+d2+d3+ (N-3) d4+n D is equal to or less than W;
that is, when the screen resolution width is 1440px (small screen):
12+6+8+(n-3)*5+n*1≤W,n=(W-11)/6;
when the screen resolution width is 1440px or less (large screen):
12+6+8+(n-3)*5+n*2≤W,n=(W-11)/7;
thus, the maximum number of columns at different resolution widths is obtained, as shown in table 2.
TABLE 2 maximum columns of different resolution widths
S203, determining the distribution weight of each form list column according to the lower width limit and the upper width limit of each column attribute; the step S203 of the embodiment of the present application may be performed in the following cases.
When a target form column in the at least one form column corresponds to a text type, determining a difference value between an upper width limit and a lower width limit of a column attribute corresponding to the target form column as an allocation weight of the target form column; the target form list is any form list to which the form to be displayed belongs;
specifically, the target table list is any one of the at least one table list, when the target table list corresponds to a text type, that is, one data type is stored in the target table list, the difference between the upper width limit and the lower width limit of the column attribute corresponding to the target table list is determined as the distribution weight of the target table list; for example, the upper limit of the width of the target table list column is 6, the lower limit of the width is 8, and the allocation weight of the target table list column is 2.
And when the target form list in the at least one form list corresponds to at least two text types, determining the maximum value of the width lower limit in a plurality of list attributes corresponding to the target form list and the maximum value of the width upper limit in the plurality of list attributes, and determining the difference value between the maximum value of the width upper limit and the maximum value of the width lower limit as the distribution weight of the target form list.
Specifically, when the target table list corresponds to at least two text types, that is, at least two data types are stored in the target table list, determining a maximum value of a lower width limit in a plurality of column attributes corresponding to the target table list, and a maximum value of an upper width limit in the plurality of column attributes, determining a difference between the maximum value of the upper width limit and the maximum value of the lower width limit as an allocation weight of the target table list, for example, the target table list corresponds to two text types, the upper width limit of a first text type of the target table list is 6, the lower width limit is 8, the upper width limit of a second text type is 4, the lower width limit is 10, the maximum value of the lower width limit of the target table list is 6, the maximum value of the upper width limit is 10, and the allocation weight of the target table list is 4.
S204, generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed; the step S204 of the embodiment of the present application may include the following steps S2041 to S2045.
S2041, determining the sum of the distribution weights of each table list column as the total distribution weight;
s2042, determining the ratio of the distribution weight of each form column to the total distribution weight as the weight proportion of each form column;
S2043, determining the width of the form to be allocated according to the total width of the form to be displayed, the lower limit of the width of each form column and the column spacing between the form columns; the width of the to-be-allocated form is smaller than the total width of the to-be-displayed form;
specifically, the sum of the lower limits of the widths of all the list columns and the sum of the column intervals among the list columns are determined, the width of the list to be allocated is determined according to the sum of the total width and the lower limit of the width of the list to be displayed and the sum of the column intervals, and specifically, the width remaining after the sum of the lower limit of the width is subtracted from the total width and the sum of the column intervals is the width of the list to be allocated.
S2044, distributing the to-be-distributed form width according to the weight proportion of each form list column to generate a distribution width corresponding to each form list column;
And S2045, determining the sum of the distribution width and the width lower limit corresponding to each single column of the table as the column width information corresponding to each single column of the table.
S205, when the column width information of the table list column is larger than the upper limit of the width of the table list column, determining the upper limit of the width of each table list column as the column width information of each table list column.
Specifically, when the column width information of the table list column is greater than the upper width limit of the table list column, the data processing device determines the upper width limit of each table list column as the column width information of each table list column, and it can be understood that when the column width information of the table list column is greater than the upper width limit of the table list column, that is, the sum of the upper width limits of all the table list columns is less than the total width of the table to be displayed, the upper width limit of each table list column is determined as the column width information of each table list column, that is, the table is displayed according to the upper width limit of the table list column.
S206, generating a table according to the column width information of each table list column.
Specifically, the data processing device generates a table according to the column width information of each table column, and it is understood that the data processing device performs typesetting according to the column width information of each table column in at least one table column and the display sequence of the table column, where the display sequence may be determined according to the priority sequence of the table column, or determine the display sequence of the table column according to a preset sequence, and add the data corresponding to the table column to each cell of the table column to generate a table including at least one table column.
Referring to fig. 6 a-6 c, an exemplary schematic diagram of a data processing method is provided in an embodiment of the present application. As shown in fig. 6a, the table includes four columns, "RadioButton", "ID/name", "mounted/total mountable" and "host expiration time", respectively, and since the data in "ID/name" is too long and the column width of "ID/name" is fixed, the data content cannot be completely presented, as shown in fig. 6b, the table includes four columns, "RadioButton", "ID/name", "mounted/total mounted" and "host expiration time", respectively, the total width of the table is 560 pixels (px), the column pitch is 20px, and the upper width limit, the lower width limit and the weight of the table columns in the table are shown in table 3;
TABLE 3 minimum width, maximum width and weight for a table list
No. Field content Field class Lower limit of width Upper limit of width Weighting of
1 RadioButton Icon(s) 2 2 0
2 ID/name Combined field 6 50 44
3 Mounted/total mounted Short text 8 8 0
4 Host expiration time Combined field 12 16 4
In table 3, the units of the width upper limit, the width lower limit and the weight are characters, the conversion relationship between the characters and the pixels is 1 character=12 pixels, the total distribution weight of the distribution weights of the table list columns is 48, and the weight ratio of each table list column is respectively: "RadioButton" is 0, "ID/name" is 11/12, "mounted/total mounted" is 0, "host expiration time" is 1/12, the table width to be allocated is determined by the total width of the table, the lower width limit of each table column, and the column spacing between the table columns;
To be allocated table width = table total width-column number row spacing-sum of width lower bound =560-4 x 20- (2+6+8+12) x12 = 144px;
column 1 width=minimum width×12+weight ratio to be allocated table width=2×12+0×144=24 px;
column 2 width=minimum width×12+weight ratio to be allocated table width=6×12+144×11/12=204 px;
Column 3 width=minimum width×12+weight ratio to be allocated table width=8×12+0×144=96 px;
column 4 width=minimum width×12+weight ratio to be allocated table width=12×12+144×1/12=156 px;
and generating a table according to the column width information of each table list column.
As shown in fig. 6c, when the total width of the table is 800px, the above weight distribution method still has a good column width distribution effect.
In the embodiment of the application, the text type of at least one list column of a form to be displayed is obtained, the column attribute corresponding to the list column is determined by the text type, the column attribute corresponding to the text type is preset, and the column attribute and the text type are stored in an associated manner; determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute; generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed, and determining the upper limit of the width of each form column as the column width information of each form column when the column width information of each form column is larger than the upper limit of the width of the form column; and generating a table according to the column width information of each table list column. By distributing the weight to each single column in the table, the situation that the column width of the table is too large or unreasonable is avoided, the reasonable distribution of the width of each column of the table is ensured when different users browse the table by using displays with different resolutions, and the readability of the table is improved.
Referring to fig. 7, a schematic structural diagram of a data processing apparatus is provided in an embodiment of the present application. As shown in fig. 7, the data processing apparatus 1 of the embodiment of the present application may include: an attribute acquisition unit 11, a weight determination unit 12, a column width generation unit 13, a table generation unit 14, a storage unit 15, and a column width determination unit 16.
An attribute obtaining unit 11, configured to obtain a text type of at least one form column to which a form to be displayed belongs, and obtain a column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table;
Specifically, the attribute obtaining unit 11 obtains a text type of at least one list column to which the to-be-displayed form belongs, and obtains a column attribute corresponding to the list column according to the text type, it is understood that the to-be-displayed form is a form which is not yet generated, the form is generated according to the at least one list column and the column attribute of the list column, the list column is any column forming the form, the to-be-displayed form comprises at least one list column, the text type is a data type stored in the list column, the text type comprises short text, long text, a combined field, an icon, a graph and the like, the text length of the short text is within a certain range, the text provided by a system and comprises a text with a fixed format, the text provided by the system comprises date, ID information, an IP address and the like, the preset text provided by the system comprises a hard disk type, an attribute, a host type and the like, and the field of the long text is a content which allows a user to fill in, such as a name, a description, a remark, a description and a text length range is large; the combined field is a text type corresponding to a form column including a plurality of fields, for example: the column of the 'IP address' table list comprises 2 fields of an intranet IP and a public network IP, and the text type of the column of the 'IP address' table list is a combined field; the form list column corresponding to the icon text type is composed of icons, so that the operation can be facilitated, the identifiability can be improved, for example, a monitoring icon, a log icon, a switch button and the like; the list column of the table corresponding to the text type of the graph is composed of the graph. The data processing equipment acquires a column attribute corresponding to the list of the form according to the text type, wherein the column attribute is a width range of the list of the form displayed in the form, the column attribute comprises a width lower limit and a width upper limit, the width lower limit is a minimum value of the width range, the width upper limit is a maximum value of the width range, and the column attribute is preset and is usually set according to the text type of the list of the form.
A weight determining unit 12 for determining an assigned weight of each table element column based on the lower width limit and the upper width limit of each column attribute;
Specifically, the weight determining unit 12 determines the allocation weight of each table list according to the lower width limit and the upper width limit of each column attribute, and it is understood that the allocation weight is used for determining the width of the table list in the table, the larger the allocation weight is, the larger the allocable width of the table list is, the allocation weight is determined by the lower width limit and the upper width limit of the column attribute, the lower width limit and the upper width limit of each column attribute determine the allocation weight of the table list, and specifically, the allocation weight of the table list can be determined according to the difference value of the lower width limit and the upper width limit.
A column width generating unit 13, configured to generate column width information corresponding to each form column according to the allocation weight of each form column and the total width of the to-be-displayed form;
Specifically, the column width generating unit 13 generates the column width information corresponding to each table list according to the allocation weight of each table list column and the total width of the table to be displayed, and it is understood that the total width of the table to be displayed is the maximum width of the table to be displayed, and the total width of the table to be displayed may be a fixed width or may be associated with an attribute of the display device, for example, the total width may be the same as the width of the display device; the column width information is the width of the display of the list columns in the table, the data processing equipment distributes the total width of the table to be displayed according to the distribution weight of each list column, and the column width information corresponding to each list column is generated, wherein the larger the distribution weight is, the larger the width of the list column is.
A table generating unit 14 for generating a table according to the column width information of each table list column.
Specifically, the table generating unit 14 generates a table according to the column width information of each table column, and it is understood that the data processing apparatus performs typesetting according to the column width information of each table column in at least one table column and the display order of the table columns, where the display order may be determined according to the priority order of the table columns, or determine the display order of the table columns according to a preset order, and adds the data corresponding to the table columns to each cell of the table columns, so as to generate a table including at least one table column.
Referring to fig. 5, the data processing apparatus 1 according to the embodiment of the present application may further include: a storage unit 15, and a column width determination unit 16.
A storage unit 15, configured to obtain a text type of a table list column, and set a column attribute of the table list column according to the text type; and performing association storage on the column attribute of the form column and the text type corresponding to the form column.
Specifically, the storage unit 15 obtains a text type of a table list column, and sets the column attribute of the table list column according to the text type, and it can be understood that the text type is a data type stored in the table list column, the text type includes a short text, a long text, a combined field, an icon, a graph, and the like, and the column attribute of the table list column is set according to the text type, specifically, the data processing device may set the column attribute of the table list column according to a text length corresponding to the text type, or obtain column attribute information set by a user, and the data processing device stores the column attribute of the table list column and the text type corresponding to the table list column in an associated manner.
And a column width determining unit 16 configured to determine, as the column width information of each of the table columns, an upper limit of the width of each of the table columns when the column width information of the table columns is greater than the upper limit of the width of the table columns.
Specifically, when the column width information of the table columns is greater than the upper width limit of the table columns, the column width determining unit 16 determines the upper width limit of each table column as the column width information of each table column, and it is understood that when the column width information of the table columns is greater than the upper width limit of the table columns, that is, the sum of the upper width limits of all the table columns is less than the total width of the table to be displayed, the upper width limit of each table column is determined as the column width information of each table column, that is, the table is displayed according to the upper width limit of the table column.
In the embodiment of the application, the text type of at least one list column of a list to be displayed is acquired, and the column attribute corresponding to the list column is determined by the text type; determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute; generating column width information corresponding to each form column according to the distribution weight of each form column and the total width of the form to be displayed; and generating a table according to the column width information of each table list column. By distributing the weight to each single column in the table, the situation that the column width of the table is too large or unreasonable is avoided, the reasonable distribution of the width of each column of the table is ensured when different users browse the table by using displays with different resolutions, and the readability of the table is improved.
Referring to fig. 8, a schematic structural diagram of a computer device is provided in an embodiment of the present application. As shown in fig. 8, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 8, an operating system, network communication modules, user interface modules, and data processing applications may be included in memory 1005, which is a type of computer storage medium.
In the computer device 1000 shown in fig. 8, the network interface 1004 may provide a network communication function, and the user interface 1003 is mainly used as an interface for providing input to a user; the processor 1001 may be configured to invoke the data processing application stored in the memory 1005 to implement the description of the data processing method in any of the embodiments corresponding to fig. 1a to 6c, which is not described herein.
It should be understood that the computer device 1000 described in the embodiment of the present application may perform the description of the data processing method in any of the embodiments corresponding to fig. 1a to 6c, and may also perform the description of the data processing device in the embodiment corresponding to fig. 7, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, where a computer program executed by the aforementioned data processing apparatus is stored, where the computer program includes program instructions, when executed by the processor, can perform the description of the data processing method in any of the foregoing embodiments of fig. 1a to 6c, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (8)

1. A method of data processing, comprising:
acquiring a text type of at least one form column to which a form to be displayed belongs, and acquiring a column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table;
determining the distribution weight of each table list column according to the width lower limit and the width upper limit of each column attribute; when a target form list in the at least one form list corresponds to a text type, the allocation weight of the target form list refers to the difference value between the upper width limit and the lower width limit of the list attribute corresponding to the target form list, and the target form list is any form list to which the form to be displayed belongs; when a target form column in the at least one form column corresponds to at least two text types, the allocation weight of the target form column refers to a difference value between a maximum value of the upper width limit in a plurality of column attributes corresponding to the target form column and a maximum value of the lower width limit in a plurality of column attributes corresponding to the target form column;
determining the sum of the distribution weights of each table list column as the total distribution weight;
Determining the ratio of the distribution weight of each form column to the total distribution weight as the weight proportion of each form column;
determining the width of the form to be allocated according to the total width of the form to be displayed, the lower limit of the width of each form column and the column spacing between the form columns; the width of the to-be-allocated form is smaller than the total width of the to-be-displayed form;
Distributing the to-be-distributed form widths according to the weight proportion of each form column to generate the distribution width corresponding to each form column;
Determining the sum of the distribution width and the width lower limit corresponding to each form column as column width information corresponding to each form column;
and generating a table according to the column width information of each table list column.
2. The method according to claim 1, wherein before the text type of at least one list column to which the to-be-presented list belongs is obtained, the method further comprises:
acquiring a text type of a form column, and setting column properties of the form column according to the text type;
And performing association storage on the column attribute of the form column and the text type corresponding to the form column.
3. The method as recited in claim 1, further comprising:
And determining the upper limit of the width of each table list column as the column width information of each table list column when the column width information of the table list column is larger than the upper limit of the width of the table list column.
4. The method according to claim 1, wherein the obtaining a text type of at least one list column to which the to-be-presented list belongs, and obtaining a column attribute corresponding to the list column according to the text type, includes:
When the sum of the width lower limits of all the list columns of the to-be-displayed list is larger than the total width information of the to-be-displayed list, determining at least one list column according to the priority order of all the list columns;
and acquiring the text type of the at least one form column, and acquiring the column attribute corresponding to the form column according to the text type.
5. The method according to claim 1, wherein the obtaining a text type of at least one list column to which the to-be-presented list belongs, and obtaining a column attribute corresponding to the list column according to the text type, includes:
When a list self-defining instruction is obtained, displaying all the list columns to which the to-be-displayed list belongs according to the list self-defining instruction;
Determining the maximum value of the list columns of the list to be displayed according to the column properties of all the list columns;
Determining at least one selected form column, the number of the at least one selected form column being less than the maximum value;
and acquiring the text type of the at least one form column, and acquiring the column attribute corresponding to the form column according to the text type.
6. A data processing apparatus, comprising:
The attribute acquisition unit is used for acquiring the text type of at least one form column to which the form to be displayed belongs, and acquiring the column attribute corresponding to the form column according to the text type; the column attributes comprise a lower width limit and an upper width limit of a list column of the table;
A weight determining unit for determining the allocation weight of each form column according to the lower width limit and the upper width limit of each column attribute; when a target form list in the at least one form list corresponds to a text type, the allocation weight of the target form list refers to the difference value between the upper width limit and the lower width limit of the list attribute corresponding to the target form list, and the target form list is any form list to which the form to be displayed belongs; when a target form column in the at least one form column corresponds to at least two text types, the allocation weight of the target form column refers to a difference value between a maximum value of the upper width limit in a plurality of column attributes corresponding to the target form column and a maximum value of the lower width limit in a plurality of column attributes corresponding to the target form column;
a column width generating unit, configured to determine a sum of the allocation weights of each table list column as a total allocation weight, determine a ratio of the allocation weight of each table list column to the total allocation weight as a weight ratio of each table list column, and determine a table width to be allocated according to the total width of the table to be displayed, a lower limit of the width of each table list column, and a column spacing between the table list columns; the width of the to-be-allocated form is smaller than the total width of the to-be-displayed form;
The column width generating unit is further configured to allocate the to-be-allocated table width according to the weight proportion of each table list column to generate an allocation width corresponding to each table list column, and determine a sum of the allocation width corresponding to each table list column and a width lower limit as column width information corresponding to each table list column;
and the table generating unit is used for generating a table according to the column width information of each table list column.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method of any of claims 1-5.
8. A computer device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1-5.
CN201911073021.5A 2019-11-05 2019-11-05 Data processing method and device Active CN111191162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911073021.5A CN111191162B (en) 2019-11-05 2019-11-05 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911073021.5A CN111191162B (en) 2019-11-05 2019-11-05 Data processing method and device

Publications (2)

Publication Number Publication Date
CN111191162A CN111191162A (en) 2020-05-22
CN111191162B true CN111191162B (en) 2024-05-17

Family

ID=70709102

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911073021.5A Active CN111191162B (en) 2019-11-05 2019-11-05 Data processing method and device

Country Status (1)

Country Link
CN (1) CN111191162B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363663B (en) * 2020-11-27 2022-04-12 深圳集智数字科技有限公司 Data display method and device
CN112632903A (en) * 2020-12-30 2021-04-09 平安证券股份有限公司 Data display method and device based on table, storage medium and electronic equipment
CN114004203A (en) * 2021-10-25 2022-02-01 杭州网易竹书信息技术有限公司 Table adjusting method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656914A (en) * 2017-10-16 2018-02-02 厦门海迈科技股份有限公司 Form generation method, device, terminal device and the storage medium of configurableization
CN107992458A (en) * 2016-10-26 2018-05-04 腾讯科技(北京)有限公司 The generation method and device of form rule
CN109635263A (en) * 2018-11-22 2019-04-16 北京字节跳动网络技术有限公司 The fixed methods of exhibiting of col width based on WEB ultra-wide table, device and electronic equipment
CN109871524A (en) * 2019-02-21 2019-06-11 腾讯科技(深圳)有限公司 A kind of chart generation method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7725815B2 (en) * 2005-12-12 2010-05-25 Sap Ag Method and system for ordered resizing columns in a table
EP3223174A1 (en) * 2016-03-23 2017-09-27 Tata Consultancy Services Limited Method and system for selecting sample set for assessing the accessibility of a website

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992458A (en) * 2016-10-26 2018-05-04 腾讯科技(北京)有限公司 The generation method and device of form rule
CN107656914A (en) * 2017-10-16 2018-02-02 厦门海迈科技股份有限公司 Form generation method, device, terminal device and the storage medium of configurableization
CN109635263A (en) * 2018-11-22 2019-04-16 北京字节跳动网络技术有限公司 The fixed methods of exhibiting of col width based on WEB ultra-wide table, device and electronic equipment
CN109871524A (en) * 2019-02-21 2019-06-11 腾讯科技(深圳)有限公司 A kind of chart generation method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于列重合度的网络表格一致性扩展;齐飞;王宁;张丽方;孙伟娟;;计算机科学;20170915(09);全文 *

Also Published As

Publication number Publication date
CN111191162A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN111191162B (en) Data processing method and device
CN112613272B (en) Information display method and device
CN106779855A (en) Advertisement fill method and device
CN110020325B (en) Page loading method, device, equipment and readable storage medium
CN101996206A (en) Method, device and system for displaying web page
US9384575B2 (en) Space constrained small format visual analytic labeling
US20220147697A1 (en) Adaptive content delivery
CN103164114A (en) Method and device of classifying icons of terminal operation interface
CN112416346B (en) Interface color scheme generation method, device, equipment and storage medium
CN112000911B (en) Page management method, device, electronic equipment and storage medium
WO2023169521A1 (en) Field merging method and apparatus, and electronic device
CN108563469A (en) page loading method, device, storage medium and terminal device
US11190581B1 (en) Job allocation support system and method
CN109542878B (en) List creation method and device
CN114968707A (en) Method and device for controlling work item state, storage medium and computer equipment
US9229913B2 (en) Font processing method for maintaining e-document layout
CN114339373B (en) Queue barrage generation method and device, storage medium and equipment
CN111046206A (en) Head portrait list display method and device, electronic equipment and storage medium
CN110992118B (en) Method, device, storage medium, equipment and system for issuing electronic invoice
CN114297552A (en) Form expansion method and device, computer equipment and storage medium
CN114186161A (en) Page display information configuration method, device, equipment and readable storage medium
CN111158566A (en) Event processing method, device, equipment and storage medium
CN106844502B (en) Data consistency processing method and equipment
CN117032543A (en) Form adjusting method and device, storage medium and terminal equipment
CN110109729B (en) Interface layout adjustment 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
TG01 Patent term adjustment
TG01 Patent term adjustment