Urban knowledge graph embedded learning method and device, server, medium and product
By mapping urban event data to high-order tensors and using multi-relation graph convolutional networks to learn modal information and generate embedding learning vectors, the limitations of existing knowledge graphs in urban event data processing are overcome, enabling the completion of urban knowledge graphs and the capture of feature information.
Patent Information
- Application Number
- CN202511812896.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-02-27
AI Technical Summary
Existing knowledge graphs mainly focus on static facts, consider limited information, and have difficulty capturing multi-dimensional feature information, which limits their use and makes them unsuitable for processing event data in cities.
By acquiring event data from the target city and mapping it to a high-order tensor, a multi-relation graph convolutional network is used to learn the modal basic information and modal cross-information of multiple modalities, generating embedded learning vectors to complete the city's knowledge graph.
It enables the learning of the feature information of temporal and spatial relationships in urban knowledge graphs, solves the application limitations of knowledge graphs in urban event data processing, and improves the ability of urban traffic planning, prediction and abnormal event classification.
Smart Images

Figure CN121581231A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The embodiment of the present application relates to the technical field of data processing, and particularly relates to a city knowledge graph embedding learning method and device, a server, a medium and a product. BACKGROUND
[0002] As an important form of structured knowledge representation, a knowledge graph mainly describes facts in the real world through triples (subject, relation, object) formed by entities (nodes) and relations (edges), and the structured characteristics enable computers to efficiently process and reason knowledge, and the knowledge graph is widely applied to the fields of information retrieval, question answering systems and recommendation systems.
[0003] The inventor finds that the following problems exist when implementing the technical solution based on the above-mentioned manner.
[0004] The existing knowledge graph mainly focuses on static facts, that is, only the subject, object and relation are considered, and the limited information considered makes it difficult to capture multi-dimensional feature information, so that the obtained knowledge graph is difficult to describe more content, thereby causing the problem of limited use of the knowledge graph. SUMMARY
[0005] The embodiment of the present application provides a city knowledge graph embedding learning method and device, a server, a medium and a product, so as to realize the technical effect that event data including time and space information can be analyzed and processed to obtain an embedding learning vector corresponding to a city knowledge graph.
[0006] In a first aspect, the embodiment of the present application provides a city knowledge graph embedding learning method, which comprises:
[0007] Obtaining a plurality of event data related to a preset task generated in a target city;
[0008] Based on the plurality of event data, determining a city knowledge graph, and mapping a plurality of event data corresponding to the city knowledge graph into a to-be-used high-order tensor; wherein the event data is used to represent related data generated when an event occurs, and the data value in the to-be-used high-order tensor is used to represent the correlation between a plurality of modalities in the event data, and the plurality of modalities at least include a time modality and a space modality;
[0009] Inputting the to-be-used high-order tensor into a multi-relation graph convolution network to learn modality basic information of a plurality of modalities in the to-be-used high-order tensor and modality cross information between any two modalities;
[0010] Outputting an embedding learning vector corresponding to the city knowledge graph.
[0011] Further, the mapping of the plurality of event data corresponding to the city knowledge graph into the to-be-used high-order tensor comprises:
[0012] For the plurality of event data, the event data is divided into multiple modes according to a plurality of modes set in advance to obtain a fact tuple of the event data.
[0013] According to the data content included in each mode of the fact tuple, the event data is mapped into the data value in the to-be-used high-order tensor.
[0014] Further, the plurality of modes comprises a first type mode or a first type mode and a second type mode when the event data is generated.
[0015] The first type mode comprises a subject, a relationship, an object, a time mode and a space mode, and the second type mode comprises at least one of a time period feature mode, a space region mode, a city weather mode, an air quality mode and a traffic event type mode.
[0016] Further, the inputting of the to-be-used high-order tensor into the multi-relation graph convolution network to learn the modal basis information of the plurality of modes in the to-be-used high-order tensor and the modal cross information between any two modes comprises:
[0017] The modal embedding matrix corresponding to each mode in the to-be-used high-order tensor is extracted based on the embedding layer in the multi-relation graph convolution network, and a high-order Laplace tensor is constructed based on the modal embedding matrix.
[0018] The high-order Laplace tensor is processed based on the multi-dimensional fusion module in the multi-relation graph convolution network to obtain modal cross information and modal basis information.
[0019] The high-order Laplace tensor is processed based on the generalized tensor product convolution module in the multi-relation graph convolution network to determine the relationship strength change information between different modes in the modal cross information.
[0020] Further, the processing of the high-order Laplace tensor based on the multi-dimensional fusion module in the multi-relation graph convolution network to obtain modal cross information and modal basis information comprises:
[0021] The modal embedding matrix corresponding to each mode in the high-order Laplace tensor is processed based on the first processing unit in the multi-dimensional fusion module to obtain the modal basis information corresponding to each mode; and
[0022] cross-fuse, based on an embedding fusion function in the multi-dimensional fusion module, the modality embedding matrices in the high-order Laplacian tensor except for the preset modality, to determine the modality cross information;
[0023] The preset modality at least includes a subject and an object.
[0024] Further, the method further includes:
[0025] Further, the method further includes:
[0026] The influence strength information is taken as the relationship strength change information.
[0027] Further, the method further includes:
[0028] The embedding learning vector is taken as the input of the multi-relation graph convolution network.
[0029] Based on the inverse high-order tensor, the to-be-used high-order tensor, a score design function and a loss function, a loss value is determined, and the multi-relation graph convolution network is model parameter corrected based on the loss value.
[0030] Further, the method further includes:
[0031] The event data with the preset numerical value in the to-be-used high-order tensor is sampled, and the to-be-used high-order tensor is updated based on the sampling result, so that the multi-relation graph convolution network processes the updated to-be-used high-order tensor to obtain an embedding learning vector, until the model convergence of the multi-relation graph convolution network is determined based on the embedding learning vector.
[0032] Further, the method further includes:
[0033] The embedding learning vector is taken as the input of the multi-relation graph convolution network.
[0034] The city knowledge graph is used to perform a downstream task.
[0035] Further, the preset task at least includes one or more of a city traffic planning task, a city traffic prediction task, a city abnormal event classification task and a city event prediction task.
[0036] In a second aspect, an embodiment of the present application further provides a device for city knowledge graph embedding learning, which comprises:
[0037] an event data obtaining module, configured to obtain a plurality of event data related to a preset task and generated in a target city;
[0038] a high-order tensor generation task, configured to determine a city knowledge graph based on the plurality of event data, and map the plurality of event data corresponding to the city knowledge graph into a high-order tensor to be used; wherein the event data is used to represent relevant data generated when an event occurs, and data values in the high-order tensor to be used are used to represent correlations between a plurality of modalities in the event data, at least including a time modality and a space modality;
[0039] a learning module, configured to input the high-order tensor to be used into a multi-relation graph convolution network to learn modality basic information of the plurality of modalities in the high-order tensor to be used and modality cross information between any two modalities;
[0040] an embedding vector generation module, configured to output an embedding learning vector corresponding to the city knowledge graph.
[0041] In a third aspect, an embodiment of the present application further provides a server, which comprises:
[0042] one or more processors;
[0043] a memory, configured to store one or more programs;
[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the city knowledge graph embedding learning method according to any one of the embodiments of the present application.
[0045] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the city knowledge graph embedding learning method according to any one of the embodiments of the present application.
[0046] In a fifth aspect, an embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the city knowledge graph embedding learning method according to any one of the embodiments of the present application.
[0047] The technical scheme provided by the embodiment of the present application obtains a plurality of event data related to a preset task generated in a target city, and determines a city knowledge graph corresponding to the event data by analyzing and processing the event data. Since the data source corresponding to the city knowledge graph obtained at this time is sparse, the event data corresponding to the city knowledge graph can be mapped into a to-be-used high-order tensor to solve the problem of data source sparseness. Further, based on processing the to-be-used high-order tensor with non-sparseness in the multi-relation graph convolution network, the embedding learning vector of the modal basic information of a plurality of modes in the to-be-used high-order tensor and the modal cross information between any two modes can be learned, thereby solving the problem that the knowledge graph in the prior art only includes static facts of entities, relations and objects, and the limited information considered leads to difficulty in capturing multi-dimensional feature information, so that the obtained knowledge graph is difficult to describe more content, resulting in the problem that the use of the knowledge graph is limited. The embedding learning vector of the feature information including time and space relations in the city knowledge graph is learned, and then the city knowledge graph can be completed based on the embedding learning vector. Finally, the problem that the knowledge graph in the prior art is mainly used to describe static facts and cannot be applied to processing event data occurring in a city is also solved. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical scheme of the exemplary embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced. Obviously, the drawings introduced are only a part of the drawings of the embodiments to be described by the present application, and not all the drawings. Those skilled in the art can also obtain other drawings from these drawings without creating labor.
[0049] Figure 1 The flowchart of the city knowledge graph embedding learning method provided by the embodiment of the present application;
[0050] Figure 2 The schematic diagram of the seven-order tensor provided by the embodiment of the present application;
[0051] Figure 3 The flowchart of the city knowledge graph embedding learning method provided by the embodiment of the present application;
[0052] Figure 4 The schematic diagram of the embedding learning based on the multi-relation graph convolution network provided by the embodiment of the present application;
[0053] Figure 5 The flowchart of the city knowledge graph embedding learning method provided by the embodiment of the present application;
[0054] Figure 6 The flowchart of the embedding learning provided by the embodiment of the present application;
[0055] Figure 7 A structural schematic diagram of a city knowledge graph embedding learning device provided by an embodiment of the present application is shown in the figure.
[0056] Figure 8 A structural schematic diagram of a server provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0057] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.
[0058] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.
[0059] Before introducing the technical solutions provided by the embodiments of the present application, the application scenarios can be exemplarily described.
[0060] Generally, the knowledge graph involved is determined based on triplets (entity, relationship and object), which cannot be applied to the case of determining a certain task by collecting information in time and space. Based on this, in the case of involving not only entities, relationships and objects, but also time, space and other factor information, the technical solutions provided by the embodiments of the present application can be used to determine the city knowledge graph that integrates time information and space information, and then the city knowledge graph is embedded and learned to obtain the embedding learning vector corresponding to the city knowledge graph.
[0061] Figure 1 A flowchart of a city knowledge graph embedding learning method provided by an embodiment of the present application, the present embodiment can be applied to the scenario of embedding and learning the city knowledge graph of a certain city under a preset task, the city knowledge graph embedding learning method provided by the present embodiment can be integrated in the existing client or server, the client or server can be integrated in an electronic device, and optionally, the electronic device can be a mobile terminal or a PC terminal.
[0062] As shown in the figure, the method specifically includes the following steps: Figure 1
[0063] S110, obtaining a plurality of event data related to a preset task generated in a target city.
[0064] Wherein, when it is determined that a knowledge graph of a certain city needs to be created, the city can be taken as a target city. The tasks to be completed in the target city can be preset, and the city traffic prediction task can be selected. For each preset task, a city knowledge graph corresponding to the task is to be generated, and event data generated by the city in the preset task can be acquired first, and then the city knowledge graph is determined according to the event data. At the same time, for a city, the event includes a subject, an object and a relationship, and other information such as time and place of the event is usually recorded. Based on this, the acquired event data can include time and space information.
[0065] The event data can be understood as data recorded when an event related to the preset task occurs. For example, for the traffic prediction task, the acquired event data can be the traffic flow, the passenger flow, and whether there is a traffic jam at a certain intersection from a certain time to a certain time. That is, the event data is used to represent the relevant data generated by the occurrence of an event.
[0066] The city knowledge graph is a knowledge graph specially used for integrating and representing multi-source heterogeneous spatio-temporal data in the city field, and is used to describe the structured knowledge base of the running state of the city, the mutual relationship between entities (for example, roads, buildings, areas, transportation tools, time, and crowds), and attributes.
[0067] Specifically, when the city knowledge graph corresponding to the target city is determined, the event data generated by the target city in the preset task can be acquired first. The event data can be data generated at a historical time or data generated at a current time.
[0068] In this embodiment, the preset task includes one or more of the city traffic planning task, the city traffic prediction task, the city abnormal event classification task, and the city event prediction task.
[0069] Based on the above, the preset task can include one or more of the above, and according to different preset tasks, corresponding event data can be acquired, and then the city knowledge graph corresponding to the event data is determined, so that the embedding learning vector corresponding to the city knowledge graph is determined.
[0070] It should be noted that the event data corresponding to the preset task is slightly different when the preset task is different. Here, the event data is described taking the traffic prediction task as an example.
[0071] For example, the preset task is a traffic prediction task, and the event data is traffic sensor data (flow, speed, occupancy), GPS trajectory data (vehicles, pedestrians), public transportation card data, point of interest (POI) data, social media check-in data, weather data (temperature, humidity, rainfall), environmental monitoring data (air quality), city event records (holidays, large events, traffic accidents), and the like. Data information corresponding to the above dimensions can be obtained.
[0072] That is, the event data corresponding to the preset task can be obtained based on the above manner, and then the embedding learning vector adapted to the event data is determined according to the event data.
[0073] S120, based on the plurality of event data, determining a city knowledge graph, and mapping the plurality of event data corresponding to the city knowledge graph to a to-be-used high-order tensor.
[0074] The city knowledge graph includes information in the modalities of subject, relationship, object, time, and place. It can be understood that the event data includes modal data in multiple modalities. The multiple modalities include at least time modality and space modality. The modalities in the event data can be a certain dimension, such as subject dimension, object dimension, relationship dimension, time dimension, and space dimension, and the like. If there is a finer granularity, there is also a corresponding dimension. For example, for the time dimension, if the corresponding holiday of the time is included, the time periodicity feature dimension is also included. For each dimension, the event data can have corresponding numerical values in all modalities, or can have corresponding numerical values in only some modalities. Whether the data is in some modalities is determined based on the collected data, and whether the data is not limited in the embodiment.
[0075] After obtaining the event data, the city knowledge graph corresponding to the event data can be determined. Then, in order to uniformly represent the heterogeneous city data (event data), the event data can be mapped to a high-order tensor. A high-order tensor table can be created in advance and used as a to-be-used high-order tensor. Each event data corresponds to a cell in the to-be-used high-order tensor, and the data value of the event data in the to-be-used high-order tensor can be determined according to whether there is a data value in each modality of the event data. That is, the to-be-used high-order tensor includes cells, and the data value in each cell is used to represent the correlation between the multiple modalities in the event data. When each modality includes a corresponding data value, it can be mapped to 1, and vice versa.
[0076] Specifically, the city knowledge graph can be constructed according to the plurality of pieces of event data. Further, whether each modality in the plurality of event data corresponding to the city knowledge graph includes a data value is determined to map the data value to each cell in the to-be-used high-order tensor.
[0077] The plurality of modalities include a first type of modality when the event data is generated, or the first type of modality and a second type of modality. The first type of modality includes a subject, a relationship, an object, a time modality, and a space modality. The second type of modality includes at least one of a time period feature modality, a space region modality, a city weather modality, an air quality modality, and a traffic event type modality.
[0078] It can be understood that the plurality of modalities include the first type of modality, or the plurality of modalities include the first type of modality and the second type of modality. The first type of modality mainly includes a subject, a relationship, an object, a time, and a space modality. The second type of modality further includes a more detailed feature modality. For example, one or more of a time period feature modality, a space region modality, a city weather modality, an air quality modality, and a traffic event type modality.
[0079] Based on the above manner, the corresponding modality to be mapped into the to-be-used high-order tensor can be defined in advance.
[0080] In the embodiment, the advantage of setting the modality type is that the problem that the determined result is inaccurate due to the multi-dimensional static features and the inability to timely focus on the information on the time and space when the existing knowledge graph and embedding learning vector are determined based on the triple can be solved.
[0081] After the plurality of modalities are determined, the event data can be mapped into the to-be-used high-order tensor. In the embodiment, the event data can be mapped into the to-be-used high-order tensor by the following manner: for the plurality of event data, the event data is divided into multiple modalities according to the plurality of modalities set in advance to obtain a fact tuple of the event data; and according to the data content included in each modality in the fact tuple, a data value of the event data mapped into the to-be-used high-order tensor is determined.
[0082] It should be noted that the processing manner for each event data is the same. Herein, one of the event data is taken as an example for description.
[0083] In order to capture the complex dynamics of city knowledge, the unit group of the traditional knowledge graph can be expanded into a multi-dimensional fact containing more context information. In the case where the set modality includes the first type of modality and the second type of modality, the event data mapped into the high-order tensor can be described as follows:
[0084] For example, the modality corresponding to the event data can include (es , r, e o , t point , t period , l coord ,l area, c1, …, c k ): where e s, r, e o : Representing the subject entity, relation, and object entity respectively, constituting the core semantics of the fact; t point : Indicates the precise point in time when an event occurred, such as "2024-07-01 08:30:00"; t period This indicates periodic characteristics, such as the hour of the day (e.g., "08:00"), the day of the week (e.g., "Monday"), the month or quarter of the year, and whether it is a holiday or public holiday. These periodic characteristics are crucial for capturing the regularity of urban activities; coord : Represents precise geographic coordinates, such as latitude and longitude, used to pinpoint the specific location where the event occurred; larea: Represents an abstract spatial region ID, such as an administrative division code, functional area ID (e.g., commercial area, residential area), or predefined grid cell ID, used to represent the macroscopic spatial scope of the event. i : This indicates contextual information specific to other cities, such as weather type (sunny, rainy, snowy), air quality level, traffic event type (traffic accident, road construction, large gathering), etc. This information can provide richer background knowledge.
[0085] Event data can be partitioned based on the multiple modalities defined above to obtain fact tuples corresponding to the event data. A fact tuple can be (e... s , r, e o , t point , t period , l coord , l area , c1, …, c k Based on whether each modality in the fact tuple contains a corresponding data value, determine the cell value of a specific cell in the higher-order tensor to be used. If the fact corresponding to the fact tuple exists, the cell value is 1; otherwise, the cell value is 0.
[0086] For example, see Figure 2 For predicting urban traffic congestion, a seventh-order tensor can be constructed. Among them, N Road It is the number of road segments, N TrafficState It is a traffic condition category (e.g., smooth flow, slow flow, congestion), N TimeOfDay N is the number of time periods in a day. DayOfWeekis the day of the week, N Weather is the number of weather types, N Event is the number of event types, N Area is the number of spatial areas. If the fact (road_i, congested, 08:00, Monday, sunny, no_event, area_j) exists, then the corresponding cell X i,congested,08:00,Monday,sunny,no_event,j = 1 in the tensor, otherwise 0. Using high-order tensor representation can associate the traffic state of a road segment with multiple dimensions such as time, day, weather, event, and area, thereby comprehensively capturing the complex dynamics of urban traffic.
[0087] In this embodiment, the advantage of mapping the event data corresponding to the city knowledge graph into a high-order tensor is that there is inherent sparsity in the city knowledge graph, that is, most elements in the high-order tensor to be used are 0, because not all possible combined facts exist. The high-order tensor to be used can naturally capture the correlation of multiple modalities and lay the foundation for subsequent tensor decomposition completion, thereby effectively addressing the data sparsity problem. Further, by uniformly representing the city multi-source heterogeneous data as a high-order tensor, a structured and comprehensive input is provided for subsequent embedding learning.
[0088] S130, inputting the high-order tensor to be used into a multi-relation graph convolution network to learn modal basic information of multiple modalities in the high-order tensor to be used and modal cross information between any two modalities.
[0089] The multi-relation graph convolution network is a MR-GCN enhanced city knowledge graph embedding learning model based on high-order tensor decomposition. The model aims to map entities, relationships, and multi-dimensional spatio-temporal context (such as time, periodic features, spatial areas, weather, and events) in the city knowledge graph to a low-dimensional continuous vector space, while capturing their high-order interactions. The core is to extend the generalized tensor product convolution operation of MR-GCN so that it can run on higher-order spatio-temporal tensors.
[0090] The modal basic information can be information obtained after learning the feature information of each modality. The modal cross information mainly refers to information obtained after learning the modal features between any two modalities.
[0091] Specifically, the event data with a data value of 1 in the high-order tensor to be used can be used in the multi-relation graph convolution network. The data under multiple modalities in the high-order tensor to be used can be learned based on the multi-relation graph convolution network to learn the modal basic information corresponding to each modality in the high-order tensor to be used and the modal cross information between the modalities.
[0092] S140, output the embedding learning vector corresponding to the city knowledge graph.
[0093] The knowledge graph embedding learning vector is a numerical vector obtained by mapping entities and relationships in the knowledge graph to a low-dimensional continuous vector space. These vectors can preserve the semantic information and structural features in the knowledge graph, so that the operations in the vector space can reflect the semantic relationships in the knowledge graph.
[0094] The purpose of obtaining the embedding learning vector is mainly that the entities and relationships in the knowledge graph are originally discrete and sparse symbolic representations, which are not conducive to computer calculation and processing. The vectors obtained by embedding learning are dense low-dimensional representations, and the computer can more efficiently perform operations and reasoning on them. The embedding learning vector can capture the semantic information and structural information in the knowledge graph, and represent the similarity and relevance between entities and relationships through the distance and direction between vectors, providing a basis for knowledge graph completion, reasoning and other tasks. It provides strong support for downstream tasks such as knowledge graph completion, reasoning, and question answering. For example, in knowledge graph completion, the embedding vector can be used to calculate the score of a multi-tuple to predict missing links in the knowledge graph; in a question answering system, embedding vectors can be used to understand entities and relationships in user questions, and then accurately answer questions. The embedded vector space can be directly trained and reasoned using existing machine learning algorithms and neural networks, enabling seamless integration of knowledge graphs with deep learning and other technologies, improving model performance and generalization ability. The vector representation obtained by embedding learning is more compact, and compared to the original knowledge graph data, it occupies less storage space, which is beneficial for knowledge graph storage and transmission.
[0095] The technical scheme provided by the embodiment of the application obtains a plurality of event data related to a preset task generated in a target city, processes the event data, and obtains a city knowledge graph. Further, the event data corresponding to the city knowledge graph is mapped to a to-be-used high-order tensor, and the to-be-used high-order tensor is input into a multi-relation graph convolution network to learn the modal basic information corresponding to each modal in the to-be-used high-order tensor and the modal cross information between any two modals, and obtain an embedding learning vector, solving the problem that the existing technology can only determine static information and cannot be applied to determine prediction information including time and / or spatial information based on the city knowledge graph.
[0096] On the basis of the above technical scheme, after obtaining the embedding learning vector, the method further comprises: completing the missing content in the city knowledge graph based on the embedding learning vector to obtain an adjusted city knowledge graph; wherein the city knowledge graph is used to perform downstream tasks.
[0097] It can be understood that there may be incomplete information in the city knowledge graph, at this time, the missing content in the city knowledge graph can be completed based on the embedding learning vector to obtain the information corresponding to the missing content in the city knowledge graph. In this way, the city knowledge graph after information completion can be obtained. The city knowledge graph can be used to perform downstream tasks. The downstream task can be one or more of the city traffic planning task, the city and traffic prediction task, the city abnormal event classification task and the city event prediction task.
[0098] The technical scheme provided by the embodiment of the application obtains a plurality of event data related to a preset task generated in a target city, and determines a city knowledge graph corresponding thereto by analyzing and processing the event data. Since the data source corresponding to the city knowledge graph obtained at this time is sparse, the event data corresponding to the city knowledge graph can be mapped into a high-order tensor to be used, so as to solve the problem of sparse data source. Further, based on processing the high-order tensor to be used with non-sparsity in the multi-relation graph convolution network, embedding learning vectors of modal basic information of a plurality of modalities in the high-order tensor to be used and modal cross information between any two modalities can be learned, thereby solving the problem in the prior art that a knowledge graph only includes static facts of entities, relations and objects, and the limited information considered makes it difficult to capture multi-dimensional feature information, so that the obtained knowledge graph is difficult to describe more content, resulting in limited use of the knowledge graph. The embedding learning vectors of the feature information including time and space relations in the city knowledge graph are learned, and then the city knowledge graph can be completed based on the embedding learning vectors. Finally, the problem in the prior art that a knowledge graph is mainly used to describe static facts and cannot be applied to processing event data occurring in a city is also solved.
[0099] Figure 3 For the city knowledge graph embedding learning method flowchart provided by the embodiment of the application, on the basis of the foregoing embodiment, the "inputting the high-order tensor to be used into the multi-relation graph convolution network to learn the modal basic information of a plurality of modalities in the high-order tensor to be used and the modal cross information between any two modalities" can be further refined, and the specific implementation manner can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the foregoing embodiment are not described herein.
[0100] As shown in Figure 3 , the method comprises:
[0101] In S210, a modal embedding matrix corresponding to each modality in the high-order tensor to be used is extracted based on an embedding layer in the multi-relation graph convolution network, and a high-order Laplacian tensor is constructed based on the modal embedding matrix.
[0102] The event data with preset numerical values in the high-order tensor to be used can be input into the multi-relation graph convolution network. The embedding layer in the multi-relation graph convolution network can perform feature extraction on the modal data corresponding to each modality in the high-order tensor to be used to determine the modal embedding matrix corresponding to each modality.
[0103] For example, referring to Figure 4 After the event data with preset numerical values in the high-order tensor to be used is input into the multi-relation graph convolution network, the embedding layer in the multi-relation graph convolution network can analyze and process the event data of each modality to obtain the modal embedding matrix corresponding to each modality. Optionally, the modal embedding matrix can include an entity embedding matrix, a relation embedding matrix, a time point embedding matrix, a time period embedding matrix, a geographic coordinate embedding matrix (a space embedding matrix), a space region embedding matrix (corresponding to a certain geographic region), and other context embedding matrices, etc. The difference between the geographic coordinate embedding matrix and the space region embedding matrix is that the geographic coordinate corresponds to a specific geographic location, and the space region can be a certain region to which the geographic location belongs, that is, the geographic coordinate is of a finer granularity, the space region is of a larger granularity, and the geographic coordinate is a position point in the space region.
[0104] In this embodiment, the core of the embedding learning based on the high-order tensor is mainly to convert the multi-dimensional association into a low-dimensional embedding through tensor decomposition.
[0105] The constructed high-order Laplace tensor is mainly used to describe and capture the high-order structure information and relations in the graph data. The high-order Laplace tensor can be constructed based on the low-dimensional embedding matrix corresponding to each modality. The high-order Laplace tensor can learn the structure and relations of the modal embedding matrix, and also can play a role in dimension reduction.
[0106] S220, processing the high-order Laplace tensor based on the multi-dimensional fusion module in the multi-relation graph convolution network to obtain modal cross information and modal basic information.
[0107] In actual applications, in order to capture the inherent time-sensitive patterns and complex spatio-temporal heterogeneity in the city knowledge graph, multi-dimensional spatio-temporal context fusion embedding can be introduced. Independent embedding matrices can be introduced to represent each time dimension (for example, time point embedding, periodic feature embedding), spatial dimension (for example, geographic coordinate embedding, region identifier embedding), and other context dimensions specific to the city (for example, weather type embedding, time type embedding).
[0108] After obtaining the high-order Laplacian tensor, the high-order Laplacian tensor can be processed based on the multi-dimensional fusion module to obtain the features corresponding to the above-mentioned dimensions. It should be noted that the multi-dimensional fusion module can not only obtain the features corresponding to each modality, but also obtain the features corresponding to the above-mentioned dimensions.
[0109] The modality basic information can be the feature information obtained after extracting the feature information of each modality, and the modality cross information can be the relationship information between the modalities obtained after analyzing the event data of any two modalities.
[0110] The mechanism of the multi-dimensional fusion module provided in the embodiment of the application for the multi-dimensional spatio-temporal context fusion embedding is an expansion of the "relationship-time context" idea. Based on this, a fusion function g(r, e tp , e tper , e lc , e la ) can be designed, which generates a comprehensive and high-dimensional spatio-temporal relationship context embedding C rstlca by deeply interacting (for example, by dot product, splicing and then passing through multiple layers of perception, or weighted sum based on attention mechanism) the relationship embedding r, the time point embedding e tp , the periodicity embedding e tper , the geographic coordinate embedding e lc and the region embedding e la . These fusion embeddings can then replace part of the original embeddings in the scoring function, thereby more accurately capturing complex associations.
[0111] It should also be noted that the functional modules mentioned in the multi-relation graph convolution network in the embodiment of the application are only used to demonstrate and introduce some functional modules. In addition to the modules, other functional modules in the multi-relation graph convolution network also need to be combined to analyze and process data.
[0112] The multi-dimensional fusion module in the multi-relation graph convolution network processes the high-order Laplacian tensor to obtain the modality cross information and the modality basic information, including: processing the modality embedding matrix corresponding to each modality in the high-order Laplacian tensor based on the first processing unit in the multi-dimensional fusion module to obtain the modality basic information corresponding to each modality; and cross-fusing the modality embedding matrix of the modalities other than the preset modalities in the high-order Laplacian tensor based on the embedding fusion function in the multi-dimensional fusion module to determine the modality cross information; wherein the preset modalities at least include the subject and the object.
[0113] Specifically, please continue to refer to Figure 4The modal embedding matrix corresponding to each modality in the high-order Laplace tensor can be processed based on the first processing unit in the multi-dimensional fusion module to obtain modal basic information corresponding to each modality. Further, the multi-dimensional fusion module further includes an embedding fusion function, which can be understood as a small neural network. The small neural network can cross-learn the modal embedding matrices of other modalities in the high-order Laplace tensor except the subject and the object to obtain modal cross information.
[0114] In S230, the high-order Laplace tensor is processed based on a generalized tensor product convolution module in the multi-relation graph convolutional network to determine relationship strength change information between different modalities in the modal cross information.
[0115] The generalized tensor product convolution operation of the multi-convolution graph neural network MR-GCN enables it to operate on higher-order spatio-temporal tensors. The traditional MR-GCN mainly focuses on the relationship dimension in the multi-relation graph. In order to capture the spatio-temporal dynamics in the city knowledge graph, the technical solution provided in the embodiment represents the city knowledge facts as a five-order or higher-order tensor, whose modalities include: subject, relationship, object, timestamp, and geographic location, etc.
[0116] Specifically, a high-order Laplace tensor will be constructed, which not only encodes the connections between entities and relationships, but also encodes the effectiveness of these connections in specific temporal and spatial contexts. The concept of generalized tensor product in MR-GCN will be generalized to allow convolution kernels to operate on all high-order dimensions, thereby being able to capture more complex, non-linear high-order interactions between entities, relationships, time, and space. This means that the model will be able to identify patterns such as changes in the strength of a certain relationship in a certain area over a certain period of time, rather than just the relationship itself.
[0117] For example, assume that the entity embedding is where N E , D in , N R , N T , N L represent the number of entities, the original feature dimension, the number of relationships, the time dimension, and the space dimension, respectively. A high-order learnable generalized tensor product convolution (graph filter tensor) is defined as where D out is the output embedding dimension. G can be parameterized by Tucker decomposition or CP decomposition: where W G is a small core tensor, and F matrices are factor matrices for each modality.
[0118] Then, the high-order spatio-temporal graph convolution operator can be defined as: where U is a feature tensor, K-phase tensor generalized multiplication, σ is a nonlinear activation function (for example, ReLU), and represents an element-level Hadamard product.
[0119] In order to realize efficient convolution and embedding learning on high-order spatio-temporal tensors, the technical scheme provided by the embodiment of the application integrates the tensor decomposition technology into the aggregation function of the MR-GCN.
[0120] Continuing to refer to Figure 4 , the convolution kernel is parameterized: the application will use Tucker decomposition or CP decomposition to parameterize the convolution kernel in MR-GCN, so that it can capture high-order nonlinear node interactions. For example, by taking the relationship, time, and spatial embedding as the factor matrix of the core tensor, dynamically changing convolution kernels can be generated, which can adjust their aggregation behavior according to the current spatio-temporal context. This will enable the model to more effectively handle heterogeneity, i.e., relationships exhibit different semantics or strengths at different times or locations.
[0121] Compact embedding representation: To address the memory and scalability challenges of large-scale urban knowledge graphs, the application will explore using TT decomposition to compactly parameterize the embedding tables of entities, relationships, timestamps, and locations. TT decomposition can significantly reduce the size of embedding vectors while maintaining or improving accuracy, and is expected to achieve significant acceleration on multi-GPU systems.
[0122] Relationship-time-space-aware neighborhood aggregation: Drawing on the idea of "Efficient relationship-aware neighborhood aggregation in graph neural networks through tensor decomposition", the embodiment of the application will use low-dimensional tensor projection matrices to enhance the representation of neighborhood entities, which are jointly defined by relationship types, time dimensions, and spatial dimensions. This method will facilitate multi-task learning, generating spatio-temporal relationship-aware representations that more carefully capture entity interactions in different spatio-temporal contexts.
[0123] It can be understood that: based on the generalized tensor product convolution module in the multi-relation graph convolution network, the high-order Laplacian tensor is processed to determine the relationship strength change information between different modalities in the modal cross information, including: based on the dynamic convolution kernel in the generalized tensor product convolution module, the modality embedding matrix in the high-order Laplacian tensor except the preset modality is processed to determine the influence strength information between different modalities; the influence strength information is taken as the relationship strength change information.
[0124] The technical scheme provided by the embodiment of the present application obtains a plurality of event data related to a preset task generated in a target city, and determines a city knowledge graph corresponding to the event data through analysis and processing of the event data. Since the data source corresponding to the city knowledge graph obtained at this time is sparse, the event data corresponding to the city knowledge graph can be mapped into a high-order tensor to be used, so as to solve the problem of data source sparseness. Further, based on processing of the high-order tensor to be used with non-sparseness in the multi-relation graph convolution network, an embedding learning vector of modal basic information of a plurality of modalities in the high-order tensor to be used and modal cross information between any two modalities can be learned, so as to solve the problem that the knowledge graph in the prior art only includes static facts of entities, relations and objects, and the limited information considered leads to difficulty in capturing multi-dimensional feature information, so that the obtained knowledge graph is difficult to describe more content, resulting in limited use of the knowledge graph. The embedding learning vector of the feature information including time and space relations in the city knowledge graph is learned, and then the city knowledge graph can be completed based on the embedding learning vector. Finally, the problem that the knowledge graph in the prior art is mainly used for describing static facts and cannot be applied to processing of event data occurring in a city is also solved.
[0125] Figure 5 For the city knowledge graph embedding learning method flowchart provided by the embodiment of the present application, it can be known on the basis of the foregoing embodiment that the obtained embedding learning vector can not be accurate, at this time, the model parameters in the multi-relation graph convolution network can be further refined based on the obtained embedding learning vector, and the specific implementation can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the foregoing embodiment are not described herein.
[0126] As shown in Figure 5 , the method comprises:
[0127] S310, a plurality of event data related to a preset task generated in a target city is obtained.
[0128] S320, based on the plurality of event data, a city knowledge graph is determined, and a plurality of event data corresponding to the city knowledge graph is mapped into a high-order tensor to be used.
[0129] Among them, the event data is used to represent the related data generated when the event occurs, the data value in the high-order tensor to be used is used to represent the correlation between a plurality of modalities in the event data, and the plurality of modalities at least include a time modality and a space modality;
[0130] S330, the high-order tensor to be used is input into a multi-relation graph convolution network to learn modal basic information of a plurality of modalities in the high-order tensor to be used and modal cross information between any two modalities.
[0131] S340, output the embedding learning vector corresponding to the city knowledge graph
[0132] S350, restore the association relationship by reconstructing the embedding learning vector to obtain an inverse high-order tensor.
[0133] The inverse high-order tensor can be understood as a tensor obtained by reconstructing the data in the embedding learning tensor after learning. The purpose of determining the inverse high-order tensor is to determine whether the loss function in the multi-relation graph convolutional network converges.
[0134] Specifically, after obtaining the embedding learning vector, the embedding learning vector can be reconstructed to recover the corresponding event data and the association relationship between the event data. The tensor obtained can be used as the inverse high-order tensor.
[0135] S360, based on the inverse high-order tensor, the to-be-used high-order tensor, the score design function and the loss function, determine the loss value, and based on the loss value, correct the model parameters of the multi-relation graph convolutional network.
[0136] The score design function is a pre-set evaluation function for determining whether a fact tuple is evaluated correctly. Optionally, for a high-order fact tuple (e s , r, e o , t p , t per , l c , l a , c1, …, c k ), its score design function can be embodied in the following way:
[0137] It can be defined as:
[0138]
[0139] Where W is the core tensor, whose dimensions match those of the high-order fact tuple. e s , r, e o , e tp , e tper , e lc , e la , e ci are the embedding vectors of the subject, the relationship, the object, the time point, the time period, the geographic coordinates, the spatial region and other context dimensions, respectively. The symbol. represents the outer product (or more complex tensor product), which is used to capture the interaction between the embedding of each dimension. This score function can directly model all high-order associations between the involved dimensions.
[0140] The scheme provided by the embodiment of the application adopts a loss function based on margin-based loss or negative sampling, such as BPR loss or cross-entropy loss. For each positive sample fact, the model generates multiple negative samples. The optimization goal is to maximize the score of the correct fact and minimize the score of the negative sample fact, so that the model can effectively distinguish between true and false facts. To prevent overfitting and improve the generalization ability of the model, the application adds an L2 regularization term to the loss function to penalize the norm of the core tensor and all embedding vectors.
[0141] The event data with data values being preset values in the to-be-used high-order tensor are sampled to update the to-be-used high-order tensor based on the sampling result, so that the multi-relation graph convolution network processes the updated to-be-used high-order tensor to obtain an embedding learning vector, until the model convergence of the multi-relation graph convolution network is determined based on the embedding learning vector.
[0142] It can be understood that the negative samples can be obtained based on sampling the data content in the relevant modalities in the event data. That is, one or more data contents in the subject, object, relation, and context modalities are randomly replaced. The data values in the to-be-used high-order tensor are updated based on the updated negative samples. The embedding learning vector can be determined based on the updated to-be-used high-order tensor.
[0143] In this embodiment, the loss value determined based on the embedding learning vector. According to the loss value, the model parameters in the multi-relation graph convolution network can be optimized. Optionally, a learnable adaptive weight mechanism can be used to learn the model parameters in the model: in order to further enhance the flexibility and adaptability of the model to the complex urban environment, the application introduces a set of learnable weight parameters (for example, λs, λr, λo, λtp, λtper, λlc, λla, λci). These weights are used to dynamically adjust the contribution of entities, relations, and different temporal and spatial context dimensions in the final scoring function. This enables the model to automatically learn the importance of different temporal and spatial contexts according to data characteristics and task requirements.
[0144] The above steps can be repeatedly performed until the model parameters obtained when the loss function converges are used as the model parameters in the multi-relation graph convolution network.
[0145] Referring to Figure 6The event data can be input into the multi-relation graph convolution network, and a loss value can be determined according to an output result. When the loss function is determined to converge based on the loss value, an embedding learning vector can be determined. At the same time, parameter optimization can be performed in a self-adaptive weight manner. When the loss function converges, embedding generation application can be performed. Optionally, the generated embedding (entity, relationship, and space-time) can also be applied to a downstream task, and optionally, the downstream task can be knowledge graph completion, event prediction, event anomaly detection, and the like.
[0146] The technical solution provided by the embodiment of the application obtains a plurality of event data related to a preset task generated in a target city, and determines a city knowledge graph corresponding to the event data by analyzing and processing the event data. Since the data source corresponding to the city knowledge graph obtained at this time is sparse, the event data corresponding to the city knowledge graph can be mapped into a to-be-used high-order tensor to solve the problem of sparse data sources. Further, based on processing of the to-be-used high-order tensor with non-sparsity in the multi-relation graph convolution network, an embedding learning vector of modal basic information of a plurality of modalities in the to-be-used high-order tensor and modal cross information between any two modalities can be learned, thereby solving the problem in the prior art that a knowledge graph only includes static facts of entities, relationships, and objects, and the limited information considered leads to difficulty in capturing multi-dimensional feature information, so that the obtained knowledge graph is difficult to describe more content, resulting in limited use of the knowledge graph. The embodiment of the application achieves learning of an embedding learning vector of feature information including time and space relationships in the city knowledge graph, and further based on the embedding learning vector, the city knowledge graph can be completed, and finally, the problem in the prior art that a knowledge graph is mainly used to describe static facts and cannot be applied to processing of event data occurring in a city is solved.
[0147] The following is an embodiment of a city knowledge graph embedding learning device provided by the embodiment of the application. The device and the city knowledge graph embedding learning method of each of the above embodiments belong to the same inventive concept. Details not described in the embodiment of the city knowledge graph embedding learning device can be referred to the embodiment of the city knowledge graph embedding learning method described above
[0148] Figure 7 The structure of a city knowledge graph embedding learning device provided by the embodiment of the application is shown in the figure. The device specifically includes an event data acquisition module 410, a high-order tensor generation module 420, a learning module 430, and an embedding vector generation module 440.
[0149] The event data acquisition module 410 is configured to acquire a plurality of event data related to a preset task generated in a target city; the high-order tensor generation module 420 is configured to determine a city knowledge graph based on the plurality of event data, and map a plurality of event data corresponding to the city knowledge graph into a high-order tensor to be used; the event data is used to represent related data generated when an event occurs, and a data value in the high-order tensor to be used is used to represent the correlation between a plurality of modes in the event data, at least including a time mode and a space mode; the learning module 430 is configured to input the high-order tensor to be used into a multi-relation graph convolution network to learn the mode basic information of a plurality of modes in the high-order tensor to be used and the mode cross information between any two modes; and the embedding vector generation module 440 is configured to output an embedding learning vector corresponding to the city knowledge graph.
[0150] The technical scheme provided by the embodiment of the application acquires a plurality of event data related to a preset task generated in a target city, and determines a city knowledge graph corresponding thereto through analysis and processing of the event data. Since the data source corresponding to the city knowledge graph obtained at this time has sparsity, the event data corresponding to the city knowledge graph can be mapped into a high-order tensor to be used to solve the problem of data source sparsity. Further, based on processing of the high-order tensor to be used with non-sparsity in the multi-relation graph convolution network, an embedding learning vector of the mode basic information of a plurality of modes in the high-order tensor to be used and the mode cross information between any two modes can be learned, solving the problem that the knowledge graph in the prior art only includes entities, relations and objects, and the graph content is not comprehensive, realizing learning of an embedding learning vector of feature information including time and space relations in the city knowledge graph, and further based on the embedding learning vector, the city knowledge graph can be completed, finally, solving the problem that the knowledge graph in the prior art is mainly used for describing static facts and cannot be applied to processing of event data occurring in a city.
[0151] On the basis of the above technical scheme, the high-order tensor generation includes:
[0152] The fact tuple division unit is configured to divide the event data according to a plurality of modes pre-set for the plurality of event data to obtain fact tuples of the event data.
[0153] The data value determination unit is configured to determine the data value of the event data mapped into the high-order tensor to be used according to the data content included in each mode in the fact tuple.
[0154] On the basis of each of the technical solutions above, the plurality of modalities comprises a first type of modality at which event data is generated, or the first type of modality and a second type of modality.
[0155] The first type of modality comprises a subject, a relationship, an object, a time modality, and a space modality, and the second type of modality comprises at least one of a time period feature modality, a space region modality, a city weather modality, an air quality modality, and a traffic event type modality.
[0156] On the basis of each of the technical solutions above, the learning module comprises:
[0157] A modality embedding matrix determination unit is configured to extract, based on an embedding layer in the multi-relation graph convolution network, a modality embedding matrix corresponding to each modality in the to-be-used high-order tensor, and construct a high-order Laplacian tensor based on the modality embedding matrix.
[0158] A modality cross information determination unit is configured to process the high-order Laplacian tensor based on a multi-dimension fusion module in the multi-relation graph convolution network, to obtain modality cross information and modality basic information.
[0159] A strength information determination unit is configured to process the high-order Laplacian tensor based on a generalized tensor product convolution module in the multi-relation graph convolution network, to determine relationship strength change information between different modalities in the modality cross information.
[0160] On the basis of each of the technical solutions above, the modality cross information determination unit comprises:
[0161] A first processing subunit is configured to process, based on a first processing unit in the multi-dimension fusion module, a modality embedding matrix corresponding to each modality in the high-order Laplacian tensor, to obtain modality basic information corresponding to each modality; and
[0162] A second processing subunit is configured to cross-fuse, based on an embedding fusion function in the multi-dimension fusion module, modality embedding matrices other than a preset modality in the high-order Laplacian tensor, to determine the modality cross information.
[0163] The preset modality at least comprises a subject and an object.
[0164] On the basis of each of the technical solutions above, the strength information determination unit is further configured to process, based on a dynamic convolution kernel in the generalized tensor product convolution module, modality embedding matrices other than a preset modality in the high-order Laplacian tensor, to determine influence strength information between different modalities.
[0165] The influence strength information is taken as the relationship strength change information.
[0166] On the basis of each of the technical solutions above, the device further comprises:
[0167] The first processing module is configured to recover the association relationship by reconstructing the embedding learning vector, so as to obtain an inverse high-order tensor.
[0168] The parameter correction module is configured to determine a loss value based on the inverse high-order tensor, the to-be-used high-order tensor, a score design function and a loss function, and correct the model parameters of the multi-relation graph convolutional network based on the loss value.
[0169] On the basis of each of the technical solutions above, the device is further configured to sample event data with a preset numerical value in the data values of the to-be-used high-order tensor, update the to-be-used high-order tensor based on the sampling result, and process the updated to-be-used high-order tensor by the multi-relation graph convolutional network to obtain an embedding learning vector, until the model convergence of the multi-relation graph convolutional network is determined based on the embedding learning vector.
[0170] On the basis of each of the technical solutions above, the device further comprises:
[0171] The urban knowledge graph completion module is configured to complete the missing content in the urban knowledge graph based on the embedding learning vector, so as to obtain an adjusted urban knowledge graph.
[0172] The urban knowledge graph is configured to perform a downstream task.
[0173] On the basis of each of the technical solutions above, the preset task at least includes one or more of a city traffic planning task, a city traffic prediction task, a city abnormal event classification task and a city event prediction task.
[0174] The urban knowledge graph embedding learning device provided in the embodiments of the present application can perform the urban knowledge graph embedding learning method provided in any of the embodiments of the present application, and has the corresponding functional modules and beneficial effects of performing the urban knowledge graph embedding learning method.
[0175] It is worth noting that in the embodiments of the above urban knowledge graph embedding learning device, each unit and module included is only divided according to functional logic, but is not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy mutual differentiation, and do not limit the protection scope of the present application.
[0176] Figure 8 A structural schematic diagram of a server provided in the embodiments of the present application is shown. Figure 8 A block diagram of an exemplary server 12 suitable for implementing embodiments of the present application is shown.Figure 8 The server 12 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0177] like Figure 8 As shown, server 12 is presented in the form of a general-purpose computing device. The components of server 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0178] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0179] Server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by server 12, including volatile and non-volatile media, removable and non-removable media.
[0180] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Server 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 8 Not shown; usually referred to as a "hard drive"). Although Figure 8 As not shown, disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disc drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0181] Program / utility 40 having a set of programs / modules 42 can be stored in system memory 28 by way of example, such programs includes, but is not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination can include implementation of the network environment as within one or more of the examples. Program modules 42 generally carry out the functions and / or methodologies of embodiments of the present application as described herein.
[0182] Server 12 can also communicate with one or more external devices 14 such as a keyboard, a pointing device, a display 24, etc.; one or more devices that enable a user to interact with server 12; and / or any devices (e.g., network card, modem, etc.) that enable server 12 to communicate with one or more other computing devices. Such communication can occur via input / output (I / O) interface(s) 22. Still yet, server 12 can communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via network adapter 20. As depicted, network adapter 20 communicates with the other components of server 12 via bus 18. It should be appreciated that although not shown, other hardware and / or software modules could be used in conjunction with server 12. Such modules include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0183] Processing unit(s) 16 can execute instructions stored in system memory 28 to perform various functions and data processing, such as implementing the city knowledge graph embedding learning method provided by the embodiment one, the method comprising:
[0184] Obtaining a plurality of event data related to a preset task generated in a target city;
[0185] Based on the plurality of event data, determining a city knowledge graph, and mapping a plurality of event data corresponding to the city knowledge graph as a to-be-used high-order tensor; wherein the event data is used to represent related data generated when an event occurs, and the data value in the to-be-used high-order tensor is used to represent the correlation between a plurality of modalities in the event data, and the plurality of modalities at least include a time modality and a space modality;
[0186] Inputting the to-be-used high-order tensor into a multi-relation graph convolutional network to learn modality basic information of a plurality of modalities in the to-be-used high-order tensor and modality cross information between any two modalities;
[0187] Outputting an embedding learning vector corresponding to the city knowledge graph.
[0188] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the city knowledge graph embedding learning method provided by any embodiment of the application.
[0189] The embodiment provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the steps of the city knowledge graph embedding learning method provided by the foregoing embodiments of the application, and the method comprises the following steps:
[0190] Obtaining a plurality of event data related to a preset task generated in a target city;
[0191] Based on the plurality of event data, determining a city knowledge graph, and mapping a plurality of event data corresponding to the city knowledge graph into a to-be-used high-order tensor; wherein the event data is used to represent related data generated when an event occurs, and a data value in the to-be-used high-order tensor is used to represent the correlation between a plurality of modalities in the event data, and the plurality of modalities at least include a time modality and a space modality;
[0192] Inputting the to-be-used high-order tensor into a multi-relation graph convolution network to learn modality basic information of a plurality of modalities in the to-be-used high-order tensor and modality cross information between any two modalities.
[0193] Outputting an embedding learning vector corresponding to the city knowledge graph.
[0194] The computer storage medium of the embodiment of the application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.
[0195] A computer readable signal medium can include a propagated data signal with computer executable code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport programming code.
[0196] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0197] Computer program code for carrying out operations for aspects of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0198] Note that the foregoing are merely examples of the preferred embodiments of the present application and the principles of the technology employed. It will be understood by those skilled in the art that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made to the present application without departing from the scope of the present application. Therefore, although the present application has been described in detail with reference to the foregoing embodiments, the present application is not limited to the foregoing embodiments, and can include other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method for embedding learning of urban knowledge graphs, characterized in that, include: Acquire multiple event data points related to a preset task generated within the target city; wherein, the event data is used to characterize the relevant data generated when the event occurs. Based on the multiple event data, a city knowledge graph is determined, and the multiple event data corresponding to the city knowledge graph are mapped into a higher-order tensor to be used; wherein, the data values in the higher-order tensor to be used are used to characterize the correlation between multiple modalities in the event data, and the multiple modalities include at least a temporal modality and a spatial modality; The high-order tensor to be used is input into a multi-relation graph convolutional network to learn the modal basis information of multiple modes in the high-order tensor to be used and the modal cross information between any two modes; Output the embedding learning vector corresponding to the city knowledge graph.
2. The method according to claim 1, characterized in that, The process of mapping multiple event data corresponding to the city knowledge graph into higher-order tensors to be used includes: For multiple event data, the event data is divided into multiple modalities according to a pre-defined set of modalities to obtain fact tuples of the event data; Based on the data content included in each modality of the fact tuple, determine the data values in the higher-order tensor to be used that map the event data.
3. The method according to any one of claims 1-2, characterized in that, The multiple modalities include a first type modality when event data is generated, or a first type modality and a second type modality; The first type of modality includes subject, relationship, object, time modality and spatial modality, and the second type of modality includes at least one of time periodic feature modality, spatial region modality, urban weather modality, air quality modality and traffic event type modality.
4. The method according to claim 1, characterized in that, The step of inputting the high-order tensor to be used into a multi-relation graph convolutional network to learn the modal basis information of multiple modes in the high-order tensor to be used and the modal interaction information between any two modes includes: Based on the embedding layer in the multi-relation graph convolutional network, the modality embedding matrix corresponding to each mode in the high-order tensor to be used is extracted, and a high-order Laplacian tensor is constructed based on the modality embedding matrix; The higher-order Laplacian tensor is processed based on the multi-dimensional fusion module in the multi-relation graph convolutional network to obtain modal cross information and modal basis information; The higher-order Laplacian tensor is processed by the generalized tensor product convolution module in the multi-relation graph convolutional network to determine the intensity change information of the relationship between different modes in the modal cross information.
5. The method according to claim 4, characterized in that, The multi-dimensional fusion module in the multi-relation graph convolutional network processes the higher-order Laplacian tensor to obtain modal cross-information and modal basis information, including: The modal embedding matrix corresponding to each mode in the higher-order Laplacian tensor is processed by the first processing unit in the multi-dimensional fusion module to obtain the basic modal information corresponding to each mode; and, Based on the embedding fusion function in the multi-dimensional fusion module, the modal embedding matrix other than the preset mode in the higher-order Laplace tensor is cross-fused to determine the modal cross information; The preset mode includes at least a subject and an object.
6. The method according to claim 4, characterized in that, The generalized tensor product convolution module based on the multi-relation graph convolutional network processes the higher-order Laplacian tensor to determine the intensity change information of the relationship between different modes in the modal cross information, including: The modality embedding matrix in the higher-order Laplacian tensor, excluding the preset mode, is processed based on the dynamic convolution kernel in the generalized tensor product convolution module to determine the influence intensity information between different modes. The influence intensity information is used as the relationship intensity change information.
7. The method according to claim 1, characterized in that, After obtaining the embedding learning vector, the method further includes: The correlation is recovered by reconstructing the embedded learning vectors to obtain the inverted higher-order tensor; Based on the inverted higher-order tensor, the higher-order tensor to be used, the scoring design function, and the loss function, a loss value is determined, and the model parameters of the multi-relation graph convolutional network are corrected based on the loss value.
8. The method according to claim 7, characterized in that, The method further includes: The event data with preset values in the high-order tensor to be used are sampled, and the high-order tensor to be used is updated based on the sampling results. The multi-relationship graph convolutional network processes the updated high-order tensor to be used to obtain an embedding learning vector, until the model convergence of the multi-relationship graph convolutional network is determined based on the embedding learning vector.
9. The method according to claim 1, characterized in that, After obtaining the embedding learning vector, the method further includes: The missing content in the city knowledge graph is filled in based on the embedded learning vector to obtain the adjusted city knowledge graph. The city knowledge graph is used to perform downstream tasks.
10. The method according to claim 1, characterized in that, The preset tasks include at least one or more of the following: urban traffic planning tasks, urban traffic prediction tasks, urban abnormal event classification tasks, and urban event prediction tasks.
11. A city knowledge graph embedded learning device, characterized in that, include: The event data acquisition module is used to acquire multiple event data related to the preset task generated within the target city. A higher-order tensor generation module is used to determine a city knowledge graph based on the multiple event data, and map the multiple event data corresponding to the city knowledge graph into higher-order tensors to be used; wherein, the event data is used to characterize the relevant data generated when the event occurs, and the data values in the higher-order tensors to be used are used to characterize the correlation between multiple modalities in the event data, and the multiple modalities include at least a temporal modality and a spatial modality; The learning module is used to input the high-order tensor to be used into a multi-relation graph convolutional network to learn the modal basis information of multiple modes in the high-order tensor to be used and the modal cross information between any two modes. The embedding vector generation module is used to output the embedding learning vectors corresponding to the city knowledge graph.
12. A server, characterized in that, The server includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the city knowledge graph embedding learning method as described in any one of claims 1-10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the city knowledge graph embedding learning method as described in any one of claims 1-10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the urban knowledge graph embedding learning method as described in any one of claims 1-10.
Citation Information
Patent Citations
Network security knowledge graph embedding method and device and medium
CN116702893A
Multi-modal knowledge graph completion method and system based on embedded synchronization and alignment
CN118821921A