Knowledge hypergraph generation method, device, terminal device and storage medium

Through a dual-channel network, the identification of entities and relationships is generated and the knowledge hypergraph is solved, which is a problem of inefficiency caused by the lack of universality of inference algorithms in the existing technology, and an efficient knowledge hypergraph construction that adapts to different data architectures is achieved.

CN114357177BActive Publication Date: 2024-11-05CHINA GREATWALL TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111491767.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2024-11-05
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

When constructing existing knowledge hypergraphs, the inference algorithm lacks universality, which makes the knowledge hypergraphs of data systems time-consuming and labor-intensive, inefficient, and unable to adapt to data systems of different architectures.

Method used

A dual-channel network is designed, and the entity is identified through the first preset network and the hidden vector is obtained. The second preset network is used to identify the relationship type between entities, generate a knowledge supermap, and fully consider the correlation between the relationship between entities.

Benefits of technology

It improves the efficiency of knowledge hypergraph generation, is suitable for different data architecture systems, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357177B_ABST
    Figure CN114357177B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of computer technology, and provides a method, device, terminal device and storage medium for generating a knowledge hypergraph. The method is applied to a data system, and the data system includes a first-level node. The method includes: for the first data under the first-level node, input the first data into a first preset network, and identify each entity in the first data; obtain a hidden vector of the first data, and the hidden vector is the intermediate data obtained after inputting the first data into the first preset network; input the hidden vector of the first data into a second preset network, and identify the relationship type between adjacent entities in the first data; generate a knowledge hypergraph of the first-level node according to the identified entities in the first data and the relationship type between adjacent entities in the first data. The above method improves the generation efficiency of the knowledge hypergraph, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a method, apparatus, terminal device and storage medium for generating a knowledge hypergraph. Background Art

[0002] With the development of artificial intelligence technology, more and more intelligent technologies are applied to production and life, involving various fields. As a big data processing method, knowledge graph has achieved very significant results in processing customer data in the fields of finance, medicine, etc. At present, many smart factory construction plans also use knowledge graph as a solution for processing enterprise data.

[0003] Taking into account the uniformity and correlation of data in some application scenarios (such as smart factories), the existing knowledge hypergraph is constructed by using reasoning algorithms to explore the connections between entities. However, the reasoning algorithm lacks versatility and is not intelligent enough. For data systems with different architectures, the corresponding reasoning algorithm needs to be redesigned, which makes the construction of the knowledge hypergraph of the data system time-consuming, labor-intensive and inefficient. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, terminal device and storage medium for generating a knowledge hypergraph, which can improve the generation efficiency of the knowledge hypergraph and thus enhance the user experience.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a knowledge hypergraph, which is applied to a data system, wherein the data system includes a first-level node, and the method includes:

[0006] For first data under the first-level node, input the first data into a first preset network, and identify each entity in the first data;

[0007] Obtaining a hidden vector of the first data, where the hidden vector is intermediate data obtained after the first data is input into the first preset network;

[0008] Inputting the hidden vector of the first data into a second preset network to identify the relationship type between adjacent entities in the first data;

[0009] A knowledge hypergraph of the first-level nodes is generated according to the identified entities in the first data and the relationship types between adjacent entities in the first data.

[0010] In a second aspect, an embodiment of the present application provides a knowledge hypergraph generation device, which is applied to a data system, wherein the data system includes a first-level node, and the device includes:

[0011] An entity identification module, for first data under a first-level node, inputting the first data into a first preset network, and identifying each entity in the first data;

[0012] An acquisition module, used to acquire a hidden vector of the first data, where the hidden vector is intermediate data obtained after the first data is input into the first preset network;

[0013] a relationship identification module, configured to input the hidden vector of the first data into a second preset network, and identify the relationship type between adjacent entities in the first data;

[0014] The first generating module is used to generate a knowledge hypergraph of the first-level nodes according to the identified entities in the first data and the relationship types between adjacent entities in the first data.

[0015] In a third aspect, an embodiment of the present application provides a data system, which includes a first-level node and a second-level node, and the data system is used to implement the method for generating a knowledge hypergraph described in any one of the first aspects above.

[0016] In a fourth aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating a knowledge hypergraph described in any one of the first aspects above when executing the computer program.

[0017] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and wherein when the computer program is executed by a processor, the method for generating a knowledge hypergraph described in any one of the first aspects above is implemented.

[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the method for generating a knowledge hypergraph described in any one of the above-mentioned first aspects.

[0019] The beneficial effects of the first aspect embodiment of the present application compared with the prior art are as follows: for the first data under the first-level node in the data system, each entity in the first data is identified by inputting the first data into the first preset network; the hidden vector of the first data is obtained, and the hidden vector is the intermediate data obtained after the first data is input into the first preset network; the hidden vector of the first data is input into the second preset network to identify the relationship type between adjacent entities in the first data; according to the identified entities in the first data and the relationship type between adjacent entities in the first data, a knowledge hypergraph of the first-level nodes is generated, so that by designing the dual channels of the first preset network and the second preset network, the same set of data, namely the entities in the first data and the relationships between the entities, is obtained, the correlation between the relationships between entities is fully considered, and the generation efficiency of the knowledge hypergraph is improved.

[0020] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a schematic flow chart of a method for generating a knowledge hypergraph provided in an embodiment of the present application;

[0022] Figure 2 yes Figure 1 Schematic diagram of specific implementation process steps of step S101;

[0023] Figure 3 It is a schematic diagram of the structure of the long short-term memory unit;

[0024] Figure 4 is a schematic flow chart of a method for generating a knowledge hypergraph provided in another embodiment of the present application;

[0025] Figure 5 A schematic diagram of a knowledge hypergraph of a smart factory generated by applying the method of this embodiment;

[0026] Figure 6 It is a relational diagram of a single super-relational fact;

[0027] Figure 7 It is a schematic diagram of the structure of a knowledge hypergraph generation device provided in one embodiment of the present application;

[0028] Figure 8 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0029] To facilitate understanding, we first briefly describe the knowledge hypergraph.

[0030] The knowledge hypergraph is a derivative of the knowledge graph. The knowledge graph can be divided into the model layer and the data layer at the logical architecture level. The model layer is above the data layer and is the core of the knowledge graph. The main content is the data structure of knowledge, including the hierarchical structure and hierarchical relationship definition of knowledge classes such as entity, relation, attribute, etc., which constrains the specific knowledge form of the data layer.

[0031] The data layer uses fact triples and other knowledge as units to store specific data information. Knowledge graphs are generally represented by triples G = {E, R, F}. Among them, E represents the entity set {e1, e2, ..., e E}, entity e is the most basic component of the knowledge graph, referring to objective and distinguishable things, which can be specific people, things, or abstract concepts. R represents the relationship set {r1, r2, …, r R}, the relationship r is an edge in the knowledge graph, indicating a certain connection between different entities. F represents the fact set {f1,f2,…,f F}, each fact f is defined as a triple (h, r, t) ∈ f. Among them, h represents the head entity, r represents the relationship, and t represents the tail entity. For example, the basic types of facts can be represented by triples such as (entity, relationship, entity) and (entity, attribute, attribute value). In general, the knowledge graph can be regarded as a structured representation of facts, including the entities, relationships, attributes and semantic descriptions of facts.

[0032] Although knowledge graphs are widely used, triple-based representation methods often oversimplify the complexity of data stored in knowledge graphs. In particular, for hyper-relational data connecting two or more entities, knowledge hypergraphs come into being. Knowledge hypergraphs are a special type of heterogeneous graph. Heterogeneous graphs are represented as a collection of nodes and edges and are widely present in many scenarios in the real world. For example, social networks that represent relationships between people, citation networks between authors and papers, etc.

[0033] Specifically, the knowledge hypergraph is represented as H = (V, E), where V represents the entity set, E represents the hyperrelation set, and the basic unit is the hyperrelation fact = (e, v1, v2, ..., v n ).

[0034] The following combination Figure 1 The method for generating the knowledge hypergraph of the embodiment of the present application is described in detail.

[0035] Figure 1A schematic flow chart of the method for generating a knowledge hypergraph provided by the present application is shown. The method applies a data system, and the data system includes a first-level node. It should be noted that the method of the embodiment of the present application is applicable to the application scenario of a smart factory. The data system is a data system of a smart factory. Among them, the smart factory is an important carrier for realizing intelligent manufacturing, which mainly realizes the intelligence of the production process by building an intelligent production system and networked distributed production facilities. Figure 1 The detailed description of the generation method of the knowledge hypergraph is as follows:

[0036] S101, for first data under a first-level node, input the first data into a first preset network, and identify each entity in the first data.

[0037] Optionally, the first-level node includes multiple child nodes, and the first data includes sub-data under each child node.

[0038] If the data system of the embodiment of the present application is a data system of a smart factory, the first-level node is the first data layer of the smart factory, wherein the first data layer is any one of the multiple data layers of the smart factory.

[0039] It should be noted that the data of smart factories can be divided into multiple layers according to the enterprise architecture. For example, the enterprise architecture of smart factories is divided into the decision-making layer, the department management layer and the department execution layer from top to bottom. Then the data of smart factories is divided into the data layer corresponding to the decision-making layer, the data layer corresponding to the department management layer and the data layer corresponding to the department execution layer.

[0040] Among them, the decision-making layer, department management layer and department execution layer are further divided into different departments according to different functions. Therefore, in this application scenario, the sub-node is a department with preset functions, the sub-data under the sub-node is the data within the department with preset intelligence, and the entities in the identified first data include entities corresponding to each department.

[0041] When the first data includes sub-data under each sub-node, step S101 may specifically include:

[0042] For the sub-data under each sub-node in the first data, the sub-data is input into the first preset network, and each entity in the sub-data corresponding to each sub-node is identified.

[0043] It should be noted that the first preset network includes a first long short-term memory network and a second long short-term memory network.

[0044] The first data is first input into the first long short-term memory network to obtain the hidden vector of the first data, and then the hidden vector of the first data is input into the second long short-term memory network to identify each entity in the first data. The specific implementation process is detailed in Example 1.

[0045] S102, obtaining a hidden vector of the first data, where the hidden vector is intermediate data obtained after the first data is input into a first preset network.

[0046] When the first data includes sub-data under each sub-node, the implementation process of step S102 may include: obtaining a hidden vector of the sub-data under each sub-node.

[0047] S103, inputting the hidden vector of the first data into a second preset network to identify the relationship type between adjacent entities in the first data.

[0048] Optionally, the second preset network is a convolutional neural network (CNN).

[0049] When the first data includes sub-data under each sub-node, the implementation process of step S103 may include: inputting the hidden vector of the sub-data under each sub-node into the second preset network, and identifying the relationship type between adjacent entities in the sub-data under each sub-node.

[0050] Through the above steps, it can be seen that the embodiment of the present application designs a dual channel, namely a long short-term memory network and a neural network, and obtains the entities in the same set of data (namely the first data) and the relationships between entities, fully considering the correlation between entities and the relationships between entities, and no longer divides entity recognition and relationship extraction into two subtasks for separate research, thereby improving the generation efficiency of the knowledge hypergraph.

[0051] S104: Generate a knowledge hypergraph of first-level nodes according to the identified entities in the first data and the relationship types between adjacent entities in the first data.

[0052] It should be noted that when the first data includes sub-data under each sub-node, a knowledge hypergraph corresponding to each sub-node is generated based on each entity in the sub-data corresponding to each identified sub-node and the relationship type between adjacent entities in the sub-data under each sub-node.

[0053] Embodiment 1

[0054] It should be noted that in the generation of knowledge hypergraphs, there are mainly two types of data, structured data and unstructured data. Structured data is data in tabular form, such as corporate attendance sheets, purchase sheets and other data. This type of data is easy for computers to recognize. As long as it is input, the relationship between entities can be extracted to form a knowledge graph. It is more complicated to process unstructured data, such as text content such as plans and project books. This type of data requires a certain level of understanding to extract entities and relationships in the text.

[0055] In the application scenario of smart factories, most of the data generated by the executive department of an enterprise are structured data of a statistical nature, while the documents such as plans formulated by the decision-making level of the enterprise are what really determine the direction of the entire enterprise. In order to achieve zero-barrier communication from top to bottom in the entire enterprise, and to achieve the goal of data being available and updated at any time, it is necessary to focus on processing unstructured data.

[0056] Therefore, refer to Figure 2 In a possible implementation, the implementation process of step S101 may include:

[0057] S1011: If the first data is a first text, segment the first text into sentences to obtain a plurality of first sentences.

[0058] S1012: for each first sentence in the first text, input the first sentence into a preset word skipping model to obtain a first character vector corresponding to each character in the first sentence, where the first character vector is used to represent the word attribute of the character.

[0059] Optionally, the preset skip-gram model is a Skip-Gram skip-gram model.

[0060] In this step, each character in the first sentence refers to each word in the first sentence. The first character vector refers to a word vector.

[0061] Optionally, the implementation process of step S1012 may specifically include:

[0062] A word in the first sentence is selected as an input word; based on a pre-set word skipping window and a pre-set number of word skipping, multiple groups of candidate output words are obtained, and a word vector of the word is determined from the multiple groups of candidate output words based on a neural network.

[0063] Here, the word-skipping window represents the number of words selected from one side (left or right) of the position of the current input word. The number of word-skipping represents the number of different word groups selected from the entire word-skipping window.

[0064] S1013, calculating and obtaining a second character vector corresponding to each character in the first sentence according to a preset word segmentation dictionary, where the second character vector is used to represent a word attribute of the character.

[0065] Here, the word encoding information about the characters is recorded in the preset word segmentation dictionary. Specifically, the word encoding information about the characters in the dictionary is recorded in three sets: I, M, and B. Taking character a in the text as an example, set I stores the information of words in the dictionary that start with character a, set M stores the information of words in the dictionary that character a is neither at the beginning nor at the end, and set B stores the information of words in the dictionary that end with character a.

[0066] Specifically, the implementation process of step S1013 may include:

[0067] Sa1, according to the preset word segmentation dictionary, obtain the first word segmentation set, the second word segmentation set and the third word segmentation set corresponding to each character in the first sentence, the first word segmentation set includes the word code starting with the character, the second word segmentation set includes the word code when the character is in the middle position of the word, and the third word segmentation set includes the word code ending with the character.

[0068] Sa2, according to the first word segmentation set corresponding to each character in the first sentence, calculate the first word segmentation vector corresponding to each character.

[0069] Sa3, according to the second word segmentation set corresponding to each character in the first sentence, calculate the second word segmentation vector corresponding to each character.

[0070] Sa4, according to the third word segmentation set corresponding to each character in the first sentence, calculate the third word segmentation vector corresponding to each character.

[0071] In the above steps Sa2 to Sa4, each word segmentation vector corresponding to a character can be calculated by the following calculation formula (1):

[0072]

[0073] For the i-th word in the set, |s| represents the number of words in the set, and w i represents the weight of the i-th word, e i Represents the vector in the dictionary corresponding to the i-th word.

[0074] Specifically, the first word segmentation vector can be expressed as v (I) , the second word segmentation vector can be expressed as v (M) , the third word segmentation vector can be expressed as v (B)

[0075] Here, the purpose of setting the weight is to filter out words that are in line with the environment corresponding to the data system. For example, if the data system is a data system of a smart factory, the purpose of setting the weight is to filter out words that are in line with the environment of the smart factory.

[0076] Sa5, concatenate the first word segmentation vector, the second word segmentation vector, and the third word segmentation vector corresponding to each character in the first sentence to obtain a second character vector corresponding to each character in the first sentence.

[0077] Specifically, the second character vector corresponding to the character can be calculated by the following calculation formula (2):

[0078]

[0079] A second character vector representing the character a.

[0080] It should be noted that each character in the first sentence refers to each word in the first sentence. The second character vector refers to the word vector of the word formed by the word in the first sentence. Here, if the word formed by the word is still itself, the second character vector represents the word vector of the word.

[0081] S1014, concatenating the first character vector and the second character vector corresponding to each character in the first sentence to obtain a third character vector for each character in the sentence.

[0082] Specifically, the third character vector corresponding to the character can be calculated by the following calculation formula (3):

[0083]

[0084] Among them, W (a) The third character vector representing the character a, The first character vector representing the character a, Second character vector representing the character a.

[0085] It should be noted that the third character vector of a character has not only word attributes but also word attributes, which can enrich the background information of the character.

[0086] Finally, the entire sentence of the first sentence can be formally expressed as W = (W1, ...W t ,W t+1 ,…,W n ), where W t+1 ∈R d , where W t+1 Represents the d-dimensional word vector corresponding to the encoding of the t-th character in the sentence, and n is the length of the input sentence.

[0087] S1015, input the third character vector of each character in the first sentence into the first long short-term memory network to obtain the hidden vector of each character in the first sentence, and the hidden vector of the first text includes the hidden vector of each character in the first text.

[0088] Here, the first LSTM network is a bidirectional LSTM network, which includes a forward LSTM network and a backward LSTM network. The forward LSTM network and the backward LSTM network are both composed of several forward LSTM units. Each memory unit is composed of an input gate, an output gate, and a forget gate. The structure of a single memory unit is as follows: Figure 3 .

[0089] Calculate the hidden vector h of each character in the first sentence t, the third character vector of each character in the first sentence needs to be input into the forward LSTM network and the backward LSTM network respectively, and calculated in several memory units in the corresponding networks. The result of the output gate of the memory unit in the forward LSTM network is expressed as The result representation of the output gate of the memory unit in the backward long short-term memory network

[0090] First, calculate the input of the memory unit in the forward long short-term memory network: in is the hidden vector obtained by the output gate of the previous memory unit in the forward long short-term memory network, is the cell array cell vector in the previous memory unit in the forward LSTM network. Similarly, the input of the memory unit in the backward LSTM network is The calculation formula for a single memory unit is as follows:

[0091]

[0092]

[0093] c t =f t ·c t-1 (6)

[0094]

[0095] h t =o t ·tanh(c t ) (8)

[0096] Among them, formulas (4), (5), and (7) are respectively used to calculate When ω, the calculation results of the input gate, forget gate and output gate in the memory unit are as follows: Formula (6) is the calculation result in the cell determined by the previous memory unit. (·) is the parameter matrix, b (·) is the bias of different gates. Finally, the hidden vector of a character can be expressed as:

[0097] S1016, inputting the hidden vector of each character in the first sentence into the second long short-term memory network to identify each entity in the first data.

[0098] In a possible implementation, the implementation process of step S1016 may include:

[0099] Sb1, performing vector transformation on the hidden vector of each character in the first sentence to obtain a label prediction vector corresponding to each character in the first sentence.

[0100] Specifically, the label prediction vector corresponding to the character can be calculated by the following calculation formula (9):

[0101] T t =ω t .h t +b T (9)

[0102] Among them, ω t is the parameter matrix, T t is the label prediction vector corresponding to the tth character in the first sentence.

[0103] Sb2, input the label prediction vector corresponding to each character in the first sentence into the fully connected layer to obtain the first calculation result.

[0104] Specifically, the first calculation result can be calculated by the following formula (10):

[0105] y t =ω y .T t +b y (10)

[0106] Among them, ω y is the fully connected layer matrix. t is the first calculation result corresponding to the t-th character in the first sentence.

[0107] Sb3, performing label probability calculation according to the first calculation result to obtain the probability of the entity to which each character in the first sentence belongs.

[0108] Specifically, the probability of the entity to which a character belongs can be calculated by the following formula (11):

[0109]

[0110] in, is the probability corresponding to the entity to which the tth character belongs in the first sentence, and nt represents the number of labels.

[0111] Sb4: If there is a target character that meets a second preset condition, the target character is determined as an entity, and the second preset condition is that the probability value of the entity to which the character belongs is greater than or equal to a second preset threshold.

[0112] Each entity in the first data is identified through the above steps. In order to obtain the relationship type between adjacent entities in the first data, in a possible implementation, step S103 may include:

[0113] S1031, merge the hidden vectors of each of two adjacent entities in the first data and the third character vectors of the characters between the adjacent entities in the first data to obtain a connection matrix.

[0114] Here, if the first data is the first text, each first sentence in the first text is composed of several characters (words), among which there are several entities, and there are also several non-entity words between two entities to express the logical relationship between the entities. Therefore, the vectors of adjacent entities and non-entity words between entities in the first sentence are extracted and merged and input into the convolutional neural network, so that the classification of the relationship between adjacent entities can be realized.

[0115] S1034: Input the connection matrix into the second preset network to obtain the relationship type between adjacent entities in the first data.

[0116] It should be noted that the relationship type between adjacent entities in the first data can be formally expressed as:

[0117] R = CNN[h e1 ,W e1 ,W e1-1 ,W e1-2 ,…W e2 ,h e2 ]

[0118] Specifically, the second preset network is a convolutional neural network, and the convolutional neural network includes a convolution layer, a maximum pooling layer, and a connection layer. Step S1034 may include:

[0119] Sc1, input the connection matrix into the convolution layer and perform convolution operations using multiple convolution kernels to obtain multiple relationship feature vectors between adjacent entities in the first data.

[0120] Specifically, multiple relationship feature vectors between adjacent entities in the first data can be calculated using the following formula (12):

[0121]

[0122] in, The convolution kernel Scroll through the character S in the first sentence l To character S l+k-1 The relational feature vector extracted from the matrix composed of r is the bias. Therefore, for a complete first sentence S, the extracted relation feature vector can be expressed as:

[0123]

[0124] Sc2, multiple relationship feature vectors between adjacent entities are input into the maximum pooling layer for pooling processing, and the first relationship feature vector between adjacent entities extracted by all convolution kernels is retained.

[0125] It should be noted that after multiple relationship feature vectors between adjacent entities are input into the maximum pooling layer for pooling, the most significant relationship feature vector between adjacent entities is retained. The relationship feature vectors between adjacent entities extracted by all retained convolution kernels can be formally expressed as:

[0126] Here, nr represents the number of convolution kernels.

[0127] Sc3, input the first feature vectors between adjacent entities extracted by all convolution kernels into the connection layer for relationship feature classification, and obtain the relationship type between adjacent entities in the first data.

[0128] It should be noted that the fully connected layer is mixed with a dropout layer. Specifically, the relationship features are classified using the following formula (13):

[0129]

[0130] Among them, r is the Bernoulli equation, that is, a vector with a value of 1 or 0 is randomly generated, ω R is the parameter matrix, b R is bias.

[0131] Afterwards, the probability of the relationship type between adjacent entities in the first data is calculated using the following formula (14).

[0132]

[0133] Where nc is the number of relationship types.

[0134] Finally, if the relationship type corresponding to the largest probability value among the calculated probability values ​​is determined as the relationship type between adjacent entities in the first data.

[0135] It should be noted that the purpose of adding a dropout layer to the fully connected layer is to prevent overfitting and improve the robustness of the neural network model.

[0136] At this point, the entities in the first data identified in the above implementation manner and the relationship types between adjacent entities in the first data can generate a knowledge hypergraph of first-level nodes.

[0137] It should be noted that when the first data includes sub-data under each sub-node, a knowledge hypergraph corresponding to each sub-node is generated based on each entity in the sub-data corresponding to each identified sub-node and the relationship type between adjacent entities in the sub-data under each sub-node.

[0138] Furthermore, a knowledge graph for each subnode is generated based on each entity in the sub-data corresponding to each subnode and the relationship type between adjacent entities in the sub-data under each subnode; a knowledge hypergraph corresponding to each subnode is generated based on the knowledge graph of each subnode and the hyperedges corresponding to each subnode.

[0139] It should be noted that the hyperedge corresponding to each sub-node can be pre-assigned to each sub-node according to the functions performed by each sub-node. The hyperedge is used to identify the data of the sub-node, specifically to identify which level of node the data of the sub-node belongs to, and the function performed by the sub-node.

[0140] Take the application scenario of smart factory as an example to illustrate the significance of assigning hyperedges to each child node. Assuming that all entities and relationships of all data in the entire smart factory are found and then layered, it will be a huge task. Simply designing a model to classify the complex entity relationships of the decision-making and execution layers with the same functions requires a large amount of data from smart factories with the same organizational structure as training data. In actual production, the production data corresponding to smart factories are all confidential, and it is not easy to obtain a large amount of data for training. Therefore, this application first assigns labels to the data in the smart factory and classifies them according to the source. For example, the data of the decision-making layer is divided into one layer, and the data of the execution layer is divided into one layer. Then, the data at the same layer is classified according to the functional departments. For example, the data of the human resources management department of the execution layer is divided into one set, and the data of the sales department is divided into another set. Then, according to the labels assigned to the data, the data of the same layer and the same department can be divided into the same hyperedge, and then the entities and relationships of the data in each hyperedge are extracted. That is, the data of the same subnode under the same level node are divided into the same hyperedge, and then the data in each hyperedge are subjected to entity recognition and relationship extraction to construct a multi-layer knowledge hypergraph, which reduces the complexity of data processing and improves the efficiency of data processing.

[0141] In order to understand the knowledge hypergraph more intuitively, the following table uses a matrix to represent the knowledge hypergraph of a certain level of nodes.

[0142] v1 v2 … v e1 e2 … en v1 0 1 … 1 0 1 … 0 v2 1 0 … 0 0 1 … 0 … … … … … … … … … v 0 0 … 0 0 0 … 0

[0143] In the above table, the relationship between entities v1, v2…vn is represented by the encoding result of the relationship type, and the hyperedge is represented by 1. For example, there is a type 1 relationship between entities v1 and v2, and v1 and v2 both belong to hyperedge e2.

[0144] Through the above implementation method, a knowledge hypergraph with multiple levels of nodes can be generated, that is, a multi-layer knowledge hypergraph. If the multi-layer knowledge hypergraph is applied to the smart factory, the knowledge hypergraph corresponding to the decision-making layer, the knowledge hypergraph of the department management layer, and the knowledge hypergraph of the department execution layer are obtained. However, it should be noted that multiple departments within the smart factory need to work closely together to improve production efficiency, and the close cooperation of multiple departments requires certain logical relationships. Usually, due to the different architectures of different smart factories, when realizing the circulation and unification of data, certain logical rules are required to explore the potential connections between departments and avoid barriers between departments. In this way, when problems occur with certain products, comprehensive information about the departments that handle the problem products can be provided, which is convenient for subsequent identification of the links where the problems occur and analysis of the causes of the problems.

[0145] In order to achieve the above purpose, refer to Figure 4 Furthermore, the data system further includes a second-level node, and the method further includes:

[0146] S201, generating a knowledge hypergraph of second-level nodes, wherein the second-level nodes are upper-level nodes of the first-level nodes.

[0147] It should be noted that the specific implementation process of step S201 may include:

[0148] S2011, for the second data under the second-level node, input the second data into the first preset network, and identify each entity in the second data.

[0149] S2012, obtaining a hidden vector of the second data, where the hidden vector is intermediate data obtained after the second data is input into the first preset network.

[0150] S2013, inputting the hidden vector of the second data into a second preset network to identify the relationship type between adjacent entities in the second data.

[0151] S2014: Generate a knowledge hypergraph of second-level nodes based on the identified entities in the second data and the relationship types between adjacent entities in the second data.

[0152] The above method of generating the knowledge hypergraph of the second-level nodes is the same as the method of generating the knowledge hypergraph of the first-level nodes. The detailed implementation steps can be referred to Figure 1 , I will not go into details here.

[0153] S202, calculating association data between entities in the first-level nodes and entities in the second-level nodes according to the knowledge hypergraph of the first-level nodes and the knowledge hypergraph of the second-level nodes.

[0154] Optionally, the implementation process of step S202 may include:

[0155] S2021, extract the first feature vector of each entity in the knowledge hypergraph of the first-level node, where the first feature vector is used to characterize the semantic features of the entity.

[0156] Optionally, the implementation process of S2021 may include:

[0157] Sd1, encodes each entity in the knowledge hypergraph of the first-level node to obtain the encoding matrix corresponding to each entity in the first-level node.

[0158] Here, when the first data includes sub-data under each sub-node, each entity in the hyperedge corresponding to each sub-node is encoded to obtain a coding matrix.

[0159] Specifically, the encoding matrix of an entity can be formally expressed as H eij ∈R D×D , where D represents the dimension of the matrix. Then the encoding matrix of a hyperedge containing multiple entities can be expressed as H ei =[H ei1 ,H ei2 ,…,H eij ,…,H ein ].

[0160] Sd2, extracts the semantic features corresponding to each entity in the first-level node according to the encoding matrix of each entity in the first-level node.

[0161] Specifically, the same convolution kernel can be used to extract the semantic features of each entity according to the encoding matrix of each entity in the first-level node. The semantic features of each entity can be expressed as sigmoid (W c *H eij +b eij ), where W c is the convolution kernel, b eij is bias.

[0162] Sd3, concatenates the semantic features of each entity in the first-level node with the timestamp to obtain the first feature vector corresponding to each entity in the first-level node, where the timestamp is the time information of the first data.

[0163] Specifically, the first eigenvector corresponding to each entity can be calculated by the following formula (15):

[0164]

[0165] Among them, τ eij It is the time information of the first data.

[0166] It should be noted that the purpose of introducing timestamps when calculating the feature vector of an entity is to facilitate data retrieval in subsequent practical applications. For example, in actual production, entities in the same department may generate multiple data in different time periods. When judging whether there is a relationship between two entities through their semantic features, timestamps are introduced for screening. By comparing whether the timestamps of the two semantic features are consistent with the production process of the product, it can be judged whether there is a relationship between the two entities.

[0167] For example, the structural data generated by the quality inspection department on May 2, 2021 should have a relationship with the structural data generated by the product production department before May 2, 2021, and can only be traced back to the date when the previous quality inspection department generated the quality inspection data. In this way, when a problem occurs in a certain link of product production, it can be accurately traced back to the link where the problem occurred and the relevant work department, discover the cause of the problem and make timely rectification to improve production efficiency.

[0168] S2022, extracting the second feature vector of each entity in the knowledge hypergraph of the second-level node, where the second feature vector is used to characterize the semantic features and relational features of the entity.

[0169] Specifically, the second eigenvector of each entity in the knowledge hypergraph of the second-level node can be extracted by the following formula (16).

[0170] h v =ReLU(∑ u,v∈N(v) ω v (h u ×h r )) (16)

[0171] Where N(v) represents the number of entities, h u ×h r Represents the product of the adjacent points and the connected relationship of the current entity, ω v is the parameter matrix.

[0172] S2023, calculating the similarity between the first eigenvector and the second eigenvector.

[0173] Specifically, the similarity between the first eigenvector and the second eigenvector can be calculated by the following formula (17):

[0174] min||h v -z eij ||2(17)

[0175] Wherein, formula (17) is a loss function. The formula can be used to compare the similarity between the first eigenvector and the second eigenvector. The smaller the result value calculated by formula (17), the smaller the difference between the first eigenvector and the second eigenvector, and the higher the similarity.

[0176] S2024, if there are a first feature vector and a second feature vector that meet a preset condition, generating association data between an entity corresponding to the first feature vector and an entity corresponding to the second feature vector, wherein the preset condition is that the similarity between the first feature vector and the second feature vector is greater than a preset threshold.

[0177] Specifically, the preset condition is that the similarity between the first feature vector and the second feature vector is greater than a preset threshold, indicating that the entities corresponding to the feature vectors with high similarity have an association relationship, that is, the entity under the next-level node has an association relationship with the entity under the previous-level node.

[0178] If the first feature vector that meets the preset conditions corresponds to the first entity, and the second feature vector that meets the preset conditions corresponds to the second entity, since the second feature vector also includes the relationship features of the entities, the third entity that has an entity relationship with the first entity under the second-level node can also be found through the relationship features in the second feature vector that meets the preset conditions; if the third entity also has an association relationship with the fourth entity under the first-level node, then since the first entity and the third entity that belong to the second-level node have an entity relationship, the second entity and the fourth entity that belong to the first-level node also have the entity relationship. In other words, since the entity relationship under the upper-level node reflects the relationship between the entities under the lower-level node, the hidden relationship between the entities under the lower-level node is found through the relationship between the entities under the upper-level node.

[0179] For example, in the application scenario of smart factories, the architecture design data or plans of the decision-making layer have already designed the logical relationship between the departments in the data layer below the decision-making layer. Therefore, for smart factories with different architectures, there is no need to design special logic rules when mining hidden relationships. It is only necessary to map the relevant entities in the data layer below the decision-making layer to the knowledge hypergraph of the decision-making layer based on the relationship between the entities in the knowledge hypergraph of the decision-making layer, and find the hidden relationship between entities in the same data layer below the decision-making layer. This method has a wide coverage and is applicable to data systems with different architectures.

[0180] To illustrate this process, there is an intelligent factory with a decision-making layer and an execution layer. The decision-making layer includes the decision-making department, and the execution layer includes the production department and the processing department. The production plan formulated by the decision-making department of the decision-making layer is: the production department produces first and then hands it over to the processing department for processing. Then the knowledge hypergraph of the decision-making layer has only two entities, production and processing, while the execution layer has two hyperedges: production department and processing department. Within the hyperedge of the production department, there are many entities of the subordinate departments of the production department, and there are relationships between them around the production process of the product. The same is true for the processing department.

[0181] We can use the above method to obtain the feature vector of the production department hyperedge, compare it with the feature vector of the entity "production" in the decision layer, and then map it. Then, based on the existing relationship in the decision layer knowledge graph, we can infer that there is a connection between the production department and the processing department. In this way, we can obtain the potential relationship between departments at different levels and the relationship between different departments at the same level. When we need to find a problem with a product, we can trace back to the data within the department and the data of related departments based on the knowledge hypergraph.

[0182] S203, generating a knowledge hypergraph of the data system according to the knowledge hypergraph of the first-level nodes, the knowledge hypergraph of the second-level nodes, and the association data between the entities in the first-level nodes and the entities in the second-level nodes.

[0183] The knowledge hypergraph of the data system generated by the above method can take into account the data of nodes at all levels, thereby achieving a high degree of centralization of all data in the entire data system.

[0184] Taking the application scenario of smart factory as an example, the knowledge hypergraph of smart factory generated by the above method can be referred to Figure 5 .

[0185] It should be noted that the entire production enterprise data is divided into the enterprise decision-making layer, department management layer and department execution layer. This figure only shows the entity relationship between the various layers of enterprise data, and does not mean that all enterprise knowledge hypergraphs are the same. Figure 5 As shown, different enterprises have different separable data layers according to their enterprise architecture, and the entity relationships in each data layer are also different.

[0186] Refer to the following Figure 5 Explain the knowledge hypergraph of the smart factory.

[0187] The knowledge hypergraph can be formally represented as: G = {L1, L2, ..., L n ,R}, where A set representing the relationship between layers, L1, L2, ..., L n Represents an n-tier data architecture.

[0188] In the example of the enterprise decision-making layer, the overall enterprise plan and the relationship between entities in the planning document formulated by the decision-making layer of the entire enterprise are formally represented as follows: in Represents the set of entities in the enterprise decision-making layer, A collection representing relationships between entities.

[0189] In the example L2, L3 layers, it is formally expressed as in, It represents the set of conceptual entities used by department managers in the department management layer L2 when making department plans and schedules. It represents the set of hyperedges to which each entity in the department management layer L2 belongs. For the department execution layer L3, it further describes the conceptual entities involved in the department management layer L2, including the specific data of each position under each department. It represents the set of instance entities of each department manager in the department execution layer L3 when making department plans and schedules. Represents the set of hyperedges to which each entity in the department execution layer L3 belongs.

[0190] Figure 5 The solid arrows between L1 and L2, and between L2 and L3 represent the mapping relationship between the two layers, and the dotted lines in the L3 layer represent the possible associations between the data generated by various positions under various departments in actual enterprise production.

[0191] Specifically, the knowledge hypergraph of a single department can be formally represented as: H = {V, R, E}, where V represents the entity set, R represents the relationship set between entities, and E represents the super-relationship set. Each super-relationship may consist of several entities. A single super-relationship fact can be represented as truth = (e, v1, v2, ..., v n ,r1,r2,…r n ), its intuitive form can be referred to Figure 6 In the figure, entity v3 is included in e1 and e2, which means that entity v3 has relationships with other entities in both relationships.

[0192] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0193] Corresponding to the method described in the above embodiment, Figure 7 A structural block diagram of a knowledge hypergraph generation device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0194] Reference Figure 7 The device 300 may include: an entity recognition module 310, an acquisition module 320, a relationship recognition module 330 and a generation module 340.

[0195] Among them, the entity recognition module 310 is used to input the first data under the first-level node into the first preset network to identify each entity in the first data; the acquisition module 320 is used to obtain the hidden vector of the first data, and the hidden vector is the intermediate data obtained after the first data is input into the first preset network; the relationship recognition module 330 is used to input the hidden vector of the first data into the second preset network to identify the relationship type between adjacent entities in the first data; the first generation module 340 is used to generate a knowledge hypergraph of the first-level node according to the identified entities in the first data and the relationship type between adjacent entities in the first data.

[0196] In a possible implementation, the first preset network includes a first long short-term memory network and a second long short-term memory network, and the entity recognition module 310 may specifically include:

[0197] The sentence processing unit is used to perform sentence processing on the first text to obtain a plurality of first sentences when the first data is a first text.

[0198] The first calculation unit is used to input each first sentence in the first text into a preset word skipping model to obtain a first character vector corresponding to each character in the first sentence, wherein the first character vector is used to represent the word attribute of the character.

[0199] The second calculation unit is used to calculate the second character vector corresponding to each character in the first sentence according to a preset word segmentation dictionary, and the second character vector is used to represent the word attribute of the character.

[0200] The first processing unit is used to concatenate the first character vector and the second character vector corresponding to each character in the first sentence to obtain a third character vector of each character in the sentence.

[0201] The second processing unit is used to input the third character vector of each character in the first sentence into the first long short-term memory network to obtain the hidden vector of each character in the first sentence, and the hidden vector of the first text includes the hidden vector of each character in the first text.

[0202] The third processing unit is used to input the hidden vector of each character in the first sentence into the second long short-term memory network to identify each entity in the first data.

[0203] In a possible implementation, the second computing unit may be specifically configured to:

[0204] According to a preset word segmentation dictionary, a first word segmentation set, a second word segmentation set and a third word segmentation set corresponding to each character in the first sentence are obtained, the first word segmentation set includes word codes that begin with the character, the second word segmentation set includes word codes when the character is located in the middle of the word, and the third word segmentation set includes word codes that end with the character.

[0205] According to the first word segmentation set corresponding to each character in the first sentence, a first word segmentation vector corresponding to each character is calculated.

[0206] According to the second word segmentation set corresponding to each character in the first sentence, a second word segmentation vector corresponding to each character is calculated.

[0207] According to the third word segmentation set corresponding to each character in the first sentence, the third word segmentation vector corresponding to each character is calculated.

[0208] The first word segmentation vector, the second word segmentation vector, and the third word segmentation vector corresponding to each character in the first sentence are concatenated to obtain a second character vector corresponding to each character in the first sentence.

[0209] In a possible implementation, the relationship identification module 330 may be specifically used to:

[0210] The hidden vectors of each of the two adjacent entities in the first data and the third character vectors of the characters between the adjacent entities in the first data are merged to obtain a connection matrix.

[0211] The connection matrix is ​​input into the second preset network to obtain the relationship type between adjacent entities in the first data.

[0212] In a possible implementation, the data system further includes a second-level node, and the apparatus 300 further includes:

[0213] The second generation module is used to generate a knowledge hypergraph of second-level nodes, wherein the second-level nodes are upper-level nodes of the first-level nodes.

[0214] The first calculation module is used to calculate the association data between the entities in the first-level nodes and the entities in the second-level nodes according to the knowledge hypergraph of the first-level nodes and the knowledge hypergraph of the second-level nodes.

[0215] The third generation module is used to generate a knowledge hypergraph of the data system based on the knowledge hypergraph of the first-level nodes, the knowledge hypergraph of the second-level nodes, and the association data between the entities in the first-level nodes and the entities in the second-level nodes.

[0216] In a possible implementation, the first calculation module may specifically include:

[0217] The first extraction unit is used to extract the first feature vector of each entity in the knowledge hypergraph of the first-level node, and the first feature vector is used to represent the semantic feature of the entity.

[0218] The second extraction unit is used to extract the second feature vector of each entity in the knowledge hypergraph of the second-level node, and the second feature vector is used to represent the semantic features and relationship features of the entity.

[0219] The third calculation unit is used to calculate the similarity between the first feature vector and the second feature vector.

[0220] A generating unit is used to generate association data between an entity corresponding to the first feature vector and an entity corresponding to the second feature vector when there are a first feature vector and a second feature vector that meet a preset condition, wherein the preset condition is that the similarity between the first feature vector and the second feature vector is greater than a preset threshold.

[0221] In a possible implementation manner, the first extraction unit is specifically configured to:

[0222] Each entity in the knowledge hypergraph of the first-level node is encoded to obtain the encoding matrix corresponding to each entity in the first-level node.

[0223] The semantic features corresponding to each entity in the first-level node are extracted according to the encoding matrix of each entity in the first-level node.

[0224] The semantic features of each entity in the first-level node are concatenated with the timestamp to obtain a first feature vector corresponding to each entity in the first-level node, where the timestamp is the time information of the first data.

[0225] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0226] The embodiment of the present application also provides a data system, which includes a first-level node and a second-level node, and the data system is used to implement the steps of the above-mentioned knowledge hypergraph generation method.

[0227] The present application also provides a terminal device, see Figure 8 The terminal device 400 may include: at least one processor 410, a memory 420, and a computer program stored in the memory 420 and executable on the at least one processor 410. When the processor 410 executes the computer program, the steps in any of the above-mentioned method embodiments are implemented, for example Figure 1Steps S101 to S104 in the illustrated embodiment. Alternatively, when the processor 410 executes the computer program, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 7 The functions of modules 310 to 340 are shown.

[0228] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 420, and executed by the processor 410 to complete the present application. The one or more modules / units may be a series of computer program segments capable of completing specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 400.

[0229] Those skilled in the art will understand that Figure 8 It is only an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.

[0230] The processor 410 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0231] The memory 420 may be an internal storage unit of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. The memory 420 is used to store the computer program and other programs and data required by the terminal device. The memory 420 may also be used to temporarily store data that has been output or is to be output.

[0232] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0233] The knowledge hypergraph generation method provided in the embodiment of the present application can be applied to terminal devices such as computers, tablet computers, laptops, netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.

[0234] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0235] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0236] In the embodiments provided in the present application, it should be understood that the disclosed terminal equipment, devices and methods can be implemented in other ways. For example, the terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0237] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0238] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0239] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by one or more processors, the steps of each of the above-mentioned method embodiments can be implemented.

[0240] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by one or more processors, the steps of each of the above-mentioned method embodiments can be implemented.

[0241] Similarly, as a computer program product, when the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0242] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.

[0243] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for generating a knowledge hypergraph, characterized in that: Applied to a data system, the data system includes a first-level node, the method includes: For first data under the first-level node, input the first data into a first preset network, and identify each entity in the first data; Obtaining a hidden vector of the first data, where the hidden vector is intermediate data obtained after the first data is input into the first preset network; Inputting the hidden vector of the first data into a second preset network to identify the relationship type between adjacent entities in the first data; Generate a knowledge hypergraph of the first-level nodes according to the identified entities in the first data and the relationship types between adjacent entities in the first data; The first preset network includes a first long short-term memory network and a second long short-term memory network; for the first data under the first-level node, the first data is input into the first preset network, and each entity in the first data is identified, including: If the first data is a first text, the first text is segmented into sentences to obtain a plurality of first sentences; For each first sentence in the first text, input the first sentence into a preset word skipping model to obtain a first character vector corresponding to each character in the first sentence, where the first character vector is used to represent the word attribute of the character; According to a preset word segmentation dictionary, a second character vector corresponding to each character in the first sentence is calculated, where the second character vector is used to represent a word attribute of the character; Concatenate the first character vector and the second character vector corresponding to each character in the first sentence to obtain a third character vector for each character in the sentence; Inputting the third character vector of each character in the first sentence into the first long short-term memory network to obtain a hidden vector of each character in the first sentence, wherein the hidden vector of the first text includes the hidden vector of each character in the first text; Inputting the hidden vector of each character in the first sentence into the second long short-term memory network to identify each entity in the first data; The step of inputting the hidden vector of the first data into a second preset network to identify the relationship type between adjacent entities in the first data includes: Merging the hidden vectors of the two adjacent entities in the first data and the third character vectors of the characters between the adjacent entities in the first data to obtain a connection matrix; The connection matrix is ​​input into the second preset network to obtain the relationship type between adjacent entities in the first data.

2. The method for generating a knowledge hypergraph according to claim 1, wherein: The step of calculating the second character vector corresponding to each character in the first sentence according to the preset word segmentation dictionary includes: According to the preset word segmentation dictionary, a first word segmentation set, a second word segmentation set, and a third word segmentation set corresponding to each character in the first sentence are obtained, wherein the first word segmentation set includes word codes starting with the character, the second word segmentation set includes word codes when the character is located in the middle of a word, and the third word segmentation set includes word codes ending with the character; Calculate a first word segmentation vector corresponding to each character in the first sentence according to the first word segmentation set corresponding to each character; According to the second word segmentation set corresponding to each character in the first sentence, a second word segmentation vector corresponding to each character is calculated; According to the third word segmentation set corresponding to each character in the first sentence, a third word segmentation vector corresponding to each character is calculated; The first word segmentation vector, the second word segmentation vector, and the third word segmentation vector corresponding to each character in the first sentence are concatenated to obtain a second character vector corresponding to each character in the first sentence.

3. The method for generating a knowledge hypergraph according to claim 1, wherein: The data system further includes a second-level node, and the method further includes: Generate a knowledge hypergraph of the second-level nodes, wherein the second-level nodes are upper-level nodes of the first-level nodes; Calculate association data between entities in the first-level nodes and entities in the second-level nodes according to the knowledge hypergraph of the first-level nodes and the knowledge hypergraph of the second-level nodes; A knowledge hypergraph of the data system is generated according to the knowledge hypergraph of the first-level nodes, the knowledge hypergraph of the second-level nodes, and association data between entities in the first-level nodes and entities in the second-level nodes.

4. The method for generating a knowledge hypergraph according to claim 3, wherein: The calculating, according to the knowledge hypergraph of the first-level nodes and the knowledge hypergraph of the second-level nodes, association data between entities in the first-level nodes and entities in the second-level nodes comprises: Extracting a first feature vector of each entity in the knowledge hypergraph of the first-level node, wherein the first feature vector is used to represent a semantic feature of the entity; Extracting a second feature vector of each entity in the knowledge hypergraph of the second-level node, wherein the second feature vector is used to represent the semantic features and relational features of the entity; Calculating the similarity between the first feature vector and the second feature vector; If there are the first feature vector and the second feature vector that meet a preset condition, association data between the entity corresponding to the first feature vector and the entity corresponding to the second feature vector is generated, and the preset condition is that the similarity between the first feature vector and the second feature vector is greater than a preset threshold.

5. The method for generating a knowledge hypergraph according to claim 4, wherein: The step of extracting the first feature vector of each entity in the knowledge hypergraph of the first-level node comprises: Encode each entity in the knowledge hypergraph of the first-level node to obtain a coding matrix corresponding to each entity in the first-level node; Extracting semantic features corresponding to each entity in the first-level node according to the encoding matrix of each entity in the first-level node; The semantic features of each entity in the first-level node are concatenated with a timestamp to obtain a first feature vector corresponding to each entity in the first-level node, where the timestamp is time information of the first data.

6. A knowledge hypergraph generation device, characterized in that: Applied to a data system, the data system includes a first-level node, and the device includes: An entity identification module, for first data under a first-level node, inputting the first data into a first preset network, and identifying each entity in the first data; An acquisition module, used for acquiring a hidden vector of the first data, where the hidden vector is intermediate data obtained after the first data is input into the first preset network; a relationship identification module, configured to input the hidden vector of the first data into a second preset network to identify the relationship type between adjacent entities in the first data; A first generating module, configured to generate a knowledge hypergraph of the first-level nodes according to the identified entities in the first data and the relationship types between adjacent entities in the first data; The first preset network includes a first long short-term memory network and a second long short-term memory network; the entity recognition module specifically includes: A sentence processing unit, configured to, when the first data is a first text, perform sentence processing on the first text to obtain a plurality of first sentences; A first calculation unit is used for inputting each first sentence in the first text into a preset skip-word model to obtain a first character vector corresponding to each character in the first sentence, wherein the first character vector is used to represent a character attribute of the character; A second calculation unit, configured to calculate, according to a preset word segmentation dictionary, a second character vector corresponding to each character in the first sentence, wherein the second character vector is used to represent a word attribute of the character; A first processing unit, configured to concatenate a first character vector and a second character vector corresponding to each character in the first sentence to obtain a third character vector for each character in the sentence; A second processing unit is used to input the third character vector of each character in the first sentence into the first long short-term memory network to obtain a hidden vector of each character in the first sentence, wherein the hidden vector of the first text includes the hidden vector of each character in the first text; A third processing unit, configured to input the hidden vector of each character in the first sentence into the second long short-term memory network to identify each entity in the first data; The relationship identification module is specifically used to: merge the hidden vectors of each of the two adjacent entities in the first data and the third character vectors of the characters between the adjacent entities in the first data to obtain a connection matrix; input the connection matrix into the second preset network to obtain the relationship type between the adjacent entities in the first data.

7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the method for generating a knowledge hypergraph as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method for generating a knowledge hypergraph as described in any one of claims 1 to 5.