An information query method and device and a storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-08-07
AI Technical Summary
[0048]本申请中第二方面到第八方面及其各种实现方式的具体描述,可以参考第一方面和第二方面及其各种实现方式中的详细描述;并且,第二方面到第八方面及其各种实现方式的有益效果,可以参考第一方面和第二方面及其各种实现方式中的有益效果分析,此处不再赘述。
Smart Images

Figure CN116049216B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data algorithm feature data processing technology, and in particular to an information query method, device and storage medium. Background Technology
[0002] Currently, more and more companies are starting to build data warehouses. A data warehouse is a data device used to store data and has data analysis capabilities. Companies often use it as a data warehouse device for the backend of the Internet to store massive amounts of data for analysis.
[0003] Feature engineering in data warehousing refers to processing data in a data warehouse into features usable for machine learning. As a commonly used technique in data analysis, efficient feature engineering of data warehouses is becoming increasingly urgent. However, some well-developed historical feature engineering projects cannot be effectively inherited or preserved, which is a significant waste in the data processing field. Furthermore, it often forces subsequent feature engineering to rely on the accumulated experience of algorithm engineers or data analysts, such as selecting data processing methods based on personal experience. This means that when junior algorithm engineers or data analysts lack experience in feature engineering, they need to conduct numerous trials, wasting considerable time and effort. Summary of the Invention
[0004] This application provides an information query method, apparatus, and storage medium for obtaining query results about query conditions in a knowledge graph based on query condition information.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] Firstly, an information retrieval method is provided, which may include:
[0007] Obtain query condition information, which represents the first target entity;
[0008] Based on the query conditions, a query operation is performed on the knowledge graph corresponding to the data warehouse to obtain the query results. The query operation is used to query the second target entity that has a relationship with the first target entity and the target relationship attribute information. The target relationship attribute information represents the relationship between the first target entity and the second target entity. The knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities. The first entity is a data table, field, or data processing method, and the second entity is a data table or field. The data table and field belong to the data warehouse, and the data processing method is the method used to process the data table or field.
[0009] The technical solution provided in this application provides at least the following beneficial effects: The information query method provided in this application can perform a query operation on the knowledge graph corresponding to the data warehouse based on query conditions, and obtain the query results in the knowledge graph regarding the query conditions, that is, the second target entity that is related to the first target entity and the target relationship attribute information. Based on the above query results, relevant information about fields, data tables, or data processing methods can be obtained, so that algorithm engineers or data analysts can refer to the historical feature engineering in the relevant information to efficiently perform feature engineering.
[0010] In some embodiments, the information query method, when the first entity and the second entity are two different data tables or two different fields, the relationship between the first entity and the second entity is an association relationship established based on a preset association method; when the first entity is a data table and the second entity is a field, the relationship between the first entity and the second entity is that the first entity contains the second entity; when the first entity is a data processing method and the second entity is a field or a data table, the relationship between the first entity and the second entity is that the first entity is used to process the second entity.
[0011] As can be seen from the above embodiments, when the first entity and the second entity are two different data tables or two different fields, the association relationship and association method between the two different data tables or two different fields can be obtained according to the corresponding knowledge graph; when the first entity is a data table and the second entity is a field, it can be obtained according to the corresponding knowledge graph that the data table contains the field and the field exists in the data table; when the first entity is a data processing method and the second entity is a field or a data table, the historical processing methods for the field or data table can be obtained according to the corresponding knowledge graph.
[0012] In some embodiments, the information query method is provided in the following ways: when the first entity is used to process the second entity, the number of times the first entity has been applied to the second entity in history exceeds a first preset number; when the first entity and the second entity are associated, the number of times the first entity and the second entity are associated based on a preset association method exceeds a second preset number. The number of historical instances and the number of association instances are determined based on the historical processing records of the second entity.
[0013] As can be seen from the above embodiments, when the first entity is a data processing method and the second entity is a data table or field, the first entity can be applied to the second entity. Typically, some data processing methods are not conventional and have a very limited number of uses with the same data table or field. Alternatively, some data processing methods have limited usage conditions, making it difficult to reuse the same data table or field. When the first entity and the second entity are related, the situation where the first entity and the second entity are associated based on a preset association method may be extremely rare, or the first entity and the second entity may only be associated based on a preset association method under very limited conditions. Displaying these data processing methods and associated data in the knowledge graph not only occupies storage space but also wastes the viewing time and effort of algorithm engineers or data analysts. Therefore, in this embodiment, the data processing method and the data table or field are only constructed as entities and added to the knowledge graph when the historical number of times the data processing method has been applied to the data table or field exceeds a first preset number, for example, more than twice. This allows for the selection of data processing methods that are more likely to be chosen by algorithm engineers or data analysts for that data table or field, thereby shortening the selection time for algorithm engineers or data analysts and improving the efficiency of feature extraction. For the same reason, in this embodiment of the application, the association between the two different fields or different data tables based on the preset association method is constructed into the knowledge graph only when the number of associations between the two different fields or different data tables based on the preset association method exceeds the second preset number, for example, more than 2 times.
[0014] In some embodiments, the knowledge graph is further used to indicate entity description information of the first entity and the second entity, as well as relational attribute information of the relationship between the first entity and the second entity; wherein, when the first entity and the second entity are two different data tables or two different fields, the relational attribute information includes a preset association method and the number of associations between the first entity and the second entity; when the first entity is a data processing method and the second entity is a field or a data table, the relational attribute information includes the historical number of times the first entity has been applied to the second entity and the historical processing results obtained.
[0015] As can be seen from the above embodiments, taking the first target entity as the target data table as an example, the information query method provided in this application embodiment can obtain other data tables that are related to the target data table, the association method between the other data tables and the target data table, the data processing methods used on the target data table, the historical number of times the target data table has been processed using the above data processing methods, and / or the historical processing results obtained based on the above data processing methods for processing the target data table. Taking the first target entity as the target field as an example, the information query method provided in this application embodiment can obtain at least one data table where the target field is located, the data processing method for the target field, the historical number of times the target field has been processed using the above data processing methods, and / or the historical processing results obtained based on the above data processing methods for processing the target field. Taking the first target entity as the target processing method as an example, the information query method provided in this application embodiment can obtain the historical processing objects of the target processing method, the historical number of times the historical processing objects have been processed, and the historical processing results obtained based on the data processing method for processing the processing objects, so that algorithm engineers or data analysts can refer to the above processing results.
[0016] In some embodiments, the query result of the information query method may further include: entity description information of the second target entity, and relationship attribute information of the relationship between the first target entity and the second target entity.
[0017] As can be seen from the above embodiments, detailed information about the target field, target data table, and target processing method, as well as historical processing results obtained by processing the first target entity based on the target processing method, can be obtained through information query. Information query can also be used to obtain the association methods between different data tables or different fields, the number of times different data tables or different fields are associated through the same association method, and the historical number of times the data processing method is applied to the same data table or the same field, so as to facilitate reference for algorithm engineers or data analysts.
[0018] In some embodiments, the information query method may further include: when the first target entity is a data table to be processed or a field to be processed, selecting a target data processing method from the data processing methods indicated by the second target entity; and processing the data table to be processed or the field to be processed using the target data processing method.
[0019] As can be seen from the above embodiments, when algorithm engineers or data analysts use data tables or fields as query conditions, they can select an appropriate data processing method from the data processing methods associated with that data table or field displayed in the knowledge graph to process it. In this way, algorithm engineers or data analysts can process data tables or fields according to the data processing methods displayed in the knowledge graph, improving the efficiency of feature engineering.
[0020] Secondly, a knowledge graph construction method is provided, which may include:
[0021] Retrieve historical processing records from the data warehouse; the data warehouse includes data tables, and each data table includes fields; historical processing records are the information on how data processing methods were used to process the data tables and / or the fields in the data tables.
[0022] Based on each historical processing record in the data warehouse, parse out one or more of the data tables, fields in the data tables, and data processing methods;
[0023] Using the parsed data table, fields, or data processing methods as the first entity and the parsed data table or fields as the second entity, determine the relationship between multiple sets of first entities and second entities;
[0024] Construct a knowledge graph to indicate the relationship between multiple sets of first entities and second entities. Two connected nodes in the knowledge graph represent a set of first entities and second entities, and the edge connecting the two nodes represents the relationship between the first entities and second entities in that set.
[0025] As can be seen from the above embodiments, historical processing records in the data warehouse can be parsed to extract data tables, fields within those tables, and one or more data processing methods. By using each group of first and second entities as two connected nodes in the knowledge graph, and the relationship between each group of first and second entities as the edge connecting these two nodes, a knowledge graph is constructed to understand the relationships between multiple groups of first and second entities. This provides a more intuitive view of the relationships between each group of first and second entities and the historical data processing methods for algorithm engineers or data analysts, facilitating their reference during feature engineering.
[0026] In some embodiments, the above-mentioned determination of the relationship between multiple sets of first entities and second entities, using data tables, fields, or data processing methods as first entities and data tables or fields as second entities, may specifically include: determining the relationship and relationship attribute information between different entities, using data tables, fields, and data processing methods as entities; wherein, the relationship between two different data tables or two different fields includes an association relationship, and the relationship attribute information corresponding to the association relationship includes a preset association method and the number of associations; the relationship between a data processing method and the processed data includes the data processing method being used to process the processed data, the processed data being a field or a data table, and the relationship attribute information corresponding to the relationship between the data processing method and the processed data includes the historical number of times the data processing method has been applied to the processed data; based on the relationship and relationship attribute information between different entities, multiple sets of first entities and second entities that meet preset construction conditions are selected from the entities, the preset construction conditions including the historical number of times a data processing method has been applied to the same processed data exceeds a first preset number, and the number of times two different data tables or two different fields have been associated through the same preset association method exceeds a second preset number; based on multiple sets of first entities and second entities and the relationship between each set of first entities and second entities, a knowledge graph corresponding to the data warehouse is constructed.
[0027] As illustrated in the above embodiments, taking two different data tables or two different fields as the first entity and the second entity as examples, the relationship between the first entity and the second entity includes the association relationship between the two different data tables or two different fields. The attribute information of the relationship between the first entity and the second entity includes the preset association method and the number of associations. Taking a field or data table as the first entity and a data processing method as the second entity as examples, the relationship between the first entity and the second entity includes the use of the data processing method to process the field or data table. The attribute information of the relationship between the first entity and the second entity includes the historical number of times the data processing method has been applied to the field or data table. By selecting multiple sets of first entities and second entities that meet the preset construction conditions from the above entities, and constructing the knowledge graph corresponding to the data warehouse based on the above multiple sets of first entities and second entities, the relevant information of the queried data tables, fields, and data processing methods can be intuitively displayed to algorithm engineers or data analysts for reference.
[0028] In some embodiments, the aforementioned historical processing records may include: processing records generated during the construction of a wide table based on data tables in the data warehouse; and processing records generated during the processing of fields in the constructed wide table.
[0029] As demonstrated by the above embodiments, parsing the processing records generated during the construction of wide tables based on data tables in the data warehouse, and the processing records generated during the processing of fields in the constructed wide tables, reveals the relationships between data tables and between data tables and fields within the data warehouse. This allows algorithm engineers or data analysts to more easily view the data tables and the processing records of their fields, providing valuable reference for their work.
[0030] Thirdly, this application provides an information query device, which includes:
[0031] The acquisition module is used to acquire query condition information, which represents the first target entity.
[0032] The query module is used to perform query operations on the knowledge graph corresponding to the data warehouse based on query conditions and obtain query results. The query operation is used to query the second target entity that has a relationship with the first target entity and the target relationship attribute information. The target relationship attribute information represents the relationship between the first target entity and the second target entity. The knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities. The first entity is a data table, field, or data processing method, and the second entity is a data table or field. The data table and field belong to the data warehouse, and the data processing method is the method used to process the data table or field.
[0033] In some embodiments, when the first entity and the second entity are two different data tables or two different fields, the relationship between the first entity and the second entity is an association relationship established based on a preset association method; when the first entity is a data table and the second entity is a field, the relationship between the first entity and the second entity is that the first entity contains the second entity; when the first entity is a data processing method and the second entity is a field or a data table, the relationship between the first entity and the second entity is that the first entity is used to process the second entity.
[0034] In some embodiments, the information query device, when the first entity is used to process the second entity, the number of times the first entity has been applied to the second entity in history exceeds a first preset number; when the first entity and the second entity are associated, the number of times the first entity and the second entity are associated based on a preset association method exceeds a second preset number, and the number of historical times and the number of association times are determined based on the historical processing records of the second entity.
[0035] In some embodiments, the information query device further includes: a knowledge graph used to indicate entity description information of the first entity and the second entity, and relational attribute information of the relationship between the first entity and the second entity; wherein, when the first entity and the second entity are two different data tables or two different fields, the relational attribute information includes a preset association method and the number of associations between the first entity and the second entity; when the first entity is a data processing method and the second entity is a field or a data table, the relational attribute information includes the historical number of times the first entity has been applied to the second entity and the historical processing results obtained.
[0036] In some embodiments, the query result of the information query device further includes: entity description information of the second target entity, and relationship attribute information of the relationship between the first target entity and the second target entity.
[0037] In some embodiments, the information query device further includes a processing module, configured to select a target data processing method from the data processing methods indicated by the second target entity when the first target entity is a data table to be processed or a field to be processed; the processing module is further configured to process the data table to be processed or the field to be processed using the target data processing method.
[0038] Fourthly, this application provides a knowledge graph construction apparatus, which includes:
[0039] The knowledge graph acquisition module is used to acquire historical processing records of the data warehouse; the data warehouse includes data tables, and the data tables include fields; historical processing records are the record information of processing data tables and / or fields in data tables using data processing methods;
[0040] The knowledge graph determination module is used to determine the relationship between multiple sets of first entities and second entities, using the parsed data tables, fields, or data processing methods as first entities and the parsed data tables or fields as second entities.
[0041] The knowledge graph processing module is used to construct a knowledge graph that indicates the relationship between multiple sets of first entities and second entities. Two connected nodes in the knowledge graph represent a set of first entities and second entities, and the edge connecting the two nodes represents the relationship between the first entities and second entities in that set.
[0042] In some embodiments, the knowledge graph processing module is specifically used to determine the relationships and relational attribute information between different entities, using data tables, fields, and data processing methods as entities. The relationships between two different data tables or two different fields include association relationships, and the relational attribute information corresponding to these association relationships includes a preset association method and the number of associations. The relationships between data processing methods and processed data include the data processing method being used to process the processed data, where the processed data is a field or a data table, and the relational attribute information corresponding to the relationship between the data processing method and the processed data includes the historical number of times the data processing method has been applied to the processed data. Based on the relationships and relational attribute information between different entities, multiple sets of first entities and second entities that meet preset construction conditions are selected from the entities. The preset construction conditions include that the historical number of times a data processing method has been applied to the same processed data exceeds a first preset number, and the number of times two different data tables or two different fields have been associated through the same preset association method exceeds a second preset number. The knowledge graph processing module is also used to construct a knowledge graph corresponding to the data warehouse based on multiple sets of first entities and second entities and the relationships between each set of first entities and second entities.
[0043] In some embodiments, historical processing records include processing records generated during the construction of a wide table based on data tables in a data warehouse, and processing records generated during the processing of fields in the wide table based on the constructed wide table.
[0044] Fifthly, this application provides an information query device, comprising: one or more processors; one or more memories; wherein the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the information query device executes any of the information query methods provided in the first aspect above.
[0045] Sixthly, this application provides a knowledge graph construction apparatus, comprising: one or more processors; one or more memory; wherein the one or more memory is used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the knowledge graph construction apparatus performs any of the knowledge graph construction methods provided in the second aspect above.
[0046] Seventhly, this application provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed on the computer, the computer performs any of the information query methods provided in the first aspect or any of the knowledge graph construction methods provided in the second aspect.
[0047] Eighthly, this application provides a computer program product comprising computer instructions that, when executed on an information query device, cause the information query device to perform an information query method as described in the first aspect and any possible design thereof, or any knowledge graph construction method provided in the second aspect.
[0048] For a detailed description of aspects two through eight and their various implementations in this application, please refer to the detailed descriptions in aspects one and two and their various implementations; and for a detailed analysis of the beneficial effects of aspects two through eight and their various implementations in aspects one and two and their various implementations, please refer to the beneficial effect analysis in aspects one and two and their various implementations, which will not be repeated here.
[0049] These or other aspects of this application will become more readily apparent in the following description. Attached Figure Description
[0050] Figure 1 This is a schematic diagram of the structure of an information query system provided in an embodiment of this application;
[0051] Figure 2 This is a schematic diagram of another information query device provided in an embodiment of this application;
[0052] Figure 3 A flowchart illustrating an information query method provided in an embodiment of this application;
[0053] Figure 4 A flowchart illustrating another information query method provided in an embodiment of this application;
[0054] Figure 5 A flowchart illustrating another information query method provided in an embodiment of this application;
[0055] Figure 6 A schematic diagram of a knowledge graph provided in an embodiment of this application;
[0056] Figure 7 A schematic diagram of another knowledge graph provided in an embodiment of this application;
[0057] Figure 8 A schematic diagram of another knowledge graph provided in an embodiment of this application;
[0058] Figure 9 This is a schematic diagram of another information query device provided in an embodiment of this application;
[0059] Figure 10 A schematic diagram of the structure of a knowledge graph construction device provided in an embodiment of this application;
[0060] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0061] The following is a detailed description of an information retrieval method, apparatus, and storage medium provided in this application, with reference to the accompanying drawings.
[0062] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0063] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0064] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or device.
[0065] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0066] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0067] To facilitate understanding, we will first provide a brief introduction and explanation of some terms or basic concepts of technology involved in the embodiments of this application.
[0068] A knowledge graph is a structured semantic knowledge base that effectively processes, handles, and integrates complex data, transforming it into simple and clear triples of "entity (node) - entity relationship (edge of different types) - entity (node)". This aggregates vast amounts of data knowledge, enabling rapid knowledge response and reasoning. The original data types of knowledge graphs include: structured data, such as relational data warehouses; semi-structured data, such as encyclopedias; and unstructured data, such as images, audio, and text. The knowledge graph in this embodiment is constructed using historical processing records from a data warehouse as its original data.
[0069] A data warehouse is a large-scale data storage collection that unifies the management of data from various heterogeneous data source databases. It removes low-quality data, converts its format, and ultimately transforms the source data organization according to a reasonable modeling approach to better support front-end visualization and analysis. In this embodiment, the data warehouse may include data tables, fields, and data processing methods.
[0070] Feature engineering refers to using data processing methods to transform data in a data warehouse into features usable for machine learning. SQL (Structured Query Language) is a data warehouse language with multiple functions, including data manipulation and data definition. In this application's embodiments, SQL can be used to parse historical processing records in the data warehouse to derive data tables, fields, and data processing methods.
[0071] A DataFrame is a tabular data structure that contains a set of ordered columns, each of which can be a different value type (numeric, string, boolean, etc.).
[0072] The above is an introduction to some of the concepts involved in the embodiments of this application, which will not be repeated below.
[0073] As described in the background section, an increasing number of enterprises are building data warehouses. A data warehouse is a data storage device with data analysis capabilities, often used as a backend data warehouse for internet systems to store massive amounts of data for analysis. Feature engineering in data warehouses refers to processing data into features usable for machine learning. As a common technique in data analysis, efficient feature engineering is becoming increasingly urgent. However, some well-preserved historical feature engineering techniques cannot be effectively inherited or retained, representing a significant waste in the data processing field. Furthermore, subsequent feature engineering often relies on the accumulated experience of algorithm engineers or data analysts. For example, the selection of data processing methods in feature engineering depends on personal experience. This means that when junior algorithm engineers or data analysts lack experience in feature engineering, they need to conduct numerous trials, wasting considerable time and effort.
[0074] Therefore, how to preserve and utilize better feature engineering has become an urgent problem to be solved.
[0075] To address the aforementioned issues, this application provides an information query method. The method involves constructing a knowledge graph based on historical processing records of a data warehouse (i.e., processing records generated during feature engineering). This knowledge graph effectively stores historical processing records of the data warehouse (such as processing records generated during successful feature engineering). Furthermore, queries can be performed on the knowledge graph corresponding to the data warehouse based on query conditions to obtain content related to the query conditions.
[0076] The embodiments provided in this application will now be described in detail with reference to the accompanying drawings.
[0077] The information query method provided in this application embodiment can be applied to information query systems. Figure 1 This illustrates one possible structure of the information retrieval system. For example... Figure 1 As shown, the information query system 10 provided in this application embodiment may include: a server 100 and a terminal device 200.
[0078] A communication connection is established between server 100 and terminal device 200. The connection method can be wireless, such as Bluetooth or Wi-Fi; or it can be wired, such as fiber optic, etc., without limitation. For example, terminal device 200 can connect to the Internet through a router to achieve a communication connection with server 100.
[0079] In some embodiments, server 100 is used for data processing and data storage in a data warehouse. For example, server 100 can acquire data from the data warehouse and parse the data warehouse content based on historical processing records to derive relevant data tables, fields, and data processing methods. A knowledge graph is then constructed based on the data tables, fields, and data processing methods. Server 100 sends corresponding query results to terminal device 200 based on query conditions sent by terminal device 200, displaying data tables, fields, and data processing methods related to the query conditions to algorithm engineers or data analysts.
[0080] In some embodiments, server 100 is used to perform a query operation on the knowledge graph corresponding to the data warehouse based on query condition information, and obtain query results.
[0081] In some embodiments, the server 100 is further configured to parse one or more of the following based on each historical processing record in the data warehouse: a data table, fields within the data table, and data processing methods. Then, using the data table, fields, and data processing methods as entities, it determines the relationships and relational attribute information between different entities. Further, based on the relationships and relational attribute information between different entities, candidate entities that meet preset construction conditions are selected from the entities. Based on the candidate entities and the relationships between different candidate entities, a knowledge graph corresponding to the data warehouse is constructed.
[0082] The preset construction conditions include: the number of times a data processing method has been applied to the same data table or the same field exceeds a first preset number; and the number of times two different data tables or two different fields have been associated through the same preset association method exceeds a second preset number.
[0083] In some embodiments, the terminal device 200 can transmit data with the server 100. For example, after the terminal device 200 obtains query condition information, it sends a query request to the server 100 based on the query condition information to request the server 100 to send the query result of the query condition information to the terminal device 200.
[0084] The query criteria can be input into the terminal device 200 by an algorithm engineer or data analyst. The server 100 stores a large number of knowledge graphs containing data tables, fields, or data processing methods. The knowledge graph related to the query criteria can be one of a large number of knowledge graphs or a part of a knowledge graph.
[0085] In some embodiments, the aforementioned servers may be one or more, and the aforementioned terminal devices may be one or more; this application embodiment does not impose any restrictions on this.
[0086] In this embodiment, server 100 may be an independent physical server, a server cluster or distributed device composed of multiple physical servers, or a cloud server that provides cloud services, cloud data warehouses, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0087] In this embodiment of the application, the terminal device 200 can be any electronic device that can establish a communication connection with the server 100, such as a personal computer (PC), a laptop computer, a mobile device, a tablet computer, a laptop computer, etc. Figure 1 The terminal device 200 in this embodiment is a PC, which is merely illustrative. This application does not limit the specific form of the terminal device 200.
[0088] The basic hardware structures of the server 100 and the terminal device 200 are similar, both including Figure 2 The components included in the computing device shown. The following are examples... Figure 2 Taking the computing device shown as an example, the hardware structure of server 100 and terminal device 200 will be introduced.
[0089] In some embodiments, the computing device may include a processor 201, a memory 202, a communication interface 203, and a bus 204. The processor 201, the memory 202, and the communication interface 203 may be connected via the bus 204.
[0090] Processor 201 is the control center of the computing device. It can be a single processor or a collective term for multiple processing elements. For example, processor 201 can be a general-purpose central processing unit (CPU) or other general-purpose processors. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0091] As one embodiment, processor 201 may include one or more CPUs, for example Figure 2 CPU 0 and CPU 1 are shown in the diagram.
[0092] The memory 202 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0093] In one possible implementation, the memory 202 can exist independently of the processor 201. The memory 202 can be connected to the processor 201 via a bus 204 and is used to store instructions or program code. When the processor 201 calls and executes the instructions or program code stored in the memory 202, it can implement the information query method provided in the embodiments of this application.
[0094] In this embodiment, the software programs stored in the memory 202 are different for the server 100 and the terminal device 200, and the functions implemented by the server 100 and the terminal device 200 are different. The functions performed by each device will be described with reference to the following flowchart.
[0095] In another possible implementation, the memory 202 can also be integrated with the processor 201.
[0096] The communication interface 203 is used for connecting the computing device to other devices via a communication network, which may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 203 may include a receiving unit for receiving data and a transmitting unit for transmitting data.
[0097] Bus 204 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 2The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0098] It should be pointed out that, Figure 2 The structure shown does not constitute a limitation on the computing device, except Figure 2 In addition to the components shown, the computing device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0099] In some embodiments, the functions implemented by server 100 and terminal device 200 in the above-described information query system can also be implemented by server 100 or terminal device 200 alone, and this application embodiment does not impose any limitations on this. The execution subject of the information query method provided in this application embodiment is an information query device. In some embodiments, the information query device can be integrated into a server, such as the server 100 described above. In other embodiments, the information query device can also be integrated into a terminal device, such as the terminal device 200 described above. This application embodiment does not impose any limitations on the specific form of the information query device.
[0100] The information query method provided in the embodiments of this application is described below with reference to the accompanying drawings.
[0101] See Figure 3 This application provides an information query method, which may include the following steps:
[0102] S101. Obtain query condition information.
[0103] The query condition information represents the first target entity, which can be a data table, field, or data processing method.
[0104] S102. Based on the query conditions, perform a query operation on the knowledge graph corresponding to the data warehouse to obtain the query results.
[0105] The query operation is used to query a second target entity that has a relationship with the first target entity, as well as the target relationship attribute information. The target relationship attribute information represents the relationship between the first target entity and the second target entity. The knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities. The first entity is a data table, field, or data processing method, and the second entity is a data table or field. The data table and field belong to the data warehouse, and the data processing method is the method used to process the data table or field.
[0106] For example, the first target entity is field a. A query operation is performed on the knowledge graph containing field a in the data warehouse to obtain a second entity that is related to field a. For example, the second entity is a data table containing field a in the data warehouse, or a data processing method for field a.
[0107] Figure 3 The illustrated embodiments offer at least the following beneficial effects: The information query method provided in this application can perform a query operation on the knowledge graph corresponding to the data warehouse based on query conditions, obtaining query results in the knowledge graph regarding the query conditions, namely, the second target entity related to the first target entity and the target relationship attribute information. Based on the above query results, relevant information about fields, data tables, or data processing methods can be obtained, allowing algorithm engineers or data analysts to refer to historical feature engineering in the relevant information and efficiently perform feature engineering.
[0108] In some embodiments, the knowledge graph is also used to indicate entity description information of the first entity and the second entity, as well as relationship attribute information of the relationship between the first entity and the second entity. Where the first entity and the second entity are two different data tables or two different fields, the relationship attribute information includes a preset association method and the number of associations between the first entity and the second entity.
[0109] As one possible approach, when the first entity is a data processing method and the second entity is a field or a data table, the relational attribute information includes the historical number of times the first entity has been applied to the second entity and the historical processing results obtained.
[0110] As can be seen from the above embodiments, taking the first target entity as the target data table as an example, the information query method provided in this application embodiment can obtain other data tables that are related to the target data table, the association method between the other data tables and the target data table, the data processing methods used on the target data table, the historical number of times the target data table has been processed using the above data processing methods, and / or the historical processing results obtained based on the above data processing methods for processing the target data table. Taking the first target entity as the target field as an example, the information query method provided in this application embodiment can obtain at least one data table where the target field is located, the data processing method for the target field, the historical number of times the target field has been processed using the above data processing methods, and / or the historical processing results obtained based on the above data processing methods for processing the target field. Taking the first target entity as the target processing method as an example, the information query method provided in this application embodiment can obtain the historical processing objects of the target processing method, the historical number of times the historical processing objects have been processed, and the historical processing results obtained based on the data processing method for processing the processing objects, so that algorithm engineers or data analysts can refer to the above processing results.
[0111] In some embodiments, when the first entity is used to process the second entity, the number of times the first entity has been applied to the second entity in history exceeds a first preset number.
[0112] As can be seen from the above embodiments, when the first entity is a data processing method and the second entity is a data table or field, the first entity can be applied to the second entity. However, some data processing methods are not conventional and have a very limited number of uses for the same data table or field. Alternatively, some data processing methods have limited usage conditions, making it difficult to reuse the same data table or field. Displaying these data processing methods in the knowledge graph not only occupies storage space but also wastes the time of algorithm engineers or data analysts reviewing information. In this embodiment, only when the historical number of times a data processing method exceeds a first preset number (e.g., more than twice) is the data processing method and the data table or field constructed as entities into the knowledge graph, and the association relationship between the two different fields or different data tables based on the preset association method is established. This allows for the selection of data processing methods that algorithm engineers or data analysts are more likely to choose from for that data table or field, thereby shortening the selection time for algorithm engineers or data analysts and improving the efficiency of feature extraction.
[0113] In some embodiments, when the first entity and the second entity are associated, the number of times the first entity and the second entity are associated based on a preset association method exceeds a second preset number, and the historical number and the number of associations are determined based on the historical processing records of the second entity.
[0114] As can be seen from the above embodiments, when the first entity and the second entity are related, the situation where the first entity and the second entity are associated based on a preset association method may rarely occur, or the first entity and the second entity will only be associated based on the preset association method under very limited conditions. Displaying such associated data in the knowledge graph not only occupies storage space but also wastes the viewing time of algorithm engineers or data analysts. In this embodiment, the association relationship between the two different fields or different data tables based on the preset association method is only displayed if the number of associations between the first entity and the second entity based on the preset association method exceeds a second preset number, for example, more than two times. This allows for the filtering of commonly used association methods between the first entity and the second entity, thereby providing recommendations for algorithm engineers or data analysts and improving the efficiency of feature extraction.
[0115] In some embodiments, when the first entity and the second entity are two different data tables or two different fields, the relationship between the first entity and the second entity is a relationship established based on a preset association method. In this way, the association method between the two different data tables or two different fields can be obtained through the corresponding knowledge graph.
[0116] As one possible approach, if the first entity is a data table and the second entity is a field, the relationship between the first and second entities is that the first entity contains the second entity. In this way, the fields contained in the data table, and the data table containing each field, can be determined through the corresponding knowledge graph.
[0117] As another possible implementation, if the first entity is a data processing method and the second entity is a field or data table, the relationship between the first and second entities is that the first entity processes the second entity. In this way, the historical processing methods for that field or data table can be obtained through the corresponding knowledge graph.
[0118] In some embodiments, the query results include a second target entity that is related to the first target entity, as well as target relationship information, whereby the target relationship information characterizes the relationship between the first target entity and the second target entity. In this way, the second target entity that is related to the first target entity, and the relationship between the first entity and the second entity, can be obtained through information querying, providing a useful reference for algorithm engineers or data analysts.
[0119] As one possible approach, when the first target entity is a data table, the query results include a second data table related to the first data table, the target association method, the processing method for the data table, the historical number of times the processing method was used, and / or the processing results obtained by processing the data table using the same method. The target association method refers to the association between the first data table and the second data table. In this way, information queries can reveal other data tables related to the first data table, their association methods, processing methods, historical number of times the processing method was used, and / or the processing results obtained by processing the data table using the same method. This information is useful for algorithm engineers or data analysts.
[0120] As another possible implementation, when the first target entity is a field, the query results include at least one data table containing that field, the processing method for the field, the historical number of times the processing method for the field has been used, and / or the processing results obtained by processing the field based on the processing method. In this way, information queries can reveal at least one data table containing the field, the processing method for that field, the historical number of times the field has been processed using the aforementioned processing method, and / or the processing results obtained by processing the field based on the aforementioned processing method, providing valuable information for algorithm engineers or data analysts.
[0121] As another possible implementation, when the first target entity is a target processing method, the query results include the processing object of the target processing method, the historical number of times the target processing method has been applied to that processing object, and the historical processing results obtained by processing that processing object based on the target processing method. In this way, information queries can reveal the historical processing objects of the processing method, the historical number of times the historical processing object has been processed, and the historical processing results obtained by processing that processing object based on the historical processing method, providing a useful reference for algorithm engineers or data analysts.
[0122] In some embodiments, the query results may also include entity description information of the second target entity and relationship attribute information of the relationship between the first target entity and the second target entity.
[0123] The entity description information may include: descriptions of the target data table, target fields, and target processing methods. The target processing method description information includes historical processing results obtained by processing the first target entity using the target processing method. Relationship attribute information may include: the association methods between different data tables or fields, the number of times different data tables or fields are associated using the same association method, and the historical number of times the data processing method is applied to the same data table or field. Thus, detailed information about the target field, target data table, and target processing method, as well as historical processing results obtained by processing the first target entity using the target processing method, can be obtained through information queries. Information queries can also obtain information about the association methods between different data tables or fields, the number of times different data tables or fields are associated using the same association method, and the historical number of times the data processing method is applied to the same data table or field, for reference by algorithm engineers or data analysts.
[0124] In some embodiments, such as Figure 4 As shown, the information retrieval method provided in this application may include:
[0125] S201. If the first target entity is a data table or a field to be processed, select the target data processing method from the data processing methods indicated by the second target entity.
[0126] For example, when the first target entity is field a, and the second target entity includes data processing method 1, data processing method 2, and data processing method 3, then the data processing method for processing field a is selected from data processing method 1, data processing method 2, and data processing method 3.
[0127] S202. Use the target data processing method to process the data table or field to be processed.
[0128] For example, an algorithm engineer or data analyst can choose data processing method 3 in the knowledge graph to process field a.
[0129] As can be seen from the above embodiments, when algorithm engineers or data analysts use data tables or fields as query conditions, they can select an appropriate data processing method from the data processing methods associated with that data table or field displayed in the knowledge graph to process it. In this way, algorithm engineers or data analysts can process data tables or fields according to the data processing methods displayed in the knowledge graph, improving the efficiency of feature engineering.
[0130] In some embodiments, this application also provides a knowledge graph construction method. The knowledge graph construction method constructs a knowledge graph corresponding to the data warehouse based on the historical processing records of the data warehouse. The constructed knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities. The first entity is a data table, field, or data processing method, and the second entity is a data table or field. Here, the data table and field belong to the data warehouse, and the data processing method is a method for processing the data table or field determined according to the historical processing records of the data warehouse.
[0131] like Figure 5 As shown, the knowledge graph construction method provided in this application embodiment may specifically include:
[0132] S301. Obtain historical processing records from the data warehouse.
[0133] The data warehouse includes data tables, which in turn include fields; historical processing records are records of how data processing methods were used to process data tables and / or fields within them.
[0134] S302. Based on each historical processing record in the data warehouse, parse out one or more of the following: data table, fields in the data table, and data processing methods.
[0135] For example, as shown in the following SQL statement:
[0136]
[0137]
[0138] The above statements can be used to parse the data tables, fields within the data tables, data processing methods, table join methods, and join conditions. Specifically, this includes: for the data table zsd_d05, fields _bic_06 and customer, the processing method for fields _bic_06 and customer is distinct; for the data table bi0_pcustomer, field customer, the processing method for the customer field is distinct; for the data table zgn_d04, fields _bic_01, bic_02, and createdon, the processing methods for fields _bic_01 and _bic_02 are in${g_InvalidValue} and renamed to fields collaborators and user; the processing methods for field createdon are unix_timestamp and from_unixtime. Data table zgn_d04 and data table zsd_d05 are based on an equi-association relationship: (_bic_01, _bic_06), (_bic_01, _bic_06); data table bi0_pcustomer and data table zsd_d05 are based on an equi-association relationship: (customer).
[0139] The above statements also reveal that the processing method in${g_InvalidValue} was used on the field _bic_01 5 times in history; and that the data tables zgn_d04 and zsd_d05 were joined equi-valued based on the fields _bic_01 and _bic_06 6 times in history.
[0140] In some embodiments, the aforementioned historical processing records include processing records generated during the construction of a wide table based on data tables in the data warehouse; and processing records generated during the processing of fields in the constructed wide table.
[0141] As one possible approach, based on the processing records generated during the construction of the wide table, some feature engineering methods are used to process the wide table fields into algorithm input data. For example, operators are used to process the fields. The aforementioned operators, as calculation methods, can be known or can be customized and generated by algorithm engineers or data analysts. During the execution of the operators, the processing methods for the fields can be obtained through instrumentation or other methods.
[0142] The following example illustrates feature engineering on a single field within a DataFrame:
[0143]
[0144] For the example above, the content that needs to be recorded is (field, feature method) → (field), such as in the example above.
[0145]
[0146] For example, as shown in the following DataFrame statement, feature engineering is performed on multiple fields:
[0147]
[0148] For the example above, the content that needs to be recorded is (Field 1: Field 2: Field 3, Feature Method) → (Field), for example, in the example above, (deliveryId: deliveryItemId: collaborators, VectorAssembler) → (vec1), (user: customer: id7, VectorAssembler) → (vec2), (id1: vec1: vec2, Interaction) → (vec3).
[0149] In some embodiments, when the feature method is renaming, a unique identifier needs to be set for the renamed record in order to accumulate the historical processing count of the renaming method.
[0150] For example, in the above example, a unique identifier needs to be set for (deliveryId: deliveryItemId: collaborators, VectorAssembler) → (vec1).
[0151] S303. Using the parsed data table, field, or data processing method as the first entity and the parsed data table or field as the second entity, determine the relationship between multiple sets of first entities and second entities.
[0152] In some embodiments, step 303 may include steps S3031-S3032.
[0153] S3031. Using data tables, fields, and data processing methods as entities, determine the relationships and relationship attribute information between different entities.
[0154] The relationships between two different data tables or two different fields include association relationships, and the relationship attribute information corresponding to the association relationships includes the preset association method and the number of associations; the relationship between the data processing method and the processed data includes the data processing method being used to process the processed data, where the processed data is a field or a data table, and the relationship attribute information corresponding to the relationship between the data processing method and the processed data includes the historical number of times the data processing method has been applied to the processed data; based on the relationships and relationship attribute information between different entities, multiple sets of first entities and second entities that meet preset construction conditions are selected from the entities, and the preset construction conditions include that the historical number of times a data processing method has been applied to the same processed data exceeds a first preset number, and the number of times two different data tables or two different fields have been associated through the same preset association method exceeds a second preset number.
[0155] For example, the first preset number of times is 2 times, and the second preset number of times is 2 times.
[0156] S3032. Based on multiple groups of first entities and second entities and the relationship between each group of first entities and second entities, construct the knowledge graph corresponding to the data warehouse.
[0157] In some embodiments, when constructing the knowledge graph corresponding to the data warehouse, a data processing method is applied to the same data table or the same field more than a first preset number of times, and two different data tables or two different fields are associated through the same preset association method more than a second preset number of times.
[0158] As illustrated in the above embodiments, taking two different data tables or two different fields as the first entity and the second entity as examples, the relationship between the first entity and the second entity includes the association relationship between the two different data tables or two different fields. The attribute information of the relationship between the first entity and the second entity includes the preset association method and the number of associations. Taking a field or data table as the first entity and a data processing method as the second entity as examples, the relationship between the first entity and the second entity includes the use of the data processing method to process the field or data table. The attribute information of the relationship between the first entity and the second entity includes the historical number of times the data processing method has been applied to the field or data table. By selecting multiple sets of first entities and second entities that meet the preset construction conditions from the above entities, and constructing the knowledge graph corresponding to the data warehouse based on the above multiple sets of first entities and second entities, the relevant information of the queried data tables, fields, and data processing methods can be intuitively displayed to algorithm engineers or data analysts for reference.
[0159] S304. Construct a knowledge graph to indicate the relationship between multiple sets of first entities and second entities. Two connected nodes in the knowledge graph represent a set of first entities and second entities, and the edge connecting the two nodes represents the relationship between the set of first entities and second entities.
[0160] For example, such as Figure 6 As shown, a wide-table knowledge graph is constructed using data tables, fields, or data processing methods as nodes and association methods or data processing methods as edges. For example, data tables zgn_d04 and zsd_d05 are associated based on the equi-value association (_bic_01, _bic_06). Data table zgn_d04 contains the field _bic_01; data table zgn_d04 contains the field bic_02; data table zgn_d04 contains the field createdon.
[0161] In some embodiments, the wide table knowledge graph described above may also include entity description information and relational attribute information about the relationship between two different entities.
[0162] In some embodiments, such as Figure 7 As shown, a field knowledge graph is constructed using fields or the processing results of fields as nodes and processing methods as edges. For example, by performing feature engineering on the fields deliveryId, deliveryItemId, and collaborators using the data processing method VectorAssembler, the field vec1 can be obtained.
[0163] In some embodiments, the wide table knowledge graph and the field knowledge graph described above can also be merged into a single fused knowledge graph. For example, such as... Figure 8 As shown, in the aforementioned wide table knowledge graph and field knowledge graph, identical entities are merged into one entity, and identical relationships between two identical entities are merged into a single relationship; different entities or different relationships between identical entities are all retained in the fused knowledge graph. Thus, when algorithm engineers or data analysts perform feature engineering based on the fused knowledge graph, they can intuitively see the table containing the query information, as well as all fields in that table, the relationships between fields, the relationships between fields and the data table, and the processing methods. Furthermore, algorithm engineers or data analysts can, based on the above content and the actual situation, select the appropriate field processing method or data table processing method to quickly complete feature extraction.
[0164] As one possible approach, based on third-order relations or by characterizing the knowledge graph, graph algorithms can be used to predict the relationships between fields, thereby showing algorithm engineers or data analysts the relationships between the first entity and the second entity.
[0165] For example, using the Common Neighbor method, the relationship between fields is calculated based on the entities that two entities are simultaneously associated with and the number of such entities, thereby predicting the association between fields.
[0166] As another possible approach, the data processing method for a field can be predicted based on the field's type and data distribution, using cosine distance to characterize the field.
[0167] Figure 5 The illustrated embodiments offer at least the following beneficial effects: As can be seen from the above embodiments, historical processing records in the data warehouse can be parsed to extract data tables, fields within those tables, and one or more data processing methods. By using each group of first and second entities as two connected nodes in the knowledge graph, and the relationship between each group of first and second entities as the edge connecting these two nodes, a knowledge graph for understanding the relationships between multiple groups of first and second entities can be constructed. This provides a more intuitive view of the relationships between each group of first and second entities and the historical data processing methods for algorithm engineers or data analysts, facilitating their reference during feature engineering.
[0168] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0169] like Figure 9 As shown in the figure, this application embodiment provides an information query device for executing the above-described information query method. The information query device 300 includes: an acquisition module 301, a query module 302, and a processing module 303.
[0170] In some embodiments, the acquisition module 301 is used to acquire query condition information, wherein the query condition information represents the first target entity;
[0171] In some embodiments, the query module 302 is used to perform a query operation on the knowledge graph corresponding to the data warehouse based on query condition information to obtain query results; the query operation is used to query a second target entity that has a relationship with the first target entity and target relationship attribute information, the target relationship attribute information representing the relationship between the first target entity and the second target entity; the knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities, the first entity is a data table, field or data processing method, the second entity is a data table or field, the data table and field belong to the data warehouse, and the data processing method is a method for processing the data table or field.
[0172] In some embodiments, when the first entity and the second entity are two different data tables or two different fields, the relationship between the first entity and the second entity is an association relationship established based on a preset association method; when the first entity is a data table and the second entity is a field, the relationship between the first entity and the second entity is that the first entity contains the second entity; when the first entity is a data processing method and the second entity is a field or a data table, the relationship between the first entity and the second entity is that the first entity is used to process the second entity.
[0173] In some embodiments, the information query device 300, when the first entity is used to process the second entity, has a historical number of times the first entity has been applied to the second entity that exceeds a first preset number of times; when the first entity and the second entity have an association relationship, has a number of associations between the first entity and the second entity based on a preset association method that exceed a second preset number of times. The historical number of times and the number of associations are determined based on the historical processing records of the second entity.
[0174] In some embodiments, the information query device 300 further includes: a knowledge graph used to indicate entity description information of the first entity and the second entity, and relational attribute information of the relationship between the first entity and the second entity; wherein, when the first entity and the second entity are two different data tables or two different fields, the relational attribute information includes a preset association method and the number of associations between the first entity and the second entity; when the first entity is a data processing method and the second entity is a field or a data table, the relational attribute information includes the historical number of times the first entity has been applied to the second entity and the historical processing results obtained.
[0175] In some embodiments, the query result of the information query device 300 may further include: entity description information of the second target entity, and relationship attribute information of the relationship between the first target entity and the second target entity.
[0176] In some embodiments, the processing module 303 is configured to select a target data processing method from the data processing methods indicated by the second target entity when the first target entity is a data table to be processed or a field to be processed.
[0177] In some embodiments, the processing module 303 is further configured to process the data table or field to be processed using the target data processing method.
[0178] like Figure 10 As shown, this application embodiment provides a knowledge graph construction apparatus for executing the above-described knowledge graph construction method. The knowledge graph construction apparatus 400 includes: a knowledge graph acquisition module 401, a knowledge graph determination module 402, and a knowledge graph processing module 403.
[0179] In some embodiments, the knowledge graph acquisition module 401 is used to acquire historical processing records of a data warehouse; the data warehouse includes data tables, and the data tables include fields; the historical processing records are record information of processing data tables and / or fields in data tables using data processing methods.
[0180] In some embodiments, the knowledge graph determination module 402 is used to determine the relationship between multiple sets of first entities and second entities, using the parsed data tables, fields or data processing methods as first entities and the parsed data tables or fields as second entities.
[0181] In some embodiments, the knowledge graph processing module 403 is used to construct a knowledge graph for indicating the relationship between multiple sets of first entities and second entities, wherein two connected nodes in the knowledge graph represent a set of first entities and second entities, and the edge connecting the two nodes represents the relationship between the set of first entities and second entities.
[0182] In some embodiments, the knowledge graph processing module 403 is specifically used to determine the relationships and relational attribute information between different entities, using data tables, fields, and data processing methods as entities. The relationships between two different data tables or two different fields include association relationships, and the relational attribute information corresponding to the association relationships includes a preset association method and the number of associations. The relationships between data processing methods and processed data include the data processing method being used to process the processed data, where the processed data is a field or a data table, and the relational attribute information corresponding to the relationship between the data processing method and the processed data includes the historical number of times the data processing method has been applied to the processed data. Based on the relationships and relational attribute information between different entities, multiple sets of first entities and second entities that meet preset construction conditions are selected from the entities. The preset construction conditions include that the historical number of times a data processing method has been applied to the same processed data exceeds a first preset number, and the number of times two different data tables or two different fields have been associated through the same preset association method exceeds a second preset number. The knowledge graph processing module 403 is also used to construct a knowledge graph corresponding to the data warehouse based on multiple sets of first entities and second entities and the relationships between each set of first entities and second entities.
[0183] In some embodiments, historical processing records include processing records generated during the construction of a wide table based on data tables in a data warehouse, and processing records generated during the processing of fields in the wide table based on the constructed wide table.
[0184] It should be noted that the embodiments of this application can divide the information query device into functional modules according to the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. Optionally, the module division in the embodiments of this application is illustrative and is only a logical functional division; other division methods may be used in actual implementation.
[0185] Another embodiment of this application also provides an electronic device, such as... Figure 11 As shown, the electronic device 500 includes a memory 501 and a processor 502; the memory 501 and the processor 502 are coupled; the memory 501 is used to store computer program code, which includes computer instructions. When the processor 502 executes the computer instructions, the electronic device 500 performs each step of the information query method in the method flow shown in the above method embodiment.
[0186] In actual implementation, the acquisition module 301, query module 302, and processing module 303 in the information query device, and the knowledge graph processing module 403 and knowledge graph construction module 402 in the knowledge graph construction device, can be derived from... Figure 11 The processor 502 shown calls the computer program code in memory 501 to implement this. The specific execution process can be found in the description of the information query method section above, and will not be repeated here.
[0187] This application provides an information query device, including: one or more processors; and one or more memories. The one or more memories are used to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the information query device performs any of the information query methods provided in the above embodiments.
[0188] This application provides a knowledge graph construction apparatus, including: one or more processors; and one or more memories. The one or more memories are used to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the knowledge graph construction apparatus performs any of the knowledge graph construction methods provided in the above embodiments.
[0189] Another embodiment of this application provides a computer-readable storage medium storing computer instructions that, when executed on an electronic device, cause the electronic device to perform the various steps executed by the information query device or knowledge graph construction device in the method flow shown in the above method embodiments.
[0190] In another embodiment of this application, a computer program product is also provided, which includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the various steps executed by the information query device or the knowledge graph construction device in the method flow shown in the above method embodiments.
[0191] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer-executable instructions. When these computer-executable instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-executable instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer-executable instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line, DSL) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs).
[0192] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple components. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0193] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
[0194] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An information retrieval method, characterized in that, The method includes: Obtain query condition information, wherein the query condition information represents the first target entity; Based on the query conditions, a query operation is performed on the knowledge graph corresponding to the data warehouse to obtain query results. The query operation is used to query a second target entity that has a relationship with the first target entity and target relationship attribute information. The target relationship attribute information represents the relationship between the first target entity and the second target entity. The knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities. The first entity is a data processing method, and the second entity is a data table or field. The data table and the field belong to the data warehouse, and the data processing method is a method for processing the data table or the field. The knowledge graph is also used to indicate the entity description information of the first entity and the second entity, as well as the relationship attribute information of the relationship between the first entity and the second entity; When the first entity is a data processing method and the second entity is a field or a data table, the relationship between the first entity and the second entity is that the first entity is used to process the second entity; the relationship attribute information includes the historical number of times the first entity has been applied to the second entity and the historical processing results obtained; the historical number of times the first entity has been applied to the second entity exceeds a first preset number.
2. The information query method according to claim 1, characterized in that, When the first entity and the second entity are associated, the number of times the first entity and the second entity are associated based on a preset association method exceeds a second preset number. The historical number and the number of associations are determined based on the historical processing records of the second entity.
3. The information query method according to any one of claims 1-2, characterized in that, The query results include entity description information of the second target entity and relationship attribute information of the relationship between the first target entity and the second target entity.
4. The information query method according to any one of claims 1-2, characterized in that, The method further includes: If the first target entity is a data table or a field to be processed, select a target data processing method from the data processing methods indicated by the second target entity; The target data processing method is used to process the data table or the field to be processed.
5. A method for constructing a knowledge graph, characterized in that, include: Obtain historical processing records from a data warehouse; the data warehouse includes data tables, and the data tables include fields; the historical processing records are record information of processing the data tables and / or the fields in the data tables using data processing methods; Based on each historical processing record in the data warehouse, one or more of the data table, the fields in the data table, and the data processing method are parsed out; Using the parsed data processing method as a first entity and the parsed data table or field as a second entity, multiple relationships between the first and second entities are determined; the data processing method is a method for processing the data table or field; the relationship between the data processing method and the processed data includes the data processing method being used to process the processed data, the processed data being a field or data table, and the relationship attribute information corresponding to the relationship between the data processing method and the processed data including the historical number of times the data processing method has been applied to the processed data and the historical processing results obtained; one of the historical number of times the data processing method has been applied to the same processed data exceeds a first preset number. A knowledge graph is constructed to indicate the relationship between the multiple groups of first entities and second entities. Two connected nodes in the knowledge graph represent a group of first entities and second entities, and the edge connecting the two nodes represents the relationship between the group of first entities and second entities.
6. The knowledge graph construction method according to claim 5, characterized in that, The historical processing records include: Processing records generated during the construction of wide tables based on the data tables in the data warehouse; Processing records generated during the processing of fields in the constructed wide table.
7. An information query device, characterized in that, include: The acquisition module is used to acquire query condition information, wherein the query condition information represents the first target entity; The query module is used to perform query operations on the knowledge graph corresponding to the data warehouse based on the query conditions and obtain query results; The query operation is used to query a second target entity that has a relationship with the first target entity and target relationship attribute information, wherein the target relationship attribute information represents the relationship between the first target entity and the second target entity; The knowledge graph is used to indicate the relationship between multiple sets of first entities and second entities. The first entity is a data processing method, and the second entity is a data table or field. The data table and field belong to the data warehouse, and the data processing method is a method for processing the data table or field. The knowledge graph is also used to indicate the entity description information of the first entity and the second entity, as well as the relationship attribute information between the first entity and the second entity. When the first entity is a data processing method and the second entity is a field or data table, the relationship between the first entity and the second entity is that the first entity is used to process the second entity. The relationship attribute information includes the historical number of times the first entity has been applied to the second entity and the historical processing results obtained. The historical number of times the first entity has been applied to the second entity exceeds a first preset number.
8. The information query device according to claim 7, characterized in that, The information query device also includes a processing module: When the first entity and the second entity are associated, the number of times the first entity and the second entity are associated based on a preset association method exceeds a second preset number. The historical number and the number of associations are determined based on the historical processing records of the second entity. The query results also include entity description information of the second target entity, and relationship attribute information of the relationship between the first target entity and the second target entity; The processing module is used to process the data table or field to be processed using the target data processing method.
9. A knowledge graph construction device, characterized in that, include: The knowledge graph acquisition module is used to acquire historical processing records of the data warehouse; the data warehouse includes data tables, and the data tables include fields; the historical processing records are record information of processing the data tables and / or the fields in the data tables using data processing methods; The knowledge graph determination module is used to determine the relationship between multiple sets of first entities and second entities, using the parsed data processing method as the first entity and the parsed data table or field as the second entity. The data processing method is a method for processing the data table or field. The relationship between the data processing method and the processed data includes the data processing method being used to process the processed data, where the processed data is a field or data table. The relationship attribute information corresponding to the relationship between the data processing method and the processed data includes the historical number of times the data processing method has been applied to the processed data and the historical processing results obtained. In one case, the historical number of times the data processing method has been applied to the same processed data exceeds a first preset number. The knowledge graph processing module is used to construct a knowledge graph that indicates the relationship between the multiple groups of first entities and second entities. Two connected nodes in the knowledge graph represent a group of first entities and second entities, and the edge connecting the two nodes represents the relationship between the group of first entities and second entities.
10. The knowledge graph construction apparatus according to claim 9, characterized in that, The historical processing records include: processing records generated during the construction of a wide table based on the data tables in the data warehouse; and processing records generated during the processing of fields in the wide table based on the constructed wide table.
11. An information query device, characterized in that, include: One or more processors; One or more memory units; Wherein, the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the information query device executes the information query method according to any one of claims 1 to 4.
12. A knowledge graph construction device, characterized in that, include: One or more processors; One or more memory units; Wherein, the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the knowledge graph construction apparatus performs the knowledge graph construction method according to any one of claims 5 to 6.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data warehouse information processing method, device, system and medium
CN109388637A
Information query method and device, system and medium
CN111782824A