Urban operation knowledge graph construction method and device and computer equipment
By converting the spatiotemporal format of urban operation data and performing correlation analysis, an urban operation knowledge graph is constructed, which solves the problem of low data processing efficiency in existing technologies and enables efficient mining and visual monitoring of urban operation patterns.
Patent Information
- Application Number
- CN201911106955.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-13
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2039-11-13
AI Technical Summary
Existing urban data analysis methods suffer from low data processing efficiency and cannot effectively meet users' needs for in-depth exploration of urban operational patterns.
By acquiring urban operation-related data, converting spatiotemporal data formats and aggregating elements, calculating correlation coefficients using a pre-set element correlation analysis algorithm, constructing an urban operation knowledge graph, and sending it to the terminal for display.
It improves the processing efficiency of massive heterogeneous urban data, provides effective technical improvements for mining potential patterns in urban operations, and meets users' needs for visualized monitoring of urban operations.
Smart Images

Figure CN111191040B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a method, apparatus, computer-readable storage medium, and computer device for constructing a knowledge graph of urban operations. Background Technology
[0002] With the continuous development and progress of science and technology, the construction of smart cities has become one of the driving forces for technological innovation. Building smart cities not only requires the effective storage, calculation and analysis of massive urban data resources, but also requires mining potential value from massive data, exploring the laws of urban operation, and providing strong support for urban operation decisions.
[0003] However, existing technologies involving the analysis of massive urban data, whether constructing knowledge graphs or building analytical frameworks, typically employ techniques such as adding semantic annotations or word segmentation to the data. While these techniques can achieve data analysis within a certain domain, they suffer from non-standardized processing of heterogeneous massive data, thus failing to meet users' needs for in-depth exploration of urban operational patterns.
[0004] Therefore, existing urban data analysis methods suffer from low data processing efficiency. Summary of the Invention
[0005] Therefore, it is necessary to address the technical problem of low data processing efficiency in existing technologies by providing a method, apparatus, computer-readable storage medium, and computer equipment for constructing a knowledge graph of urban operation.
[0006] On one hand, embodiments of the present invention provide a method for constructing a knowledge graph of urban operation, comprising: acquiring urban operation thematic data; converting the urban operation thematic data according to the format of spatiotemporal data, and aggregating the elements of the format-converted spatiotemporal data to obtain a thematic element spatiotemporal dataset; calculating the correlation coefficient between at least two thematic element spatiotemporal datasets through a preset element association analysis algorithm; the correlation coefficient is used to determine the related elements in the urban operation data; constructing an urban operation knowledge graph based on the association information of the related elements; and sending the urban operation knowledge graph to a terminal for the terminal to display the graph.
[0007] On the other hand, embodiments of the present invention provide a device for constructing a knowledge graph of urban operation, comprising: a data acquisition module for acquiring urban operation thematic data; a format conversion module for converting the urban operation thematic data into a spatiotemporal data format, and aggregating the elements of the format-converted spatiotemporal data to obtain a thematic element spatiotemporal dataset; a correlation analysis module for calculating the correlation coefficient between at least two thematic element spatiotemporal datasets using a preset element correlation analysis algorithm; the correlation coefficient is used to determine the related elements in the urban operation data; and a graph construction module for constructing an urban operation knowledge graph based on the correlation information of the related elements; the urban operation knowledge graph is sent to a terminal for the terminal to display the graph.
[0008] In another aspect, embodiments of the present invention provide a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it performs the following steps: acquiring urban operation thematic data; converting the urban operation thematic data according to a spatiotemporal data format, and aggregating the converted spatiotemporal data into a thematic element spatiotemporal dataset; calculating the correlation coefficient between at least two thematic element spatiotemporal datasets using a preset element association analysis algorithm; the correlation coefficient is used to determine the associated elements in the urban operation data; constructing an urban operation knowledge graph based on the association information of the associated elements; and sending the urban operation knowledge graph to a terminal for the terminal to display the graph.
[0009] In another aspect, embodiments of the present invention provide a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: acquiring urban operation thematic data; converting the urban operation thematic data according to a spatiotemporal data format, and aggregating the converted spatiotemporal data into a thematic element spatiotemporal dataset; calculating the correlation coefficient between at least two thematic element spatiotemporal datasets using a preset element association analysis algorithm; the correlation coefficient is used to determine the associated elements in the urban operation data; constructing an urban operation knowledge graph based on the association information of the associated elements; and sending the urban operation knowledge graph to a terminal for the terminal to display the graph.
[0010] The aforementioned method, apparatus, computer-readable storage medium, and computer equipment for constructing a knowledge graph of urban operations acquire thematic data on urban operations, convert this data into a spatiotemporal data format to obtain a spatiotemporal dataset of thematic elements, and then calculate the correlation coefficients between thematic elements using a preset element association analysis algorithm. This identifies the associated elements, allowing the construction of a knowledge graph of urban operations using the association information of these elements. This method not only improves the processing efficiency of massive heterogeneous urban data and provides effective technical improvements for uncovering potential patterns in urban operations, but also provides data support for smart city-related applications and services, while meeting users' needs for visualized monitoring of urban operations. Attached Figure Description
[0011] Figure 1 This is an application environment diagram of a method for constructing a knowledge graph of urban operations in one embodiment;
[0012] Figure 2 This is a structural block diagram of a computer device in one embodiment;
[0013] Figure 3 This is a flowchart illustrating a method for constructing a knowledge graph of city operations in one embodiment;
[0014] Figure 4 This is a flowchart illustrating the spatiotemporal data format conversion steps in one embodiment;
[0015] Figure 5 This is a flowchart illustrating the steps for determining associated elements in one embodiment;
[0016] Figure 6 This is a flowchart illustrating the steps involved in constructing a knowledge graph of city operations in one embodiment.
[0017] Figure 7 This is a flowchart illustrating the steps for determining the direction of arrows connecting graph nodes in one embodiment.
[0018] Figure 8 This is a flowchart illustrating the step of determining the direction of the arrows connecting the nodes in another embodiment;
[0019] Figure 9 This is a flowchart illustrating the data cleaning and structuring process steps in one embodiment;
[0020] Figure 10 This is a schematic diagram illustrating the structured processing of urban operation-related data in one embodiment;
[0021] Figure 11 This is a schematic diagram illustrating the changes in the city operation knowledge graph displayed by user instructions in one embodiment.
[0022] Figure 12This is a structural block diagram of a city operation knowledge graph construction device in one embodiment. Detailed Implementation
[0023] 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.
[0024] First, it should be noted that the terms "first" and "second" used in the embodiments of this invention are merely used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permissible. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in an order other than those illustrated or described herein.
[0025] Figure 1 This is an application environment diagram of a city operation knowledge graph construction method in one embodiment. (Refer to...) Figure 1 The application environment includes server 110 and terminal 120, which establish a communication connection through a network, including but not limited to: wide area network, metropolitan area network or local area network.
[0026] The server 110, based on acquired urban operation thematic data (such as Urban Operation Thematic Data 1 and Urban Operation Thematic Data 2), converts the data according to the spatiotemporal data format and aggregates the converted spatiotemporal data into thematic element spatiotemporal datasets. Then, using a preset element association analysis algorithm, it calculates the association coefficients between at least two thematic element spatiotemporal datasets to determine the related elements in the urban operation thematic data. Finally, it constructs an urban operation knowledge graph using the association information of these related elements. This knowledge graph is then sent to the terminal 120, which displays the thematic graph information for different regions within the knowledge graph according to user requests. For example, the environmental protection thematic information for a scenic area in City A.
[0027] Furthermore, terminal 120 can be a desktop terminal or a mobile terminal. A mobile terminal can be at least one of a mobile phone, tablet, or laptop. The urban operation knowledge graph constructed using the method of this invention can be applied to the construction of various smart city services, such as municipal planning services, ecological and environmental governance services, public safety services, traffic control services, and public services. Server 110 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0028] Figure 2An internal structural diagram of a computer device in one embodiment is shown. Specifically, this computer device may be... Figure 1 Server 110 in the middle. For example... Figure 2 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and may also store computer programs. When executed by the processor, these computer programs enable the processor to implement a method for synchronously updating management privilege transfers. The internal memory may also store computer programs. When executed by the processor, these computer programs enable the processor to execute a method for constructing a city operation knowledge graph.
[0029] Those skilled in the art will understand that Figure 2 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0030] like Figure 3 As shown, in one embodiment, a method for constructing a knowledge graph of urban operations is provided. This embodiment mainly applies this method to the above-mentioned... Figure 1 Let's take server 110 as an example. (Refer to...) Figure 3 The method for constructing the knowledge graph for city operation specifically includes the following steps:
[0031] S302, Obtain city operation-related data.
[0032] Among them, urban operation-related data can refer to basic data generated in various fields during urban operation, such as data on transportation, environmental protection, education, healthcare, population, chemicals, and enterprises.
[0033] Specifically, server 110 can obtain real-time data from various data platforms via the network, and then store all urban operation data by topic according to the data source or data analysis, including thematic data such as transportation, environmental protection, education, medical care, population, chemical industry, and enterprises.
[0034] S304, the city operation thematic data is converted according to the spatiotemporal data format, and the converted spatiotemporal data is aggregated into elements to obtain the thematic element spatiotemporal dataset.
[0035] Spatiotemporal data can refer to data that simultaneously possesses time and space dimensions. In the real world, more than 80% of data is related to geographical location. Spatiotemporal big data includes three-dimensional information of time, space, and thematic attributes.
[0036] The spatiotemporal data format can be a tuple format that includes data entity information, timestamp, and spatial coordinates. For example, the spatiotemporal data format of PM2.5 air quality can be represented as a tuple of {PM2.5 content, timestamp, spatial coordinates}.
[0037] Among them, element aggregation can refer to the collection and classification of data by element. For example, the "air quality" information in the environmental protection topic data can be aggregated by element to obtain the relevant data set of air quality elements under the environmental protection topic.
[0038] Among them, the thematic element spatiotemporal dataset can refer to a data set with spatiotemporal data format, with elements as the unit, such as the data set of air quality elements in the environmental protection theme.
[0039] Specifically, since urban operation thematic data all contain temporal and spatial information, and given the significant heterogeneity of urban operation thematic data across various fields, server 110 first needs to standardize the data format before conducting data analysis. Because spatiotemporal data formats can reflect the temporal, spatial, and thematic attributes of different data, this technology, applied in this application, not only improves the efficiency of constructing urban operation knowledge graphs but also, combined with GIS (Geographic Information System), presents a visualized urban operation situation based on GIS layers.
[0040] For example, the converted spatiotemporal data can be categorized and collected by thematic elements. The categorization and collection methods can be the pre-set thematic element filling method (e.g., environmental protection themes mainly include three elements: air quality, water quality, and soil, and environmental protection thematic data can be categorized into three categories), or the spatiotemporal data entity semantic classification method (analyzing the semantics of entity nouns in thematic data and classifying them according to semantic mapping, such as mapping "PM.5" to "air quality" and "30℃" to "temperature"). The resulting thematic element spatiotemporal dataset can be stored in the form of GIS layers.
[0041] S306, using a preset element association analysis algorithm, calculate the association coefficient between at least two thematic element spatiotemporal datasets; the association coefficient is used to determine the associated elements in the city operation data.
[0042] Among them, the feature association analysis algorithm can be a preset algorithm for analyzing the similarity or association between features, such as the Euclidean distance algorithm for analyzing the similarity between features, or the Apriori algorithm for analyzing the frequent itemset association between features.
[0043] Specifically, server 110 can select the best algorithm from at least one candidate feature association analysis algorithm based on the actual application scenario requirements, to calculate the association coefficient between at least two thematic feature spatiotemporal datasets. Meanwhile, these at least two thematic feature spatiotemporal datasets can be two features from the same thematic topic, or features belonging to different thematic topics.
[0044] For example, the correlation coefficient between environmental protection-related thematic elements and chemical industry-related thematic elements.
[0045] S308, Based on the association information of the associated elements, a city operation knowledge graph is constructed; the city operation knowledge graph is sent to the terminal for the terminal to display the graph.
[0046] The related information may include the number of related elements, the magnitude of the correlation coefficient, and the causal relationship between the related elements.
[0047] Among them, a knowledge graph is a semantic network knowledge base with a graph structure that reveals the relationships between entities. Its basic building block is the triple "entity, relation, entity". The entity is a node in the graph, and the relation is the connection between two entities in the graph to form a node relationship network.
[0048] Specifically, to construct a knowledge graph of urban operation, server 110 first needs to identify the related elements in the urban operation thematic data, and then use the relationships between these elements to construct the knowledge graph of urban operation. This knowledge graph can be applied to the development of specific applications, and users can view the knowledge graph of urban operation on terminal 120 by clicking on the relevant functions of specific applications, thereby obtaining the potential patterns of urban operation.
[0049] In this embodiment, urban operation thematic data is acquired and converted according to a spatiotemporal data format to obtain a thematic element spatiotemporal dataset. Then, a preset element association analysis algorithm is used to calculate the association coefficients between thematic elements, thereby identifying related elements. This allows for the construction of an urban operation knowledge graph using the association information of these elements. This method not only improves the processing efficiency of massive heterogeneous urban data and provides effective technical improvements for uncovering potential patterns in urban operations, but also provides data support for smart city-related application services and meets users' needs for visualized monitoring of urban operations.
[0050] like Figure 4 As shown, in one embodiment, step S304 involves converting the city operation thematic data according to a spatiotemporal data format, and then aggregating the converted spatiotemporal data into a thematic element spatiotemporal dataset. This specifically includes the following steps:
[0051] S3042, the city operation thematic data is converted according to the spatiotemporal data format to obtain a set of spatiotemporal data tuples.
[0052] Among them, the spatiotemporal data tuple set can refer to a spatiotemporal data tuple that includes a data set.
[0053] Specifically, after the city operation thematic data is structured in the form of spatiotemporal data by server 110, it can be converted into spatiotemporal data tuples.
[0054] For example, air PM2.5 data are all converted into tuples of {PM2.5 content, timestamp, spatial coordinates}.
[0055] S3044, Based on the part-of-speech tags of entities in the spatiotemporal data tuple set, elements are grouped and classified to obtain a thematic element spatiotemporal dataset; the thematic element spatiotemporal dataset is stored in the form of a GIS layer so that the terminal can perform dynamic GIS display.
[0056] Specifically, the part-of-speech attribute of entities in the spatiotemporal data tuple set can be the part-of-speech attribute of the first element in the spatiotemporal data triple. The server 110 performs element aggregation and classification based on the part-of-speech attribute of entities in the spatiotemporal data tuple set. This can be based on a preset semantic mapping relationship or on the element categories redefined in the spatiotemporal data tuple set.
[0057] For example, in the spatiotemporal data tuple {PM2.5 content, timestamp, spatial coordinates}, the first entity noun is "PM2.5 content". It can be assigned to the element "air quality" according to the preset semantic mapping, or it can be redefined as "PM2.5". Subsequent elements will then be named based on this element as the classification basis.
[0058] In this embodiment, the processing efficiency of massive heterogeneous urban data can be further improved by identifying the part-of-speech of entities in the spatiotemporal data tuple set for element aggregation and classification.
[0059] like Figure 5 As shown, in one embodiment, after calculating the correlation coefficient between at least two thematic element spatiotemporal datasets using a preset element correlation analysis algorithm in step S306, the specific steps include the following:
[0060] S502, Determine the preset element association threshold.
[0061] Among them, the element association threshold can be a critical value for determining whether elements are associated. For example, if the association coefficient ranges from 0 to 1, then the element association threshold can be 0.6.
[0062] Specifically, the setting of the element association threshold can be determined according to the actual application situation. For example, it can be determined according to the data ratio, or it can be determined according to the actual situation, or it can be determined according to the user's requirements for the strength of element association. Therefore, the determination of the element association threshold is not specifically limited in this application.
[0063] S504, if the correlation coefficient is greater than or equal to the element correlation threshold, then the thematic elements corresponding to the at least two thematic element spatiotemporal datasets are determined to be related elements.
[0064] Specifically, after calculating the correlation coefficient between at least two elements, the server 110 can match the correlation coefficient with a preset element correlation threshold. If the threshold requirement is met, the corresponding two elements are determined to be related elements. By analogy, all related elements in the urban operation thematic data can be determined.
[0065] In this embodiment, the association threshold is set to determine the associated elements, which can adaptably meet the association elements of different situations and different needs. This not only further improves the processing efficiency of massive heterogeneous urban data, but also adds multi-functional options to the application of urban operation knowledge graphs to meet the specific determination of associated elements in different scenarios.
[0066] like Figure 6 As shown, in one embodiment, step S308 involves constructing a city operation knowledge graph based on the association information of the associated elements, specifically including the following steps:
[0067] S3082, determine the size of the graph node based on the number of associated elements; the size of the graph node is proportional to the number of associated elements.
[0068] The number of associated elements can refer to the total number of other elements associated with a given element, such as 2, 3, 4, etc.
[0069] The size of a graph node can be the node area whose radius increases with the number of associated elements. For example, if element A has 3 associated elements (the number of elements associated with element A is 3), then the size of the graph node can be the area π(3k) of a circle with a radius of 3*k. 2 k can be any positive number determined based on the actual situation.
[0070] Specifically, server 110 needs to construct a knowledge graph of city operation. First, it needs to count the number of element associations of each related element. Then, it can determine the node area of the related element in the graph by using the preset relationship between the number of element associations and the size of the graph nodes.
[0071] For example, in an environmental protection topic, the related elements of the element "air quality" include "wind force", "temperature", "road traffic", "electricity consumption of chemical enterprises" and "tourist flow in scenic spots". The number of related elements of "air quality" is 5. The size of its node in the graph is determined by the relationship between the number of related elements and the size of the graph node, which is the area of a circle with a radius of 5mm.
[0072] S3084, Determine the width of the map node connection line based on the correlation coefficient of the associated elements; the width of the map node connection line is proportional to the correlation coefficient.
[0073] Specifically, the thickness of the connecting lines between nodes in the graph can be determined by the correlation coefficient of the associated elements.
[0074] For example, if the correlation coefficient between element A and element B is 0.1, then the line width connecting the nodes of the two elements in the map is 1 / 4pt; if the correlation coefficient between element A and element B is 0.2, then the line width connecting the nodes of the two elements in the map is 1 / 2pt. The higher the correlation coefficient, the thicker the line width connecting the nodes in the map. There can be a preset proportional mapping relationship between the two.
[0075] S3086, Determine the direction of the arrows connecting the nodes in the graph based on the causal relationship of the associated elements.
[0076] Specifically, server 110 can determine the "causal" relationship between elements based on the temporal correlation, and then determine what is the "cause" and what is the "effect" between two related elements. In the urban operation thematic data, determining the causal relationship between related elements can be done by querying the core impact factors of a certain element in a certain thematic area step by step, and then tracing the essence of the problem.
[0077] For example, if there is a correlation between elements A and B, select a spatiotemporal data set of element A over a period of time, and perform correlation analysis on the spatiotemporal dataset of element A and the spatiotemporal dataset of element B over the same period of time to obtain multiple correlation coefficients. Then, determine the causal relationship between the two elements based on the trend of the correlation coefficients.
[0078] S3088, Construct the city operation knowledge graph based on the size of the graph nodes, the width of the graph node connection lines, and the direction of the arrows on the graph node connection lines.
[0079] Specifically, by combining information such as the size of the graph nodes, the width of the graph node connection lines, and the direction of the arrows on the graph node connection lines, server 110 can construct a knowledge graph of city operation.
[0080] In this embodiment, by analyzing the number of element associations, association coefficients, and causal relationships of related elements, not only can a knowledge graph that only presents the relationships between elements be constructed, but also a knowledge graph with more potential information such as entity result-oriented factors and the scope of entity influence can be constructed, providing data support for smart city-related application services, while meeting users' needs for visualized monitoring of urban operations.
[0081] like Figure 7 As shown, in one embodiment, determining the direction of the arrow connecting the graph nodes based on the causal relationship of the associated elements further includes the following steps:
[0082] S702, determine the first element and the second element in the associated elements.
[0083] Specifically, server 110 analyzes the causal relationship between two related elements and can randomly determine one element as the first element and the other element as the second element.
[0084] For example, among two related factors, "air quality" and "electricity consumption of chemical enterprises", if "air quality" is the first factor, then "electricity consumption of chemical enterprises" is the second factor.
[0085] S704, calculate the correlation coefficient between the first element and the second element at the current time within a preset time period to obtain the temporal trend of the correlation coefficient.
[0086] Specifically, server 110 will obtain the spatiotemporal dataset of the first element within a preset time period, and at the same time obtain the spatiotemporal dataset of the second element in the current time slice. Then, it will obtain N spatiotemporal datasets of the first element within the preset time period, and perform correlation calculation with the spatiotemporal dataset of the second element at the current time to finally obtain the temporal change trend of the correlation coefficient between the first element and the second element at the current time within the preset time period.
[0087] For example, the spatiotemporal dataset of the first element A within a preset time period is A0, A1, A2...A n If the spatiotemporal dataset of the second element at the current moment is B0, then n correlation coefficients will be calculated. These n correlation coefficients, for the first element A, represent the temporal variation trend of the correlation coefficients according to the temporal variation.
[0088] S706, Determine the direction of the arrow connecting the nodes in the graph based on the temporal variation trend of the correlation coefficient.
[0089] Specifically, server 110 will determine the direction of the arrow connecting the graph nodes according to the temporal change trend of the correlation coefficient and the predetermined direction determination rules.
[0090] For example, when the correlation coefficient shows an increasing trend over time, the arrow of the graph node connecting the first element A and the second element B points from A to B. Thus, the first element A is the "cause" element and the second element B is the "effect" element.
[0091] In this embodiment, the direction of the arrow of the map node connection line is determined by calculating the time-series change trend of the correlation coefficient, which can further improve the processing efficiency of massive heterogeneous urban data.
[0092] like Figure 8 As shown, in one embodiment, determining the direction of the arrow connecting the graph nodes based on the time-series change trend of the correlation coefficient specifically includes the following steps:
[0093] S802, if the temporal change trend of the correlation coefficient is an increasing trend, then the first element is determined to be the causal element among the correlation elements and the second element is the effect element.
[0094] Specifically, if the correlation coefficient shows an increasing trend over time, it indicates that the change of the first element over a period of time will lead to an enhanced correlation with the second element. In this case, the first element is a cause of the existence of the second element, and the first element is the causal element and the second element is the effect element.
[0095] For example, if the data change of "electricity consumption of chemical enterprises" over a period of time leads to an enhanced correlation with the second factor "air quality", it indicates that "electricity consumption of chemical enterprises" is a key factor affecting "air quality", and "electricity consumption of chemical enterprises" is the causal factor and "air quality" is the effect factor.
[0096] S804, if the correlation coefficient shows a decreasing trend over time, then the first element is determined to be the effect element among the correlation elements and the second element is determined to be the cause element.
[0097] Specifically, if the correlation coefficient shows an increasing trend over time, it indicates that changes in the first element over a period of time will lead to a weakening of the correlation with the second element. However, this does not mean that the first element is a cause of the existence of the second element.
[0098] For example, if we reverse the above embodiments, "electricity consumption of chemical enterprises" cannot be used as a resultant factor of "air quality," that is, changes in "air quality" will not cause "electricity consumption of chemical enterprises" to change in a certain trend.
[0099] S806, determine the direction from the cause element to the effect element in the associated elements, and use it as the arrow direction of the graph node connection line.
[0100] Specifically, the direction of the arrows connecting the nodes in the graph is an effective way to illustrate causal relationships. In the knowledge graph of urban operation, the direction of the arrows connecting the nodes between related elements can illustrate the causal relationship between the two elements, making it easier for users to intuitively obtain the guiding factors of urban operation entities.
[0101] In this embodiment, the direction of the arrow of the connecting line of the map node is determined by analyzing the time series change trend of the specific correlation coefficient, which can further improve the processing efficiency of massive heterogeneous urban data.
[0102] like Figure 9 As shown, in one embodiment, after obtaining the city operation thematic data in step S302, the specific steps include the following:
[0103] S902, Obtain basic GIS data.
[0104] Among them, GIS basic data can include spatial geographic data such as surveying and mapping maps, satellite imagery, place names and addresses, and administrative divisions.
[0105] Specifically, server 110 can obtain basic GIS data of the corresponding city based on the GIS geographic information system.
[0106] S904, perform data cleaning on the urban operation thematic data, and perform spatial geographic framework matching between the cleaned urban operation thematic data and the GIS basic data, so as to convert the urban operation thematic data into a spatiotemporal data format; the GIS basic data includes at least one of surveying and mapping maps, satellite imagery, place names and addresses, and administrative divisions.
[0107] Data cleaning refers to the final procedure for discovering and correcting identifiable errors in data files, including checking data consistency and handling invalid and missing values.
[0108] For details, please refer to Figure 10 The diagram illustrates the structured processing of urban operation thematic data. All urban operation thematic data, after being structured in a spatiotemporal format, can be converted into spatiotemporal data tuples. Since the same city uses the same standard spatial geographic framework, all urban operation data are standard datasets of the same size. Combined with GIS basic data, the spatiotemporal datasets of each urban operation element can be visualized dynamically on the GIS platform through GIS layers, showcasing the spatiotemporal distribution of data from various business areas of urban operation.
[0109] In this embodiment, by acquiring and matching basic GIS data, not only can the structured processing of urban operation thematic data be realized, but the processed spatiotemporal dataset can also be stored and displayed in GIS layer style, providing users with a visualized view of urban operation.
[0110] In one embodiment, the feature association analysis algorithm includes at least one of the following: Euclidean distance algorithm, Pearson correlation coefficient algorithm, Hamming distance algorithm, DTW distance algorithm, KL divergence algorithm, Apriori algorithm, and FP-Growth algorithm.
[0111] Euclidean distance is the most common distance metric, measuring the absolute distance between points in a multidimensional space. In scenarios such as calculating similarity (e.g., face recognition), Euclidean distance is a relatively intuitive and common similarity algorithm. The smaller the Euclidean distance, the greater the similarity; the larger the Euclidean distance, the smaller the similarity.
[0112] The Pearson correlation coefficient, also known as the Pearson product-moment correlation coefficient, is used to measure the correlation (linear correlation) between two variables X and Y, and its value ranges between -1 and 1.
[0113] Hamming distance is used in data transmission error control coding. Hamming distance is a concept that represents the number of different bits between two words (of the same length). We use d(x,y) to represent the Hamming distance between two words x and y.
[0114] Among them, the DTW distance algorithm is a method for measuring the similarity between two time series of different lengths.
[0115] Among them, the KL divergence algorithm is a method for calculating distance from the perspective of information theory and entropy.
[0116] Among them, the Apriori algorithm is a frequent itemset mining algorithm for association rules. Its core idea is to mine frequent itemsets through two stages: candidate set generation and downward closure detection of plots.
[0117] The FP-Growth algorithm refers to a computational strategy that compresses a database that provides frequent itemsets into a frequent pattern tree (FP-tree) while still retaining the itemset association information.
[0118] Specifically, in other embodiments, the element association analysis algorithm can also be a machine learning method, such as a deep learning method.
[0119] In this embodiment, by providing multiple types of element association analysis algorithms, the selection of specific algorithms depends on the implementation effect in specific applications, thereby further improving the processing efficiency of massive heterogeneous urban data.
[0120] It should be understood that, although Figure 3-9 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed, and they can be performed in other orders. Furthermore, Figure 3-9 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0121] To facilitate a deeper understanding of the embodiments of this application by those skilled in the art, the following will be combined with Figure 11 Provide a specific example. Figure 11 This is a schematic diagram illustrating the changes in the urban operation knowledge graph displayed by the user instruction in this application embodiment. The diagram is presented in a knowledge graph change style from a product perspective. As can be seen from the diagram, in a practical situation, the user needs to analyze the environmental protection situation of a scenic spot. Clicking to select the environmental protection topic displays three related elements: air quality, water quality, and soil. Further clicking to select air quality expands to display elements with first-level correlation to this element: wind force, temperature, highway traffic flow, electricity consumption of chemical enterprises, and tourist flow in the scenic spot. Through the first-level correlation knowledge graph, it can be seen that among all the related elements of the current element "air quality", "electricity consumption of chemical enterprises" is the most strongly correlated "cause" element. Clicking to select this element expands all the related elements of this element: distribution of chemical enterprises, production capacity of chemical enterprises, and environmental impact assessment rectification records. Among them, the connecting line between "environmental impact assessment rectification records" and "electricity consumption of chemical enterprises" is the thickest, which is the core influencing factor in this layer of influencing elements.
[0122] It should be noted that the size of each node representing an element is proportional to the number of its primary related elements. The larger the node, the more factors influence that element. In urban operation decisions, the adjustment of this element is more complex and is affected by multiple factors. The width of the connecting line is proportional to the correlation coefficient. The wider the connecting line, the greater the correlation coefficient between the two connected elements. The direction of the arrow determines the "causal" relationship between elements based on the temporal correlation. Clicking on the main "cause" related element expands its related elements.
[0123] In this embodiment, by expanding the knowledge graph of urban operation at multiple levels, the core influencing factors corresponding to different levels of elements in the urban operation topics that users are interested in can be displayed intuitively, which can further meet users' needs for visualized monitoring of urban operation.
[0124] like Figure 12As shown, in one embodiment, a city operation knowledge graph construction device 1200 is provided. This device 1200 can be installed in a smart city service system to execute the aforementioned city operation knowledge graph construction method. The city operation knowledge graph construction device 1200 specifically includes: a data acquisition module 1202, a format conversion module 1204, an association analysis module 1206, and a graph construction module 1208, wherein:
[0125] Data acquisition module 1202 is used to acquire thematic data on urban operations;
[0126] The format conversion module 1204 is used to convert the city operation thematic data into a spatiotemporal data format, and to collect the elements of the format-converted spatiotemporal data to obtain a thematic element spatiotemporal dataset.
[0127] The correlation analysis module 1206 is used to calculate the correlation coefficient between at least two thematic element spatiotemporal datasets using a preset element correlation analysis algorithm; the correlation coefficient is used to determine the related elements in the city operation data.
[0128] The graph construction module 1208 is used to construct a city operation knowledge graph based on the association information of the associated elements; the city operation knowledge graph is used to send to the terminal for the terminal to display the graph.
[0129] In one embodiment, the format conversion module 1204 is further configured to convert the city operation thematic data according to the spatiotemporal data format to obtain a spatiotemporal data tuple set; classify the elements according to the part-of-speech of the entities in the spatiotemporal data tuple set to obtain a thematic element spatiotemporal dataset; the thematic element spatiotemporal dataset is used to store it in the form of a GIS layer so that the terminal can perform dynamic GIS display.
[0130] In one embodiment, the city operation knowledge graph construction device 1200 further includes an associated element determination module, which is used to determine a preset element association threshold; if the association coefficient is greater than or equal to the element association threshold, then the thematic elements corresponding to the at least two thematic element spatiotemporal datasets are determined to be associated elements.
[0131] In one embodiment, the graph construction module 1208 is further configured to: determine the graph node size based on the number of element associations of the associated elements; the graph node size is proportional to the number of element associations; determine the graph node connection line width based on the association coefficient of the associated elements; the graph node connection line width is proportional to the association coefficient; determine the graph node connection line arrow direction based on the causal relationship of the associated elements; and construct the city operation knowledge graph based on the graph node size, the graph node connection line width, and the graph node connection line arrow direction.
[0132] In one embodiment, the map construction module 1208 is further configured to determine the first element and the second element among the associated elements; calculate the correlation coefficient between the first element and the second element at the current time within a preset time period to obtain the temporal change trend of the correlation coefficient; and determine the direction of the arrow of the map node connection line based on the temporal change trend of the correlation coefficient.
[0133] In one embodiment, the graph construction module 1208 is further configured to: if the temporal change trend of the correlation coefficient is an increasing trend, determine that the first element is the causal element and the second element is the effect element among the correlation elements; if the temporal change trend of the correlation coefficient is a decreasing trend, determine that the first element is the effect element and the second element is the causal element among the correlation elements; and determine the direction from the causal element to the effect element among the correlation elements as the arrow direction of the graph node connection line.
[0134] In one embodiment, the urban operation knowledge graph construction device 1200 further includes a data cleaning module for acquiring GIS basic data; cleaning the urban operation thematic data; and performing spatial geographic framework matching between the cleaned urban operation thematic data and the GIS basic data, so as to convert the urban operation thematic data according to the spatiotemporal data format; the GIS basic data includes at least one of surveying and mapping maps, satellite imagery, place names and addresses, and administrative divisions.
[0135] In one embodiment, the feature association analysis algorithm includes at least one of the following: Euclidean distance algorithm, Pearson correlation coefficient algorithm, Hamming distance algorithm, DTW distance algorithm, KL divergence algorithm, Apriori algorithm, and FP-Growth algorithm.
[0136] In this embodiment, urban operation thematic data is acquired and converted according to a spatiotemporal data format to obtain a thematic element spatiotemporal dataset. Then, a preset element association analysis algorithm is used to calculate the association coefficients between thematic elements, thereby identifying related elements. This allows for the construction of an urban operation knowledge graph using the association information of these elements. This approach not only improves the processing efficiency of massive heterogeneous urban data and provides effective technical improvements for uncovering potential patterns in urban operations, but also provides data support for smart city-related application services, while simultaneously meeting users' needs for visualized monitoring of urban operations.
[0137] In one embodiment, the urban operation knowledge graph construction apparatus provided in this application can be implemented as a computer program, which can be implemented in the form of, for example... Figure 2It runs on the computer device shown. The computer device's memory can store the various program modules that make up the knowledge graph construction device that enables the city's operation, for example, Figure 12 The data acquisition module 1202, format conversion module 1204, association analysis module 1206, and graph construction module 1208 are shown. The computer program, comprised of these modules, causes the processor to execute the steps in the city operation knowledge graph construction methods of the various embodiments of this application described in this specification.
[0138] For example, Figure 2 The computer equipment shown can be used as follows Figure 12 The data acquisition module 1202 in the city operation knowledge graph construction device shown executes step S302. The computer device can execute step S304 through the format conversion module 1204, step S306 through the association analysis module 1206, and step S308 through the graph construction module 1208.
[0139] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the above-described city operation knowledge graph construction method. The steps of the city operation knowledge graph construction method here can be the steps in the city operation knowledge graph construction methods of the various embodiments described above.
[0140] In one embodiment, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of the above-described city operation knowledge graph construction method. The steps of the city operation knowledge graph construction method here can be the steps in the city operation knowledge graph construction methods of the various embodiments described above.
[0141] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0142] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for constructing an urban operation knowledge graph, characterized in that, The method comprises the following steps: obtaining city operation thematic data; converting the city operation thematic data into a format of space-time data, and collecting elements of the space-time data after format conversion to obtain a thematic element space-time data set; calculating a correlation coefficient between at least two thematic element space-time data sets by using a preset element correlation analysis algorithm; the correlation coefficient is used to determine a correlation element in the city operation thematic data; determining a first element and a second element in the correlation element; calculating a correlation coefficient between the first element and the second element at a current time within a preset time period to obtain a correlation coefficient time sequence change trend; if the correlation coefficient time sequence change trend is an increasing change trend, it is determined that the first element is a cause element in the correlation element and the second element is a result element; if the correlation coefficient time sequence change trend is a decreasing change trend, it is determined that the first element is a result element in the correlation element and the second element is a cause element; determining a direction in which the cause element points to the result element in the correlation element as a graph node connection line arrow direction; constructing a city operation knowledge graph according to the graph node connection line arrow direction; the city operation knowledge graph is used to be sent to a terminal for graph display.
2. The method of claim 1, wherein, The conversion of the city operation thematic data into a format of space-time data, and the collection of elements of the space-time data after format conversion to obtain a thematic element space-time data set comprises: converting the city operation thematic data into a format of space-time data to obtain a space-time data tuple set; performing element collection classification according to entity word forms in the space-time data tuple set to obtain a thematic element space-time data set; the thematic element space-time data set is used to be stored in a GIS layer form so as to be dynamically displayed by the terminal.
3. The method of claim 1, wherein, After the calculation of the correlation coefficient between at least two thematic element space-time data sets by using the preset element correlation analysis algorithm, the method further comprises: determining a preset element correlation threshold; if the correlation coefficient is greater than or equal to the element correlation threshold, it is determined that thematic elements corresponding to the at least two thematic element space-time data sets are correlation elements.
4. The method of claim 1, wherein, The method further comprises: determining a graph node size according to an element correlation quantity of the correlation element; the graph node size is directly proportional to the element correlation quantity; and determining a graph node connection line width according to the correlation coefficient of the correlation element; the graph node connection line width is directly proportional to the correlation coefficient; and The construction of the city operation knowledge graph according to the graph node connection line arrow direction comprises: constructing the city operation knowledge graph according to the graph node size, the graph node connection line width, and the graph node connection line arrow direction.
5. The method of claim 1, wherein, After the obtaining of the city operation thematic data, the method further comprises: obtaining GIS basic data; The city operation special data is cleaned, and the cleaned city operation special data is matched with the GIS basic data in a spatial geographic framework, so as to convert the city operation special data into a format of spatio-temporal data; the GIS basic data includes at least one of surveying and mapping maps, satellite images, place names and addresses, and administrative divisions.
6. The method of claim 1, wherein, The element correlation analysis algorithm includes at least one of a Euclidean distance algorithm, a Pearson correlation coefficient algorithm, a Hamming distance algorithm, a DTW distance algorithm, a KL divergence algorithm, an Apriori algorithm, and an FP-Growth algorithm.
7. An urban operation knowledge graph construction apparatus, characterized by comprising: The device includes: a data acquisition module configured to acquire city operation special data; a format conversion module configured to convert the city operation special data into a format of spatio-temporal data, and to collect elements of the converted spatio-temporal data to obtain a special element spatio-temporal data set; a correlation analysis module configured to calculate a correlation coefficient between at least two special element spatio-temporal data sets by using a preset element correlation analysis algorithm; the correlation coefficient is used to determine a correlation element in the city operation special data; a graph construction module configured to determine a first element and a second element in the correlation element; to calculate a correlation coefficient between the first element and the second element at a current time within a preset time period, to obtain a correlation coefficient time series trend; if the correlation coefficient time series trend is an increasing trend, the first element is determined as a cause element in the correlation element, and the second element is determined as a result element; if the correlation coefficient time series trend is a decreasing trend, the first element is determined as the result element in the correlation element, and the second element is determined as the cause element; a direction from the cause element to the result element in the correlation element is determined as an arrow direction of a graph node connection line; and a city operation knowledge graph is constructed according to the arrow direction of the graph node connection line; the city operation knowledge graph is sent to a terminal for graph display. 8.The urban operation knowledge graph construction apparatus of claim 7, wherein, The format conversion module is further configured to convert the city operation special data into a format of spatio-temporal data to obtain a spatio-temporal data tuple set; to collect and classify elements according to entity word forms in the spatio-temporal data tuple set to obtain a special element spatio-temporal data set; and to store the special element spatio-temporal data set in a GIS layer form for GIS dynamic display by the terminal. 9.The urban operation knowledge graph construction apparatus of claim 7, wherein, The device further includes a correlation element determination module configured to determine a preset element correlation threshold; if the correlation coefficient is greater than or equal to the element correlation threshold, a special element corresponding to the at least two special element spatio-temporal data sets is determined as a correlation element. 10.The urban operation knowledge graph construction apparatus of claim 7, wherein, The graph construction module is further configured to determine a graph node size according to a number of element associations of the associated elements, wherein the graph node size is proportional to the number of element associations; determine a graph node connection line width according to a number of associations of the associated elements, wherein the graph node connection line width is proportional to the number of associations; and construct the urban operation knowledge graph according to the graph node size, the graph node connection line width, and a graph node connection line arrow direction. 11.The urban operation knowledge graph construction apparatus of claim 7, wherein, The device further comprises a data cleaning module configured to acquire GIS basic data; clean the urban operation thematic data, and match the cleaned urban operation thematic data with the GIS basic data in a spatial geographic framework, so as to convert the urban operation thematic data into a format of space-time data; and the GIS basic data comprises at least one of surveying and mapping maps, satellite images, place names and addresses, and administrative divisions. 12.The urban operation knowledge graph construction apparatus of claim 7, wherein, The element association analysis algorithm comprises at least one of a Euclidean distance algorithm, a Pearson correlation coefficient algorithm, a Hamming distance algorithm, a DTW distance algorithm, a KL divergence algorithm, an Apriori algorithm, and an FP-Growth algorithm.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The computer program, when executed by the processor, implements the method of any one of claims 1 to 6.
14. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the method of any one of claims 1 to 6.
15. A computer program product comprising computer instructions, characterized in that, The computer program, when executed by the processor, implements the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Event graph construction method based on social media
CN108763333A