Table merging method and device, equipment, storage medium and product
By determining the target table header and semantic similarity between tables and automatically merging the same data, the problem of inefficient table merging in the existing technology is solved, and efficient and accurate table merging is achieved.
Patent Information
- Application Number
- CN202411216615.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, data of the same business is scattered in multiple tables, and manual copying and pasting is required to merge, resulting in inefficient table merging.
By determining the target headers between tables, merging based on semantic similarity, the same data are automatically merged into one table to avoid manual participation.
Improve the efficiency and accuracy of table merging, avoid manual errors, and realize the automated table merging process.
Smart Images

Figure CN119089874A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a table merging method, device, equipment, storage medium and product. Background Art
[0002] At present, for the same business, the data of different aspects of the business may be recorded by different people, and the data is generally recorded in tables, which makes the data of the same business scattered in multiple tables. To merge the data in multiple tables into one table, manual operations are required to organize the tables, such as copying and pasting to merge the data in one table into another table, which is obviously time-consuming and labor-intensive, reducing the efficiency of table merging. Summary of the invention
[0003] The embodiment of the present application provides a table merging method, device, equipment, storage medium and product, which improves the efficiency of table merging. The technical solution is as follows:
[0004] In one aspect, a table merging method is provided, the method comprising:
[0005] Obtain a first table and a second table, each table including a plurality of table headers and a plurality of data corresponding to each table header;
[0006] For each table, determine a target header from multiple headers of the table, and multiple data corresponding to the target header are respectively used to uniquely identify a piece of data in the table;
[0007] Determine at least one set of header pairs between the first table and the second table, each set of header pairs includes a first header and a second header, the first header belongs to the first table, the second header belongs to the second table, and the semantic similarity between the first header and the second header meets a preset condition;
[0008] Determine a target header pair from the at least one set of header pairs, wherein a first target header in the target header pair is a target header in the first table, and a second target header in the target header pair is a target header in the second table;
[0009] Based on the target header pair, the first table and the second table are merged to obtain a merged table.
[0010] In some embodiments, the merging the first table and the second table based on the target table header pair to obtain a merged table includes:
[0011] Based on the target header pair, merging the first table and the second table to obtain a third table;
[0012] Based on the at least one set of header pairs, one header in each set of header pairs and a plurality of data corresponding to the header are removed from the third table, and the merged table is obtained based on the third table.
[0013] In some embodiments, obtaining the merged table based on the third table includes:
[0014] For the statistical calculation cells in the third table, based on the data in the cells associated with the statistical calculation cells in the third table, the data in the statistical calculation cells are updated, and the updated third table is output as the merged table.
[0015] In some embodiments, the merging the first table and the second table based on the target table header pair to obtain a merged table includes:
[0016] Based on the at least one set of header pairs, the first header in each set of header pairs and the multiple data corresponding to the first header are removed from the first table to obtain a fourth table; based on the target header pair, the second table and the fourth table are merged to obtain the merged table; or,
[0017] Based on the at least one group of header pairs, the second header in each group of header pairs and multiple data corresponding to the second header are removed from the second table to obtain a fifth table; based on the target header pair, the first table and the fifth table are merged to obtain the merged table.
[0018] In some embodiments, the merging the first table and the second table based on the target table header pair to obtain a merged table includes:
[0019] In the case where the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the second table, the cells included in each data in the first table are added, the data in the added cells are the data in the second table, and the first table after the data is added is output as the merged table; or
[0020] When the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the first table, the cells included in each data in the second table are added, and the data in the added cells are the data in the second table. The second table after the added data is output as the merged table.
[0021] In some embodiments, the merging the first table and the second table based on the target table header pair to obtain a merged table includes:
[0022] In the case where the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the first table based on the multiple data in the second table, and the first table after the data is added is output as the merged table; or
[0023] When the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the second table based on the multiple data in the first table, and the added multiple data are the multiple data in the first table. The second table after the added data is output as the merged table.
[0024] In some embodiments, the merging the first table and the second table based on the target table header pair to obtain a merged table includes:
[0025] Based on the arrangement order of the multiple data corresponding to the first target header in the first table, the arrangement order of the multiple data respectively identified by the multiple data corresponding to the second target header in the second table is adjusted, and the first table and the adjusted second table are merged to obtain the merged table; or
[0026] Based on the arrangement order of multiple data corresponding to the second target header in the second table, the arrangement order of multiple data respectively identified by the multiple data corresponding to the first target header in the first table is adjusted, and the second table and the adjusted first table are merged to obtain the merged table.
[0027] In some embodiments, for each table, determining a target header from a plurality of headers of the table includes:
[0028] For each header in each table, if there is no duplicate data in the multiple data corresponding to the header, output the header as the target header of the table; or,
[0029] For each header in each table, the header is input into a header detection model, and a detection result of the header is output. When the detection result indicates that the header is a target header, the header is output as a target header of the table. The header detection model is used to detect the target header in the table.
[0030] In another aspect, a table merging device is provided, the device comprising:
[0031] An acquisition module, used for acquiring a first table and a second table, each table including a plurality of table headers and a plurality of data corresponding to each table header;
[0032] A determination module, configured to determine, for each table, a target table header from a plurality of table headers of the table, wherein a plurality of data corresponding to the target table header are respectively used to uniquely identify a piece of data in the table;
[0033] The determination module is further used to determine at least one set of header pairs between the first table and the second table, each set of header pairs includes a first header and a second header, the first header belongs to the first table, the second header belongs to the second table, and the semantic similarity between the first header and the second header meets a preset condition;
[0034] The determination module is further configured to determine a target header pair from the at least one group of header pairs, wherein a first target header in the target header pair is a target header of the first table, and a second target header in the target header pair is a target header of the second table;
[0035] A merging module is used to merge the first table and the second table based on the target header pair to obtain a merged table.
[0036] In some embodiments, the merging module is used to:
[0037] Based on the target header pair, merging the first table and the second table to obtain a third table;
[0038] Based on the at least one set of header pairs, one header in each set of header pairs and a plurality of data corresponding to the header are removed from the third table, and the merged table is obtained based on the third table.
[0039] In some embodiments, the merging module is used to:
[0040] For the statistical calculation cells in the third table, based on the data in the cells associated with the statistical calculation cells in the third table, the data in the statistical calculation cells are updated, and the updated third table is output as the merged table.
[0041] In some embodiments, the merging module is used to:
[0042] Based on the at least one set of header pairs, the first header in each set of header pairs and the multiple data corresponding to the first header are removed from the first table to obtain a fourth table; based on the target header pair, the second table and the fourth table are merged to obtain the merged table; or,
[0043] Based on the at least one group of header pairs, the second header in each group of header pairs and multiple data corresponding to the second header are removed from the second table to obtain a fifth table; based on the target header pair, the first table and the fifth table are merged to obtain the merged table.
[0044] In some embodiments, the merging module is used to:
[0045] In the case where the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the second table, the cells included in each data in the first table are added, the data in the added cells are the data in the second table, and the first table after the data is added is output as the merged table; or
[0046] When the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the first table, the cells included in each data in the second table are added, and the data in the added cells are the data in the second table. The second table after the added data is output as the merged table.
[0047] In some embodiments, the merging module is used to:
[0048] In the case where the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the first table based on the multiple data in the second table, and the first table after the data is added is output as the merged table; or
[0049] When the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the second table based on the multiple data in the first table, and the added multiple data are the multiple data in the first table. The second table after the added data is output as the merged table.
[0050] In some embodiments, the merging module is used to:
[0051] Based on the arrangement order of the multiple data corresponding to the first target header in the first table, the arrangement order of the multiple data respectively identified by the multiple data corresponding to the second target header in the second table is adjusted, and the first table and the adjusted second table are merged to obtain the merged table; or
[0052] Based on the arrangement order of multiple data corresponding to the second target header in the second table, the arrangement order of multiple data respectively identified by the multiple data corresponding to the first target header in the first table is adjusted, and the second table and the adjusted first table are merged to obtain the merged table.
[0053] In some embodiments, the determining module is used to:
[0054] For each header in each table, if there is no duplicate data in the multiple data corresponding to the header, output the header as the target header of the table; or,
[0055] For each header in each table, the header is input into a header detection model, and a detection result of the header is output. When the detection result indicates that the header is a target header, the header is output as a target header of the table. The header detection model is used to detect the target header in the table.
[0056] On the other hand, a computer device is provided, comprising one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the table merging method described in any of the above implementations.
[0057] On the other hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the table merging method described in any of the above implementations.
[0058] On the other hand, a computer program product is provided, which includes a computer program code, wherein the computer program code is stored in a computer-readable storage medium, a processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the table merging method described in any of the above-mentioned implementations.
[0059] An embodiment of the present application provides a table merging method, which determines a target header for each table, and multiple data under the target header are respectively used to uniquely identify a piece of data in the table, and also determines at least one set of header pairs between two tables. Since the semantic similarity between the two headers in the header pair meets the preset conditions, it means that the data under the two headers are the same data; then the target header pair where the two target headers are located is determined from at least one set of header pairs. Since the data under the target header is used to uniquely identify each piece of data in the table, that is, the data under the target header is used to indicate the object to which the each piece of data belongs, and since the two target headers are semantically similar, it is further indicated that the two target headers identify data of the same object, that is, the data in the two tables are data of the same object. On this basis, based on the two headers in the target header pair, the data of the same object in multiple tables can be merged into one table, thereby ensuring the pertinence and accuracy of the table merging, avoiding errors caused by arbitrary merging between tables, and the method can automatically merge tables without manual participation, saving time and effort, thereby improving the efficiency of table merging. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0061] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0062] Figure 2 is a flow chart of a table merging method provided in an embodiment of the present application;
[0063] Figure 3 is a flow chart of another table merging method provided in an embodiment of the present application;
[0064] Figure 4 is a block diagram of a table merging device provided in an embodiment of the present application;
[0065] Figure 5 is a block diagram of a terminal provided in an embodiment of the present application;
[0066] Figure 6 This is a block diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0068] The terms "first", "second", "third" and "fourth" in the specification and claims of this application and the drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0069] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the tables involved in this application are all obtained with full authorization.
[0070] The table merging method provided in the embodiment of the present application can be executed by a computer device. In the embodiment of the present application, the computer device can be configured as a terminal or a server. When the computer device is configured as a terminal, the terminal can be used as the execution subject to implement the technical solution provided in the embodiment of the present application. When the computer device is configured as a server, the server can be used as the execution subject to implement the technical solution provided in the embodiment of the present application. The technical solution provided in the present application can also be implemented through interaction between the terminal and the server, which is not limited in the embodiment of the present application.
[0071] See also Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment of a table merging method provided in an embodiment of the present application, and the implementation environment includes a terminal 10 and a server 20. The terminal 10 and the server 20 can be directly or indirectly connected by wired or wireless communication, and the present application does not limit this. In some embodiments, the terminal 10 is equipped with a target application, and the target application is used to merge tables. The server 20 is a background server of the target application, which is used to provide background services for the target application.
[0072] In some embodiments, the terminal 10 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, a VR (Virtual Reality) device, an AR (Augmented Reality) device, etc., but is not limited thereto. In some embodiments, the server 20 is an independent server or a server cluster or a distributed system composed of multiple servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some embodiments, the server 20 mainly undertakes computing work, and the terminal 10 undertakes secondary computing work; or, the server 20 undertakes secondary computing services, and the terminal 10 undertakes the main computing work; or, the server 20 and the terminal 10 use a distributed computing architecture for collaborative computing.
[0073] Figure 2 : is a flowchart of a table merging method provided in an embodiment of the present application. The method is executed by a computer device as an execution subject. The method includes:
[0074] 201. A computer device obtains a first table and a second table, each table including a plurality of table headers and a plurality of data corresponding to each table header.
[0075] In the embodiment of the present application, the first table and the second table may be Excel tables. Of course, the first table and the second table may also be other types of tables. The multiple data included in each table are respectively located in multiple cells.
[0076] In the embodiment of the present application, the arrangement of the first table and the second table can be horizontal arrangement or vertical arrangement. Among them, horizontal arrangement means that multiple table headers are arranged in a row, and multiple data corresponding to each table header are arranged in a column, that is, one table header corresponds to one column of data. Vertical arrangement means that multiple table headers are arranged in a column, and multiple data corresponding to each table header are arranged in a row, that is, one table header corresponds to one row of data.
[0077] The header is used to identify and distinguish the data in each cell. In a table, the header is usually a column name or a row name. One header can correspond to multiple data.
[0078] The arrangement of the first table and the second table may be the same or different. In the embodiment of the present application, the arrangement of the first table and the second table is the same as an example for description.
[0079] 202. The computer device determines, for each table, a target header from multiple headers of the table, and multiple data corresponding to the target header are respectively used to uniquely identify a piece of data in the table.
[0080] In the embodiment of the present application, if the table is arranged horizontally, a piece of data is a row of data, and the piece of data identified by each piece of data is also the row of data in which the data is located. If the table is arranged vertically, a piece of data is a column of data, and the piece of data identified by each piece of data is also the column of data in which the data is located.
[0081] 203. The computer device determines at least one set of header pairs between the first table and the second table, each set of header pairs includes a first header and a second header, the first header belongs to the first table, the second header belongs to the second table, and the semantic similarity between the first header and the second header meets a preset condition.
[0082] In the embodiment of the present application, the preset condition refers to that the semantic similarity is greater than the preset similarity, that is, the semantics between the first header and the second header are highly similar, that is, the multiple data corresponding to the first header and the multiple data corresponding to the second header belong to the same type of data. For example, the first header is the student ID, and the second header is the student ID.
[0083] 204. The computer device determines a target header pair from at least one set of header pairs, where a first target header in the target header pair is a target header of the first table, and a second target header in the target header pair is a target header of the second table.
[0084] Optionally, the computer device determines, for each set of header pairs, whether the first header is a target header in the first table, and determines, for each set of header pairs, whether the second header is a target header in the second table.
[0085] 205. The computer device merges the first table and the second table based on the target table header pair to obtain a merged table.
[0086] In the embodiment of the present application, merging refers to adding the data in the first table to the second table, or adding the data in the second table to the first table, or adding the data in two tables to a new table to obtain a merged table.
[0087] An embodiment of the present application provides a table merging method, which determines a target header for each table, and multiple data under the target header are respectively used to uniquely identify a piece of data in the table, and also determines at least one set of header pairs between two tables. Since the semantic similarity between the two headers in the header pair meets the preset conditions, it means that the data under the two headers are the same data; then, a target header pair where the two target headers are located is determined from at least one set of header pairs. Since the data under the target header is used to uniquely identify each piece of data in the table, that is, the data under the target header is used to indicate the object to which the each piece of data belongs, and since the two target headers are semantically similar, it is further indicated that the two target headers identify data of the same object, that is, the data in the two tables are data of the same object. On this basis, based on the two headers in the target header pair, the data of the same object in multiple tables can be merged into one table, thereby ensuring the pertinence and accuracy of the table merging, avoiding errors caused by arbitrary merging between tables, and the method can automatically merge tables without manual participation, saving time and effort, thereby improving the efficiency of table merging.
[0088] Above Figure 2 The embodiment of the table merging method is the basic process. Figure 3 The process is further described in the embodiment of FIG. Figure 3 , Figure 3 It is a flowchart of a table merging method provided in an embodiment of the present application. The method is executed by a computer device and includes the following steps.
[0089] 301. A computer device obtains a first table and a second table, each table header including a plurality of table headers and a plurality of data corresponding to each table header.
[0090] In some embodiments, the computer device exports the first table and the second table from a database to obtain the first table and the second table. Optionally, the computer device obtains the first table and the second table and displays them to allow the user to confirm the table to be merged.
[0091] In some embodiments, the process of the computer device identifying the header in each table includes the following implementation methods.
[0092] For a table arranged horizontally, the computer device processes multiple rows from top to bottom, and outputs the data in the first row whose number of columns is the same as that of the next row as multiple headers of the table. That is, the computer device starts from the first row of the table and sequentially determines whether the number of columns in the current row is the same as that of the next row. If they are the same, the data in the current row is output as multiple headers of the table.
[0093] For a table arranged vertically, the computer device processes multiple columns from left to right, and outputs the data in the first column whose number of rows is the same as the number of rows in the next column as multiple table headers. That is, the computer device starts from the first column of the table and determines whether the number of rows in the current column is the same as the number of rows in the next column. If they are the same, the data in the current column is output as multiple table headers.
[0094] 302. For each table, the computer device determines a target header from multiple headers of the table, and multiple data corresponding to the target header are respectively used to uniquely identify a piece of data in the table.
[0095] In the embodiment of the present application, the multiple data corresponding to the target header are respectively used to uniquely identify a piece of data in the table, that is, each data is used to indicate the object to which the data it identifies belongs. For example, if the target header is a student ID, each corresponding student ID is used to uniquely identify the data of a student.
[0096] In some embodiments, the computer device determines, for each table, a target header from multiple headers of the table, including the following implementations.
[0097] In the first implementation, the computer device outputs each header in each table as the target header of the table when there is no duplicate data in the multiple data corresponding to the header. In this implementation, since each data under the target header is used to uniquely identify a piece of data, each data under the target header is not duplicated, so the header without duplicate data in the corresponding multiple data is used as the target header, which improves the rationality and convenience of determining the target header.
[0098] In a second implementation, the computer device inputs each header in each table into a header detection model and outputs a detection result of the header. When the detection result indicates that the header is a target header, the header is output as a target header of the table. The header detection model is used to detect the target header in the table.
[0099] The header detection model may be an artificial intelligence model. In this implementation, the target header is determined by the header detection model, that is, the target header is determined by artificial intelligence technology, thereby improving the efficiency and convenience of determining the target header.
[0100] In a third implementation, for each header in each table, if there is no duplicate data among the multiple data corresponding to the header, the computer device outputs the header as a candidate header; the computer device inputs the candidate header into a header detection model, outputs a detection result of the candidate header, and if the detection result indicates that the candidate header is a target header, outputs the candidate header as a target header of the table. The header detection model is used to detect the target header in the table.
[0101] In this embodiment, the headers corresponding to the non-repetitive data are first screened out, and then further detected through the header detection model. This not only narrows the detection range of the header detection model, but also further ensures the accuracy of the determined target header.
[0102] In the embodiment of the present application, taking the horizontal arrangement of the table as an example, the column where the multiple data corresponding to the target table header are located is also the primary key column, and each data in the primary key column is used to uniquely identify a row of data in the row where it is located.
[0103] 303. The computer device determines at least one set of header pairs between the first table and the second table, each set of header pairs includes a first header and a second header, the first header belongs to the first table, the second header belongs to the second table, and the semantic similarity between the first header and the second header meets a preset condition.
[0104] In some embodiments, the computer device combines each header in the first table with each table in the second table to obtain multiple groups of candidate header pairs, determines the semantic similarity between two headers in each group of candidate header pairs, and outputs the candidate header pairs whose semantic similarity meets a preset condition as a group of header pairs.
[0105] Optionally, the computer device inputs two headers in each set of candidate header pairs into a semantic model, and outputs the semantic similarity between the two headers through the semantic model. The semantic model is used to determine the semantic similarity, and the semantic model may be an artificial intelligence model.
[0106] In the embodiment of the present application, the computer device determines at least one set of table header pairs, that is, determines whether there is an association relationship between the table headers in multiple tables. For example, the first table has a table header of student ID and student name, and the second table has a table header of student ID and name. The semantics of the student ID and the student ID are the same, that is, the semantic similarity meets the preset conditions, and it is determined that there is an association relationship between the two; the semantics of the student name and the name are the same, that is, the semantic similarity meets the preset conditions, and it is determined that there is an association relationship between the two.
[0107] 304. The computer device determines a target header pair from at least one set of header pairs, where a first target header in the target header pair is a target header of the first table, and a second target header in the target header pair is a target header of the second table.
[0108] Optionally, the target header in each table is marked to indicate that the header is a target header, such as marking a primary key on the target header, so as to facilitate subsequent determination of a target header pair.
[0109] In the embodiment of the present application, a target header pair is determined, that is, in the headers that are associated with each table, it is determined whether it is a target header. If so, the two tables can be merged according to the target header.
[0110] In the embodiment of the present application, the target header pair can be one or more groups, such as the student ID and ID number can both be used to uniquely identify a piece of data of a student. In the case where the target header pair is multiple groups, the computer device can randomly select one group to merge the tables.
[0111] 305. When the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, the computer device adds cells included in each data in the first table based on the data in the second table, and the data in the added cells are the data in the second table. The first table after the added data is output as a merged table.
[0112] Among them, since the data under the target header is used to uniquely identify each piece of data in the table, that is, the target header is used to indicate the object to which the data belongs, if the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, it means that the first table and the second table record the data of the same object, and then add the data in one table to another table, that is, increase the dimension of each piece of data, thereby realizing the merging of data of the same object in different dimensions into one table.
[0113] In an embodiment of the present application, the process of merging the first table and the second table based on the target table header pair to obtain a merged table is implemented through the above step 305. In this embodiment, the example of adding the data in the second table to the first table to obtain a merged table is used for explanation. In other embodiments, the computer device adds the data in the first table to the second table to obtain a merged table, and the process includes the following steps.
[0114] When the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, the computer device adds cells included in each data in the second table based on the data in the first table, and the data in the added cells are the data in the second table, and outputs the second table after the added data as a merged table.
[0115] In some embodiments, when merging tables, the user can select a target table from two tables, so that when merging, the data in the other table is added to the target table to obtain a merged table.
[0116] In the above embodiments, the example of adding data in one table to another table to obtain a merged table is used for explanation. In other embodiments, the computer device obtains data in two tables respectively, and fills the data in the two tables into one table to obtain a merged table.
[0117] Optionally, the data in the target table is arranged in front in the merged table, that is, the arrangement order of the data in the merged table is set by selecting the target table.
[0118] 306. When the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, the computer device adds multiple data to the first table based on the multiple data in the second table, and the added multiple data are the multiple data in the second table, and outputs the first table after the added data as a merged table.
[0119] Among them, since the data under the target header is used to uniquely identify each piece of data in the table, that is, the target header is used to indicate the object to which the data belongs, if the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, it means that the first table and the second table record data of different objects, and then the data in one table is added to another table, which means that the number of data in the table is increased, thereby merging data of different objects into one table.
[0120] Optionally, when the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, the computer device further determines whether there is a one-to-one correspondence between the headers in the two tables. When the headers in the two tables correspond one-to-one, multiple data are added to the first table based on the multiple data in the second table, and the added multiple data are the multiple data in the second table, and the first table after the data is added is output as a merged table. The one-to-one correspondence between the headers in the two tables means that the semantic similarity between the two headers in the two tables meets the preset conditions, forming a set of header pairs.
[0121] Among them, the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header and there is a one-to-one correspondence between the headers in the two tables, indicating that the two tables are data of the same type of different objects in the same dimension, and then the data in one table is added to another table, which means that the data of these objects are merged into one table.
[0122] In the embodiment of the present disclosure, the process of merging the first table and the second table based on the target header pair to obtain a merged table is implemented through the above step 306. In this embodiment, the process of adding the data in the second table to the first table to obtain a merged table is used as an example for explanation. In other embodiments, the computer device adds the data in the first table to the second table to obtain a merged table, and the process includes the following steps: when the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, the computer device adds multiple data in the second table based on the multiple data in the first table, and the added multiple data are the multiple data in the first table, and the second table after the added data is output as a merged table.
[0123] In some embodiments, when merging tables, the user can select a target table from two tables, so that when merging, the data in the other table is added to the target table to obtain a merged table.
[0124] In the above embodiment, the example of adding data in one table to another table to obtain a merged table is used for explanation. In other embodiments, the computer device obtains data in two tables respectively and fills the data in the two tables into one table.
[0125] Optionally, the data in the target table is arranged in front in the merged table, that is, the arrangement order of the data in the merged table is set by selecting the target table.
[0126] In other embodiments, the process in which a computer device merges a first table and a second table based on a target header pair to obtain a merged table includes the following steps: the computer device merges the first table and the second table based on the target header pair to obtain a third table; based on at least one group of header pairs, one header and multiple data corresponding to the header in each group of header pairs are removed from the third table to obtain a merged table based on the third table.
[0127] In this embodiment, after the data in the two tables are merged into one table, duplicate data is removed, ensuring that the merged table does not include duplicate header data, thereby improving the effect of table merging.
[0128] In the embodiment of the present application, the horizontal arrangement of cells is used as an example for explanation. When the tables with established primary key column associations are merged, the duplicate columns are removed. For example, the first table includes three columns A, B, and C, and the second table includes four columns A, B, D, and E, where columns A and B are duplicate columns, and A is the primary key column. The merged table obtained after the merge includes five columns A, B, C, D, and E.
[0129] The process in which the computer device merges the first table and the second table based on the target table header pair to obtain the third table is the same as step 305 and step 306, and will not be repeated here.
[0130] For the third table, when removing a header in each header pair and a plurality of data corresponding to the header, one header in the header pair may be randomly removed, or the user may select a header to be removed from the header pair.
[0131] In some embodiments, the process of obtaining a merged table based on a third table by a computer device includes the following steps: the computer device updates the data in the statistical calculation cells in the third table based on the data in the cells associated with the statistical calculation cells in the third table, and outputs the updated third table as a merged table. In this embodiment, for the statistical calculation cells in the table, the data in the statistical calculation cells can be updated based on the latest data in the merged table, thereby ensuring the accuracy of the table merge.
[0132] Among them, the statistical calculation cell is also a cell with a calculation formula. For each cell, the computer device detects whether the cell has a calculation formula, and outputs the cell with the calculation formula as a statistical calculation cell. Take the table in the embodiment of the present application as an Excel table as an example for explanation. For example, cell C1 is the table header, and the calculation formula in cell C5 is SUM(C1:C4), then cell C5 is a statistical calculation cell, and the data in this cell is the sum of the data in the previous cells in its column.
[0133] The statistical calculation cells in the third table include the statistical calculation cells in the first table and the second table. Optionally, before merging the tables, the computer device determines the statistical calculation cells in each table, and marks and records the statistical calculation cells, so as to facilitate the subsequent direct use of the determined statistical calculation cells.
[0134] Optionally, the cell associated with the statistical calculation cell in the third table is determined based on the cell associated with the statistical calculation cell in the previous table, and the previous table is the first table or the second table. Optionally, the computer device determines the table header corresponding to the cell associated with the statistical calculation cell in the previous table, and uses the multiple cells under the table header in the third table as the cells associated with the statistical calculation cell in the third table.
[0135] Optionally, when there is a statistical calculation cell in the third table, the statistical calculation cell is arranged in front of or behind the plurality of data to facilitate data statistical calculation.
[0136] For example, referring to Table 1 and Table 2, Table 1 is the first table and Table 2 is the merged table. In the first table, the statistical calculation cell C5=SUM(C2:C4) becomes C9=SUM(C2:C8) because four rows of data are added to the merged table.
[0137] Table 1
[0138]
[0139]
[0140] Table 2
[0141]
[0142] The above embodiments are described by taking the example of merging tables and then removing duplicate data. In other embodiments, the computer device removes duplicate data before merging. This process includes the following two implementation methods.
[0143] In a first implementation, the computer device removes the first header and multiple data corresponding to the first header in each group of header pairs from the first table based on at least one group of header pairs to obtain a fourth table; based on the target header pair, the second table and the fourth table are merged to obtain a merged table.
[0144] In a second implementation, the computer device removes the second header and multiple data corresponding to the second header in each group of header pairs from the second table based on at least one group of header pairs to obtain a fifth table; based on the target header pair, the first table and the fifth table are merged to obtain a merged table.
[0145] In this embodiment, duplicate data in two tables are first removed and then the tables are merged, which reduces the amount of data processing when merging tables and ensures that the merged table does not include duplicate header data, thereby improving the effect of table merging.
[0146] In other embodiments, if the arrangement order of multiple data corresponding to the first target header is different from the arrangement order of multiple data corresponding to the second target header, that is, the arrangement order of the multiple data in the first table is different from the arrangement order of the multiple data in the second table, then the arrangement order of the multiple data in the two tables is adjusted to be the same. This process includes the following two implementation methods.
[0147] In a first implementation method, a computer device adjusts the arrangement order of multiple data respectively identified by multiple data corresponding to a second target header in a second table based on the arrangement order of multiple data corresponding to a first target header in a first table, and merges the first table and the adjusted second table to obtain a merged table.
[0148] In a second implementation method, the computer device adjusts the arrangement order of multiple data respectively identified by the multiple data corresponding to the first target header in the first table based on the arrangement order of the multiple data corresponding to the second target header in the second table, and merges the second table and the adjusted first table to obtain a merged table.
[0149] Among them, since the data arrangement order of the two adjusted tables is the same, the data in one table can be directly spliced behind the data in the other table to obtain a merged table. Taking the horizontal arrangement of tables as an example, multiple columns of data in one table are spliced to multiple columns of data in another table. Furthermore, the duplicate columns in the two tables are removed.
[0150] It should be noted that the above implementation is performed when the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second header. When the multiple data corresponding to the first target header are different from the multiple data corresponding to the second header, the computer device adjusts the arrangement order of the multiple headers in the second table based on the arrangement order of the multiple headers in the first table, adjusts the arrangement order between the data corresponding to the multiple headers based on the adjusted arrangement order of the multiple headers, and merges the first table and the adjusted second table to obtain a merged table. Alternatively, the computer device adjusts the arrangement order of the multiple headers in the first table based on the arrangement order of the multiple headers in the second table, adjusts the arrangement order between the data corresponding to the multiple headers based on the adjusted arrangement order of the multiple headers, and merges the second table and the adjusted first table to obtain a merged table.
[0151] Among them, since the data arrangement order of the two adjusted tables is the same, the data in one table can be directly spliced behind the data in the other table to obtain a merged table. Taking the horizontal arrangement of tables as an example, multiple rows of data in one table are spliced behind multiple rows of data in another table, and the row where the header of the other table is located is removed.
[0152] In an embodiment of the present application, the arrangement order of data in one table is adjusted based on the arrangement order of data in another table. In this way, when merging tables, the data of one table can be directly spliced to the back of the data of another table. This is efficient and convenient, thereby improving the efficiency of table merging.
[0153] The process in which the computer device merges the first table and the adjusted second table to obtain the merged table and merges the second table and the adjusted first table to obtain the merged table is the same as step 305 and step 306, and will not be repeated here.
[0154] It should be noted that the above-mentioned multiple implementation methods of merging the first table and the second table based on the target header pair to obtain the merged table can be freely combined. For example, the arrangement order of data in one table is first adjusted based on the arrangement order of data in another table, and then the duplicate data in the two tables are removed, and then the two tables are merged.
[0155] The method provided by the embodiment of the present application can realize the efficient merging of the contents of multiple tables, and improve the functional diversity and user experience of the target application. The method realizes the efficient merging of the contents of multiple tables by intelligently identifying the table type and judging the relationship between the tables. The method can intelligently identify duplicate columns and merge them to avoid data redundancy. In addition, for cells containing statistical calculations, recalculation can be realized after merging to ensure the accuracy of the data in the merged table.
[0156] It should be noted that in the embodiments of the present application, only the merging of two tables is used as an example for illustrative description. Of course, more tables can also be merged, wherein the merging process of the tables is similar and will not be repeated here.
[0157] An embodiment of the present application provides a table merging method, which determines a target header for each table, and multiple data under the target header are respectively used to uniquely identify a piece of data in the table, and also determines at least one set of header pairs between two tables. Since the semantic similarity between the two headers in the header pair meets the preset conditions, it means that the data under the two headers are the same data; then, a target header pair where the two target headers are located is determined from at least one set of header pairs. Since the data under the target header is used to uniquely identify each piece of data in the table, that is, the data under the target header is used to indicate the object to which the each piece of data belongs, and since the two target headers are semantically similar, it is further indicated that the two target headers identify data of the same object. On this basis, based on the two headers in the target header pair, the data of the same object in multiple tables can be merged into one table, thereby ensuring the pertinence and accuracy of the table merge, avoiding errors caused by arbitrary merges between tables, and the method can automatically merge tables without manual participation, saving time and effort, thereby improving the efficiency of table merging.
[0158] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0159] The present application also provides a table merging device. Figure 4 , the device comprises:
[0160] An acquisition module 401 is used to acquire a first table and a second table, each table including a plurality of table headers and a plurality of data corresponding to each table header;
[0161] A determination module 402 is used to determine, for each table, a target header from multiple headers of the table, wherein multiple data corresponding to the target header are respectively used to uniquely identify a piece of data in the table;
[0162] The determination module 402 is further used to determine at least one set of table header pairs between the first table and the second table, each set of table header pairs includes a first table header and a second table header, the first table header belongs to the first table, the second table header belongs to the second table, and the semantic similarity between the first table header and the second table header meets a preset condition;
[0163] The determination module 402 is further configured to determine a target header pair from at least one set of header pairs, wherein a first target header in the target header pair is a target header of the first table, and a second target header in the target header pair is a target header of the second table;
[0164] The merging module 403 is used to merge the first table and the second table based on the target table header pair to obtain a merged table.
[0165] In some embodiments, the merging module 403 is used to:
[0166] Based on the target table header pair, merge the first table and the second table to obtain a third table;
[0167] Based on at least one set of header pairs, one header and a plurality of data corresponding to the header in each set of header pairs are removed from the third table, and a merged table is obtained based on the third table.
[0168] In some embodiments, the merging module 403 is used to:
[0169] For the statistical calculation cells in the third table, based on the data in the cells associated with the statistical calculation cells in the third table, the data in the statistical calculation cells are updated, and the updated third table is output as a merged table.
[0170] In some embodiments, the merging module 403 is used to:
[0171] Based on at least one set of header pairs, remove the first header and the multiple data corresponding to the first header in each set of header pairs from the first table to obtain a fourth table; based on the target header pair, merge the second table and the fourth table to obtain a merged table; or,
[0172] Based on at least one set of header pairs, the second header and the multiple data corresponding to the second header in each set of header pairs are removed from the second table to obtain a fifth table; based on the target header pair, the first table and the fifth table are merged to obtain a merged table.
[0173] In some embodiments, the merging module 403 is used to:
[0174] In the case where the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the second table, the cells included in each data in the first table are added, the data in the added cells are the data in the second table, and the first table after the added data is output as a merged table; or
[0175] When the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the first table, the cells included in each data in the second table are added, and the data in the added cells are the data in the second table. The second table after the added data is output as a merged table.
[0176] In some embodiments, the merging module 403 is used to:
[0177] In the case where the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the first table based on the multiple data in the second table, and the added multiple data are the multiple data in the second table, and the first table after the added data is output as a merged table; or
[0178] When the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the second table based on the multiple data in the first table, and the added multiple data are the multiple data in the first table. The second table after the added data is output as a merged table.
[0179] In some embodiments, the merging module 403 is used to:
[0180] Based on the arrangement order of the multiple data corresponding to the first target header in the first table, the arrangement order of the multiple data respectively identified by the multiple data corresponding to the second target header in the second table is adjusted, and the first table and the adjusted second table are merged to obtain a merged table; or
[0181] Based on the arrangement order of multiple data corresponding to the second target header in the second table, the arrangement order of multiple data respectively identified by the multiple data corresponding to the first target header in the first table is adjusted, and the second table and the adjusted first table are merged to obtain a merged table.
[0182] In some embodiments, the determination module 402 is configured to:
[0183] For each header in each table, if there is no duplicate data in the multiple data corresponding to the header, output the header as the target header of the table; or,
[0184] For each header in each table, the header is input into the header detection model, and the detection result of the header is output. When the detection result indicates that the header is the target header, the header is output as the target header of the table. The header detection model is used to detect the target header in the table.
[0185] An embodiment of the present application provides a table merging device, which determines a target header for each table, and multiple data under the target header are respectively used to uniquely identify a piece of data in the table, and also determines at least one set of header pairs between two tables. Since the semantic similarity between the two headers in the header pair meets the preset conditions, it means that the data under the two headers are the same data; then, a target header pair where the two target headers are located is determined from at least one set of header pairs. Since the data under the target header is used to uniquely identify each piece of data in the table, that is, the data under the target header is used to indicate the object to which the each piece of data belongs, and since the two target headers are semantically similar, it is further indicated that the two target headers identify data of the same object. On this basis, based on the two headers in the target header pair, the data of the same object in multiple tables can be merged into one table, thereby ensuring the pertinence and accuracy of the table merge, avoiding errors caused by arbitrary merges between tables, and the device can automatically merge tables without manual participation, saving time and effort, thereby improving the efficiency of table merging.
[0186] It should be noted that the table merging device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the control device is divided into different functional modules to complete all or part of the functions described above. In addition, the table merging device provided in the above embodiment and the table merging method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0187] In some embodiments, the computer device is provided as a terminal. Figure 5 The structure block diagram of a terminal 500 provided by an exemplary embodiment of the present application is shown. The terminal 500 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 500 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0188] Typically, the terminal 500 includes a processor 501 and a memory 502 .
[0189] The processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0190] The memory 502 may include one or more computer-readable storage media, which may be non-transitory. The memory 502 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 502 is used to store at least one program code, which is used to be executed by the processor 501 to implement the table merging method provided in the method embodiment of the present application.
[0191] In some embodiments, the terminal 500 may further optionally include: a peripheral device interface 503 and at least one peripheral device. The processor 501, the memory 502 and the peripheral device interface 503 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 503 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 504, a display screen 505, a camera assembly 506, an audio circuit 507 and a power supply 508.
[0192] The peripheral device interface 503 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 501 and the memory 502. In some embodiments, the processor 501, the memory 502, and the peripheral device interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 501, the memory 502, and the peripheral device interface 503 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0193] The radio frequency circuit 504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 504 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 504 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 504 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 504 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0194] The display screen 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 505 is a touch display screen, the display screen 505 also has the ability to collect touch signals on the surface or above the surface of the display screen 505. The touch signal can be input to the processor 501 as a control signal for processing. At this time, the display screen 505 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 505 can be one, set on the front panel of the terminal 500; in other embodiments, the display screen 505 can be at least two, respectively set on different surfaces of the terminal 500 or in a folding design; in other embodiments, the display screen 505 can be a flexible display screen, set on a curved surface or a folding surface of the terminal 500. Even, the display screen 505 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 505 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.
[0195] The camera assembly 506 is used to capture images or videos. Optionally, the camera assembly 506 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 506 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0196] The audio circuit 507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 501 for processing, or input them into the radio frequency circuit 504 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 500. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 501 or the radio frequency circuit 504 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 507 may also include a headphone jack.
[0197] The power supply 508 is used to power various components in the terminal 500. The power supply 508 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 508 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0198] In some embodiments, the terminal 500 further includes one or more sensors 509 , including but not limited to: an acceleration sensor 510 , a gyroscope sensor 511 , a pressure sensor 512 , an optical sensor 513 , and a proximity sensor 514 .
[0199] The acceleration sensor 510 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 500. For example, the acceleration sensor 510 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 501 can control the display screen 505 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 510. The acceleration sensor 510 can also be used to collect game or user motion data.
[0200] The gyro sensor 511 can detect the body direction and rotation angle of the terminal 500, and the gyro sensor 511 can cooperate with the acceleration sensor 510 to collect the user's 3D actions on the terminal 500. The processor 501 can implement the following functions based on the data collected by the gyro sensor 511: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0201] The pressure sensor 512 can be set on the side frame of the terminal 500 and / or the lower layer of the display screen 505. When the pressure sensor 512 is set on the side frame of the terminal 500, it can detect the user's holding signal of the terminal 500, and the processor 501 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 512. When the pressure sensor 512 is set on the lower layer of the display screen 505, the processor 501 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 505. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0202] The optical sensor 513 is used to collect the ambient light intensity. In one embodiment, the processor 501 can control the display brightness of the display screen 505 according to the ambient light intensity collected by the optical sensor 513. Specifically, when the ambient light intensity is high, the display brightness of the display screen 505 is increased; when the ambient light intensity is low, the display brightness of the display screen 505 is reduced. In another embodiment, the processor 501 can also dynamically adjust the shooting parameters of the camera component 506 according to the ambient light intensity collected by the optical sensor 513.
[0203] The proximity sensor 514, also called a distance sensor, is usually arranged on the front panel of the terminal 500. The proximity sensor 514 is used to collect the distance between the user and the front of the terminal 500. In one embodiment, when the proximity sensor 514 detects that the distance between the user and the front of the terminal 500 is gradually decreasing, the processor 501 controls the display screen 505 to switch from the screen-on state to the screen-off state; when the proximity sensor 514 detects that the distance between the user and the front of the terminal 500 is gradually increasing, the processor 501 controls the display screen 505 to switch from the screen-off state to the screen-on state.
[0204] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the terminal 500, and the terminal 500 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0205] In some embodiments, the computer device is provided as a server, Figure 6It is a block diagram of a server provided in an embodiment of the present application. The server 600 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 601 and one or more memories 602, wherein the memory 602 is used to store executable program codes, and the processor 601 is configured to execute the above executable program codes to implement the table merging methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
[0206] In an exemplary embodiment, a storage medium including a program code is also provided, such as a memory 602 including the program code, and the program code can be executed by a processor 601 of a server 600 to complete the above table merging method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM (Read-Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0207] The embodiment of the present application further provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the table merging method of any of the above implementation modes.
[0208] An embodiment of the present application also provides a computer program product, which includes a computer program code. The computer program code is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the table merging method of any of the above-mentioned implementation methods.
[0209] In some embodiments, the computer program product involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain system.
[0210] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. Multiple embodiments in the present application can be freely combined, and the combination of at least two embodiments shall be included in the protection scope of the present application.
Claims
1. A table merging method, characterized in that: The method comprises: Obtain a first table and a second table, each table including a plurality of table headers and a plurality of data corresponding to each table header; For each table, determine a target header from multiple headers of the table, and multiple data corresponding to the target header are respectively used to uniquely identify a piece of data in the table; Determine at least one set of header pairs between the first table and the second table, each set of header pairs includes a first header and a second header, the first header belongs to the first table, the second header belongs to the second table, and the semantic similarity between the first header and the second header meets a preset condition; Determine a target header pair from the at least one set of header pairs, wherein a first target header in the target header pair is a target header in the first table, and a second target header in the target header pair is a target header in the second table; Based on the target header pair, the first table and the second table are merged to obtain a merged table.
2. The method according to claim 1, characterized in that The step of merging the first table and the second table based on the target table header pair to obtain a merged table includes: Based on the target header pair, merging the first table and the second table to obtain a third table; Based on the at least one set of header pairs, one header in each set of header pairs and a plurality of data corresponding to the header are removed from the third table, and the merged table is obtained based on the third table.
3. The method according to claim 2, characterized in that The obtaining the combined table based on the third table includes: For the statistical calculation cells in the third table, based on the data in the cells associated with the statistical calculation cells in the third table, the data in the statistical calculation cells are updated, and the updated third table is output as the merged table.
4. The method according to claim 1, characterized in that: The step of merging the first table and the second table based on the target table header pair to obtain a merged table includes: Based on the at least one set of header pairs, the first header in each set of header pairs and the multiple data corresponding to the first header are removed from the first table to obtain a fourth table; based on the target header pair, the second table and the fourth table are merged to obtain the merged table; or, Based on the at least one group of header pairs, the second header in each group of header pairs and multiple data corresponding to the second header are removed from the second table to obtain a fifth table; based on the target header pair, the first table and the fifth table are merged to obtain the merged table.
5. The method according to claim 1, characterized in that The step of merging the first table and the second table based on the target table header pair to obtain a merged table includes: In the case where the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the second table, the cells included in each data in the first table are added, the data in the added cells are the data in the second table, and the first table after the data is added is output as the merged table; or When the multiple data corresponding to the first target header are the same as the multiple data corresponding to the second target header, based on the data in the first table, the cells included in each data in the second table are added, and the data in the added cells are the data in the second table. The second table after the added data is output as the merged table.
6. The method according to claim 1, characterized in that The step of merging the first table and the second table based on the target table header pair to obtain a merged table includes: In the case where the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the first table based on the multiple data in the second table, and the first table after the data is added is output as the merged table; or When the multiple data corresponding to the first target header are different from the multiple data corresponding to the second target header, multiple data are added to the second table based on the multiple data in the first table, and the added multiple data are the multiple data in the first table. The second table after the added data is output as the merged table.
7. The method according to claim 1, characterized in that The step of merging the first table and the second table based on the target table header pair to obtain a merged table includes: Based on the arrangement order of the multiple data corresponding to the first target header in the first table, the arrangement order of the multiple data respectively identified by the multiple data corresponding to the second target header in the second table is adjusted, and the first table and the adjusted second table are merged to obtain the merged table; or Based on the arrangement order of multiple data corresponding to the second target header in the second table, the arrangement order of multiple data respectively identified by the multiple data corresponding to the first target header in the first table is adjusted, and the second table and the adjusted first table are merged to obtain the merged table.
8. The method according to claim 1, characterized in that For each table, determining a target table header from a plurality of table headers of the table includes: For each header in each table, if there is no duplicate data in the multiple data corresponding to the header, output the header as the target header of the table; or, For each header in each table, the header is input into a header detection model, and a detection result of the header is output. When the detection result indicates that the header is a target header, the header is output as a target header of the table. The header detection model is used to detect the target header in the table.
9. A table merging device, characterized in that: The device comprises: An acquisition module, used for acquiring a first table and a second table, each table including a plurality of table headers and a plurality of data corresponding to each table header; A determination module, configured to determine, for each table, a target table header from a plurality of table headers of the table, wherein a plurality of data corresponding to the target table header are respectively used to uniquely identify a piece of data in the table; The determination module is further used to determine at least one set of header pairs between the first table and the second table, each set of header pairs includes a first header and a second header, the first header belongs to the first table, the second header belongs to the second table, and the semantic similarity between the first header and the second header meets a preset condition; The determination module is further configured to determine a target header pair from the at least one group of header pairs, wherein a first target header in the target header pair is a target header of the first table, and a second target header in the target header pair is a target header of the second table; A merging module is used to merge the first table and the second table based on the target header pair to obtain a merged table.
10. A computer device, characterized in that: The computer device includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the table merging method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the table merging method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product includes a computer program code, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device executes the table merging method according to any one of claims 1 to 8.
