Table generation method, table generation device, storage medium and electronic device
By generating data input boxes and supporting table editing operations, it solves the problem that tables on web pages cannot be edited, realizes the flexibility and interactivity of tables, and improves the accuracy and usage of data input.
Patent Information
- Application Number
- CN202110035972.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-12
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-01-12
AI Technical Summary
The web page tables generated by the existing technology cannot be edited, the data display is fixed, and lack flexibility and interactivity.
By obtaining the table to be processed, the mapping relationship between the table header data and the table body data is determined, a data input box is generated, the user is allowed to edit the table content, and row and column deletion, addition and clearing operations are provided to realize dynamic editing of the table.
It realizes the flexible editing of web page tables, reduces the data input error rate, improves the flexibility of table display and use, and facilitates data viewing and understanding.
Smart Images

Figure CN113779943B_ABST
Abstract
Description
Background Art
[0002] With the rapid development of science and technology and the increasing value of data, tables have become a common form of data presentation on web pages. Programmers usually use two methods to implement tables on web pages. The first method is to use hypertext markup language to convert fixed data into a table for display. The second method is to use the table component in the front-end framework component to generate a table on a web page. However, the tables generated using these two methods can only display fixed data and cannot be edited.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The purpose of the present disclosure is to provide a table generation method, a table generation device, a computer-readable storage medium and an electronic device, thereby overcoming the problem of fixed table display of web pages due to limitations and defects of related technologies at least to a certain extent.
[0005] According to a first aspect of the present disclosure, a table generation method is provided, comprising: obtaining a table to be processed, wherein the table to be processed includes table header data and table body data; determining a mapping relationship between each type of data in the table header data and table body data corresponding to each type of data, and obtaining a mapping relationship set; generating a data input box corresponding to the table to be processed according to the mapping relationship set and the number of rows of the table body data; based on the mapping relationship set, inputting the table header data and the table body data into the data input box corresponding to the table to be processed, and generating a target table, which is displayed on a web page.
[0006] According to a second aspect of the present disclosure, a table generation device is provided, including: a table acquisition module, used to acquire a table to be processed, wherein the table to be processed includes header data and body data; a relationship determination module, used to determine the mapping relationship between each type of data in the header data and the body data corresponding to each type of data, as a mapping relationship set; an input box generation module, used to generate a data input box corresponding to the table to be processed according to the mapping relationship set and the number of rows of the body data; the table generation module, used to input the header data and the body data into the data input box corresponding to the table to be processed based on the mapping relationship set, to generate a target table, and the target table is displayed on a web page.
[0007] Optionally, the table generating device further includes: an identifier determining module for determining the identifier of each row of data in the table body data; and a column control generating module for generating a row deletion control corresponding to the identifier of each row of data based on the identifier of each row of data and the number of rows of the table body data, so as to delete the data input box corresponding to the identifier of each row of data.
[0008] Optionally, the table generating device further includes: a quantity determining module for determining the number of data types in the header data as the number of columns; and a row control generating module for generating a column deletion control corresponding to each mapping relationship in the mapping relationship set according to the mapping relationship set and the number of columns.
[0009] Optionally, the table generation device also includes: a deletion operation response module, used to respond to the delete column operation of the target table, determine the mapping relationship corresponding to the delete column operation, as the delete column mapping relationship; an input box processing module, used to delete the data input box corresponding to the delete column mapping relationship in the target table based on the delete column mapping relationship.
[0010] Optionally, the deletion operation response module may be configured to execute: responding to a touch operation on a column deletion control in the target table, determining a mapping relationship corresponding to the touch operation on the column deletion control as a deletion column mapping relationship.
[0011] Optionally, the table generating device further includes: a quantity recording module, which can be configured to execute: determining the expression type of each type of data in the header data, and recording the number of expression types; an input box determining module, which can be configured to execute: generating a header data input box corresponding to each mapping relationship in the mapping relationship set based on the mapping relationship set and the number of expression types.
[0012] Optionally, the table generation device also includes: an add operation response module, which can be configured to execute: respond to the add column operation of the target table, determine the mapping relationship corresponding to the add column operation, and obtain the target column mapping relationship; add column processing module, which can be configured to execute: based on the target column mapping relationship, add a data input box corresponding to the target column mapping relationship and a column deletion control corresponding to the target column mapping relationship in the target table.
[0013] Optionally, the table generating device further comprises: a table conversion module, which may be configured to execute: in response to a clearing operation of clearing the target table, converting the target table into an empty table with preset data input boxes.
[0014] Optionally, the table generation device also includes: a modified data determination module, which can be configured to execute: upon receiving a data modification instruction of a target data input box, determine the modified data corresponding to the data modification instruction; and a table determination module, which can be configured to execute: replacing the data of the target data input box with the modified data, and determining the modified target table.
[0015] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the table generating method as described above is implemented.
[0016] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the table generation method as described above.
[0017] The exemplary embodiments of the present disclosure have the following beneficial effects:
[0018] In the technical solutions provided by some embodiments of the present disclosure, first, a table to be processed is obtained; then, a mapping relationship between each type of data in the header data and the table body data corresponding to each type of data is determined to obtain a mapping relationship set; then, a data input box corresponding to the table to be processed is generated according to the mapping relationship set and the number of rows of the table body data; then, based on the mapping relationship set, the header data and the table body data are input into the data input box corresponding to the table to be processed to generate a target table. On the one hand, the present disclosure uses the mapping relationship set and the number of rows of the table body data to generate a data input box corresponding to the table to be processed, which can not only input data to avoid the fixed display of the data in the table on the web page, but also re-edit the input data to improve the display flexibility of the table and realize the editing operation of the table on the web page. On the other hand, the present disclosure associates the mapping relationship between each type of data in the header data and the table body data corresponding to each type of data with the data input box to avoid the table body data inputted in the data input box being not associated with the header data, and reduce the error rate of the table data input. At the same time, the present disclosure displays the header data and the table body data on the web page, which is convenient for viewing and understanding the data and data types in the table.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0021] Figure 1 A flowchart schematically shows a table generation method according to an exemplary embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram schematically shows a target table in a web page according to an exemplary embodiment of the present disclosure;
[0023] Figure 3 A flowchart schematically illustrates a table generation method according to another exemplary embodiment of the present disclosure;
[0024] Figure 4 A flowchart schematically illustrates the conversion of target table data into original data according to an exemplary embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of a user operation on a target table according to an exemplary embodiment of the present disclosure is schematically shown;
[0026] Figure 6 A block diagram schematically shows a table generating device according to an exemplary embodiment of the present disclosure;
[0027] Figure 7 Schematically shows a block diagram of a table generating device according to another exemplary embodiment of the present disclosure;
[0028] Figure 8 A block diagram schematically shows a table generating device according to another exemplary embodiment of the present disclosure;
[0029] Fig. 9 A block diagram schematically shows a table generating device according to another exemplary embodiment of the present disclosure;
[0030] Fig.10 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0032] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0033] It should be noted that, in the present disclosure, the terms "include" and "comprising" are used to express an open-ended meaning of inclusion, and mean that in addition to the listed elements / components / etc., there may be other elements / components / etc. In addition, the terms "first" and "second" used in the present disclosure are only for the purpose of distinction and should not be used as limitations of the present disclosure.
[0034] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0035] Currently, web pages use tables as one of the main ways to display data. Usually, the table component of the interface in the desktop component library is used to implement the table in the web page. The specific steps include: first, obtaining the initial data; then, adding the fixed column data and the fixed header data to the table component, and then generating the table in the web page to display the data in a fixed manner. However, the table in the web page will make the data display format fixed, and it is impossible to edit the data in the table, nor can it edit the table structure of the table.
[0036] To address this problem, the present disclosure proposes a table generation method.
[0037] It should be noted that, in the exemplary embodiments of the present disclosure, the following-described table generation method can generally be implemented by a server, that is to say, each step of the table generation method can be executed by the server. In this case, the table generation device can be configured in the server.
[0038] In addition, the table generation method can be implemented by a terminal device (such as a mobile phone, a tablet, a personal computer, etc.), that is to say, each step of the table generation method can be executed by the terminal device. In this case, the table generation device can be configured in the terminal device.
[0039] Next, each step of the table generation method in the exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings and embodiments.
[0040] Figure 1 The flowchart of the table generation method of the exemplary embodiments of the present disclosure is schematically shown. In the following illustrative examples, the server is used as the execution subject for illustration. Refer to Figure 1 , the table generation method can specifically include the following steps:
[0041] S102. Obtain the table to be processed.
[0042] In the exemplary embodiments of the present disclosure, the table to be processed may include header data and body data. The header data may include multiple types of data, and each type of data corresponds to a column of body data. Among them, the type of data may refer to the type of each column of data in the body data. For example, the header data includes type data such as name, age, and gender. Among them, the type of data regarding "name" corresponds to a column of data filled with "name" in the body data.
[0043] The header data may include multiple expression types of each type of data. For example, the type of data regarding "name" can be expressed in Chinese as "姓名" and also in English as "name". The server can define an empty array Headers to store the header data. The server can define an empty array Table to store the body data.
[0044] The table to be processed may also be an empty table with a preset number of rows and columns and a preset data type for each column. For example, the table to be processed may be an empty table with 2 rows and 2 columns and a preset data type for each column. When setting the body data and header data of the empty table, the server can use the initTableData array to define the preset body data of the empty table, use the intiHeaders array to define the preset body data of the empty table, and use the intiColumn array to define the mapping relationship between each type of data in the preset header data and the preset body data in the empty table.
[0045] S104. Determine the mapping relationship between each type of data in the header data and the table body data corresponding to each type of data, and obtain a mapping relationship set.
[0046] The mapping relationship may refer to the relationship between a type of data in the header data and a column of data in the uniquely corresponding body data.
[0047] The mapping relationship set may include a mapping relationship between each type of data in the header data and the table body data corresponding to each type of data.
[0048] After the server obtains the table to be processed, it can first define an empty Column array, and then determine the mapping relationship between each type of data in the header data and the corresponding table body data from the table to be processed, and store them in the empty Column array. The empty Column array can be a mapping relationship collection.
[0049] In an exemplary embodiment of the present disclosure, after obtaining a mapping relationship set, the server can define a Table empty array to store table body data. First, the server can extract table body data corresponding to each mapping relationship from the table to be processed based on the mapping relationship, and then store the mapping identifier corresponding to each mapping relationship and the meaning of the table body data corresponding to each mapping relationship into the Table empty array.
[0050] The server may also set a temporary space to store the table body data of the table to be processed into the Table empty array. The specific steps may include: first, taking out a mapping relationship from the mapping relationship set, and storing the taken out mapping relationship and the mapping identifier corresponding to the taken out mapping relationship into the temporary space; then, based on the taken out mapping relationship, extracting the table body data corresponding to the taken out mapping relationship from the table to be processed, and inputting it into the temporary space; then, storing the table body data corresponding to the taken out mapping relationship into the Table empty array, and clearing the temporary space. The server repeats the specific steps of storing the table body data into the Table empty array until all the table body data corresponding to each mapping relationship in the mapping relationship set is stored into the Table empty array.
[0051] S106. Generate a data input box corresponding to the table to be processed according to the mapping relationship set and the number of rows of table body data.
[0052] In an exemplary embodiment of the present disclosure, the data input box corresponding to the table to be processed can receive input data, and can also receive and store data modified from the input data. The number of columns of the data input box of the table to be processed can be determined based on the number of mapping relationships in the mapping relationship set, wherein the number of mapping relationships is the same as the number of data types in the header data. The number of rows of the data input box of the table to be processed can be determined based on the number of rows of the table body data. The data input box of the table to be processed may include a header data input box and a body data input box. The server may generate, based on the mapping relationship set and the number of rows of the table body data, a data input box corresponding to each mapping relationship in the mapping relationship set as the data input box corresponding to the table to be processed. Among them, the data input box corresponding to each mapping relationship may include a header data input box and a body data input box. The data input box corresponding to each mapping relationship may match the mapping identifier corresponding to each mapping relationship.
[0053] After obtaining the mapping relationship set, the server can first determine the number of columns of the data input box corresponding to the table to be processed according to the mapping relationship set, and then generate a header data input box corresponding to each mapping relationship in the mapping relationship set based on the number of columns; then, based on the number of columns and the number of rows of table body data, generate a table body data input box corresponding to each mapping relationship, and then merge the header data input box corresponding to each mapping relationship and the table body data input box corresponding to each mapping relationship to obtain the data input box corresponding to the table to be processed.
[0054] It should be noted that, for the data input boxes of the table to be processed disclosed in the present invention, the header data input box and the table body data input box can be displayed in two areas on the web page, that is, in the web page, a part of the page area displays the header data input box, and a part of the page area displays the table body data input box. The present invention does not limit the display area of the header data input box, and it can be displayed at any position above, below, left, or right of the web page. The data input boxes of the table to be processed disclosed in the present invention can also be displayed in one area.
[0055] The present disclosure matches the header data corresponding to each mapping relationship, the table body data corresponding to each mapping relationship, and the data input box corresponding to each mapping relationship, that is, based on each mapping relationship in the mapping relationship set, the server can determine the header data corresponding to each mapping relationship, the table body data corresponding to each mapping relationship, and the data input box corresponding to each mapping relationship. The present disclosure can avoid the table body data input into the data input box being unrelated to the header data, and reduce the error rate of table data input.
[0056] like Figure 2 The table displayed on the web page has a shaded area showing a table header data input box, and an area below the shaded area showing a table body data input box.
[0057] The present invention discloses a data input box corresponding to a table to be processed generated based on a mapping relationship set and the number of rows of table body data, which can not only input data to avoid fixed display of data in the table on the web page, but also re-edit the input data to improve the display flexibility of the table and realize editing operations on the table on the web page.
[0058] According to an exemplary embodiment of the present disclosure, the server can determine the expression type of each type of data in the header data and record the number of expression types; based on the mapping relationship set and the number of expression types, generate a header data input box corresponding to each mapping relationship in the mapping relationship set.
[0059] The server may first determine the number of mapping relationships in the mapping relationship set, and then generate a header data input box corresponding to each mapping relationship based on the number of mapping relationships and the number of expression types.
[0060] The header data input box corresponding to each mapping relationship may include a mapping identifier corresponding to each mapping relationship.
[0061] For example, the header data of the table to be processed includes two types of data: "name" and "age". The Chinese expression type is: "name", and the English expression type is "name". The type of data about "age". The Chinese expression type is: "age", and the English expression type is "age". The body data has one column for data about "name" and one column for data about "age".
[0062] The server may first determine the expression type of each type of data in the header data, record the number of expression types as 2, and then generate a header data input box corresponding to each mapping relationship, that is, a header data input box with 2 rows and 2 columns.
[0063] According to an exemplary embodiment of the present disclosure, the server can first determine the identifier of each row of data in the table data; then, based on the identifier of each row of data and the number of rows of the table data, generate a row deletion control corresponding to the identifier of each row of data, so as to delete the data input box corresponding to the identifier of each row of data.
[0064] The identifier of each row of data may be index information corresponding to each row of data in the table body data. The row deletion control may delete the table body data corresponding to the identifier of the row of data based on the identifier of the row of data.
[0065] The present disclosure does not limit the display style and position of the row delete control. The row delete control can be displayed in the form of text, an icon, or a slider. The row delete control can be located at the beginning or end of the corresponding row data. Figure 2As shown, the row deletion control "Delete Row" is located at the end of each row of table data.
[0066] In an exemplary embodiment of the present disclosure, the server may record and display the operation column of the row deletion control. A word "operation" is set in the header data mine, and a mapping relationship between the "operation" word and the row deletion control corresponding to the identifier of each row of data is determined. The server stores the mapping relationship corresponding to the operation column of the row deletion control in the Column array.
[0067] According to an exemplary embodiment of the present disclosure, the server may first determine the number of data types in the header data as the number of columns; then, based on the mapping relationship set and the number of columns, generate a column deletion control corresponding to each mapping relationship in the mapping relationship set.
[0068] The present disclosure does not limit the display style and position of the column delete control. The column delete control can be displayed in the form of text, an icon, or a slider. The column delete control can be located at the beginning or end of the corresponding column data, or at the end or beginning of the column header data input box in the table header data. Figure 2 As shown, the column deletion control "Delete Column" is located at the end of the header data input box of each column in the header data.
[0069] S108. Based on the mapping relationship set, input the header data and the body data into the data input box corresponding to the table to be processed to generate a target table.
[0070] In an exemplary embodiment of the present disclosure, the target table may be displayed on a web page. It should be noted that the target table may also be an empty table including a table header data input box and a table body data input box.
[0071] The data input box of the target table is associated with each mapping relationship in the mapping relationship set. The server can determine the header data and body data, the header data input box and the body data input box corresponding to each mapping relationship from the table to be processed according to each mapping relationship in the mapping relationship set.
[0072] The server may respond to a touch operation on a row delete control in the target table, determine an identifier of the row data corresponding to the row delete control, and then delete the row data input box corresponding to the identifier of the row data based on the identifier of the row data.
[0073] If the row data input box includes data, the server will delete the row data input box and data corresponding to the row data deletion mark. If the row data input box does not include data, the server will delete the row data input box corresponding to the row data deletion mark.
[0074] For example, a user clicks on the row delete control of the second row in the target table of the web page. After receiving the touch operation on the row delete control of the second row, the server can first obtain the index information "row 2" corresponding to the row delete control of the second row, and then execute the "table.splice(index,1)" statement on the Table array to delete the data of the second row.
[0075] In an exemplary embodiment of the present disclosure, the server can respond to a touch operation of adding a control to a row in a target table, determine the identifier of the row data corresponding to the row addition control, and then based on the identifier of the row data and the mapping relationship set, add a data input box corresponding to each mapping relationship in the mapping relationship set, as well as a row deletion control corresponding to the identifier of the row data.
[0076] After receiving the touch operation for adding a row control, the server can first determine the identifier of the row data, and then, based on the mapping relationship between each type of data in the header data and the table body data, add a data input box corresponding to each mapping relationship. In other words, the data input box corresponding to each mapping relationship can input data that is the same as the type of data corresponding to the mapping relationship. Then, a row deletion control corresponding to the identifier of the row data is added.
[0077] In an exemplary embodiment of the present disclosure, the server may set a row addition control in the target table of the web page. The present disclosure does not limit the display style and position of the row addition control. The row addition control may be displayed in the form of text or in the form of an icon. The row addition control may be located at the beginning of the table header data input box or at the end of the table body data. Figure 2 As shown, the row adding control "+Add Row" is located at the beginning of the header data.
[0078] According to an exemplary embodiment of the present disclosure, the server can respond to an operation of adding a column to a target table and determine a mapping relationship corresponding to the operation of adding a column as a target column mapping relationship; then, based on the target column mapping relationship, add a data input box corresponding to the target column mapping relationship and a column deletion control corresponding to the target column mapping relationship in the target table.
[0079] In an exemplary embodiment of the present disclosure, the server may set a column adding control corresponding to the column adding operation in the web page. The present disclosure does not limit the display style and position of the column adding control. The column adding control may be displayed in the form of text or in the form of an icon. The column adding control may be located at the beginning of the table header data input box or at the end of the table body data. Figure 2As shown, the column adding control "+Add Column" is located at the beginning of the table header data. The server stores the added target column mapping relationship in the Column array, and the target column mapping relationship can be stored before the mapping relationship corresponding to the operation column of the column deletion control.
[0080] The server may respond to the add column operation of the target table, determine the mapping relationship corresponding to the add column operation, and add the mapping relationship corresponding to the add column operation to the mapping relationship set so that the server may subsequently delete the target column and provide the mapping relationship.
[0081] For example, a user clicks on a column adding control in a web page. After receiving a touch operation for the column adding control, the server can first determine the mapping relationship corresponding to the touch operation of the column adding control as the target mapping relationship; then, based on the target mapping relationship, a table header data input box is generated, that is, a first data space corresponding to the target mapping relationship is added to the Headers array, and the first data space can only store data corresponding to the target mapping relationship; then, based on the target mapping relationship, a data input box corresponding to the target mapping relationship is added to each row of the table body data input box, that is, the server performs a calendar operation on the Table array, and a second data space corresponding to the target mapping relationship is added to each row, and the second data space can only store data corresponding to the target mapping relationship.
[0082] According to an exemplary embodiment of the present disclosure, the server can first respond to the column deletion operation of the target table, determine the mapping relationship corresponding to the delete column operation, as the delete column mapping relationship; then, based on the delete column mapping relationship, delete the data input box in the target table corresponding to the delete column mapping relationship.
[0083] According to an exemplary embodiment of the present disclosure, the server may first respond to a touch operation on a column delete control in a target table, then determine a mapping relationship corresponding to the touch operation of the column delete control as a delete column mapping relationship, and then, based on the delete column mapping relationship, perform deletion processing on the data input box in the target table corresponding to the delete column mapping relationship.
[0084] If the column data input box includes data, the server will delete the column data input box and data corresponding to the deleted column mapping relationship. If the column data input box does not include data, the server will delete the column data input box corresponding to the deleted column mapping relationship.
[0085] For example, a user clicks on the column delete control of the second column in the web page. After receiving the touch operation on the column delete control of the second column, the server can first determine the mapping relationship corresponding to the touch operation on the column delete control as the delete column mapping relationship; then, based on the delete column mapping relationship, delete the table body data input box and table body data corresponding to the delete column mapping relationship in the Tabl array; then, delete the delete column mapping relationship in the Column array.
[0086] When the data in the Column array, Headers array, and Table array are arranged in index order, the server can first determine the index information of the deleted column based on the touch operation of the column deletion control; then execute "headers.splice(index,1)" on the Headers array based on the index information to delete the header data and the header data input box of the deleted column in the Headers array; then, obtain the deleted column mapping relationship based on the index information, and execute "columns.splice(index,1)" on the Column array to delete the deleted column mapping relationship in the Column array; then, based on the deleted column mapping relationship, execute "delete(name)" on the Table array to delete the table body data and the table body data input box corresponding to the deleted column mapping relationship in the Table array.
[0087] According to an exemplary embodiment of the present disclosure, the server may convert the target form into an empty form with preset data input boxes in response to a clearing operation of clearing the target form.
[0088] The preset data input box may be a data input box with preset rows and columns and preset data types that can be input in each column.
[0089] The server can respond to the touch operation for clearing the table control and convert the target table into an empty table with a preset data input box. The server can also respond to the touch operation for clearing the table slider and convert the target table into an empty table with a preset data input box.
[0090] like Figure 2 The table on the web page shown has a clear table control set in the upper right corner. The empty table of the preset data input box is an empty table with 2 rows and 2 columns.
[0091] After receiving the touch operation for clearing the table control, the server converts the target table into an empty table with 2 rows and 2 columns, wherein the empty table with 2 rows and 2 columns includes: a table body data input box with 2 rows and 2 columns, and a table header data input box with 1 row and 2 columns.
[0092] In an exemplary embodiment of the present disclosure, after receiving a touch operation for clearing a table control, a selection box may pop up first, and then a selection may be made as to whether to clear the target table data or to clear the target table data and data input box.
[0093] On the one hand, the server disclosed in the present invention can perform operations such as deleting columns, deleting rows, adding columns, and adding rows on the target table in the web page, thereby improving the display flexibility of the target table, avoiding low utilization rate caused by fixed table data, and improving the utilization rate of the table. At the same time, the table disclosed in the present invention visually displays the controls corresponding to the operations of deleting columns, deleting rows, adding columns, and adding rows, respectively, which facilitates the addition, deletion, and editing operations of the table and improves the human-computer interaction capability. On the other hand, the present invention displays the header data and the body data on the web page, which is convenient for viewing and understanding the data and data types in the table.
[0094] According to an exemplary embodiment of the present disclosure, upon receiving a data modification instruction for a target data input box, the server may first determine the modification data corresponding to the data modification instruction; then, replace the data of the target data input box with the modification data to determine a modified target table.
[0095] The target data input box may be a data input box for the data to be modified in the target table.
[0096] The target data input box can be a table header data input box or a table body data input box.
[0097] In the case where the target data input box is a header data input box, after the server replaces the data in the target data input box with the modified data, it can first determine the mapping relationship corresponding to the target data input box; then, clear the data in the body data input box associated with the mapping relationship corresponding to the target data input box, and issue a reminder to modify the body data, so as to modify the body data associated with the mapping relationship corresponding to the target data input box to body data with the same data type as the modified data; then, based on the modified header data and body data, determine the modified target table.
[0098] When the target data input box is a table body data input box, after the server replaces the data of the target data input box with the modified data, it can replace the data of the target data input box with the modified data, and then determine the modified target table based on the modified table body data.
[0099] The present disclosure can utilize the table component, fusion slot component and input box component of the interface in the desktop component library to generate the data input box corresponding to the table to be processed, and bind the data in the table to be processed with the data in the input box. After modifying the data in the data input box in the target table, the modified data can be stored to determine the modified target table.
[0100] Figure 3 The flowchart of the table generation method according to another exemplary embodiment of the present disclosure is schematically shown. In step S102, the server first obtains the table to be processed; in step S302, it is determined whether the table to be processed is an empty table. If the table to be processed is an empty table, step S304 is executed, otherwise, step S104 is executed; in step S304, the server can determine the data input box corresponding to the table to be processed according to the preset mapping relationship set and the preset number of rows of table body data, that is, the target table, that is, the data input box corresponding to the table to be processed without filling in the header data and the table body data is the target table; in step S104, the server determines the mapping relationship between each type of data in the header data and the table body data corresponding to each type of data, and obtains the mapping relationship set; in step S106, according to the mapping relationship set and the number of rows of table body data, the data input box corresponding to the table to be processed is generated; in step S108, based on the mapping relationship set, the header data and the table body data are input into the data input box corresponding to the table to be processed to generate the target table.
[0101] After step S106, the server may determine the identifier of each row of data in the table body data; based on the identifier of each row of data and the number of rows of the table body data, generate a row delete control corresponding to the identifier of each row of data. The server may determine the number of data types in the header data as the number of columns; based on the mapping relationship set and the number of columns, generate a column delete control corresponding to each mapping relationship in the mapping relationship set. The server may also configure a column add control, a row add control, and a table clear control in the target table of the web page.
[0102] In an exemplary embodiment of the present disclosure, for a target table, the table header data and the table body data can be edited and modified, and the target table can be deleted, deleted, added, added, and cleared, so that the display formats of the table of the web page are increased, and the use rate of the target table is avoided from being reduced due to the fixed table data. The present disclosure improves the use rate of the table.
[0103] refer to Figure 4For the target table disclosed in the present invention, first, the server can display the target table on the web page; then, it can respond to the user performing one or more operations of the user operation 400 based on the target table, specifically, the user operation 400 includes: adding a row operation 401, adding a column operation 403, deleting a row operation 405, deleting a column operation 407, editing the data in the header data input box and the data in the table body data input box 409, and clearing the operation 411; then, the server will perform corresponding processing on the target table based on the response to different operations, and then display the processed data of the target table on the web page.
[0104] In the present disclosure, the server may also convert the data of the target table into original data in the same format as the table to be processed for storage. Figure 5 In step S502, the server first determines the target table; in step S504, it determines whether the target table is the same as the table to be processed. If they are the same, step S506 is executed to use the data of the table to be processed as the original data, otherwise step S508 is executed; in step S508, based on the mapping relationship set, the corresponding header data of each mapping relationship in the mapping relationship set is determined as the type name of the table body data corresponding to each mapping relationship, then the table body data of the target table is traversed, and each row of data in the target table is converted into data in the same format as the table to be processed as the original data.
[0105] The target table determined by the server may be a table on a web page generated based on the table to be processed, or may be a modified table obtained by further modifying the generated table after the table on the web page is generated based on the table to be processed, or may be an edited table obtained by further editing the generated table after the table on the web page is generated based on the table to be processed. The original data may be data in the same format as the table to be processed after conversion based on the target table.
[0106] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0107] Furthermore, in an exemplary embodiment of the present disclosure, a table generating device is also provided.
[0108] Figure 6 FIG. 1 schematically shows a block diagram of a table generating device according to an exemplary embodiment of the present disclosure. Figure 6According to an exemplary embodiment of the present disclosure, a table generating device 600 may include: a table acquiring module 601 , a relationship determining module 603 , an input box generating module 605 , and a table generating module 607 .
[0109] Among them, the table acquisition module 601 is used to acquire the table to be processed, wherein the table to be processed includes header data and body data; the relationship determination module 603 is used to determine the mapping relationship between each type of data in the header data and the body data corresponding to each type of data, as a mapping relationship set; the input box generation module 605 is used to generate a data input box corresponding to the table to be processed according to the mapping relationship set and the number of rows of the body data; the table generation module 607 is used to input the header data and the body data into the data input box corresponding to the table to be processed based on the mapping relationship set to generate a target table.
[0110] According to another embodiment of the present disclosure, Figure 7 Compared with the table generating device 600 , the table generating device 700 further includes: an identification determining module 702 and a column control generating module 704 .
[0111] The identifier determination module 702 is used to determine the identifier of each row of data in the table body data; the column control generation module 704 is used to generate a row deletion control corresponding to the identifier of each row of data based on the identifier of each row of data and the number of rows of the table body data.
[0112] According to another embodiment of the present disclosure, Figure 8 Compared with the table generating device 600 , the table generating device 800 further includes: a quantity determining module 801 and a row control generating module 803 .
[0113] Among them, the quantity determination module 801 is used to determine the number of data types in the header data as the number of columns; the row control generation module 803 is used to generate a column deletion control corresponding to each mapping relationship in the mapping relationship set according to the mapping relationship set and the number of columns.
[0114] According to another embodiment of the present disclosure, the mapping relationship set includes a mapping identifier of each mapping relationship, referring to Fig. 9 Compared with the table generating device 600 , the table generating device 900 further includes: a deletion operation response module 902 and an input box processing module 904 .
[0115] Among them, the deletion operation response module 902 is used to respond to the column deletion operation of the target table, determine the mapping relationship corresponding to the deletion column operation, as the deletion column mapping relationship; the input box processing module 904 is used to delete the data input box corresponding to the deletion column mapping relationship in the target table based on the deletion column mapping relationship.
[0116] According to another embodiment of the present disclosure, the delete operation response module 902 may be configured to execute: responding to a touch operation on a column delete control in a target table, determining a mapping relationship corresponding to the touch operation on the column delete control as a delete column mapping relationship.
[0117] According to another embodiment of the present disclosure, the table generating device 600 further includes: a quantity recording module, which can be configured to execute: determining the expression type of each type of data in the header data, and recording the number of the expression types; an input box determining module, which can be configured to execute: generating a data input box corresponding to each mapping relationship in the mapping relationship set based on the mapping relationship set and the number of expression types.
[0118] According to another embodiment of the present disclosure, the table generation device 600 also includes: an add operation response module, which can be configured to execute: in response to the add column operation of the target table, add a mapping relationship to the mapping relationship set, and obtain a target column mapping relationship; an add column processing module, which can be configured to execute: based on the target column mapping relationship, add a data input box corresponding to the target column mapping relationship and a column deletion control corresponding to the target column mapping relationship in the target table.
[0119] According to another embodiment of the present disclosure, the table generating apparatus 600 further includes: a table conversion module, which may be configured to execute: in response to a clearing operation of clearing the target table, converting the target table into an empty table with preset data input boxes.
[0120] According to another embodiment of the present disclosure, the table generation device 600 also includes: a modified data determination module, which can be configured to execute: upon receiving a data modification instruction of a target data input box, determine the modified data corresponding to the data modification instruction; and a table determination module, which can be configured to execute: replacing the data of the target data input box with the modified data, and determining a modified target table.
[0121] The specific details of each module / unit in the above device have been described in detail in the embodiment of the method part, so they will not be repeated here.
[0122] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0123] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0124] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0125] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present invention will be described. Fig.10 The electronic device 1000 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0126] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010), and a display unit 1040.
[0127] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps: Figure 1 Steps S102 to S108 are shown.
[0128] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .
[0129] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0130] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0131] The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to communicate with the electronic device 1000, and / or may communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0132] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0133] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0134] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0135] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0136] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A table generation method, characterized in that: The table generation method comprises: Obtaining a table to be processed, wherein the table to be processed includes table header data and table body data; Determine a mapping relationship between each type of data in the table header data and table body data corresponding to each type of data, and obtain a mapping relationship set; Generate a data input box corresponding to the table to be processed according to the mapping relationship set and the number of rows of the table body data; Based on the mapping relationship set, the table header data and the table body data are input into the data input box corresponding to the table to be processed to generate a target table, and the target table is displayed on a web page; The table header data is stored in an empty array of Headers, the table body data is stored in an empty array of Table, the mapping relationship set is stored in an empty array of Column, and the data in the Column array, the Headers array, and the Table array are arranged in index order.
2. The table generation method according to claim 1, characterized in that: The table generation method further includes: Determine the identifier of each row of data in the table body data; Based on the identifiers of the respective rows of data and the number of rows of the table body data, row deletion controls corresponding to the identifiers of the respective rows of data are generated so as to perform deletion processing on the data input boxes corresponding to the identifiers of the respective rows of data.
3. The table generation method according to claim 1 or 2, characterized in that: The table generation method further includes: In response to a delete column operation of the target table, determining a mapping relationship corresponding to the delete column operation as a delete column mapping relationship; Based on the delete column mapping relationship, a data input box corresponding to the delete column mapping relationship in the target table is deleted.
4. The table generation method according to claim 3, characterized in that: The table generation method further includes: Determine the number of data types in the header data as the number of columns; A column deletion control corresponding to each mapping relationship in the mapping relationship set is generated according to the mapping relationship set and the number of columns.
5. The table generation method according to claim 4, characterized in that: In response to the column deletion operation of the target table, a mapping relationship corresponding to the column deletion operation is determined, where the column deletion mapping relationship includes: In response to a touch operation on a column delete control in the target table, a mapping relationship corresponding to the touch operation on the column delete control is determined as a delete column mapping relationship.
6. The table generation method according to claim 1 or 2, characterized in that: The table generation method further includes: Determine the expression type of each type of data in the header data, and record the number of the expression types; Based on the mapping relationship set and the number of expression types, a header data input box corresponding to each mapping relationship in the mapping relationship set is generated.
7. The table generation method according to claim 1 or 2, characterized in that: The table generation method further includes: In response to an add column operation of the target table, determining a mapping relationship corresponding to the add column operation, and obtaining a target column mapping relationship; Based on the target column mapping relationship, a data input box corresponding to the target column mapping relationship and a column deletion control corresponding to the target column mapping relationship are added to the target table.
8. The table generation method according to claim 1 or 2, characterized in that: The table generation method further includes: In response to a clearing operation of clearing the target form, the target form is converted into an empty form with preset data input boxes.
9. The table generation method according to claim 1 or 2, characterized in that: The table generation method further includes: In case of receiving a data modification instruction of a target data input box, determining modification data corresponding to the data modification instruction; The data in the target data input box is replaced with the modified data to determine the modified target table.
10. A table generating device, characterized in that: The table generating device comprises: A table acquisition module, used to acquire a table to be processed, wherein the table to be processed includes table header data and table body data; A relationship determination module, used to determine a mapping relationship between each type of data in the header data and the table body data corresponding to each type of data, as a mapping relationship set; An input box generation module, used to generate a data input box corresponding to the table to be processed according to the mapping relationship set and the number of rows of the table body data; A table generation module, for inputting the table header data and the table body data into a data input box corresponding to the table to be processed based on the mapping relationship set, to generate a target table, wherein the target table is displayed on a web page; The table header data is stored in an empty array of Headers, the table body data is stored in an empty array of Table, the mapping relationship set is stored in an empty array of Column, and the data in the Column array, the Headers array, and the Table array are arranged in index order.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the table generation method according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the table generation method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Table rule generation method and apparatus
CN107992458A
Table generation method and device, electronic equipment and computer readable storage medium
CN111695330A
