Knowledge graph construction method and device, equipment and storage medium
By building a knowledge graph, using API watermarks and database watermarks to closely connect flowing data and database data, solving the problem of inefficient data asset management and utilization in the existing technology, and achieving efficient data management and utilization.
Patent Information
- Application Number
- CN202510409179.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-01
AI Technical Summary
Existing technologies cannot fully understand and utilize liquid data and database data, resulting in inefficient data management and utilization.
By building a knowledge graph, use API watermarks and database watermarks to closely connect flowing data and database data, track data flow, and achieve efficient management.
Improve data utilization efficiency and realize effective tracking and management of data flow.
Smart Images

Figure CN120409636A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a method, apparatus, device, and storage medium for constructing a knowledge graph. Background Art
[0002] In modern information society, data has become an important asset. Data assets can be mainly divided into two types. One type is flowing data, and the other type is database data. The above-mentioned flowing data refers to the data transmitted in the network, such as API call data, network traffic data, etc., while database data is the data stored in the database, such as table data, field data, etc. And as the scale and complexity of data assets continue to grow, some methods for efficiently managing and making full use of these valuable resources have also been proposed in the existing technologies. For example, a database management system (DBMS) is usually used to manage and store database data. For flowing data, network monitoring tools and API gateways are usually used to capture and analyze it. However, these tools and methods usually only provide limited monitoring and analysis capabilities and cannot comprehensively understand and utilize data assets. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for constructing a knowledge graph, which can make the connection between flowing data and database data closer, effectively track the flow of various types of data, realize the efficient management of data, and improve the utilization efficiency of data.
[0004] In a first aspect, this application provides a method for constructing a knowledge graph, including:
[0005] Receiving a service request sent by a client, and generating a first API watermark according to the user information corresponding to the service request;
[0006] Generating a database operation instruction according to the service request, and calling a database system according to the database operation instruction, so that the database system determines the response result and database watermark information corresponding to the service request;
[0007] Sending the watermark-embedded response information to the client, so that the server constructs a knowledge graph according to the watermark-embedded response information received by the client; wherein, the watermark-embedded response information includes the response result corresponding to the service request, the first API watermark, a second API watermark determined according to API call information, and the database watermark information.
[0008] In one or more possible embodiments, the user information corresponding to the service request includes at least one of the following: user ID, access time corresponding to the service request, client IP, session ID corresponding to the service request.
[0009] In one or more possible embodiments, determining the second API watermark according to the API call information includes:
[0010] Generating a second API watermark based on at least one of the called API interface, user ID, client IP, and the sending time of the watermark embedding response information.
[0011] In one or more possible embodiments, before sending the watermark embedding response information to the client, it further includes:
[0012] Processing the response result corresponding to the service request according to the preset business logic;
[0013] Assembling the response result corresponding to the processed service request into the preset output parameter format according to the API documentation.
[0014] In a second aspect, the present application provides a method for constructing a knowledge graph, including:
[0015] Receiving a database operation instruction sent by an API system, generating a first database watermark according to the database operation instruction, and querying the database to determine the response result corresponding to the service request;
[0016] Determining to generate a second database watermark according to the position information of the response result corresponding to the service request in the database;
[0017] Integrating the first database watermark and the second database watermark into database watermark information, and sending the database watermark information and the response result corresponding to the service request to the API system.
[0018] In a third aspect, the present application provides a method for constructing a knowledge graph, including
[0019] Receiving the watermark embedding response information sent by the client, and determining the watermark integration result according to the first API watermark, the second API watermark, and the database watermark information in the watermark embedding response information;
[0020] Determining entity, entity relationship, and entity attribute information according to the watermark integration result, database data resources, and API data resources;
[0021] Constructing a knowledge graph according to the entity, the entity relationship, and the entity attribute information.
[0022] In a fourth aspect, the present application provides a device for constructing a knowledge graph, including:
[0023] The first API watermark generation module is used to receive a service request sent by a client and generate a first API watermark according to the user information corresponding to the service request;
[0024] The database operation instruction generation module is used to generate a database operation instruction according to the service request and call a database system according to the database operation instruction, so that the database system determines the response result corresponding to the service request and database watermark information;
[0025] The watermark embedding response information sending module is used to send watermark embedding response information to the client, so that the server constructs a knowledge graph according to the watermark embedding response information received by the client; wherein, the watermark embedding response information includes the response result corresponding to the service request, the first API watermark, a second API watermark determined according to API call information, and the database watermark information.
[0026] In a fifth aspect, the present application provides a device for constructing a knowledge graph, including:
[0027] The database operation instruction receiving module is used to receive a database operation instruction sent by an API system, generate a first database watermark according to the database operation instruction, and query the database to determine the response result corresponding to the service request;
[0028] The second database watermark generation module is used to determine the generation of a second database watermark according to the position information of the response result corresponding to the service request in the database;
[0029] The database watermark information generation module is used to integrate the first database watermark and the second database watermark into database watermark information, and send the database watermark information and the response result corresponding to the service request to the API system.
[0030] In a sixth aspect, the present application provides a device for constructing a knowledge graph, including:
[0031] At least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any one of the methods in the first aspect or the second aspect or the third aspect.
[0032] In a seventh aspect, the present application provides a computer storage medium, and the computer storage medium stores a computer program, and the computer program is used to make a computer execute any one of the methods in the first aspect or the second aspect or the third aspect.
[0033] A method, apparatus, device, and storage medium for constructing a knowledge graph according to the present application can make the connection between streaming data and database data closer, effectively track the flow of various types of data, achieve efficient data management, and improve data utilization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application, and do not constitute an improper limitation of the present application.
[0035] Figure 1 A flowchart of constructing a knowledge graph applied to an API system according to an embodiment;
[0036] Figure 2 A flowchart of constructing a knowledge graph applied to a database system according to an embodiment;
[0037] Figure 3 An interaction flowchart between various systems according to an embodiment;
[0038] Figure 4 A flowchart of constructing a knowledge graph applied to a server according to an embodiment;
[0039] Figure 5 A flowchart of a distribution similarity method according to an embodiment;
[0040] Figure 6 An effect diagram of a knowledge graph according to an embodiment;
[0041] Figure 7 A schematic diagram of a method for constructing a knowledge graph according to an embodiment;
[0042] Figure 8 A schematic diagram of an application scenario according to an embodiment;
[0043] Figure 9 A module diagram of a device for constructing a knowledge graph applied to an API system according to an embodiment;
[0044] Figure 10 A module diagram of a device for constructing a knowledge graph applied to a database system according to an embodiment;
[0045] Figure 11 A module diagram of a device for constructing a knowledge graph applied to a server according to an embodiment;
[0046] Figure 12 A schematic diagram of a device for constructing a knowledge graph according to an embodiment;
[0047] Figure 13 Schematic diagram of a computer-readable storage medium provided according to an embodiment. Detailed implementation manners
[0048] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order different from those illustrated or described herein. The embodiments of the present disclosure may include multiple steps. For the convenience of description, these steps are numbered, but these numbers are not intended to limit the execution time slots and execution sequences between the steps; these steps can be implemented in any order, and the embodiments of the present disclosure do not make any limitations in this regard. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure detailed in the appended claims.
[0050] Moreover, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.
[0051] For the convenience of understanding, the nouns involved in the embodiments of the present invention are explained below:
[0052] Data watermark: A data watermark is a hidden mark embedded in data, used to identify the ownership, source of the data or track the usage of the data. In the context of knowledge graph construction, data watermarks can help trace the flow trajectory of data and ensure the integrity and security of data, especially during the process of data being processed and transmitted multiple times.
[0053] API Monitoring: API (Application Programming Interface) monitoring refers to the real-time or periodic supervision and recording of the invocation situations of application programming interfaces. When constructing a knowledge graph, API monitoring can capture information such as the invocation frequency, request response time, and error rate of APIs, which helps to understand the data usage patterns and dependency relationships, and thus more accurately depict the associations between data assets.
[0054] Flowing Data: Flowing data refers to the data transmitted in a network or exchanged between different systems, and these data are in a dynamically changing state. When constructing a knowledge graph, the real-time capture and analysis of flowing data are crucial for understanding and updating the relationships between data assets. Especially when data flows between multiple systems, it can timely reflect the latest status and location of the data.
[0055] Database Data: Database data refers to the structured data stored in a database management system, and these data usually follow a certain data model and structure. In knowledge graph construction, the identification and association of database data assets are the foundation, including information such as the database structure, table relationships, and field attributes, which are all key components for constructing a detailed asset graph.
[0056] Knowledge Graph Construction: Knowledge graph construction refers to extracting entities, relationships, and attributes from various data sources, and then organizing them in a graphical way to form a structured knowledge base. In this process, the information provided by data watermarking and API monitoring is used to enhance the links between entities, ensuring the accuracy and timeliness of the knowledge graph, so as to better support functions such as data analysis, decision-making support, and automated operation and maintenance.
[0057] Data Assets: Data assets refer to the digital information resources owned by an enterprise or organization that have economic value, including databases, files, logs, API invocation records, etc. In knowledge graph construction, data assets are regarded as core entities. By identifying, classifying, and associating them, a comprehensive and in-depth understanding of the entire data ecosystem can be formed.
[0058] In the modern information society, data has become an important asset. Data assets can be mainly divided into two types. One type is flowing data, and the other type is database data. The above-mentioned flowing data refers to the data transmitted in the network, such as API call data, network traffic data, etc. Database data is the data stored in the database, such as table data, field data, etc. And as the scale and complexity of data assets continue to grow, some methods for efficiently managing and fully utilizing these valuable resources have also been proposed in the existing technologies. For example, a database management system (DBMS) is usually used to manage and store database data. For flowing data, network monitoring tools and API gateways are usually used to capture and analyze it. However, these tools and methods usually only provide limited monitoring and analysis capabilities and cannot comprehensively understand and utilize data assets.
[0059] To solve the above existing problems, the present application provides a method, device, equipment and storage medium for constructing a knowledge graph, which can make the connection between flowing data and database data closer, effectively trace the flow of various types of data, realize the efficient management of data and improve the utilization efficiency of data.
[0060] Embodiment 1
[0061] The present application provides a method for constructing a knowledge graph, as Figure 1 shown, including:
[0062] Step 101, receiving a service request sent by a client, and generating a first API watermark according to the user information corresponding to the service request;
[0063] In one or more possible embodiments, the service request sent by the client is a data query request or a data acquisition request, generally for querying information related to a specific topic or requirement in a database; these queries may involve finding specific records, statistical data, associated information, etc. For example, the above service request is to query all order records of user A on an e-commerce platform, or to query the historical prices of mobile phone A, etc.; when the client sends the above service request, it is actually an operation by the user. When the user sends the above service request, a session will be generated correspondingly, which is used to maintain the consistency and coherence of context information during the process of the user sending the request and receiving the request response. When performing multiple-step operations, the session can be used to save the state of each step until the entire process is completed. The session in this application is used to track the state of each step from when the client sends the service request until the client receives the watermark embedding response information; the user information corresponding to the above service request includes at least one of the following: user ID, the access time corresponding to the above service request, client IP, the session ID corresponding to the above service request; simply put, the API watermark system can generate a first API watermark based on the user ID included in the user information corresponding to the service request and the access time corresponding to the above service request, and associate the generated first API watermark with the above session. Therefore, the relevant session will carry the information of the above user ID and the access time corresponding to the above service request, which can further verify the identity and permissions of the user. For example, embedding the unique identifier of the user as a watermark in the API call can be verified in subsequent requests to ensure the legality of the request, and it is also convenient for detailed logging and auditing, etc.
[0064] Step 102, generate a database operation instruction according to the above service request, and call a database system according to the above database operation instruction, so that the database system determines the response result corresponding to the above service request and database watermark information;
[0065] In one or more possible embodiments, the API gateway will perform business processing on the above service request, and the processed service request is the above database operation instruction, which is used to call the database system; the above database system will obtain the response result corresponding to the above service request and database watermark information according to the above database operation instruction; the specific content of the response result and database watermark information will be described in detail in subsequent Embodiment 2 and will not be elaborated here.
[0066] Step 103, send the watermark embedding response information to the above client, so that the server constructs a knowledge graph according to the watermark embedding response information received by the above client; wherein, the watermark embedding response information includes the response result corresponding to the above service request, the above first API watermark, the second API watermark determined according to the API call information, and the above database watermark information.
[0067] In one or more possible embodiments, the API system includes an API watermarking system and an API gateway. The API watermarking system is used for the first API watermark and the second API watermark described above. The API gateway is used to call the corresponding API interface to process data. Determining the second API watermark according to the API call information includes: generating the second API watermark according to at least one of the called API interface, user ID, client IP, and the sending time of the watermark embedding response information. The call information of the API can be obtained through API monitoring, and the specific method will not be elaborated here.
[0068] In one or more possible embodiments, before sending the watermark embedding response information to the client, it further includes: processing the response result corresponding to the service request according to the preset business logic; assembling the processed response result corresponding to the service request into the preset output parameter format according to the API document. That is, after the API gateway obtains the response result sent by the database, it will process the response result according to the preset business logic. The preset business logic is not fixed in the actual application process. For different situations, the preset business logic may also be different, or the preset business logic is directly using the response result; sending the processed response result corresponding to the service request to the client after assembling it into the output parameter format defined by the API document.
[0069] Embodiment 2
[0070] This application provides a method for constructing a knowledge graph, as Figure 2 shown, including:
[0071] Step 201, receiving a database operation instruction sent by the API system, generating a first database watermark according to the database operation instruction, and querying the database to determine the response result corresponding to the service request;
[0072] In one or more possible embodiments, the database watermarking system receives the database operation instruction sent by the API gateway. The database operation instruction is determined by the API gateway according to the service request. That is, the first database watermark is generated after the database watermarking system audits and responds to the service request. The first database watermark is used to determine the specific content of the service request. For a simple example, the first database watermark may be that user A needs to obtain the current price of product 1, etc. After the database watermarking system generates the first database watermark, the database queries the corresponding data according to the database operation instruction to determine the response result corresponding to the service request.
[0073] Step 202: Determine the generation of the second database watermark according to the location information of the response result corresponding to the above service request in the above database.
[0074] In one or more possible embodiments, after the above database queries the corresponding response result, the database watermark system will generate a second database watermark according to the library, table, and field information where the above response result is located, that is, the location information of the response result in the above database, for tracking the specific location of the response result in the above database.
[0075] Step 203: Integrate the above first database watermark and the above second database watermark into database watermark information, and send the above database watermark information and the response result corresponding to the above service request to the above API system.
[0076] In one or more possible embodiments, as Figure 3 shown, it is an interaction flowchart between the client, the API system, and the database system. For the convenience of description, the API system is divided into an API watermark system and an API gateway, and the database system is divided into a database watermark system and a database for description.
[0077] Step 301: The client sends a service request to the API watermark system.
[0078] Step 302: The API watermark system generates a first API watermark according to the user information corresponding to the above service request, and adds the above first API watermark to the session corresponding to the above service request.
[0079] Step 303: The API gateway generates a database operation instruction according to the above service request.
[0080] Step 304: The database watermark system generates a first database watermark according to the above database operation instruction.
[0081] Step 305: The database determines the response result corresponding to the service request according to the database operation instruction, and returns it to the database watermark system.
[0082] Step 306: The database watermark system determines the generation of the second database watermark according to the location information of the response result corresponding to the above service request in the above database.
[0083] Step 307: The API gateway processes the response result corresponding to the above service request according to the preset business logic; assembles the processed response result corresponding to the service request according to the API document in the preset output parameter format.
[0084] Step 308, the API watermarking system determines the second API watermark based on the API call information, and embeds the watermark into the response information and sends it to the above-mentioned client.
[0085] Embodiment 3
[0086] This application also provides a method for constructing a knowledge graph, as Figure 4 shown, including:
[0087] Step 401, receive the watermark embedding response information sent by the client, and determine the watermark integration result according to the first API watermark, the second API watermark and the above-mentioned database watermark information in the watermark embedding response information;
[0088] Step 402, determine entity, entity relationship and entity attribute information according to the above-mentioned watermark integration result, database data resources and API data resources;
[0089] Step 403, construct a knowledge graph according to the above-mentioned entity, the above-mentioned entity relationship and the above-mentioned entity attribute information.
[0090] In one or more possible embodiments, the construction process of a classic knowledge graph includes three links: knowledge extraction, knowledge fusion and knowledge processing.
[0091] First is the knowledge extraction stage, taking the watermark integration result, database data resources, and API data resources as inputs in the construction process of the knowledge graph; among them, the database data resources include database official documents, database initialization files, and ES data: used to understand the library, table, and qualification structure of the database, and extract relevant entities and relationships for static data storage; the API data resources include API gateway data and API interface documents: used to understand the input-output relationship of API assets, and extract relevant entities and relationships for flowing data; the watermark integration result: is the user's behavior information, including the above-mentioned first API watermark, second API watermark, and database watermark. Through the watermark integration result, the flowing data API assets and the static data storage structure can be directly connected and placed in the same context for processing.
[0092] In one or more possible embodiments, the input of the above-mentioned knowledge extraction includes the above-mentioned official database documents, database initialization files, ES data, API gateway data, API interface documents, and watermark integration results; knowledge extraction is a crucial step in the process of constructing a knowledge graph, and its main purpose is to automatically identify, extract, and transform structured knowledge representations from various unstructured or semi-structured data sources; these data sources can include text documents, web pages, database records, social media posts, etc. Through knowledge extraction, information such as entities (such as names of people, places, organizations), relationships (such as "is located in", "works at"), and attributes (such as age, nationality) can be obtained from the original data and transformed into nodes and edges in the knowledge graph; in the process of constructing a knowledge graph, knowledge extraction refers to the process of automatically identifying, extracting, and transforming structured knowledge representations from various unstructured or semi-structured data sources. Semantic class extraction in knowledge extraction not only involves identifying named entities (such as names of people, places, organization names, etc.) in the text, but also includes assigning appropriate semantic classes to these entities and establishing associations between the entities and these semantic classes; the present application uses co-occurrence similarity calculation, and the result is the similarity information between words. For example, the triple (lisi, zhangsan, s1) represents that the similarity between Lisi and Zhangsan is s1. The condition for two words to have a high co-occurrence similarity is that they have a co-occurrence relationship (that is, they belong to the same semantic class) and have a large degree of association. According to such a standard, lisi@demo.com and zhangsan@demo.com have a high co-occurrence similarity, while the co-occurrence similarity between "beijing" and "zhangsan" is very low (because they do not belong to the same semantic class); for the three municipal districts of Shunyi, Chaoyang, and Baixia, the co-occurrence similarity between Shunyi and Chaoyang is greater than the similarity between Shunyi and Baixia, because Shunyi and Chaoyang belong to Beijing and have a higher degree of association, while Baixia District belongs to Nanjing; the distribution similarity method is based on Harris's distributional hypothesis, that is, two words that often appear in similar context environments have semantic similarity;
[0093] The implementation of the distribution similarity method in the present application is divided into three steps, as Figure 5 shown, including:
[0094] Step 501, define all input and output data operations in the session associated through the first API watermark, the second API watermark, and the database watermark;
[0095] Step 502, represent each entity as a feature vector, where each dimension of the feature vector represents a different context, and the value of the vector represents the weight of this word relative to the context;
[0096] Step 503: Calculate the similarity between two feature vectors and use it as the similarity between the entities they represent.
[0097] In summary, knowledge extraction is one of the basic steps in constructing a knowledge graph. The quality of knowledge extraction directly affects the accuracy and practicality of the finally constructed knowledge graph. Among them, semantic class extraction constructs semantic classes by automatically extracting information from text and uses methods such as co-occurrence similarity calculation to establish the association between entities and semantic classes, realizing the effective regularization and abstraction at the entity level.
[0098] Secondly is the knowledge fusion stage. Through knowledge extraction, the goal of obtaining entity, relationship, and entity attribute information from unstructured and semi-structured data has been achieved. However, due to the wide range of knowledge sources, there are problems such as uneven knowledge quality, duplication of knowledge from different data sources, and lack of hierarchical structure. Therefore, knowledge fusion must be carried out. Knowledge fusion is a high-level knowledge organization that enables knowledge from different knowledge sources to perform steps such as heterogeneous data integration, disambiguation, processing, reasoning verification, and updating under the same framework specification, achieving the fusion of data, information, methods, experience, and people's thinking to form a high-quality knowledge base.
[0099] Then is the knowledge processing stage. Through entity alignment, a series of basic fact expressions or preliminary ontology prototypes can be obtained. However, facts are not equal to knowledge; they are just the basic units of knowledge. To form high-quality knowledge, a knowledge processing process is still required to form a large-scale knowledge system hierarchically and uniformly manage the knowledge. Knowledge processing mainly includes two aspects: ontology construction and quality assessment.
[0100] Finally, output the formed knowledge graph. The effect diagram is as Figure 6 shown. Store the above knowledge graph in a graph database, provide retrieval services, and can use visualization technologies such as d3 to provide visualization arrangement functions.
[0101] In one or more possible embodiments, such as Figure 7As shown, it is a schematic diagram of the method for constructing a knowledge graph in this application, which is applied on the server side and mainly includes four stages: data acquisition, knowledge extraction, knowledge fusion and knowledge processing; the first is to receive the watermark embedding response information sent by the client, and determine the watermark integration result according to the first API watermark, the second API watermark and the above-mentioned database watermark information in the above watermark embedding response information, and use the watermark integration result, database official documents, database initialization files, ES data, API gateway data, API interface documents and database data as input data for knowledge extraction; knowledge extraction includes entity extraction, attribute extraction and relationship extraction; knowledge fusion is performed after knowledge extraction to form a unified knowledge system; including entity alignment: used to align information describing the same entity in different data sources; entity ambiguity elimination: used to solve the ambiguity problem that may exist in entities in different data sources; and based on the general domain ontology library, a specific ontology model is constructed; finally, the extracted and integrated knowledge is further processed and evaluated to finally generate a complete knowledge graph; and the knowledge can be re-evaluated according to the preset update rules and knowledge combing, and the knowledge graph can be updated.
[0102] In one or more possible embodiments, the knowledge graph construction method provided in this application can be used to facilitate data asset lineage analysis in various isolated environments in complex business scenarios with long links. Two application scenarios are listed below:
[0103] Application scenario 1: Typical front-end and back-end separation application scenario, such as Figure 8 As shown, this is a schematic diagram of application and watermark device deployment in a front-end and back-end separation scenario. The flow data asset identification (API asset identification) system and the database classification and grading system identify data in different forms of existence in different fields, forming different data asset ledgers. Access to the same data (such as user personal information) is naturally isolated by the system into API assets and database assets (including database assets, database table assets and database field assets); this is not conducive to the management principle of data-centric data asset identification, nor is it conducive to the integrated management of data assets; this application breaks the disadvantage that data asset identification is limited to data flow and storage forms after the separation of the front-end and back-end through the watermark integration results acting on different data links, and realizes true data-centric data asset identification. At the same time, this application is also applicable to other complex business scenarios with long business links and diversified entity element flows.
[0104] Application Scenario 2: The API monitoring system detects abnormal call volume of a certain API asset, and obtains user personal information and password information in the user table within a short period of time. After triggering an event alert, the system administrator can retrieve the data asset knowledge graph, discover the associated database asset information, check that the database audit device corresponding to this asset lacks such alert rules, append alert configurations, and set the action to perform personal information desensitization processing when the short-term data acquisition exceeds the preset number of times; trace the API access information to discover the attacker's IP and behavior characteristics; perform risk warnings on user accounts in the data leakage, and forcibly lock high-net-worth accounts and reset password reminders, etc. Through the knowledge graph retrieval and data asset lineage analysis provided by this application, an emergency response can be quickly carried out with the leaked data asset as the core, enhancing the security of data assets and improving the response speed.
[0105] Embodiment 4
[0106] Corresponding to the method in the above Embodiment 1, the present invention also proposes a device for constructing a knowledge graph. Since the device embodiment of the present invention corresponds to the above method embodiment, the details not disclosed in the device embodiment can be referred to the above method embodiment, and will not be elaborated in the present invention.
[0107] This application provides a device for constructing a knowledge graph, as Figure 9 shown, including:
[0108] The first API watermark generation module 901 is configured to receive a service request sent by a client, generate a first API watermark according to the user information corresponding to the service request, and associate the first API watermark with the session corresponding to the service request;
[0109] The database operation instruction generation module 902 is configured to generate a database operation instruction according to the service request, and call a database system according to the database operation instruction, so that the database system determines the response result and database watermark information corresponding to the service request;
[0110] The watermark embedding response information sending module 903 is configured to send the watermark embedding response information to the client, so that the server constructs a knowledge graph according to the watermark embedding response information received by the client; wherein, the watermark embedding response information includes the response result corresponding to the service request, the first API watermark, the second API watermark determined according to the API call information, and the database watermark information.
[0111] Embodiment 5
[0112] This application provides a device for constructing a knowledge graph, as Figure 10 shown, including:
[0113] The database operation instruction receiving module 1001 is configured to receive database operation instructions sent by the API system, generate a first database watermark according to the database operation instructions, and query the database to determine the response result corresponding to the service request.
[0114] The second database watermark generating module 1002 is configured to determine the generation of a second database watermark according to the position information of the response result corresponding to the service request in the database.
[0115] The database watermark information generating module 1003 is configured to integrate the first database watermark and the second database watermark into database watermark information, and send the database watermark information and the response result corresponding to the service request to the API system.
[0116] Embodiment 6
[0117] This application provides a knowledge graph construction device, as Figure 11 shown, including:
[0118] The watermark embedding response information receiving module 1101 is configured to receive the watermark embedding response information sent by the client, and determine the watermark integration result according to the first API watermark, the second API watermark and the database watermark information in the watermark embedding response information.
[0119] The entity determination module 1102 is configured to determine entity, entity relationship and entity attribute information according to the watermark integration result, database data resources and API data resources.
[0120] The knowledge graph construction module 1103 is configured to construct a knowledge graph according to the entity, the entity relationship and the entity attribute information.
[0121] Embodiment 7
[0122] This application also provides a knowledge graph construction device, including at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the knowledge graph construction method provided in the above embodiments.
[0123] As Figure 12 shown, the device includes a processor 1201, a memory 1202, a communication interface 1203 and a bus 1204. Among them, the processor 1201, the memory 1202 and the communication interface 1203 are interconnected through the bus 1204.
[0124] The processor 1201 is configured to read and execute the instructions in the memory 1202 so that at least one processor can execute the knowledge graph construction method provided in the above embodiments.
[0125] A memory 1202 for storing various instructions and programs of the method for constructing the knowledge graph provided in the above embodiments.
[0126] The bus 1204 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 12 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0127] The processor 1201 can be a central processing unit (CPU), a network processor (NP), a graphic processing unit (GPU), or any combination of CPU, NP, and GPU. It can also be a hardware chip. The above hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0128] In addition, the present application also provides a computer-readable storage medium, such as Figure 13 shown, the computer storage medium stores a computer program, and the computer program is used to cause a computer to execute any one of the methods in the above embodiments.
[0129] The memory may include a readable medium in the form of volatile memory, such as a random access memory (RAM) 1301 and / or a cache memory 1302, and may further include a read-only memory (ROM) 1303.
[0130] The memory may also include a program / utilities 1305 having a set (at least one) of program modules 1304, such program modules 1304 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a network environment.
[0131] Those skilled in the art will appreciate that the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
[0132] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general purpose computer, a special purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0133] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0135] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to cover these changes and modifications.
Claims
1. A method for constructing a knowledge graph, characterized in that, including: Receiving a service request sent by a client, and generating a first API watermark according to user information corresponding to the service request; Generating a database operation instruction according to the service request, and invoking a database system according to the database operation instruction, so that the database system determines a response result corresponding to the service request and database watermark information; Embedding the watermark into the response information and sending it to the client, so that the server constructs a knowledge graph according to the watermark-embedded response information received by the client; wherein, the watermark-embedded response information includes a response result corresponding to the service request, the first API watermark, a second API watermark determined according to API call information, and the database watermark information.
2. The method according to claim 1, wherein The user information corresponding to the service request includes at least one of the following: user ID, access time corresponding to the service request, client IP, session ID corresponding to the service request.
3. The method according to claim 1, wherein The determining the second API watermark according to API call information includes: Generating a second API watermark according to at least one of the called API interface, user ID, client IP, and sending time of the watermark-embedded response information.
4. The method according to claim 1, characterized in that, Before embedding the watermark into the response information and sending it to the client, it further includes: Processing the response result corresponding to the service request according to a preset business logic; Assembling the processed response result corresponding to the service request according to the API document in a preset output parameter format.
5. A method for constructing a knowledge graph, characterized in that, including: Receiving a database operation instruction sent by an API system, generating a first database watermark according to the database operation instruction, and querying the database to determine a response result corresponding to the service request; Determining a second database watermark to be generated according to position information of the response result corresponding to the service request in the database; Integrating the first database watermark and the second database watermark into database watermark information, and sending the database watermark information and the response result corresponding to the service request to the API system.
6. A method for constructing a knowledge graph, characterized in that, including: Receiving watermark-embedded response information sent by a client, and determining a watermark integration result according to the first API watermark, the second API watermark, and the database watermark information in the watermark-embedded response information; Determining entity, entity relationship, and entity attribute information according to the watermark integration result, database data resources, and API data resources; Constructing a knowledge graph according to the entity, the entity relationship, and the entity attribute information.
7. An apparatus for constructing a knowledge graph, characterized in that, including: A first API watermark generation module, configured to receive a service request sent by a client, and generate a first API watermark according to user information corresponding to the service request; A database operation instruction generation module, configured to generate a database operation instruction according to the service request, and invoke a database system according to the database operation instruction, so that the database system determines a response result corresponding to the service request and database watermark information; The watermark embedding response information sending module is used to send the watermark embedding response information to the client, so that the server constructs a knowledge graph according to the watermark embedding response information received by the client; wherein, the watermark embedding response information includes the response result corresponding to the service request, the first API watermark, the second API watermark determined according to the API call information, and the database watermark information.
8. An apparatus for constructing a knowledge graph, characterized in that Comprising: The database operation instruction receiving module is used to receive the database operation instruction sent by the API system, generate the first database watermark according to the database operation instruction, and query the database to determine the response result corresponding to the service request; The second database watermark generating module is used to determine the generation of the second database watermark according to the position information of the response result corresponding to the service request in the database; The database watermark information generating module is used to integrate the first database watermark and the second database watermark into database watermark information, and send the database watermark information and the response result corresponding to the service request to the API system.
9. An apparatus for constructing a knowledge graph, characterized in that, The device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-4 or claim 5 or claim 6.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, and the computer program is used to cause a computer to execute the method according to any one of claims 1-4 or claim 5 or claim 6.
Citation Information
Patent Citations
Watermark processing and data traceability method based on false lines and false rows
CN107992726A
Watermark embedding method for embedded application system plug-in
CN114285669A
Dynamic information protection method and device based on API interface
CN115270191A
Full-link data tracing method based on local data consanguinity digital watermarking
CN117131477A
Data leakage prevention method and device in external interaction scene of electric power data
CN117688597A