CN118093610A - Data editing method, device, equipment and storage medium - Google Patents

Data editing method, device, equipment and storage medium Download PDF

Info

Publication number
CN118093610A
CN118093610A CN202410290387.2A CN202410290387A CN118093610A CN 118093610 A CN118093610 A CN 118093610A CN 202410290387 A CN202410290387 A CN 202410290387A CN 118093610 A CN118093610 A CN 118093610A
Authority
CN
China
Prior art keywords
data
cell
data table
target
spliced
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.)
Pending
Application number
CN202410290387.2A
Other languages
Chinese (zh)
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.)
Wuming Technology Hangzhou Co ltd
Original Assignee
Wuming Technology Hangzhou 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 Wuming Technology Hangzhou Co ltd filed Critical Wuming Technology Hangzhou Co ltd
Priority to CN202410290387.2A priority Critical patent/CN118093610A/en
Publication of CN118093610A publication Critical patent/CN118093610A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a data editing method, a device, equipment and a storage medium, and relates to the technical field of data processing. The specific implementation scheme is as follows: responding to a display instruction aiming at the data content of the target data table, and displaying a spliced data table which is spliced based on the target data table and at least one data table with an association relation with the target data table; responding to the editing operation for the first cell in the spliced data table, and acquiring the editing content in the first cell and the first basic information corresponding to the cell; determining a second cell based on the first basic information; updating data in the second cell based on the edited content and updating the splice data table based on the updated data; and updating the data in the cells associated with the third cell in the spliced data table based on the data in the third cell in which the updating occurs in the spliced data table. Therefore, by the scheme, the editing efficiency can be improved, and the data accuracy can be ensured.

Description

Data editing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data editing method, apparatus, device, and storage medium.
Background
In game development, a data table is an important component of game data management for storing various data in a game, including character attributes, item attributes, skill attributes, and the like. The game data is of a large variety and a large number, and is often required to be stored in a plurality of data tables in a scattered manner, and the plurality of data tables have an association relationship with each other. For example, if the data in data table a references the data in data table B and the data in data table a is relied upon by the data in data table C, data table B and data table C are data tables having an association relationship with data table a.
In the related art, editing of a data table is generally performed by a tool such as Excel (a kind of electronic form). When it is necessary to edit a plurality of data tables having an association relationship, a data maintainer needs to frequently switch between different data tables to edit the data tables one by one. In addition, after editing each data table, due to the association relationship between the data tables, the data maintainer also needs to manually check whether the associated data in each data table is kept synchronous, so as to ensure the accuracy of the data. Thus, editing efficiency is low, and data accuracy is difficult to ensure.
Disclosure of Invention
The embodiment of the invention aims to provide a data editing method, a device, equipment and a storage medium, so as to improve editing efficiency and ensure data accuracy. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a data editing method, including:
responsive to detecting a presentation instruction for the data content of the target data table, presenting the splice data table within a presentation interface; the spliced data table is spliced based on the target data table and at least one data table with an association relation with the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which data in the cell is derived;
Acquiring editing content in a first cell and first basic information corresponding to the first cell in response to detection of editing operation for the first cell in the spliced data table;
determining a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
updating the data in the second cell based on the editing content, and updating the spliced data table based on the updated data in the second cell;
And updating the data in the cells associated with the third cell in the spliced data table based on the data in the third cell updated in the spliced data table.
Optionally, the updating the spliced data table based on the updated data in the second cell includes:
If the second cell is a cell belonging to the target type, determining the data referenced by the updated data in the second cell as data to be utilized; replacing the data in the unit cell to be updated in the spliced data table by the data to be utilized; the data in the target type cells are used for referencing the data in other data tables, and the cells to be updated comprise the first cells and cells taking the data in the first cells as the row ids of the corresponding original cells;
and if the second cell is a cell which does not belong to the target type, replacing the data in the first cell in the spliced data table by using the updated data in the second cell.
Optionally, the cell associated with the third cell is: and referring to the cell of the data in the native cell corresponding to the third cell.
Optionally, the display instruction for the data content of the target data table is: a presentation instruction generated in response to the target id input in the configuration interface;
the target data table is a data table taking the target id as a key field;
The generation mode of the spliced data table comprises the following steps:
Determining line data in the target data table, wherein the line data takes the target id as line id, and the line data is taken as reference line data;
Searching a database for the data referenced by the reference line data and/or the data relied on by the reference line data;
And based on the reference line data and the searched line data, performing data splicing to obtain a spliced data table.
Optionally, in response to detecting the display instruction for the target data table, displaying the spliced data table in the display interface, including:
Determining, in response to a data presentation instruction for a target node in a tree structure displayed by a configuration interface, data associated with target data represented by the target node based on node information stored in the target node; the tree structure is used for representing the association relation between the line data of the data table stored in the database, each node in the tree structure is used for representing one line of data and is associated with node information, the node information comprises an identifier of the line data represented by the node and an identifier of the line data with the association relation with the line data represented by the node, and the target node is a node used for representing the line data in the target data table;
Constructing a spliced data table based on the target line data and the line data associated with the target line data;
And displaying the spliced data table in the display interface.
In a second aspect, an embodiment of the present application provides a data editing apparatus, including:
The display module is used for displaying the spliced data table in the display interface in response to detecting a display instruction aiming at the data content of the target data table; the spliced data table is spliced based on the target data table and at least one data table with an association relation with the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which the cell is derived;
The acquisition module is used for responding to the detection of the editing operation for the first cell in the spliced data table, and acquiring the editing content in the first cell and the first basic information corresponding to the first cell;
a determining module, configured to determine a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
the first updating module is used for updating the data in the second cell based on the editing content and updating the spliced data table based on the updated data in the second cell;
and the second updating module is used for updating the data in the cells associated with the third cells in the spliced data table based on the data in the third cells updated in the spliced data table.
Optionally, the first updating module includes:
The first updating sub-module is used for determining the data referenced by the updated data in the second cell as the data to be utilized if the second cell belongs to the cell of the target type; replacing the data in the unit cell to be updated in the spliced data table by the data to be utilized; the data in the target type cells are used for referencing the data in other data tables, and the cells to be updated comprise the first cells and cells taking the data in the first cells as the row ids of the corresponding original cells;
And the second updating sub-module is used for replacing the data in the first cell in the spliced data table by using the updated data in the second cell if the second cell does not belong to the cell of the target type.
Optionally, the cell associated with the third cell is: and referring to the cell of the data in the native cell corresponding to the third cell.
Optionally, the display instruction for the data content of the target data table is: a presentation instruction generated in response to the target id input in the configuration interface;
the target data table is a data table taking the target id as a key field;
The generation mode of the spliced data table comprises the following steps:
Determining line data in the target data table, wherein the line data takes the target id as line id, and the line data is taken as reference line data;
Searching a database for the data referenced by the reference line data and/or the data relied on by the reference line data;
and based on the reference line data and the searched reference line data, performing data splicing to obtain a spliced data table.
Optionally, the display module displays the spliced data table in the display interface in response to detecting the display instruction for the target data table, including:
Determining, in response to a data presentation instruction for a target node in a tree structure displayed by a configuration interface, data associated with target data represented by the target node based on node information stored in the target node; the tree structure is used for representing the association relation between the line data of the data table stored in the database, each node in the tree structure is used for representing one line of data and is associated with node information, the node information comprises an identifier of the line data represented by the node and an identifier of the line data with the association relation with the line data represented by the node, and the target node is a node used for representing the line data in the target data table;
Constructing a spliced data table based on the target line data and the line data associated with the target line data;
And displaying the spliced data table in the display interface.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
And the processor is used for realizing any one of the data editing methods when executing the program stored in the memory.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored therein, which when executed by a processor, implements any of the above-described data editing methods.
The embodiment of the invention has the beneficial effects that:
According to the scheme provided by the embodiment of the invention, the display instruction aiming at the data content of the target data table is detected, and the spliced data table obtained by splicing at least one data table based on the target data table and the data table with the association relation with the target data table is displayed in the display interface, so that the data content in the target data table and the data content in other data tables with the association relation with the data content in the target data table can be displayed in a concentrated manner. And in response to the editing operation for the first cell in the spliced data table, updating the original cell corresponding to the first cell based on the editing content in the first cell, and then updating the spliced data table displayed in the display interface according to the updated data in the original cell, so that the synchronization of the data in the spliced data table displayed in the display interface and the data stored in the spliced data table can be maintained when the original cell corresponding to the first cell is updated. Next, based on the data in the third cell in which the update occurs in the spliced data table, the data in the cell associated with the third cell in the spliced data table is updated. In this way, the data in the spliced data table and the cell associated with the third cell can be synchronized according to the update content in the spliced data table, so that the synchronous update of the associated data in the plurality of data tables can be realized. According to the scheme, the data in the cells associated with the edited cells in the spliced data table can be synchronously updated only by editing the spliced data table, so that synchronous updating of a plurality of data tables is realized. Therefore, the scheme can improve the editing efficiency and ensure the data accuracy.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
FIG. 1 is a flowchart of a data editing method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for generating a spliced data table according to an embodiment of the present invention;
FIG. 3 is a flowchart of a display manner of a spliced data table according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a manner of displaying a spliced data table in a display interface according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a target tree structure according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of another object tree structure according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data editing apparatus according to an embodiment of the present invention;
Fig. 8 is a block diagram of an electronic device implementing a data editing method provided by an embodiment of the present invention.
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. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
In the related art, editing of a data table is generally performed by a tool such as Excel. When it is necessary to edit a plurality of data tables having an association relationship, a data maintainer needs to frequently switch between different data tables to edit the data tables one by one. Therefore, the display interface needs to display a plurality of data tables, so that the interface is complex, the operation is not visual enough, and the use of data maintenance personnel is not facilitated, so that the editing efficiency is low. In addition, if a plurality of data tables are opened, the performance of the editor may be limited when the data tables are switched, and a situation of a jam or crash may easily occur when a large amount of data is edited. In addition, after editing each data table, since there is an association relationship between the data tables, the data maintainer also needs to manually check whether the associated data in each data table remains synchronized, and it is difficult to accurately check and manage the dependency and reference relationship between the data tables by manual checking, so that it is difficult to ensure the accuracy of the data.
In order to solve the above problems, the embodiments of the present invention provide a data editing method, apparatus, device, and storage medium, so as to improve editing efficiency and ensure data accuracy.
Next, a description is first given of a data editing method provided by an embodiment of the present invention.
The data editing method provided by the embodiment of the invention can be applied to a client. In a specific application, the client for implementing the data editing method application may be a client with data display and editing functions in the terminal device. In practical application, the terminal device may be: smart phones, tablet computers, desktop computers, and the like.
Specifically, the execution subject of the data editing method may be a data editing apparatus. For example, when the data editing method is applied to a terminal device, the data editing apparatus may be a plug-in running in a client, for example: and a plug-in for editing data in the client with data presentation and editing functions.
The data editing method provided by the embodiment of the invention can comprise the following steps:
Responsive to detecting a presentation instruction for the data content of the target data table, presenting the splice data table within a presentation interface; the spliced data table is spliced based on the target data table and at least one data table with an association relation with the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which the cell is derived;
Acquiring editing content in a first cell and first basic information corresponding to the first cell in response to detection of editing operation for the first cell in the spliced data table;
determining a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
updating the data in the second cell based on the editing content, and updating the spliced data table based on the updated data in the second cell;
And updating the data in the cells associated with the third cell in the spliced data table based on the data in the third cell updated in the spliced data table.
According to the scheme provided by the embodiment of the invention, the display instruction aiming at the data content of the target data table is detected, and the spliced data table obtained by splicing at least one data table based on the target data table and the data table with the association relation with the target data table is displayed in the display interface, so that the data content in the target data table and the data content in other data tables with the association relation with the data content in the target data table can be displayed in a concentrated manner. And in response to the editing operation for the first cell in the spliced data table, updating the original cell corresponding to the first cell based on the editing content in the first cell, and then updating the spliced data table displayed in the display interface according to the updated data in the original cell, so that the synchronization of the data in the spliced data table displayed in the display interface and the data stored in the spliced data table can be maintained when the original cell corresponding to the first cell is updated. Next, based on the data in the third cell in which the update occurs in the spliced data table, the data in the cell associated with the third cell in the spliced data table is updated. In this way, the data in the spliced data table and the cell associated with the third cell can be synchronized according to the update content in the spliced data table, so that the synchronous update of the associated data in the plurality of data tables can be realized. According to the scheme, the data in the cells associated with the edited cells in the spliced data table can be synchronously updated only by editing the spliced data table, so that synchronous updating of a plurality of data tables is realized. Therefore, the scheme can improve the editing efficiency and ensure the data accuracy.
The following describes a data editing method provided by an embodiment of the present invention with reference to the accompanying drawings.
As shown in fig. 1, the data editing method provided by the embodiment of the present invention may include steps S101 to S105:
s101, in response to detection of a display instruction for the data content of the target data table, displaying the spliced data table in a display interface; the splicing data table is obtained by splicing at least one data table with an association relation with the target data table based on the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which data in the cell is derived;
In this embodiment, the target data table is a data table to be subjected to data display, and may be any data table stored in a database, which is named as a target data table, and is not limited in any way. The display instruction for the data content of the target data table may be a display instruction for a certain line of data in the target data table, and accordingly, the spliced data table displayed in response to the splicing instruction is spliced based on the line of data and at least one line of data having an association relationship with the line of data; the display instruction for the data content of the target data table may also be a display instruction for a plurality of rows of data in the target data table, and accordingly, the spliced data table displayed in response to the splicing instruction is spliced based on the plurality of rows of data and the data having an association relationship with each row of data in the plurality of rows of data. In addition, the display instruction for the data content of the target data table may also be a display instruction for a predetermined data column in the one or more rows of data, where it is reasonable that the spliced data table displayed in response to the display instruction is spliced based on the data in the predetermined data column and the data having an association relationship with the data in the predetermined data column.
It will be appreciated that the number of game data is enormous, there are cases where there are cross-table stores, and there are relationships between multiple data tables, that is, there are dependency and reference relationships between the data stored in each data table. In order to improve editing efficiency, when a display instruction for the data content of the target data table is detected, a spliced data table obtained by splicing at least one data table based on the target data table and having an association relationship with the target data table is displayed in the display interface. In this way, the data editing can be performed subsequently by directly operating on the spliced data table without frequently switching between a plurality of tables to edit the data table one by one.
When the target data table and at least one data table with an association relation with the target data table are spliced, the information of the original cell from which the data in each cell is derived in the spliced data table obtained by splicing can be recorded and used as the basic information corresponding to the cell. The information of the native cell from which the data in each cell originates may include: the table name, field name, and line id (identity, serial number) to which the native cell from which the data in the cell is derived belongs, where the line id is the id of the line. Thus, when the spliced data table is edited later, the original cell corresponding to the cell can be rapidly determined according to the edited cell.
Illustratively, the data table having an association with the target data table includes a reference data table referenced by the target data table and a dependent data table on which the target data table depends. The association between the data tables is exemplarily described below in conjunction with tables 1 to 3:
TABLE 1
id Name of the name Initial equipment
0301 A_01 28090001
0302 A_02 28090003
0303 A_03 28090002
TABLE 2
id Initial equipment
28090001 B_01
28090003 B_02
28090002 B_03
TABLE 3 Table 3
id Character numbering
0001 0301
0002 0302
0003 0303
As can be seen from the above tables 1 to 3, the data in the "id" field of table 2 is referenced by the data in the "initial setup" field of table 1, and at this time, the data in table 2 is referenced by table 1, and the reference table referenced by table 1 is shown in table 2; and the data in the "id" field in table 1 is stored in the "role number" field in table 3, at this time, table 1 depends on the data in table 3, and table 3 is the dependency table on which table 1 depends. That is, tables 2 and 3 are data tables having an association relationship with table 1.
The manner in which the native cells corresponding to the cells compiled in the splice data table are determined is described below in connection with the exemplary description of Table 4. If the presentation instruction for the data content of the target data table is the presentation instruction for the "id" field and the "initial equipment" field of table 1, and the spliced data table presented in the presentation interface in response to the presentation instruction is as shown in table 4:
TABLE 4 Table 4
Table 1: id (id) Table 1: initial equipment Table 2: initial equipment Table 3: id (id)
0301 28090001 B_01 0001
0302 28090003 B_02 0002
0303 28090002 B_03 0003
The splice data table shown in table 4 is obtained by splicing the "id" field and the "initial equipment" field in table 1, the "initial equipment" field in table 2, and the "id" field in table 3. The "initial setup" field in table 1 at this time corresponds to "table 1" in table 4: the initial setup "field, the" id "field in table 3 corresponds to" table 3 "in table 4: id "field.
It can be understood that the native cells from which each cell in the spliced data table is derived may be cells in the target data table, or may be cells in the data table having an association relationship with the target data table. For example, as can be seen from table 4, "table 2: the "b_01" in the field of the initial equipment "is derived from the data in the cell a with the field name" initial equipment "and the line id" 28090001 "in table 2, and the cell a in table 2 is the native cell corresponding to the cell in table 4 where the" b_01 "is located. In table 4, "table 3: the "0001" in the id "field is derived from the data in the cell B in the field named" id "and the row id" 0001 "in table 3, and then the cell B in table 3 is the native cell of the cell in which" 0001 "is located in table 4. At the time of splicing, the table name, field name, and row id of the cell from which the data in each cell in table 4 is derived are recorded as the basic information corresponding to the cell in table 4.
It should be noted that, for the sake of clear layout of the solution, in the following embodiments, an implementation manner of displaying the spliced data table in the display interface in response to detecting the display instruction for the data content of the target data table is described, which is not repeated here.
S102, acquiring editing content in a first cell and first basic information corresponding to the first cell in response to detection of editing operation for the first cell in the spliced data table;
In this embodiment, the first cell may be any cell in the spliced data table that is undergoing editing operation, and the designation of the first cell is not limited in any way. It can be understood that, since the spliced data table records information of the native cell from which the data in each cell originates when the spliced data table is spliced, when an editing operation for a first cell in the spliced data table is detected, editing content in the first cell can be acquired, and first basic information corresponding to the first cell can be acquired from a storage address where basic information of each cell is recorded.
S103, determining a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
Illustratively, according to the table name, the field name and the row id included in the first basic information, each data table stored in the database may be traversed to find out a cell whose table name, field name and row id are consistent with the first basic information, as the second cell.
S104, updating data in the second cell based on the editing content, and updating the spliced data table based on the updated data in the second cell;
In this embodiment, the obtained editing content is used to replace the data in the second cell, so as to update the data in the second cell, that is, update the data in the native cell corresponding to the edited cell. After updating the data in the second cell, the splice data table may be updated based on the updated data in the second cell, so as to achieve synchronization of the stored data and the data displayed in the display interface.
Optionally, in an implementation, updating the spliced data table based on the updated data in the second cell may include steps A1-A2:
A1, if the second cell is a cell belonging to the target type, determining the data referenced by the updated data in the second cell as data to be utilized; replacing data in the spliced data table and the cells to be updated by the data to be utilized; the data in the target type cells are used for referencing the data in other data tables, and the cells to be updated comprise first cells and cells taking the data in the first cells as the row ids of the corresponding original cells;
In this implementation, the data in the cells of the target type is used to reference the data in other data tables, for example, the data stored in each cell under the "initial equipment" field in table 1 is used to reference the data in table 2, where each cell under the "initial equipment" field in table 1 is a cell of the target type.
For example, if the spliced data table is shown in table 4, the editing operation is performed for the cell where "28090001" is located and the editing content is "28090003", and at this time, the cell where "28090001" is located in table 4 is the first cell. And determining a second cell as a cell where 28090001 is located in table 1 according to the first basic information corresponding to the first cell recorded during splicing. At this time, the second cell is a cell belonging to the target type. After updating the data in the second cell based on the editing content, the data in the spliced data table, the first cell and the cell with the data in the first cell as the row id of the corresponding native cell are replaced by using the data referenced by the updated data in the second cell as the data to be utilized, that is, the data with the row id of '28090003' in table 2 is used as the data to be utilized, and the data in the cell to be updated in table 4 is replaced. The cells to be updated include cells in which "28090001" in table 4 is located, and cells in which "28090001" is used as row id for the corresponding native cells, i.e. cells in which "b_01" in table 4 is located. Thus, the updated splice data table is shown in table 5:
TABLE 5
id Reference id Initial equipment Dependent id
0301 28090003 B_02 0001
0302 28090003 B_02 0002
0303 28090002 B_03 0003
A2, if the second cell is not of the target type, replacing the data in the first cell in the spliced data table by the updated data in the second cell.
In this implementation manner, if the second cell is a cell that does not belong to the target type, the data in the first cell in the spliced data table is directly replaced by the updated data in the second cell.
For example, if the spliced data table is shown in table 4, the editing operation is performed for the cell where "b_01" is located and the editing content is "b_04", and at this time, the cell where "b_01" is located in table 4 is the first cell. And determining a second cell which is a cell where 'B_01' in the table 1 is located according to the first basic information corresponding to the first cell recorded during splicing, wherein the second cell is a cell which does not belong to the target type. At this time, after updating the data in the second cell based on the editing content, the updated data in the second cell is replaced with the data in the first cell in the spliced data table, and a new spliced data table is obtained as shown in table 6:
TABLE 6
id Reference id Initial equipment Dependent id
0301 28090003 B_04 0001
0302 28090003 B_02 0002
0303 28090002 B_03 0003
S105, updating the data in the cells associated with the third cell in the spliced data table based on the data in the third cell updated in the spliced data table.
It is understood that, after the spliced data table is updated in step S104, the third cell updated in the spliced data table may include only the first cell, or may include the first cell and other cells except the first cell. For example, when editing data in a cell of a target type in the spliced data table, the cell in the spliced data table, which is updated, includes a first cell and a cell with the data in the first cell as a row id of a corresponding native cell.
In this embodiment, the spliced data table is a data table utilized when splicing the spliced data table. After updating the spliced data table displayed in the display interface, the transmission modification can be performed again according to the data in the third cell updated in the spliced data table, namely, the data in the cell associated with the third cell in the spliced data table is modified. In this way, the data in the spliced data table and the cell associated with the third cell can be synchronized according to the update content in the spliced data table, so that the synchronous update of the associated data in the plurality of data tables can be realized.
Optionally, in one implementation, the cells associated with the third cell are: and referring to the cell of the data in the native cell corresponding to the third cell.
It will be appreciated that if the data in the third cell is updated, the native cell corresponding to the third cell may be determined according to the basic information corresponding to the third cell. At this time, the data in the cell referencing the data in the native cell corresponding to the third cell needs to be kept in sync with the data in the native cell corresponding to the third cell to ensure the accuracy of the data. Accordingly, the data in the cell associated with the third cell may be updated based on the data in the third cell in which the update occurs in the spliced data table, i.e., the data in the cell referencing the data in the native cell corresponding to the third cell is updated to the data in the third cell. In this way, the data in the third cell which is updated in the data table can be synchronously updated by splicing the data in the third cell, so that the accuracy of the data is ensured.
According to the scheme provided by the embodiment of the invention, the display instruction aiming at the data content of the target data table is detected, and the spliced data table obtained by splicing at least one data table based on the target data table and the data table with the association relation with the target data table is displayed in the display interface, so that the data content in the target data table and the data content in other data tables with the association relation with the data content in the target data table can be displayed in a concentrated manner. And in response to the editing operation for the first cell in the spliced data table, updating the original cell corresponding to the first cell based on the editing content in the first cell, and then updating the spliced data table displayed in the display interface according to the updated data in the original cell, so that the synchronization of the data in the spliced data table displayed in the display interface and the data stored in the spliced data table can be maintained when the original cell corresponding to the first cell is updated. Next, based on the data in the third cell in which the update occurs in the spliced data table, the data in the cell associated with the third cell in the spliced data table is updated. In this way, the data in the spliced data table and the cell associated with the third cell can be synchronized according to the update content in the spliced data table, so that the synchronous update of the associated data in the plurality of data tables can be realized. According to the scheme, the data in the cells associated with the edited cells in the spliced data table can be synchronously updated only by editing the spliced data table, so that synchronous updating of a plurality of data tables is realized. Therefore, the scheme can improve the editing efficiency and ensure the data accuracy.
Optionally, in another embodiment of the present invention, the presentation instruction for the data content of the target data table is: a presentation instruction generated in response to the target id input in the configuration interface; the target data table is a data table taking a target id as a key field;
For example, in practical application, the data maintainer may open a configuration interface in the client for data presentation and editing, and the configuration interface may include an input box for inputting an id. A data maintainer needs to view a certain line data of a certain data table, and a line id of the line data in the data table can be input in the input box. At this time, the id input in the input box is the target id, and the client generates a presentation instruction in response to the target id input in the configuration interface, that is, generates a presentation instruction for row data in which the row id of the row is the target id, with respect to the data table in which the target id is the key field. Illustratively, the manner in which the target data table is determined based on the target id may be: traversing the data table stored in the database to find out the data table taking the target id as a key field as a target data table. Wherein, the key field is also called an id field, each data table has a unique id field, and each data in the data table has a unique row id.
Accordingly, in this embodiment, as shown in fig. 2, the generation manner of the spliced data table may include steps S201 to S203:
s201, determining line data taking a target id as a line id in a target data table as reference line data;
in this embodiment, an input box for inputting an id may be presented in the configuration interface. And traversing the target data table in response to a display instruction generated by the target id input in the configuration interface so as to find out line data taking the target id as line id in the target data table as reference line data.
S202, searching a database for the line data referenced by the reference line data and/or the line data relied on by the reference line data;
For example, the data referenced by the reference field may be determined as the data referenced by the reference row from the reference field in the reference row data that characterizes the data referenced by the data in the other data tables. That is, the field in the reference line data, except the key field, in which the id is stored is the reference field of the reference line data, and the line data with the id of the reference field of the reference line data as the line id is the line data referenced by the reference line data.
For example, if the target data table is provided with a presentation column, the row data referenced by the reference field in the presentation column of the reference row data may be determined as the row data referenced by the reference row. The setting mode of the display column of the target data table may be: the data maintainer opens a configuration interface in the client for data display and editing, the configuration interface also comprises an input box for inputting table names, after the table names of the target data table are input in the input box, the field names of all columns of the target data table are output and displayed on the configuration interface, the display form of each field name is a field name+a check box, the data maintainer can check the check box of each field name, and the columns with the field names corresponding to the checked check boxes are display columns.
In addition, the line data of the line id storing the reference line data except the key field can be searched for as the line data on which the reference line data depends by traversing the line data in each data table stored in the database.
And S203, performing data splicing based on the reference line data and the searched line data to obtain a spliced data table.
For example, the reference line data and all the contents in the searched line data can be subjected to data splicing to obtain a spliced data table; and the reference line data and part of the content in the searched line data can be subjected to data splicing to obtain a spliced data table, which is reasonable. In practical application, after the configuration interface detects the target id input in the input box, each field name of the reference line data corresponding to the target id and each field name of the line data referenced and/or relied on by the reference line data can be output in the configuration interface, and the display form of each field name is a field name+a check box. The data maintainer can select the field names to be displayed from the field names output and displayed in the configuration interface according to the service requirements. In this way, the column with the field name corresponding to the checked frame is the display column, and the data belonging to the display column in all the row data searched based on the target id is spliced into one row of data, so as to obtain the spliced data table.
In addition, it should be noted that after the data is spliced, other ids may be continuously input as new target ids in the input box of the configuration interface, and the steps of steps S201 to S202 may be repeated to find out the reference line data corresponding to the new target ids and the line data referenced and/or relied on by the reference line data. And then repeating the step S203 to splice the data to obtain a spliced data table.
Therefore, through the scheme, the associated data contents in the data tables can be displayed in a centralized manner, so that the data tables do not need to be opened for editing when the data is edited, only the editing operation is needed to be performed in the spliced data tables, and the editing efficiency is improved.
Optionally, in another embodiment of the present invention, as shown in fig. 3, in response to detecting the display instruction for the target data table in step S101, displaying the spliced data table in the display interface may include steps S301 to S303:
S301, determining data associated with target data represented by the target node based on node information stored in the target node in response to a data display instruction for the target node in the tree structure displayed by the configuration interface; the method comprises the steps that a tree structure is used for representing the association relation between data of a data table stored in a database, each node in the tree structure is used for representing one line of data and is associated with node information, the node information comprises an identifier of the line data represented by the node and an identifier of the line data with association relation with the line data represented by the node, and a target node is a node used for representing the line data in the target data table;
In this embodiment, a tree structure representing an association relationship between rows of data tables stored in a database may be displayed in the configuration interface, and each node in the tree structure is used to represent a row of data and associated with node information. The node information of each node comprises an identifier of the line data represented by the node and an identifier of the line data having an association relation with the line number represented by the node. In response to a data presentation instruction for a target node in a tree structure displayed by a configuration interface, target row data characterized by the target node and row data associated with the target row data may be determined based on node information stored in the target node.
For example, the line id of the line data represented by the target node, and the line id of the line data referenced by the line data and/or the line id of the line data on which the line data depends may be used as node information of the node. In practical application, the data maintainer can click a certain node of the display tree structure in the configuration interface, the clicked node is a target node, and a data display instruction aiming at the target node is triggered. At this time, based on the node information stored in the target node, the line data having the line id may be determined according to each line id included in the node information, so that the line data associated with the target line data characterized by the target node may be determined.
S302, constructing a spliced data table based on target line data and line data associated with the target line data;
in this embodiment, the target line data and the line data associated with the target line data may be spliced into one line of data, to obtain the spliced data table.
S303, displaying the spliced data table in the display interface.
In this embodiment, after the spliced data table is constructed, the spliced data table may be displayed in the display interface. For example, a table interface may be provided in a client for data presentation and editing by using WPF (Windows Presentation Foundation, user interface framework) interface technology, and the spliced data table is presented in an interface, which is a presentation interface.
Therefore, through the scheme, node information is stored in each node of the tree structure, and the target line data represented by the target node and the spliced data table obtained by splicing the line data associated with the target line data can be displayed in the display interface by clicking the target node of the tree structure. In this way, a centralized presentation of the associated data in the respective data tables is achieved.
Optionally, in another embodiment of the present invention, the presentation instruction for the data content of the target data table is: responding to opening the target data table, and triggering a display instruction aiming at the data content of the target data table;
accordingly, in this embodiment, as shown in fig. 4, the manner of displaying the spliced data table in the display interface may include S401-S404:
s401, acquiring a data table identifier of a target data table;
In this embodiment, a user may open a target data table in a client, and trigger a display instruction for data content of the target data table, so that the client detects the display instruction and may obtain a data table identifier of the target data table indicated by the display instruction. Illustratively, the data table identification may be a data table name, a data table storage path, and so forth.
S402, determining a tree structure of which the root node is a data table identifier of the target data table as a target tree structure; wherein, each data table corresponds to a tree structure, the data table of each data table is identified as a root node, the tree structure of each data table comprises a first type node representing a field in the data table, and when the field represented by any first type node is an index field, a second type node associated with the first type node represents the fields in other data tables except the data table, which are referenced by the index field;
In this embodiment, the data maintainer may set a tree structure for each data table stored in the database in advance, where the tree structure corresponding to each data table uses the data table identifier of the data table as a root node, so that after the data table identifier of the target data table is obtained, the target tree structure corresponding to the target data table may be determined from the preset tree structures. That is, the tree structure identified by the root node for the data table of the target data table is the target tree structure corresponding to the target data table.
For example, if the root node of the tree structure 1 is the identifier a, the root node of the tree structure 2 is the identifier B, and if a data presentation instruction for a target data table identified by the data table identifier a is detected, it may be determined that the tree structure 1 is a target tree structure corresponding to the target data table.
Each data table corresponds to a tree structure which comprises first class nodes representing fields in the data table, and when the fields represented by any first class node are index fields, the second class nodes associated with the first class nodes represent the fields in other data tables except the data table, which are referenced by the index fields. It will be appreciated that when the field characterized by the first class node is an index field, by associating the first class node with the second class node in the tree structure, the data reference relationship of the index field in the target data table with the fields in the other data tables is set, i.e. the index field references the field characterized by its associated second class node.
For example, if field 1 and field 2 are included in the target data table a, and field 1 is an index field referencing field 3 in data table B, then the relevant technician may construct the target tree structure as shown in fig. 5. The data table of the target tree structure, which is identified as a root node, is characterized in that a next level node of the root node comprises a first type node used for representing the field 1 and a first type node used for representing the field 2. Since field 1 is an index field, a first type node used to characterize field 1 is associated with a second type node, which is used to characterize field 3 in data table B.
S403, acquiring first data to be displayed from a target data table based on a field represented by a first type node in the target tree structure, and acquiring second data to be displayed from other data tables based on a field represented by a second type node in the target tree structure;
In this embodiment, after determining the target tree structure in step S402, the fields represented by the first type nodes and the fields represented by the second type nodes in the target tree structure may be determined. For example, if the target tree structure is shown in fig. 5, it may be determined that the fields represented by the first type node are field 1 and field 2, and the field represented by the second type node is field 3 in the target tree structure.
It can be appreciated that, since the fields characterized by the nodes of the first class in the target tree structure are fields in the target data table, the first data to be displayed can be obtained from the target data table. The first data to be displayed is a field value of a field represented by the determined first type node in a target data table. Because the second type node in the target tree structure is a node corresponding to a field in other data tables except the data table, which is referred by the index field, and the field value of the index field is an index and is used for pointing to a storage position in the other data tables, the second data to be displayed can be obtained from the other data tables. The second data to be displayed is the field value of the field represented by the second class node associated with the index field in other data tables pointed by the field value of the index field.
Optionally, in one implementation, based on a field characterized by a first type of node in the target tree structure, obtaining the first data to be exposed from the target data table may include: and reading the field values of the fields represented by the nodes of the first type in the determined target tree structure from the target data table to obtain first data to be displayed.
It can be understood that, because the field represented by the first type node is a field in the target data table, the field value of the field represented by each first type node can be directly read from the target data table to obtain the first data to be displayed.
Optionally, in one implementation, based on the field characterized by the second class node in the target tree structure, the obtaining the second data to be displayed from the other data table may include steps B1-B3:
B1, determining an index field represented by a first class node associated with a second class node in the target tree structure as a target index field;
b2, determining a data table to be accessed in the other data tables and a data row to be accessed in the data table to be accessed according to each field value in the target index field;
And B3, reading the field value of the field represented by the second class node associated with the target index field from the data row of the data table to be accessed to obtain second data to be displayed.
It can be understood that, because in the target tree structure, the field represented by the second class node associated with the first class node of each represented index field is the field referenced by the index field, and each field value in the index field is the index, the actual service data corresponding to the field value of each index field is the field value belonging to the field referenced by the index field in the storage location represented by the field value; therefore, in this implementation manner, the index field represented by the first class node associated with the second class node may be determined first as the target index field, so that the data table to be accessed may be determined from other data tables according to the field value of the target index field later, and further the second data to be displayed may be obtained from the data table to be accessed.
Since the field value of the index field is an index for pointing to a storage location in another data table, the data table to be accessed in another data table and the data row to be accessed in the data table to be accessed can be determined according to the field value. Therefore, the field value of the field represented by the second class node associated with the target index field can be read from the data row to be accessed in the data table to be accessed, so that the second data to be displayed can be obtained.
For example, if there are several pieces of data in the target data table a, one piece of data may be used as a data row, where each piece of data includes a field 1 and a field 2, and the field 1 is an index field, and references a field 3 in other data tables. The target tree structure corresponding to the target data table a is shown in fig. 5, and the second type of nodes in the target tree structure are nodes for representing the field 3. To obtain the second data to be presented, a target index field, i.e., field 1, characterized by the first class node with which the second class node is associated may be determined. Then, if the field 1 in the target data table a corresponds to two field values, namely, the field value of the field 1 in the first piece of data in the target data table a is the index 1; and, the field value of field 1 in the second piece of data belonging to the target data table a is index 2. If the storage position indicated by the index 1 is the 3 rd data in the data table B, the storage position indicated by the index 2 is the 5 th data in the data table B; the field value belonging to field 3 in the 3 rd data may be read from the data table B, the read field value is the actual service data corresponding to the index 1, and the field value belonging to field 3 in the 5 th data is read from the data table B. The field value belonging to the field 3 in the obtained data table B is the second data to be displayed.
In addition, it should be noted that, a field value included in the target index field may have a null value, and when the field value is a null value, the field value does not have corresponding service data.
Illustratively, in an alternative implementation, the field value of the index field is comprised of a data table identification and a row number identification; the row number identification is an identification for representing a data row in the data table;
Accordingly, in the present implementation manner, the determining the data table to be accessed in the other data tables according to the field value in the step B2, and the data row to be accessed in the data table to be accessed may include steps B21-B22:
B21, determining the data table with the data table identifier in the field value in the other data tables according to the data table identifier in the field value to obtain a data table to be accessed;
And B22, determining the data row indicated by the row number identification in the field value in the data table to be accessed, and obtaining the data row to be accessed.
In this implementation, since the field value of the index field may be composed of a data table identifier and a line number identifier. Wherein the line number is an identification for characterizing a data line in a data table, the data line in the data table may be what data in the data table, or if the data table type is a table, the line number may characterize what line in the table, and so on.
Illustratively, if a field value of the index field is 28090001 and the first four bits in the field value are identified as a data table, the last four bits are identified as a row number, characterizing the first row of data in the data table identified as 2809. The data table to be accessed, identified as 2809, may be found from the data table identification included in the field value. Then, the field value of the field represented by the second class node associated with the index field in the first row of data is read from the to-be-accessed data table identified as 2809, so as to obtain second to-be-displayed data.
S404, based on the first data to be displayed and the second data to be displayed, displaying a spliced data table in a display interface.
It can be understood that, after the first data to be displayed and the second data to be displayed are obtained in step S403, the first data to be displayed and the second data to be displayed are displayed in a centralized manner in the display interface, so as to display the spliced data table in the display interface. Because the second data to be displayed is the field value of the field in the other data table referenced by the index field in the target data table, in the embodiment, by displaying the first data to be displayed and the second data to be displayed in the interface in a centralized manner, the user does not need to open the other data table to view all the data with the association relationship with the target data table, the data viewing efficiency is improved, and the user can edit all the data with the association relationship with the target data table conveniently.
Optionally, in an implementation manner, based on the first data to be displayed and the second data to be displayed, displaying the spliced data table in the display interface may include steps C1-C2:
C1, constructing the spliced data table according to the first data to be displayed and the second data to be displayed; each column in the spliced data table is used for representing field values related to the same field in the first data to be displayed and the second data to be displayed and the same field;
and C2, displaying the spliced data table in a display interface.
In this embodiment, after the first data to be displayed and the second data to be displayed are obtained, the first data to be displayed and the second data to be displayed may be spliced in a table, that is, in the first data to be displayed and the second data to be displayed, the field value of the same field and the field are used as the same column data, so as to construct the spliced data table. The target data table is then presented within a presentation interface. For example, if the first data to be presented includes field value 11 and field value 21 in field 1, and field value 21 and field value 22 in field 2, the second data to be presented includes field value 31 and field value 32 in field 3. A data table may be constructed as shown in table 7 in which each column of data is a field value corresponding to the same field and the field.
TABLE 7
Field 1 Field 2 Field 3
Field value 11 Field value 21 Field value 31
Field value 21 Field value 22 Field value 32
It can be understood that the acquired first data to be displayed and the second data to be displayed are displayed in a centralized manner in the spliced data table, so that a user can more intuitively view the complete data related to the target data table. When the spliced data table is displayed, the field value belonging to the index field in the first data to be displayed, and the field value belonging to the field referenced by the index field in the storage position corresponding to the field value of the index field can be displayed in the same row, so that a user can conveniently and quickly see specific service data corresponding to the field value of the index field.
Therefore, according to the scheme, the data associated with the target data table can be displayed in a centralized manner by opening the target data table, so that a plurality of data tables are not required to be opened for editing when the data is edited later, only the editing operation is required to be performed in the spliced data table, and the editing efficiency is improved.
Optionally, in another embodiment of the present invention, on the basis of the embodiment shown in fig. 4, a third type of node may be further included between the root node and the first type of node of the target tree structure; the third class node is used for representing preset field categories, different third class nodes are used for representing different field categories, and the next level node of the third class node representing any field category comprises: characterizing a first class node of a field belonging to the field class;
In this embodiment, a third class node is further included between the root node and the first class node of the target tree structure. The third class node is used for representing preset field types, the different third class nodes are used for representing different field types, and the different field types correspond to different fields. As shown in fig. 6, in an exemplary target tree structure corresponding to the target data table, the target tree structure includes third class nodes representing field class 1 and field class 2, a next level node corresponding to the third class node of field class 1 includes first class nodes representing fields 1 and 2 belonging to the field class 1, and a next level node corresponding to the third class node of field class 2 includes first class nodes representing fields 4 and 5 belonging to the field class 2. The field 1 and the field 5 are index fields, which are associated with the second class node, i.e. the field 1 refers to the field 3 in the other data table, and the field 5 refers to the field 6 in the other data table.
It will be appreciated that when the data maintainer builds the target tree structure, each field class may be set according to the service requirement. Accordingly, when the user opens any data table, a data display panel with a selection frame can be displayed in the appointed client, and the drop-down option of the selection frame comprises each field category, so that the user can select any field category in the selection frame, and therefore service data under the selected field category can be checked. For example, if the target data table includes four fields, namely, field 1, field 2, field 3 and field 4, the data maintainer may set a default class and a basic information class, where the default class may correspond to field 1, field 2, field 3 and field 4, and the basic information class may correspond to field 1 and field 2.
Accordingly, in this embodiment, before the step S403 obtains the first data to be displayed from the target data table based on the field characterized by the first type node in the target tree structure, and obtains the second data to be displayed from the other data table based on the field characterized by the second type node in the target tree structure, the method may further include:
in response to detecting a data presentation instruction for a target field class in the target data table, determining a third class of nodes in the target tree structure that characterize the target field class;
In this embodiment, when the user opens any data table in the specified client, a data display panel with a selection frame may also be displayed in the specified client, where the drop-down option of the selection frame includes each preset field category. If the user opens the target data table, a field type is selected in a selection frame in a data display panel displayed in the designated client, and the client detects a data display instruction aiming at the field type selected by the user in the target data table. The detected field category selected by the user is the target field category of the target data table, and at this time, a third type node representing the target field category can be determined from the target tree structure.
Accordingly, in the embodiment, the step S403 of obtaining the first data to be displayed from the target data table based on the field represented by the first class node in the target tree structure and obtaining the second data to be displayed from the other data table based on the field represented by the second class node in the target tree structure may include:
The method comprises the steps of obtaining first data to be displayed from the target data table based on a field represented by a next-level node of a third-class node representing the target field class, and obtaining second data to be displayed from the other data tables based on a field represented by a second-class node associated with the next-level node of the third-class node representing the target field class.
In this embodiment, after determining the third class node that characterizes the class of the target field, the first data to be displayed may be obtained from the target data table based on the field that is characterized by the next node of the third class node in the target tree structure. The next node of the third class node is the first class node. It should be noted that, the manner of acquiring the first data to be displayed from the target data table based on the fields represented by the first class nodes and acquiring the second data to be displayed from the other data tables based on the fields represented by the second class nodes associated with the first class nodes may refer to the descriptions in the above embodiments, and will not be repeated herein.
For example, if the target tree structure is shown in fig. 6, if the target field type is field type 2, and the fields represented by the next level node of the third class node representing the target field type are field 4 and field 5, then the field 4 and the field 5 are the fields represented by the first class node to be subjected to data presentation. It can be understood that by setting the third class node representing the preset field class, the user can select various field classes according to the need to view the service data under different field classes, thereby improving the flexibility of the display of the spliced data table.
Therefore, the flexibility of the display of the spliced data table can be improved through the scheme.
The present invention will be better understood, and a data editing method provided by an embodiment of the present invention will be described below with reference to a specific example.
The data editing method provided in this example is implemented on the basis that the associated data in the plurality of data tables are displayed in one table in a centralized manner, and a process flow of displaying the associated plurality of data tables in a centralized manner is first described below.
1. The data maintainer opens the client for data presentation and editing, and after determining that a certain data table is a base table (corresponding to the target data table above), the presentation column of the base table may be set first. For example, the configuration interface may include an input box for inputting a table name, after the table name of the base table is input in the input box, outputting, at the configuration interface, field names displaying all columns of the base table, where each field name is displayed in a form of a field name+a checkbox, and the data maintainer may perform a checkbox for each field name, where a column having a field name corresponding to the checked checkbox is displayed. The display columns need to contain a column of id columns storing id data, that is, the field name "id" is checked by default, and each data in the id columns is determined without repetition. Wherein the determined base table is typically the data table most associated with the other data tables.
2. The data maintainer opens the configuration interface in the client, inputs an id (corresponding to the target id above) in the basic table in an input box of the configuration interface, and in response to detecting the id input in the input box, the client searches each data table stored in the database for the data corresponding to the id and all the line data referenced and relied on by the data. The flow of searching the row data corresponding to the id and all row data referenced and relied on by the row data is as follows (1) - (3):
(1) Searching for a line data (corresponding to the above reference line data) having the id input in the input box as a line id;
(2) Searching the row data indicated by the reference field of the other data table in the display column of the row data in the step (1) to serve as the row data referenced by the searched row data in the step (1);
(3) Searching data in all data tables except the basic table, and finding the data column in which the data of the id input in the input box is stored as the data on which the found line data in (1) depends.
3. Outputting field names of all columns of all the searched row data in the configuration interface, wherein the display form of each field name is a field name+a check frame, a data maintainer can check the check frame of each field name, the column with the field name corresponding to the checked check frame is a display column, and data belonging to the display column in all the row data searched based on the id input in the input frame are spliced into one row of data to be displayed in the display interface.
4. The data maintainer can again enter the id in the input box and repeat the process flows of 2 and 3 above.
5. And providing a form interface by using the WPF interface technology, wherein the form interface displays all display columns of row data selected by data maintenance personnel, namely, all display columns are spliced into a spliced data table to be displayed in one display interface, and the spliced data table is provided for the data maintenance personnel to view.
The present example also provides another way to centrally present the associated multiple data tables, and the following describes the process flow of this other centralized presentation way.
The present example provides a data table association viewer of a tree structure, which is hit by a data maintainer at a client, at which time the tree structure may be displayed in a configuration interface, each node in the tree structure being used to represent a row of data and associated with node information, the node information of each node including a row id of the row data represented by the node, and a row id of the row data referenced by the row data and/or a row id of the row data relied on by the row data. When a data maintainer clicks a certain node in the tree structure, a spliced data table is displayed in the display interface, so that the data maintainer can select a node and directly modify the data corresponding to the selected node on the display interface, the original data table does not need to be opened to search the data of the row and then modify the data, and the operation is simple and visual. The spliced data table is spliced by specified line data, and the specified line data is line data determined based on node information of the clicked node. The data that can be determined based on the node information of each node includes: the line data characterized by the node and/or the line data referenced by the line data and/or the line data relied upon by the line data.
The tree structure is constructed in advance based on the association relation between the data tables stored in the database. When the tree structure is displayed on the interface, the nodes with the association relationship are connected through a wire. When the tree structure is constructed, node information of each node is recorded. Wherein the node information of each node includes all reference information and all dependency information of the node. For data characterized by taking a certain data of a certain data table as an initial node of a tree structure, the determination mode of the reference information of the node is as follows: and taking the id of the line data as a searching key word, and searching the line data taking the id as the line id in a database. This row data is traversed again to find the reference fields stored with the data characterizing the reference other data tables, the row data indicated by these reference fields being the row data referenced by the row data characterized by the initial node. And taking the data in the reference field as reference information of the initial node, and adding the reference information into the node information of the initial node. The determination mode of the dependency information of the node is as follows: and traversing the data of other data tables in the database by taking the id of the data as a key word for searching, and finding out all the data of the data, which are the data of the data, characterized by the initial node, and depend on the data of the data. And adding the row id in the depending row data as the dependent information of the initial node into the node information of the initial node. In addition, the node information also stores the row id of the row data represented by the node.
On the basis of the above data set presentation, the processing flow of the editing method provided in this example is as follows:
(1) The data maintainer edits a cell (corresponding to the first cell) in the spliced data table in the display interface, and the client responds to the editing operation for the cell to acquire the edited content in the cell and the basic information (corresponding to the first basic information) corresponding to the cell. The basic information of the cell is information of a native cell from which the data in the cell is derived, that is, a table name, a field name, and a row id to which the native cell from which the data in the cell is derived belongs. And in the process of splicing to obtain the spliced data table, recording the basic information of each cell in the spliced data table.
(2) And determining a primary cell (corresponding to the second cell) corresponding to the edited cell according to the acquired basic information, modifying data in the primary cell stored in the database by utilizing the acquired editing content, and updating the spliced data table in the display interface based on the data in the updated primary cell.
(3) And updating the data in the cells associated with the cells in the spliced data table, which are subjected to data updating, in the data table stored in the database according to the data in the cells (corresponding to the third cells) in the spliced data table, which are subjected to data updating. The cells associated with the cells in the spliced data table where the data update occurs are cells that reference data in the native cells corresponding to the cells where the data update occurs.
Therefore, through the scheme, the data in the multiple data tables can be displayed in a concentrated mode on the same display interface, and the associated multiple data tables are synchronously updated by editing the spliced data tables in the display interface, so that the editing efficiency is improved. By utilizing the tree structure, the dependency and reference relation of one node and other nodes can be visually checked, and the editing efficiency is improved. After editing is completed, whether the data in each data table associated with the edited cell is synchronously updated or not is automatically checked, and the accuracy of the data is improved. Therefore, the scheme can improve the editing efficiency and ensure the data accuracy.
Correspondingly, the embodiment of the method further provides a data editing device, as shown in fig. 7, including:
A presentation module 710 for presenting the splice data table within the presentation interface in response to detecting a presentation instruction for the data content of the target data table; the spliced data table is spliced based on the target data table and at least one data table with an association relation with the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which the cell is derived;
an obtaining module 720, configured to obtain, in response to detecting an editing operation for a first cell in the spliced data table, editing content in the first cell and first basic information corresponding to the first cell;
A determining module 730, configured to determine a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
A first updating module 740, configured to update the data in the second cell based on the edited content, and update the spliced data table based on the updated data in the second cell;
and a second updating module 750, configured to update data in a cell associated with a third cell in the spliced data table based on data in the third cell updated in the spliced data table.
Optionally, the first updating module includes:
The first updating sub-module is used for determining the data referenced by the updated data in the second cell as the data to be utilized if the second cell belongs to the cell of the target type; replacing the data in the unit cell to be updated in the spliced data table by the data to be utilized; the data in the target type cells are used for referencing the data in other data tables, and the cells to be updated comprise the first cells and cells taking the data in the first cells as the row ids of the corresponding original cells;
And the second updating sub-module is used for replacing the data in the first cell in the spliced data table by using the updated data in the second cell if the second cell does not belong to the cell of the target type.
Optionally, the cell associated with the third cell is: and referring to the cell of the data in the native cell corresponding to the third cell.
Optionally, the display instruction for the data content of the target data table is: a presentation instruction generated in response to the target id input in the configuration interface;
the target data table is a data table taking the target id as a key field;
The generation mode of the spliced data table comprises the following steps:
Determining line data in the target data table, wherein the line data takes the target id as line id, and the line data is taken as reference line data;
Searching a database for the data referenced by the reference line data and/or the data relied on by the reference line data;
and based on the reference line data and the searched reference line data, performing data splicing to obtain a spliced data table.
Optionally, the display module displays the spliced data table in the display interface in response to detecting the display instruction for the target data table, including:
Determining, in response to a data presentation instruction for a target node in a tree structure displayed by a configuration interface, data associated with target data represented by the target node based on node information stored in the target node; the tree structure is used for representing the association relation between the line data of the data table stored in the database, each node in the tree structure is used for representing one line of data and is associated with node information, the node information comprises an identifier of the line data represented by the node and an identifier of the line data with the association relation with the line data represented by the node, and the target node is a node used for representing the line data in the target data table;
Constructing a spliced data table based on the target line data and the line data associated with the target line data;
And displaying the spliced data table in the display interface.
The embodiment of the present invention further provides an electronic device, as shown in fig. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804,
A memory 803 for storing a computer program;
a processor 801 for executing the program stored in the memory 803 to implement any one of the data editing methods
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of any of the data editing methods described above.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the data editing methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method of editing data, the method comprising:
responsive to detecting a presentation instruction for the data content of the target data table, presenting the splice data table within a presentation interface; the spliced data table is spliced based on the target data table and at least one data table with an association relation with the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which data in the cell is derived;
Acquiring editing content in a first cell and first basic information corresponding to the first cell in response to detection of editing operation for the first cell in the spliced data table;
determining a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
updating the data in the second cell based on the editing content, and updating the spliced data table based on the updated data in the second cell;
And updating the data in the cells associated with the third cell in the spliced data table based on the data in the third cell updated in the spliced data table.
2. The method of claim 1, wherein the updating the splice data table based on the updated data in the second cell comprises:
If the second cell is a cell belonging to the target type, determining the data referenced by the updated data in the second cell as data to be utilized; replacing the data in the unit cell to be updated in the spliced data table by the data to be utilized; the data in the target type cells are used for referencing the data in other data tables, and the cells to be updated comprise the first cells and cells taking the data in the first cells as the row ids of the corresponding original cells;
and if the second cell is a cell which does not belong to the target type, replacing the data in the first cell in the spliced data table by using the updated data in the second cell.
3. The method of claim 1 or 2, wherein the cell associated with the third cell is: and referring to the cell of the data in the native cell corresponding to the third cell.
4. The method according to claim 1 or 2, wherein the presentation instructions for the data content of the target data table are: a presentation instruction generated in response to the target id input in the configuration interface;
the target data table is a data table taking the target id as a key field;
The generation mode of the spliced data table comprises the following steps:
Determining line data in the target data table, wherein the line data takes the target id as line id, and the line data is taken as reference line data;
Searching a database for the data referenced by the reference line data and/or the data relied on by the reference line data;
And based on the reference line data and the searched line data, performing data splicing to obtain a spliced data table.
5. The method of claim 1 or 2, wherein displaying the splice data table within the presentation interface in response to detecting a presentation instruction for the target data table comprises:
Determining, in response to a data presentation instruction for a target node in a tree structure displayed by a configuration interface, data associated with target data represented by the target node based on node information stored in the target node; the tree structure is used for representing the association relation between the line data of the data table stored in the database, each node in the tree structure is used for representing one line of data and is associated with node information, the node information comprises an identifier of the line data represented by the node and an identifier of the line data with the association relation with the line data represented by the node, and the target node is a node used for representing the line data in the target data table;
Constructing a spliced data table based on the target line data and the line data associated with the target line data;
And displaying the spliced data table in the display interface.
6. A data editing apparatus, the apparatus comprising:
The display module is used for displaying the spliced data table in the display interface in response to detecting a display instruction aiming at the data content of the target data table; the spliced data table is spliced based on the target data table and at least one data table with an association relation with the target data table; each cell in the spliced data table corresponds to basic information, wherein the basic information is recorded during splicing and is information of a primary cell from which the cell is derived;
The acquisition module is used for responding to the detection of the editing operation for the first cell in the spliced data table, and acquiring the editing content in the first cell and the first basic information corresponding to the first cell;
a determining module, configured to determine a second cell based on the first basic information; the second cell is a native cell corresponding to the first cell;
the first updating module is used for updating the data in the second cell based on the editing content and updating the spliced data table based on the updated data in the second cell;
and the second updating module is used for updating the data in the cells associated with the third cells in the spliced data table based on the data in the third cells updated in the spliced data table.
7. The apparatus of claim 6, wherein the first update module comprises:
The first updating sub-module is used for determining the data referenced by the updated data in the second cell as the data to be utilized if the second cell belongs to the cell of the target type; replacing the data in the unit cell to be updated in the spliced data table by the data to be utilized; the data in the target type cells are used for referencing the data in other data tables, and the cells to be updated comprise the first cells and cells taking the data in the first cells as the row ids of the corresponding original cells;
And the second updating sub-module is used for replacing the data in the first cell in the spliced data table by using the updated data in the second cell if the second cell does not belong to the cell of the target type.
8. The apparatus of claim 6 or 7, wherein the presentation module, in response to detecting a presentation instruction for a target data table, displays a splice data table within a presentation interface, comprising:
Determining, in response to a data presentation instruction for a target node in a tree structure displayed by a configuration interface, data associated with target data represented by the target node based on node information stored in the target node; the tree structure is used for representing the association relation between the line data of the data table stored in the database, each node in the tree structure is used for representing one line of data and is associated with node information, the node information comprises an identifier of the line data represented by the node and an identifier of the line data with the association relation with the line data represented by the node, and the target node is a node used for representing the line data in the target data table;
Constructing a spliced data table based on the target line data and the line data associated with the target line data;
And displaying the spliced data table in the display interface.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
A processor for implementing the method of any of claims 1-5 when executing a program stored on a memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-5.
CN202410290387.2A 2024-03-14 2024-03-14 Data editing method, device, equipment and storage medium Pending CN118093610A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410290387.2A CN118093610A (en) 2024-03-14 2024-03-14 Data editing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410290387.2A CN118093610A (en) 2024-03-14 2024-03-14 Data editing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118093610A true CN118093610A (en) 2024-05-28

Family

ID=91159875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410290387.2A Pending CN118093610A (en) 2024-03-14 2024-03-14 Data editing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118093610A (en)

Similar Documents

Publication Publication Date Title
US6438535B1 (en) Relational database method for accessing information useful for the manufacture of, to interconnect nodes in, to repair and to maintain product and system units
EP2778929B1 (en) Test script generation system
CN111722839B (en) Code generation method and device, electronic equipment and storage medium
CN109740122B (en) Method and device for converting thinking guide graph use case file
CN112199093B (en) Resource checking method, device, equipment and computer readable storage medium
US20220350857A1 (en) Methods and systems for browser extension used to generate relative xpath, absolute xpath and/or css selectors
CN112560422A (en) Chart processing method, device, equipment and medium
CN113742338A (en) Structured storage system for project acceptance forms
JP5651050B2 (en) Data generation apparatus and data generation program
CN109189688B (en) Test case script generation method and device and electronic equipment
CN116842910A (en) Service data display method, device, equipment and storage medium
CN108777648B (en) Network equipment testing method and device
CN118093610A (en) Data editing method, device, equipment and storage medium
CN111078671A (en) Method, device, equipment and medium for modifying data table field
CN115994709A (en) Data index calculation method, device, computer equipment and storage medium
CN115310011A (en) Page display method and system and readable storage medium
CN114860759A (en) Data processing method, device and equipment and readable storage medium
CN114281845A (en) Index generation method and device, electronic equipment and readable storage medium
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN112579456A (en) Web automatic testing method and device
CN111444392A (en) Method, device and equipment for accessing cave library
CN111191057A (en) User-defined retrieval method and device, electronic equipment and storage medium thereof
CN113392022B (en) Test requirement analysis method, device, computer readable medium and program product
CN117130946B (en) Test scene generation method and device, electronic equipment and readable storage medium
CN112000664B (en) Data synchronization method, device, electronic equipment and readable 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