Learning embedding methods, devices, electronic devices and media for dual-view knowledge graphs
By employing a dual-view knowledge graph learning embedding method and utilizing Riemannian manifold space for feature mapping and attention fusion, the limitations of feature representation caused by a single viewpoint in existing technologies are resolved, resulting in more accurate knowledge graph representation and scoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PENG CHENG LAB
- Filing Date
- 2024-09-26
- Publication Date
- 2026-06-30
AI Technical Summary
Existing knowledge graph learning embedding methods, when dealing with complex data, mainly learn from a single perspective, resulting in limitations in feature representation and an inability to fully capture global and local information.
We employ a dual-view approach, modeling entity embeddings from both global and local perspectives. We utilize Riemannian manifold spaces (hyperbolic space, hypersphere space, and Euclidean space) for feature mapping and attention fusion to obtain more accurate knowledge graph representations.
It achieves a comprehensive representation of the knowledge graph, integrating global location and rich local details, improving the accuracy and reliability of the scoring results, and optimizing the structure and content of the knowledge graph.
Smart Images

Figure CN119398156B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge graph learning technology, and in particular to a learning embedding method, device, electronic device and medium for dual-view knowledge graphs. Background Technology
[0002] In fields such as intelligent transportation systems and urban planning and management, knowledge graphs, as a powerful semantic representation tool, are widely used to integrate and express complex data relationships. Particularly in urban road traffic flow assessment, knowledge graphs can effectively organize multi-source heterogeneous data such as road networks, traffic flow, and traffic events, providing a foundation for accurate prediction and decision support. However, existing knowledge graph learning and embedding methods only learn from a single perspective when dealing with such complex data, resulting in limitations in the learned feature representations. Summary of the Invention
[0003] The main objective of this application is to propose a dual-view knowledge graph learning embedding method, device, electronic device, and medium, which aims to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation.
[0004] To achieve the above objectives, a first aspect of this application proposes a learning embedding method for dual-view knowledge graphs, the method comprising:
[0005] Acquire urban road data and road flow rate data, and construct an initial knowledge graph based on the urban road data and road flow rate data;
[0006] Based on the entities corresponding to each city road in the initial knowledge graph and the relationships between the entities, the triples to be evaluated are determined;
[0007] The entity embedding features of the triples are subjected to global mapping transformation to obtain the global entity features;
[0008] The global features of the entity are subjected to local mapping transformation to obtain the entity hypersphere features, entity hyperbolic features and entity Euclidean features, respectively;
[0009] The entity global features, entity hypersphere features, entity hyperbolic features, and entity Euclidean features are input into the attention fusion model to obtain entity fusion features;
[0010] Based on the entity global features and the entity fusion features, a score value for the triple is obtained;
[0011] The relationships between entities in the initial knowledge graph are updated based on the scoring values to obtain the target knowledge graph.
[0012] In some embodiments, the step of performing a global mapping transformation on the entity embedding features of the triples to obtain global entity features includes:
[0013] The entity embedding features of the triples are input into a first mapping model that maps Euclidean space to hyperbolic space to obtain global entity features; wherein, the entity embedding features include head entity embedding features and tail entity embedding features, and the global entity features include head global entity features and tail global entity features;
[0014] The first mapping model is:
[0015]
[0016] Among them, e H For global features of the entity, For the first mapping model, c represents spatial curvature, and v represents entity embedding feature. Let be a Möbius sign, ‖·‖2 denote the second modulus of the vector, x be the mapping x-coordinate, and x = 0.
[0017] In some embodiments, the local mapping transformation processing of the entity's global features to obtain entity hypersphere features, entity hyperbolic features, and entity Euclidean features includes:
[0018] The global features of the entity are input into a second mapping model that maps Euclidean space to hypersphere space to obtain the entity hypersphere features; wherein, the entity hypersphere features include head entity hypersphere features and tail entity hypersphere features;
[0019] The second mapping model is as follows:
[0020]
[0021] in, Features of a solid hypersphere For the second mapping model, x = 0;
[0022] The entity's global features are input into a preset third mapping model that maps Euclidean space to hyperbolic space to obtain entity hyperbolic features; wherein, the entity hyperbolic features include head entity hyperbolic features and tail entity hyperbolic features;
[0023] The third mapping model is as follows:
[0024]
[0025] in, It is a solid hyperbolic feature. For the third mapping model, x = 0;
[0026] The global features of the entity are taken as the entity Euclidean features; wherein, the entity Euclidean features include head entity Euclidean features and tail entity Euclidean features.
[0027] In some embodiments, the step of inputting the entity global features, the entity hypersphere features, the entity hyperbolic features, and the entity Euclidean features into an attention fusion model to obtain entity fusion features includes:
[0028] Obtain the preset rotation transformation matrix and translation transformation parameters;
[0029] Based on the rotation transformation matrix and the translation transformation parameters, the entity hypersphere feature, the entity hyperbolic feature, and the entity Euclidean feature are subjected to rotation and translation processing to obtain the first hypersphere feature, the first hyperbolic feature, and the first Euclidean feature, respectively.
[0030] The entity global features, the first hypersphere features, the first hyperbolic features, and the first Euclidean features are input into the attention fusion model to obtain entity fusion features; wherein, the entity fusion features include head entity fusion features and tail entity fusion features.
[0031] In some embodiments, the step of inputting the entity global features, the first hypersphere features, the first hyperbolic features, and the first Euclidean features into an attention fusion model to obtain entity fusion features includes:
[0032] Obtain the preset attention vector;
[0033] Based on the entity global features, the first hypersphere features, the first hyperbolic features, the first Euclidean features, and the attention vector, a first attention score with respect to the first hypersphere features, a second attention score with respect to the first hyperbolic features, and a third attention score with respect to the first Euclidean features are calculated.
[0034] The entity fusion feature is obtained by multiplying the first attention score by the first hypersphere feature, the second attention score by the first hyperbolic feature, and the third attention score by the first Euclidean feature.
[0035] In some embodiments, the entity global features include head entity global features and tail entity global features, and the entity fusion features include head entity fusion features and tail entity fusion features;
[0036] The step of obtaining a score value for the triple based on the entity's global features and the entity's fusion features includes:
[0037] Based on the global features of the head entity and the fused features of the tail entity, a first predicted distance value is obtained;
[0038] The second predicted distance value is obtained based on the global features of the tail entity and the fused features of the head entity;
[0039] A score for the triple is obtained based on the first predicted distance value and the second predicted distance value.
[0040] In some embodiments, obtaining the first predicted distance value based on the global features of the head entity and the fused features of the tail entity includes:
[0041] Based on the global features of the head entity and the fusion features of the tail entity, a first predicted distance value is calculated using a preset distance prediction formula;
[0042] The distance prediction formula is as follows:
[0043]
[0044] in, This represents the first predicted distance value. For tail entity fusion features, h H For the global features of the head entity, c represents the spatial curvature. For Möbius addition, ||·||2 denotes the second modulus of the vector;
[0045] The step of obtaining a score for the triple based on the first predicted distance value and the second predicted distance value includes:
[0046] Based on the first predicted distance value and the second predicted distance value, a score value for the triple is calculated using a preset evaluation model;
[0047] The evaluation model is as follows:
[0048]
[0049] Where Φ(h,r,t) represents the score of the triple. denoted as the second predicted distance value, and b as the score compensation value.
[0050] In some embodiments, after the step of updating the initial knowledge graph based on the scoring value to obtain the relationships between entities in the target knowledge graph, the method further includes:
[0051] Obtain training triples from the target knowledge graph;
[0052] Based on the training triples, obtain the training score value for the training triples.
[0053] The training triples are input into a preset urban road traffic flow assessment model to obtain the training output features;
[0054] The loss value is calculated based on the training triples, the training output features, and the training score.
[0055] The parameters of the urban road traffic flow assessment model are optimized based on the loss value until the loss value meets the preset conditions.
[0056] To achieve the above objectives, a second aspect of this application proposes a learning embedding device for a dual-view knowledge graph, the device comprising:
[0057] The acquisition module is used to acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and road flow speed data;
[0058] The determination module is used to determine the triples to be evaluated based on the entities corresponding to each city road in the initial knowledge graph and the relationships between the entities;
[0059] The global mapping module is used to perform global mapping transformation on the entity embedding features of the triples to obtain the entity global features.
[0060] The local mapping module is used to perform local mapping transformation on the global features of the entity to obtain the entity hypersphere features, entity hyperbolic features and entity Euclidean features, respectively.
[0061] The fusion module is used to input the entity hypersphere features, the entity hyperbolic features, and the entity Euclidean features into the attention fusion model to obtain entity fusion features;
[0062] The scoring module is used to obtain a score value for the triple based on the entity's global features and the entity's fusion features;
[0063] An update module is used to update the initial knowledge graph based on the rating value to obtain the target knowledge graph.
[0064] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0065] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0066] This application proposes a dual-view knowledge graph learning embedding method, apparatus, electronic device, and storage medium. It acquires urban road data and road flow speed data to construct an initial knowledge graph. Based on the entities corresponding to the pre-evaluated urban roads in the initial knowledge graph, it selects or generates a series of triples to be evaluated from the initial knowledge graph. These triples represent key information points or potential relationships in the knowledge graph. Subsequently, the entity embedding features of the triples are processed using a dual-view analysis method. Specifically, the entity embedding features are globally mapped and transformed to obtain global entity features. Further, the global features are converted into various local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives. An attention fusion model is used to fuse these various local features to obtain entity fusion features. Then, using the obtained global entity features and entity fusion features, a score value for the triples is calculated. This score reflects the rationality and importance of the triples in the knowledge graph. The score value not only considers the global position and relationships of the entities but also incorporates rich local detailed information, making the scoring results more accurate and reliable. Based on the scoring values, the relationships between entities in the initial knowledge graph triples are filtered, adjusted, or added to optimize the structure and content of the knowledge graph, resulting in a more complete and accurate target knowledge graph. This invention utilizes various Riemannian manifold spaces with different curvature types (hyperbolic space, hypersphere space, and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation. Attached Figure Description
[0067] Figure 1 This is a flowchart of the dual-view knowledge graph learning and embedding method provided in the embodiments of this application;
[0068] Figure 2 yes Figure 1 Flowcharts of steps S130 and S140 in the document;
[0069] Figure 3 yes Figure 1 The flowchart of step S150 in the middle;
[0070] Figure 4 yes Figure 3 The flowchart of step S430 in the middle;
[0071] Figure 5 yes Figure 1 The flowchart of step S160 in the process;
[0072] Figure 6 yes Figure 1 The flowchart following step S170;
[0073] Figure 7This is a schematic diagram of the structure of the dual-view knowledge graph learning embedding device provided in the embodiments of this application;
[0074] Figure 8 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0076] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0077] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0078] First, let's analyze some of the terms used in this application:
[0079] Knowledge Graph: In the library and information science field, it is called knowledge domain visualization or knowledge domain mapping map. It is a series of different graphics that show the development process and structural relationships of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display knowledge and the interrelationships between them.
[0080] A triple typically consists of three elements: a head entity, a relation, and a tail entity. The relationship between them can be represented as: head entity - relation - tail entity. Triples in a knowledge graph are the foundation for constructing the entire knowledge graph. Through a large amount of triple data, a vast and complex knowledge network can be built, thereby achieving a comprehensive description and understanding of various entities and relationships in the real world.
[0081] Euclidean space, also known as Euclidean space, is one of the most fundamental spaces in mathematics. It possesses characteristics such as linearity, measurable distances, and definable angles. In Euclidean space, vectors can be added, subtracted, multiplied, and divided, and satisfy fundamental properties such as the commutative and associative laws of vector addition. Distances in Euclidean space can be calculated using the dot product of vectors, satisfying properties such as nonnegativity, symmetry, and the triangle inequality.
[0082] Hyperbolic space is a homogeneous space with constant negative curvature, contrasting with the zero curvature of Euclidean space. Hyperbolic geometry provides an efficient method for learning low-dimensional embeddings of hierarchical data. In particular, tree-like data can be embedded with arbitrarily low distortion using only two-dimensional hyperbolic space. Hyperbolic space is more efficient than Euclidean space in representing data with rich hierarchical structures.
[0083] Hypersphere: A spherical region in a higher-dimensional space, which can be viewed as a generalization of the sphere in Euclidean space to a higher-dimensional space. In a hypersphere, all points lie on a sphere of fixed radius, which gives it some unique properties, such as nonlinearity of distance metrics and reduced dimensionality effects.
[0084] Attention fusion models are a method used in deep learning, particularly when dealing with complex data and tasks, to improve model performance and effectiveness by fusing different attention mechanisms or features. The core idea of this model is to use attention mechanisms to guide the model to focus more on key information in the input data, thereby enhancing the model's representational and generalization abilities by fusing attention weights or features from different sources or types.
[0085] In fields such as intelligent transportation systems and urban planning and management, knowledge graphs, as a powerful semantic representation tool, are widely used to integrate and express complex data relationships. Particularly in urban road traffic flow assessment, knowledge graphs can effectively organize multi-source heterogeneous data such as road networks, traffic flow, and traffic events, providing a foundation for accurate prediction and decision support. However, existing knowledge graph learning embedding methods often face a key technical challenge when processing such complex data: the limitations of feature representation.
[0086] Traditional knowledge graph embedding methods mostly focus on extracting single features from either a global or local perspective. Global perspective methods, such as TransE, TransH, TransR, and TransD, capture global structural information in the knowledge graph by defining translation or rotation rules for entities and relations in vector space. While these methods can maintain the overall consistency of the graph relatively well, they struggle with handling local details and specific contextual information, easily losing some crucial local features.
[0087] Specifically, from a global perspective, knowledge graph embedding methods generally embed nodes and relations by defining a unified paradigm (such as embedding space, operators, etc.), thus ignoring the spatial features of the inherent local structure of the knowledge graph. TransE is the first method to embed knowledge graphs geometrically. It mainly models some simple spatial structures by embedding entities and relations as points and translations in an n-dimensional vector space, such as h + r ≈ t, where h and t are the vector embeddings of entities and the transformation modeling form of relations. TransH attempts to model hierarchical relationships (or many-to-many problems) in knowledge graphs by performing linear transformations based on the relation type on each node. Then, to further improve the representational power of Euclidean space, TransR embeds relations and entities into different spaces, while TransD reduces the number of parameters without reducing the model's representational performance.
[0088] However, translation transformations cannot always satisfy more complex relation types (such as symmetric / antisymmetric, invertible relations, etc.). RotatE first extended relation embedding to the complex plane, thereby promoting the model to learn more accurate embeddings. Subsequently, many rotation-based methods were proposed. QuatE first extended the space to a four-dimensional hypercomplex space and used quaternions to model entities and relations; BiQUE extended it to double quaternions; Rotate3D used 3D rotation for modeling; and OTE generalized rotation transformations. Other methods, such as Comp l Ex, Hol E, and Hol Ex, utilize semantic matching based on the complex space to capture global structural features.
[0089] ManifestE was the first embedding method to introduce the concept of manifolds into the field of knowledge graph embedding, used to locate the global structural positional relationships of entities in manifold space. Due to the metric properties of manifold space, some works have demonstrated that facade geometry has strong expressive power for embedding non-Euclidean structural data. Therefore, MuRP first embedded the knowledge graph in hyperbolic space, hoping to obtain more accurate spatial structure embedding from a global perspective. Unlike previous methods that used fixed curvature values, ATTH can adaptively obtain the spatial features of hierarchy and logical patterns by learning the curvature of the space. HEB breaks through the original Cartesian coordinate system and further models the hierarchical structure of the knowledge graph by mapping the Poincaré disk to the polar coordinate system. HyperKA is the first KGE method to combine hyperbolic manifold space with graph neural networks. To further improve the representation ability of manifold space on knowledge graphs, UltraE uses hyperhyperbolic manifold space to model the nodes of the knowledge graph from a global perspective.
[0090] On the other hand, local perspective methods, such as graph neural networks (GNNs), enrich entity representations by aggregating information from neighboring nodes, and can capture local contextual information better. However, these methods often ignore the global structure of the knowledge graph, leading to a lack of global consistency in the embedding results and affecting the performance of subsequent tasks.
[0091] Specifically, unlike traditional knowledge graph embedding algorithms that employ a single transformation type, 5*E adaptively acquires local structural features by introducing a projective geometric mapping that supports multiple transformations. In manifold geometry, Albert Gu et al. proposed in 2018 to learn embeddings in a direct product space jointly formed by multiple manifold spaces (spherical, hyperbolic, and Euclidean spaces) and heuristically evaluate the spatial curvature required for local graph data. DGS, noting the differences in knowledge graph structure between entity and ontology perspectives, proposed a carefully designed multi-manifold space for fine-grained embedding of knowledge graph structures. The AMCAD method uses a hybrid curvature space for knowledge graph embedding, while M... 2 Building upon this foundation, GNN further introduces graph neural networks to extract environmental and local spatial information from a local perspective. GIE models the structure of knowledge graphs from a local perspective through attention-based geometric interaction modules. Field E, on the other hand, uses first-order differential equations to model the local structure of data.
[0092] Existing knowledge graph embedding methods only consider the spatial features of knowledge graphs from a single perspective, a global perspective, or a local perspective. As a result, the knowledge graph embeddings learned in this way are biased and inaccurate.
[0093] Based on this, embodiments of this application provide a dual-view knowledge graph learning embedding method, apparatus, electronic device, and medium, which aim to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation.
[0094] The dual-view knowledge graph learning embedding method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the dual-view knowledge graph learning embedding method, etc., but is not limited to the above forms.
[0095] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0096] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data for the proper functioning of the embodiments of this application obtained.
[0097] Figure 1 This is an optional flowchart of the dual-view knowledge graph learning and embedding method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S110 to S150.
[0098] Step S110: Obtain urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and road flow speed data.
[0099] Step S120: Based on the entities corresponding to each city road in the initial knowledge graph and the relationships between entities, determine the triples to be evaluated.
[0100] Step S130: Perform global mapping transformation on the entity embedding features of the triples to obtain the global entity features.
[0101] Step S140: Perform local mapping transformation on the global features of the entity to obtain the entity hypersphere features, the entity hyperbolic features, and the entity Euclidean features, respectively.
[0102] Step S150: Input the entity global features, entity hypersphere features, entity hyperbolic features, and entity Euclidean features into the attention fusion model to obtain entity fusion features.
[0103] Step S160: Based on the entity global features and entity fusion features, obtain the score value for the triple.
[0104] Step S170: Update the relationships between entities in the initial knowledge graph based on the score values to obtain the target knowledge graph.
[0105] In step S110, an initial knowledge graph is constructed based on urban road data and road flow rate data. Entities in this knowledge graph may include different types of roads, traffic junctions, regions, etc. Relationships between entities may involve various types, such as direct connections, indirect connections, flow rate relationships, and flow direction relationships. Since road flow rate data changes over time, the initial knowledge graph may include timestamps or time intervals to reflect dynamic changes in road conditions. The specific structural form of this knowledge graph is not limited in this application.
[0106] In step S160, a weight can be assigned to each of the head entity global features, tail entity global features, head entity fusion features, and tail entity fusion features. Each feature is multiplied by its corresponding weight, and then all weighted feature values are summed to obtain the triple score. Similarity or distance metrics can also be used to evaluate the similarity or difference between the head and tail entities in their respective feature spaces. Alternatively, a neural network model can be designed, taking the four features as input. The network internally performs nonlinear transformations and combinations of features through multiple hidden layers. In the output layer of the network, one or more neurons are used to calculate the triple score. This application does not impose limitations on this approach.
[0107] In step S130, the entity embedding features are subjected to global mapping transformation to obtain the entity global features. The entity global features mainly focus on analyzing the overall position and relationships of the entity in the knowledge graph. Specifically, it considers factors such as the connections between the entity and other entities, the hierarchical structure of the entity, and the importance of the entity in the global environment.
[0108] In step S140, the global features of entities undergo local mapping transformation to obtain entity hypersphere features, entity hyperbolic features, and entity Euclidean features. Entity hypersphere features capture the spatial distribution and shape information of entities. In urban road traffic flow assessment, entity hypersphere features can be used, but are not limited to, to represent the distribution of traffic flow at different times or on different road segments, or to describe the spread and impact of traffic incidents. Hypersphere features provide a more intuitive understanding of the spatial state and changes of entities. Entity hyperbolic features utilize the characteristics of hyperbolic space to capture complex relationships between entities. Hyperbolic space is advantageous in representing data with hierarchical structures and power-law distributions. In urban road traffic flow assessment, hyperbolic features may be used to represent complex relationships such as the hierarchical structure of road networks and nonlinear changes in traffic flow. Entity hyperbolic features can reveal deeper information hidden behind the data. Entity Euclidean features capture the similarity and differences between entities based on metrics such as distance and angle in Euclidean space. In urban road traffic flow assessment, Euclidean features can be used to represent the similarity of traffic flow between different road segments, the correlation between different traffic events, etc. Through Euclidean features, entities can be quantitatively compared and analyzed.
[0109] In steps S130 to S150, the entity global features, entity hypersphere features, entity hyperbolic features, and entity Euclidean features of the dual-view analysis method together constitute a comprehensive and in-depth representation of the entity, providing strong support for complex tasks such as urban road traffic flow assessment.
[0110] Steps S110 to S170, as illustrated in this embodiment, involve acquiring urban road data and road flow speed data to construct an initial knowledge graph. Based on the entities corresponding to the pre-evaluated urban roads in the initial knowledge graph, a series of triples to be evaluated are selected or generated from the initial knowledge graph. These triples represent key information points or potential relationships in the knowledge graph. Subsequently, the entity embedding features of the triples are processed using a dual-view analysis method. Specifically, the entity embedding features are globally mapped and transformed to obtain global entity features. Further, the global features are converted into various local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives. An attention fusion model is then used to fuse these various local features to obtain entity fusion features. Finally, using the obtained global entity features and entity fusion features, the score value of the triples is calculated. This value reflects the rationality and importance of the triples in the knowledge graph. The score value not only considers the global position and relationships of the entities but also incorporates rich local detail information, making the scoring results more accurate and reliable. Based on the scoring values, the relationships between entities in the initial knowledge graph triples are filtered, adjusted, or added to optimize the structure and content of the knowledge graph, resulting in a more complete and accurate target knowledge graph. This invention utilizes various Riemannian manifold spaces with different curvature types (hyperbolic space, hypersphere space, and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation.
[0111] Reference Figure 2 It is understandable that in step S130, the specific steps are as follows:
[0112] Step S210: Input the entity embedding features of the triples into the first mapping model that maps Euclidean space to hyperbolic space to obtain the entity global features; wherein, the entity embedding features include head entity embedding features and tail entity embedding features, and the entity global features include head entity global features and tail entity global features.
[0113] The first mapping model is:
[0114]
[0115] Among them, e H For global features of the entity, For the first mapping model, c represents spatial curvature, and v represents entity embedding feature. For Möbius addition, ||·||2 represents the second modulus of the vector, x is the mapping x-coordinate, x = 0 represents the mapping relationship at the origin.
[0116] In step S210, a first mapping model, mapping from Euclidean space to hyperbolic space, is used to calculate the global features of the entity. This is to fully utilize the unique advantages of hyperbolic space in processing data with hierarchical structures, power-law distributions, or nonlinear relationships, thereby capturing the features of the entity more comprehensively from a global perspective. The first mapping model not only improves the accuracy and comprehensiveness of entity representation but also provides strong support for subsequent tasks (such as scoring and prediction).
[0117] Continue to refer to Figure 2 It is understood that in this application, it is assumed that the local space of the Riemannian manifold is flat; therefore, the local space of the global features of an entity in hyperbolic space can be approximated as being in Euclidean space. Furthermore, step S140 may include, but is not limited to, the following steps:
[0118] Step S310: Input the global features of the entity into the second mapping model that maps Euclidean space to hypersphere space to obtain the entity hypersphere features; wherein, the entity hypersphere features include head entity hypersphere features and tail entity hypersphere features.
[0119] The second mapping model is as follows:
[0120]
[0121] in, Features of a solid hypersphere For the second mapping model, x = 0.
[0122] Step S320: Input the global features of the entity into the third mapping model that maps Euclidean space to hyperbolic space to obtain the hyperbolic features of the entity; wherein, the hyperbolic features of the entity include head hyperbolic features and tail hyperbolic features.
[0123] The third mapping model is as follows:
[0124]
[0125] in, It is a solid hyperbolic feature. For the third mapping model, x = 0;
[0126] Step S330: Use the global features of the entity as the entity Euclidean features; wherein, the entity Euclidean features include the head entity Euclidean features and the tail entity Euclidean features.
[0127] In steps S310 to S330, the Riemannian manifold is a smooth manifold with a metric tensor. The metric tensor allows us to define concepts such as length, angle, and inner product at each point of the manifold. Therefore, in a Riemannian manifold, the local space (i.e., a small neighborhood on the manifold) can be approximated as Euclidean space, meaning that the curvature of the manifold is negligible within that local region. More specifically, the metric tensor of the manifold is very close to the metric tensor of Euclidean space within that region. Global features of entities defined in hyperbolic space, when confined to a local space, can be approximated as being defined in Euclidean space, meaning that Euclidean geometric tools and concepts can be used to analyze and process these features. Therefore, in this step, global features are converted into various local features (hypersphere features, hyperbolic features, and Euclidean features) to capture local information from different perspectives, providing strong support for complex tasks such as urban road traffic flow assessment.
[0128] Reference Figure 3 It is understood that step S134 may include, but is not limited to, the following steps:
[0129] Step S410: Obtain the preset rotation transformation matrix and translation transformation parameters;
[0130] Step S420: Based on the rotation transformation matrix and translation transformation parameters, perform rotation and translation processing on the solid hypersphere feature, solid hyperbolic feature and solid Euclidean feature to obtain the first hypersphere feature, the first hyperbolic feature and the first Euclidean feature, respectively;
[0131] Step S430: Input the global entity feature, the first hypersphere feature, the first hyperbolic feature, and the first Euclidean feature into the attention fusion model to obtain the entity fusion feature; wherein, the entity fusion feature includes the head entity fusion feature and the tail entity fusion feature.
[0132] In steps S410 to S430, different spatial representations may have different intrinsic structures and metrics. Through rotation and translation, these features can be aligned and standardized to a certain extent, making them more consistent and comparable when input into the attention fusion model. This helps the model better understand and utilize feature information from different spaces, thereby improving the fusion effect. Rotation and translation also reduce the information loss that might occur during direct fusion due to feature mismatches, minimizing such mismatches and preserving more original feature information, thus maintaining the model's accuracy and robustness.
[0133] Specifically, in steps S310 to S330, the features of the solid hypersphere are obtained respectively. Solid hyperbolic features and solid Euclidean features In steps S410 to S430, the geometric transformation is a combination of rotation and translation transformations, for any entity embedding e∈R n The result after its geometric transformation is Where R is the general rotation transformation matrix and v is the translation transformation parameter. Subsequently, by performing the above geometric transformations on each entity in space, the first hypersphere feature is obtained. First hyperbolic feature and the first Euclidean feature
[0134] Reference Figure 4 It is understood that step S430 may include, but is not limited to, the following steps:
[0135] Step S510: Obtain the preset attention vector;
[0136] Step S520: Based on the entity global features, the first hypersphere features, the first hyperbolic features, the first Euclidean features, and the attention vector, calculate the first attention score regarding the first hypersphere features, the second attention score regarding the first hyperbolic features, and the third attention score regarding the first Euclidean features;
[0137] Step S530: Obtain entity fusion features based on the product of the first attention score and the first hypersphere feature, the product of the second attention score and the first hyperbolic feature, and the product of the third attention score and the first Euclidean feature.
[0138] In steps S510 to S530, the attention mechanism allows the model to automatically learn and distinguish the importance of different features. During the fusion process, important features are assigned higher weights, while less important features are relatively weakened. This mechanism helps the model focus more on features that contribute more to the task objective, thereby improving overall performance.
[0139] Additionally, the attention vector is a predefined parameter vector used to calculate the weights of different features in the attention mechanism. It can be randomly initialized and updated via backpropagation during model training. Using some form of attention mechanism (such as dot product attention, additive attention, etc.), the entity's global features, features of each geometric space (first hypersphere feature, first hyperbolic feature, first Euclidean feature), and the attention vector are taken as input. Through the operation of the attention mechanism, an attention score is calculated for each feature in the geometric space. This score reflects the importance of the feature in the current task. Specifically, the calculation of the attention score may involve some form of interaction between the attention vector and the representations of each feature (such as dot product, concatenation followed by a neural network layer, etc.), and then normalizing the score through a non-linear function (such as softmax) so that the sum of the attention scores of all features is 1. The attention vector λ is introduced to calculate the corresponding attention score for each entity in the space, as shown below.
[0140]
[0141] Where, λ S , λ H and λ E These are the first attention score, the second attention score, and the third attention score, respectively.
[0142] The global and local embeddings are concatenated using a "concatenation" operator, allowing for a joint consideration of local spatial features from multiple spaces from both global and local perspectives, thus enabling better fusion. Finally, the attention score for each space is calculated. A weighted sum is then used to obtain the fused entity embedding, as shown below:
[0143]
[0144] in, This is a feature of entity fusion.
[0145] Reference Figure 5 It is understood that the entity global features include the head entity global features and the tail entity global features, and the entity fusion features include the head entity fusion features and the tail entity fusion features. Step S160 may include, but is not limited to, the following steps:
[0146] Step S610: Obtain the first predicted distance value based on the global features of the head entity and the fused features of the tail entity;
[0147] Step S620: Obtain the second predicted distance value based on the global features of the tail entity and the fused features of the head entity;
[0148] Step S630: Obtain the score value for the triple based on the first predicted distance value and the second predicted distance value.
[0149] In steps S610 to S630, by simultaneously considering the global and fused features of both the head and tail entities, not only is a global perspective on the relationships between entities taken into account, but the fused features also capture potential relationships or higher-order dependencies between entities. This allows the model to better handle complex relationship modeling problems, such as many-to-many relationships and hierarchical relationships. The first and second predicted distance values are then subjected to some form of comprehensive processing, such as weighted summation, averaging, or maximum / minimum value selection, to obtain the final score for the triple. This score reflects the overall matching degree and credibility of the head and tail entities under a given relationship.
[0150] Step S610 may include, but is not limited to, the following technical features:
[0151] Based on the global features of the head entity and the fused features of the tail entity, the first predicted distance value is calculated using a preset distance prediction formula;
[0152] The distance prediction formula is as follows:
[0153]
[0154] in, This represents the first predicted distance value. For tail entity fusion features, h H For the global features of the head entity, c represents the spatial curvature. For Möbius addition, ||·||2 denotes the second modulus of the vector.
[0155] Similarly, in step S620, the formula for calculating the second predicted distance value is as follows:
[0156]
[0157] in, This represents the first predicted distance value. For head entity fusion features, t H This is a global feature of the tail entity.
[0158] Step S630 may include, but is not limited to, the following steps:
[0159] Based on the first and second predicted distance values, a score for the triple is calculated using a pre-defined evaluation model.
[0160] The evaluation model is as follows:
[0161] Φ(h,r,t)=-(dist(h~ H,t H )+dist(t~ H ,h H ))+b;
[0162] Where Φ(h,r,t) represents the score of the triple, and b is the score compensation value.
[0163] The score reflects the overall matching degree and credibility of the head and tail entities under a given relation, that is, it reflects the overall matching degree and credibility of the triple to be evaluated. In the above formula, the score of the triple is calculated as the sum of the predicted distance between the head entity and the tail entity and the predicted distance between the tail entity and the head entity; therefore, the closer the distance, the higher the score.
[0164] Reference Figure 6 It is understood that after step S170, the following steps may be included, but are not limited to:
[0165] Step S710: Obtain training triples from the target knowledge graph.
[0166] Step S720: Based on the training triples, obtain the training score value for the training triples;
[0167] Step S730: Input the training triples into the urban road traffic flow assessment model to obtain the training output features;
[0168] Step S740: Calculate the loss value based on the training triples, training output features, and training score;
[0169] Step S750: Optimize the parameters of the urban road traffic flow assessment model based on the loss value until the loss value meets the preset conditions.
[0170] In steps S710 to S750, a certain number of triples are selected from the updated target knowledge graph as training triples. These training triples contain sufficient diversity to cover multiple aspects of urban road traffic assessment. The training triples are scored in step S140, and this score reflects the confidence level of the training triples in model training, serving as a reference for subsequent model training. The selected training triples are used as input data and passed to the already constructed urban road traffic assessment model. Based on the input triple information, the model calculates the corresponding output features using its internal algorithms and parameters. A loss value is calculated using the training score, training output features, and information from the training triples themselves. This loss value measures the difference between the model output and the expected output. Based on the calculated loss value, the internal parameters of the urban road traffic assessment model are adjusted using optimization algorithms such as backpropagation. The above steps are repeated: continuously acquiring new training triples from the target knowledge graph, calculating training scores, inputting them into the model to obtain output, calculating loss values, and optimizing model parameters. This process will continue until the loss value meets preset conditions, such as reaching a certain threshold or the loss value no longer decreasing significantly, indicating that the urban road traffic assessment model has been trained to a certain level of accuracy.
[0171] This invention primarily focuses on the completion and representation of knowledge graphs. Real-world knowledge graph data often suffers from incompleteness, meaning its description of the real world is incomplete. To address this issue, this invention first maps entities and relation edges in the knowledge graph to a low-dimensional Euclidean vector space. Then, it uses the scoring function of this invention to calculate the score of any possible triples in the graph and sorts them according to the scores. Next, we statistically analyze the ranking of triples that exist in reality but are not observed in the knowledge graph data. Through testing, we found that in the WN18RR dataset, the probability of a triple that exists in reality but is not observed ranking in the top ten is 58.1%; in the FB15K-237 dataset, the probability is 55.7%; and in the YAGO3-10 dataset, the probability is 71.3%. This invention utilizes various Riemannian manifold spaces with different curvature types (hyperbolic space, hypersphere space, and Euclidean space) to model entity embeddings from both global and local perspectives, thereby learning more accurate knowledge graph representations. It also introduces a geometric attention module, which, by combining global and local attention mechanisms, can effectively fuse multiple heterogeneous spaces to learn more appropriate entity representations.
[0172] Please see Figure 7This application also provides a dual-view knowledge graph learning embedding device 700, which can implement the above-mentioned dual-view knowledge graph learning embedding method. The device includes:
[0173] The acquisition module 710 is used to acquire urban road data and road flow speed data, and to construct an initial knowledge graph based on the urban road data and road flow speed data;
[0174] The determination module 720 is used to determine the triples to be evaluated based on the entities corresponding to each city road in the initial knowledge graph and the relationships between the entities;
[0175] The global mapping module 730 is used to perform local mapping transformation on the global features of the entity to obtain the entity hypersphere features, the entity hyperbolic features and the entity Euclidean features, respectively.
[0176] The local mapping module 740 is used to perform local mapping transformation on the global features of the entity to obtain the entity hypersphere features, the entity hyperbolic features and the entity Euclidean features, respectively.
[0177] The fusion module 750 is used to input the entity global features, entity hypersphere features, entity hyperbolic features and entity Euclidean features into the attention fusion model to obtain entity fusion features;
[0178] The scoring module 760 is used to obtain the scoring value of the triple based on the entity global features and entity fusion features;
[0179] The update module 770 is used to update the initial knowledge graph based on the score to obtain the target knowledge graph.
[0180] The specific implementation of the dual-view knowledge graph learning embedding device is basically the same as the specific implementation of the dual-view knowledge graph learning embedding method described above, and will not be repeated here.
[0181] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described dual-view knowledge graph learning embedding method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0182] Please see Figure 8 , Figure 8 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0183] The processor 801 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0184] The memory 802 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and is called and executed by the processor 801 to execute the dual-view knowledge graph learning embedding method of the embodiments of this application.
[0185] The 803 input / output interface is used to implement information input and output.
[0186] The communication interface 804 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0187] Bus 805 transmits information between various components of the device (e.g., processor 801, memory 802, input / output interface 803, and communication interface 804);
[0188] The processor 801, memory 802, input / output interface 803, and communication interface 804 are connected to each other within the device via bus 805.
[0189] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described dual-view knowledge graph learning embedding method.
[0190] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0191] The dual-view knowledge graph learning embedding method, apparatus, electronic device, and storage medium provided in this application acquire urban road data and road flow speed data to construct an initial knowledge graph. Based on the entities corresponding to the pre-evaluated urban roads in the initial knowledge graph, a series of triples to be evaluated are selected or generated from the initial knowledge graph. These triples represent key information points or potential relationships in the knowledge graph. Subsequently, the entity embedding features of the triples are processed using a dual-view analysis method. Specifically, the entity embedding features are globally mapped and transformed to obtain global entity features. Further, the global features are converted into various local features (hypersphere features, hyperbolic features, Euclidean features) to capture local information from different perspectives. An attention fusion model is used to fuse these various local features to obtain entity fusion features. Then, using the obtained global entity features and entity fusion features, the score value of the triples is calculated. This value reflects the rationality and importance of the triples in the knowledge graph. The score value not only considers the global position and relationships of the entities but also incorporates rich local detail information, making the scoring results more accurate and reliable. Based on the scoring values, the relationships between entities in the initial knowledge graph triples are filtered, adjusted, or added to optimize the structure and content of the knowledge graph, resulting in a more complete and accurate target knowledge graph. This invention utilizes various Riemannian manifold spaces with different curvature types (hyperbolic space, hypersphere space, and Euclidean space) to model the embedding of entities from both global and local perspectives, thereby learning a more accurate knowledge graph representation.
[0192] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0193] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0194] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0195] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0196] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0197] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0198] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0199] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0200] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0201] If the integrated unit is implemented as 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 technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0202] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for learning embedding of dual-view knowledge graph, characterized in that, The method includes: Acquire urban road data and road flow rate data, and construct an initial knowledge graph based on the urban road data and road flow rate data; Based on the entities corresponding to each city road in the initial knowledge graph and the relationships between the entities, the triples to be evaluated are determined; The entity embedding features of the triples are subjected to global mapping transformation to obtain the global entity features; The global features of the entity are subjected to local mapping transformation to obtain the entity hypersphere features, entity hyperbolic features and entity Euclidean features, respectively; The entity global features, entity hypersphere features, entity hyperbolic features, and entity Euclidean features are input into the attention fusion model to obtain entity fusion features; Based on the entity global features and the entity fusion features, a score value for the triple is obtained; The relationships between entities in the initial knowledge graph are updated based on the scoring values to obtain the target knowledge graph; The step of inputting the entity global features, the entity hypersphere features, the entity hyperbolic features, and the entity Euclidean features into the attention fusion model to obtain entity fusion features includes: Obtain a preset rotation transformation matrix and translation transformation parameters; perform rotation and translation processing on the entity hypersphere feature, the entity hyperbolic feature, and the entity Euclidean feature according to the rotation transformation matrix and the translation transformation parameters to obtain the first hypersphere feature, the first hyperbolic feature, and the first Euclidean feature, respectively; input the entity global feature, the first hypersphere feature, the first hyperbolic feature, and the first Euclidean feature into the attention fusion model to obtain the entity fusion feature; wherein, the entity fusion feature includes the head entity fusion feature and the tail entity fusion feature. 2.The method of claim 1, wherein, The step of performing a global mapping transformation on the entity embedding features of the triples to obtain global entity features includes: The entity embedding features of the triples are input into a first mapping model that maps Euclidean space to hyperbolic space to obtain global entity features; wherein, the entity embedding features include head entity embedding features and tail entity embedding features, and the global entity features include head global entity features and tail global entity features; The first mapping model is: ; where e H is the entity global feature, is the first mapping model, c represents the spatial curvature, v represents the entity embedding feature, and is the Moebius addition. c is the Moebius addition, ‖·‖2 represents the two modulus of the vector, x is the mapping abscissa, and x=0. 3.The method of claim 2, wherein, The local mapping and transformation process performed on the global features of the entity to obtain the entity hypersphere features, entity hyperbolic features, and entity Euclidean features includes: The global features of the entity are input into a second mapping model that maps Euclidean space to hypersphere space to obtain the entity hypersphere features; wherein, the entity hypersphere features include head entity hypersphere features and tail entity hypersphere features; The second mapping model is as follows: ; in, Features of a solid hypersphere For the second mapping model, x=0; The entity's global features are input into a preset third mapping model that maps Euclidean space to hyperbolic space to obtain entity hyperbolic features; wherein, the entity hyperbolic features include head entity hyperbolic features and tail entity hyperbolic features; The third mapping model is as follows: ; in, It is a solid hyperbolic feature. For the third mapping model, x=0; The global features of the entity are taken as the entity Euclidean features; wherein, the entity Euclidean features include head entity Euclidean features and tail entity Euclidean features.
4. The learning embedding method for dual-view knowledge graphs according to claim 1, characterized in that, The step of inputting the entity global features, the first hypersphere features, the first hyperbolic features, and the first Euclidean features into the attention fusion model to obtain entity fusion features includes: Obtain the preset attention vector; Based on the entity global features, the first hypersphere features, the first hyperbolic features, the first Euclidean features, and the attention vector, a first attention score with respect to the first hypersphere features, a second attention score with respect to the first hyperbolic features, and a third attention score with respect to the first Euclidean features are calculated. The entity fusion feature is obtained by multiplying the first attention score by the first hypersphere feature, the second attention score by the first hyperbolic feature, and the third attention score by the first Euclidean feature.
5. The learning embedding method for dual-view knowledge graphs according to claim 1, characterized in that, The entity global features include head entity global features and tail entity global features, and the entity fusion features include head entity fusion features and tail entity fusion features; The step of obtaining a score value for the triple based on the entity's global features and the entity's fusion features includes: Based on the global features of the head entity and the fused features of the tail entity, a first predicted distance value is obtained; The second predicted distance value is obtained based on the global features of the tail entity and the fused features of the head entity; A score for the triple is obtained based on the first predicted distance value and the second predicted distance value.
6. The learning embedding method for dual-view knowledge graphs according to claim 5, characterized in that, The step of obtaining the first predicted distance value based on the global features of the head entity and the fused features of the tail entity includes: Based on the global features of the head entity and the fused features of the tail entity, a first predicted distance value is calculated using a preset distance prediction formula; The distance prediction formula is as follows: ; in, This represents the first predicted distance value. For tail entity fusion features, h H For the global features of the head entity, c represents the spatial curvature, ⊕ c For Möbius addition, ||·||2 denotes the second modulus of the vector; The step of obtaining a score for the triple based on the first predicted distance value and the second predicted distance value includes: Based on the first predicted distance value and the second predicted distance value, a score value for the triple is calculated using a preset evaluation model; The evaluation model is as follows: ; Where Φ(h,r,t) represents the score of the triple. denoted as the second predicted distance value, and b as the score compensation value.
7. The learning embedding method for dual-view knowledge graphs according to claim 1, characterized in that, After the step of updating the relationships between entities in the initial knowledge graph based on the scoring values to obtain the target knowledge graph, the method further includes: Obtain training triples from the target knowledge graph; Based on the training triples, a training score value for the training triples is obtained; The training triples are input into a preset urban road traffic flow assessment model to obtain the training output features; The loss value is calculated based on the training triples, the training output features, and the training score. The parameters of the urban road traffic flow assessment model are optimized based on the loss value until the loss value meets the preset conditions.
8. A learning embedding device for a dual-view knowledge graph, characterized in that, The device includes: The acquisition module is used to acquire urban road data and road flow speed data, and construct an initial knowledge graph based on the urban road data and road flow speed data; The determination module is used to determine the triples to be evaluated based on the entities corresponding to each city road in the initial knowledge graph and the relationships between the entities; The global mapping module is used to perform global mapping transformation on the entity embedding features of the triples to obtain the entity global features. The local mapping module is used to perform local mapping transformation on the global features of the entity to obtain the entity hypersphere features, entity hyperbolic features and entity Euclidean features, respectively. The fusion module is used to input the entity global features, the entity hypersphere features, the entity hyperbolic features, and the entity Euclidean features into the attention fusion model to obtain entity fusion features; The scoring module is used to obtain a score value for the triple based on the entity's global features and the entity's fusion features; The update module is used to update the initial knowledge graph according to the score value to obtain the target knowledge graph; The step of inputting the entity global features, the entity hypersphere features, the entity hyperbolic features, and the entity Euclidean features into the attention fusion model to obtain entity fusion features includes: Obtain a preset rotation transformation matrix and translation transformation parameters; perform rotation and translation processing on the entity hypersphere feature, the entity hyperbolic feature, and the entity Euclidean feature according to the rotation transformation matrix and the translation transformation parameters to obtain the first hypersphere feature, the first hyperbolic feature, and the first Euclidean feature, respectively; input the entity global feature, the first hypersphere feature, the first hyperbolic feature, and the first Euclidean feature into the attention fusion model to obtain the entity fusion feature; wherein, the entity fusion feature includes the head entity fusion feature and the tail entity fusion feature.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the dual-view knowledge graph learning embedding method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the learning embedding method for the dual-view knowledge graph as described in any one of claims 1 to 7.