A subway flow prediction method and system based on multi-granularity time series knowledge graph

By constructing a multi-grained timing knowledge graph and combining tensor decomposition embedding and LSTM, the problems of low prediction accuracy of subway flow and weak generalization capabilities in the prior art are solved, and higher prediction accuracy and reliability are achieved.

CN118313510BActive Publication Date: 2025-04-18NANJING UNIV OF POSTS & TELECOMM
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410439351.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2025-04-18
Estimated Expiration
2044-04-12

AI Technical Summary

Technical Problem

When the existing subway traffic prediction method deals with complex multi-grained time characteristics and the spatiotemporal correlation of subway networks, the prediction accuracy is limited and the model generalization ability is weak.

Method used

The prediction method based on multi-grained time sequence knowledge graph is adopted to build a multi-grained time sequence knowledge graph, combining tensor decomposition embedding and long short-term memory network (LSTM) to improve the generalization ability and prediction accuracy of the prediction model.

Benefits of technology

It significantly improves the accuracy and reliability of subway traffic prediction, and can better capture the complex spatio-temporal relationships and multi-grained time characteristics within the subway system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118313510B_ABST
    Figure CN118313510B_ABST
Patent Text Reader

Abstract

The present invention discloses a subway flow prediction method and system based on a multi-granularity time series knowledge graph, and relates to the technical field of subway flow prediction based on a multi-granularity time series knowledge graph, including constructing a multi-granularity time series knowledge graph of urban subway flow; a multi-granularity time series knowledge graph embedding framework based on tensor decomposition; and subway flow prediction that integrates multi-granularity time series knowledge graph embedding and LSTM. The method of the present invention uses a subway flow time series knowledge graph to mine dynamic passenger flow patterns of distant stations using POI data around subway stations, subway station inflow and outflow information, and subway line network topology information, thereby improving the dynamic correlation between distant stations and improving the prediction results of subway passenger flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of subway flow prediction, and in particular to a subway flow prediction method and system based on a multi-granularity time series knowledge graph. Background Art

[0002] With the acceleration of urbanization, subways are an important part of urban public transportation. The accurate prediction of passenger flow is of great significance for optimizing subway operation management, improving passenger travel experience, and planning future transportation network development. In recent years, with the rapid development of artificial intelligence and deep learning technologies, the research on subway flow prediction using various types of data has gradually increased. Among these studies, time series knowledge graphs, as an emerging data processing model, have attracted attention because they can comprehensively consider the multi-scale characteristics and complex spatiotemporal relationships of time series data. Traditional subway flow prediction methods mostly rely on time series analysis, machine learning and other technologies. Although they have achieved results to a certain extent, they still have problems such as limited prediction accuracy and weak model generalization ability. Especially when dealing with large-scale, high-dimensional and nonlinear subway flow data, these methods often find it difficult to capture the complex spatiotemporal dependencies between data, resulting in limited accuracy and reliability of prediction results.

[0003] The shortcomings of existing subway traffic prediction technologies are mainly manifested in two aspects: First, most studies on time series knowledge graphs are based on public datasets with only one time granularity, and there are no different time granularities to constrain the relationships between entities in the time series knowledge graph. For example, the time information in the subway system has multiple time units, such as year, month, day, hour, minute, etc. When describing the outflow flow of a station, the minimum time unit is minute, and when describing the situation of the station's adjacent stations, the minimum time unit is hour. Existing methods often ignore the impact of this multi-granularity time characteristic on prediction accuracy. Second, existing methods are insufficient in dealing with the complex spatiotemporal correlations between lines and stations in the subway network. The subway system is a highly complex network, and the passenger flows between different lines and stations affect each other. Simple linear models or traditional machine learning methods are difficult to accurately capture the impact of this complex network structure on traffic prediction.

[0004] In response to the above shortcomings, our invention proposes a subway flow prediction method based on a multi-granularity time series knowledge graph. By constructing a multi-granularity time series knowledge graph of urban subway flow, it can not only more comprehensively represent the multi-dimensional characteristics of spatiotemporal data, but also effectively capture the complex spatiotemporal relationships within the subway system. Furthermore, the multi-granularity time series knowledge graph embedding framework based on tensor decomposition can not only deeply mine the potential characteristics of subway flow data and improve the generalization ability of the prediction model, but also solve the problem that the existing methods ignore the impact of multi-granularity time features on the prediction results. At the same time, by integrating multi-granularity time series knowledge graph embedding with long short-term memory network (LSTM), it can effectively handle the long-term dependency of time series data, thereby significantly improving the accuracy and reliability of subway flow prediction. Our invention has made beneficial explorations and innovations in response to the shortcomings of the existing technology, and provided a new technical solution for improving the accuracy and efficiency of urban subway flow prediction. Summary of the invention

[0005] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0006] In view of the above problems or problems existing in the prior art, the present invention is proposed.

[0007] Therefore, the technical problem solved by the present invention is that due to the complexity of the subway system, the time constraint granularity of its relations is also different.

[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: a subway flow prediction method based on a multi-granularity time series knowledge graph, which includes constructing a multi-granularity time series knowledge graph of urban subway flow;

[0009] Multi-granularity temporal knowledge graph embedding framework based on tensor decomposition;

[0010] Subway traffic prediction by integrating multi-granularity temporal knowledge graph embedding and LSTM.

[0011] As a preferred solution of the subway flow prediction method based on the multi-granularity time series knowledge graph of the present invention, wherein: the multi-granularity time series knowledge graph for constructing the urban subway flow includes:

[0012] Based on the POI data around the subway station, the subway station flow information and the subway line network topology information, the fact quadruple is obtained to build a subway flow time series knowledge graph;

[0013] Based on the traffic information of the subway system, the fact quadruple is constructed with the inflow and outflow of subway stations as entities and the number of people as relations;

[0014] Based on the subway network topology information, the fact quadruple is constructed with subway stations, line information, and whether there is a transfer as entities, and the connection status between stations, the relationship between stations and lines, and the station type as relationships.

[0015] As a preferred solution of the subway flow prediction method based on multi-granularity time series knowledge graph described in the present invention, wherein: the embedding of multi-granularity time series knowledge graph based on tensor decomposition includes: using the tensor decomposition method to realize the embedding of urban subway flow time series knowledge graph, extending the embedding model based on tensor decomposition to the static knowledge graph, and forming a new model T-SimplE; T-SimplE expresses the similarity function of fact quadruple as:

[0016]

[0017] Among them, h ei ,t ej Represent the head entity and tail entity vectors, v r represents the relationship vector, ω τ represents the timestamp vector; the embedding of each entity e in the new model T-SimplE has two vectors Each relation r has two vectors And for each timestamp τ there is a single vector

[0018] As a preferred solution of the subway flow prediction method based on multi-granularity time series knowledge graph described in the present invention, wherein: the time granularity representation includes randomly selecting two knowledge quadruplets of different granularities from the subway flow time series knowledge graph; through the corresponding learnable parameter vector W a ,W b ,W c ,W s ,W e ,W l The time representation is performed, and the quadruple representation is obtained by concatenating the time representation and the triple representation; the asynchronous embedding method is combined with the spectrum analysis method to form an improved time representation method; the improved time representation method is:

[0019]

[0020] in, W l k , is a learnable parameter vector with representation for the kth time unit; θ k Represents the value of the kth time unit of a time; Indicates that the time in the kth time unit is represented by a combination of sine waves; each time unit of time is represented separately according to the above formula; by fusing the embedding vectors of each time, the following time representation is obtained:

[0021]

[0022] Among them, x represents the number of time values ​​of different time units of a time; in order to realize the representation of the time period, the representation vector of each time unit is fused through the above formula to obtain the representation of the time period, and the formula is as follows:

[0023]

[0024] Among them, N k represents the value of the quantity of time corresponding to the kth time unit; θ k,n Represents the nth value of the kth time unit.

[0025] As a preferred solution of the subway flow prediction method based on multi-granularity time series knowledge graph described in the present invention, wherein: the multi-granularity time series knowledge graph embedding representation includes decomposing the relation tensor embedding R into a static relation tensor R s and the dynamic time relation tensor embedding; where the dynamic time relation tensor embedding can be expressed as the dynamic relation tensor embedding R t The Hadamard product with the time tensor embedding T, that is, R t e T; let the time tensor be embedded Let T be t b The product of t and the current timestamp t; then the relation tensor embedding R of the temporal knowledge graph can be calculated as follows:

[0026] R=R s +R t e T

[0027] Among them, R represents the relation embedding tensor embedding, R s represents the static relation tensor embedding, R t and T denote dynamic relation tensor embedding and temporal tensor embedding, respectively.

[0028] As a preferred solution of the subway flow prediction method based on multi-granularity time series knowledge graph described in the present invention, wherein: the fusion of multi-granularity time series knowledge graph embedding and LSTM includes inputting the relationship R obtained by tensor decomposition embedding into LSTM; Predict the passenger flow data P for the next time period t+1 .

[0029] As a preferred solution of the subway flow prediction method based on multi-granularity time series knowledge graph described in the present invention, it also includes a learning step, and the learning step includes dividing the facts in the knowledge graph into a training set, a verification set and a test set.

[0030] Another object of the present invention is to provide a system for subway flow prediction based on a multi-granularity time series knowledge graph, which can solve the problem that the granularity of time constraints of its relationships is not the same due to the complexity of the subway system by constructing a multi-granularity time series knowledge graph of urban subway flow; a multi-granularity time series knowledge graph embedding framework based on tensor decomposition; and a subway flow prediction system that integrates multi-granularity time series knowledge graph embedding and LSTM.

[0031] As a preferred solution of the system for subway flow prediction based on multi-granularity time series knowledge graph described in the present invention, it includes: a construction module, an embedding module, and a prediction module;

[0032] The construction module is used to construct a multi-granularity time series knowledge graph of urban subway traffic;

[0033] The embedding module is used for embedding a multi-granularity temporal knowledge graph framework based on tensor decomposition;

[0034] The prediction module is used to integrate multi-granularity time series knowledge graph embedding and LSTM to predict subway traffic.

[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of a subway flow prediction method based on a multi-granularity time series knowledge graph as described in any one of claims 1 to 7 when executing the computer program.

[0036] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the subway flow prediction method based on a multi-granularity time series knowledge graph described in any one of claims 1 to 7 are implemented.

[0037] Beneficial effects of the present invention: The present invention uses this method to input the representation vector obtained by embedding the multi-granularity time series knowledge graph into the long short-term memory network (LSTM), which significantly improves the prediction accuracy compared with directly inputting the original sequence data into the LSTM. The present invention includes three key parts. First, a multi-granularity time series knowledge graph of urban subway traffic is constructed. By using the time series knowledge graph of subway traffic, the dynamic passenger flow pattern of distant stations is mined by using the POI data around the subway station, the inflow and outflow information of the subway station, and the topology information of the subway line network, and the dynamic correlation between distant subway stations is improved, thereby improving the prediction results of urban subway passenger flow. Second, a multi-granularity time series knowledge graph embedding framework based on tensor decomposition first effectively extracts the dynamic information of the fact quadruple in the knowledge graph over time by adopting a fourth-order tensor embedding model, and controls the time dimension by introducing a hyperparameter, because some entities are time-sensitive, while some entities are not time-sensitive. The ratio of time-sensitive features to time-insensitive features, so there is no need to set the time-sensitive features to be embedded in each entity and relationship, so the amount of calculation will be reduced. Experimental results show that the introduction of hyperparameters can significantly improve the performance when the number of embedded features is large. Secondly, due to the complexity of the relationship, the time granularity of the constraints on the relationship is different. Therefore, we propose a multi-granular time representation method, which separates different time units of time and then accumulates the representation of each unit to achieve multi-granular time representation. This method changes the problem that previous studies only focus on a data set of one time granularity, which affects the accuracy of the prediction results. Third, the multi-granular time series knowledge graph is integrated with the LSTM model. The relationship tensor embedding R is decomposed into the superposition of the static relationship tensor Rs and the dynamic time relationship tensor embedding to obtain the representation vector R, which is then input into the LSTM model to obtain the traffic prediction result, thereby realizing the integration of the multi-granular time series knowledge graph and LSTM. Compared with traditional mathematical statistics methods and prediction models, this method can greatly improve the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0039] Figure 1 It is a schematic diagram of the overall framework of subway flow prediction based on multi-granularity time series knowledge graph embedding of the present invention;

[0040] Figure 2A schematic diagram of a multi-granularity time-series knowledge graph constructed based on urban subway traffic provided by the present invention;

[0041] Figure 3 A schematic diagram of the LSTM model for realizing subway flow prediction by integrating a multi-granularity time series knowledge graph based on tensor decomposition embedding provided by the present invention;

[0042] Figure 4 This is a graph representing the traffic prediction accuracy obtained by inputting the representation vector data of the traffic R into the LSTM.

[0043] Figure 5 The figure represents the traffic prediction accuracy obtained by inputting the original time series data of traffic R into LSTM.

[0044] Figure 6 This is a flow chart of the subway flow prediction system based on multi-granularity time series knowledge graph. DETAILED DESCRIPTION

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0046] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0047] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0048] Example 1

[0049] Reference Figures 1 to 3 , which is an embodiment of the present invention, provides a subway flow prediction method based on a multi-granularity time series knowledge graph, including:

[0050] S1: Obtain urban subway traffic data and build a multi-granularity time series knowledge graph of urban subway traffic.

[0051] Furthermore, the multi-granularity time series knowledge graph includes subway stations as head entities, inflow passenger flow and outflow passenger flow as tail entities, and the corresponding relationships are inflow and outflow, respectively. In addition, the time information in the quadruple includes year, month, day, hour, and minute. The story quadruple is defined as:

[0052] (h,r,t,τ)

[0053] Among them, h∈E, t∈E, r∈R, τ∈T, E represents the entity set, R represents the relationship set, and T represents the relationship set.

[0054] It should be noted that the temporal knowledge graph (Temporal KG), such as Figure 2 As shown in the figure, it is the extension of the static knowledge graph in the time dimension, which is also defined as a directed graph with timestamps G = (E, R, T), where E is a finite set of entities, R is a finite set of relations, and T is a finite set of timestamps;

[0055] Each temporal fact in the temporal knowledge graph is represented by a quadruple (h, r, t, τ), where Represents head entities, relations, tail entities, and timestamps.

[0056] Furthermore, the multi-granularity time series knowledge graph for constructing urban subway traffic includes the topological relationship of the subway network, that is, the connection relationship between subway stations, the subway lines to which the subway stations belong, and the transfer information of the subway stations. The traffic value corresponding to the subway station in each time period. The number of POIs (including: hotels, communities, hospitals, schools, airports, etc.). In addition, time information is added to the relationship between each pair of entities.

[0057] For example: 2022-4-11-15 and 2022-4-11-6 to 2022-4-11-24 represent the times from 15:00 on April 11, 2022, and from 6:00 on April 11, 2022 to 24:00 on April 11, 2022, respectively.

[0058] Based on the POI data around the subway station, the subway station flow information and the subway line network topology information, we obtain the fact quadruple and build the subway flow time series knowledge graph. Specifically, based on the location information of the subway station, we obtain the POI data around the subway station, and build the fact quadruple with the subway station and POI as entities and the number of POIs around the subway station as a relationship. For example: (station,1,18,residential area,2022-04-11-06to2022-04-11-24). Based on the flow information of the subway system, we build the fact quadruple with the inflow and outflow of the subway station as entities and the number of people as a relationship. For example: (station1,689,outflow,2022-04-11-15). Based on the subway network topology information, we build the fact quadruple with the subway station, line information, and whether to transfer as entities, and the connection status between stations, the relationship between stations and lines, and station types as relationships. For example: (station1,connection,station2,2022-04-11-06to 2022-04-11-24).

[0059] There is multi-granularity time information in the subway passenger flow time series knowledge graph. The time in the subway flow time series knowledge graph is divided into two categories. The first category is the time point. We need to represent the time of each time unit separately, and then add the representation of each time unit to get the representation of the time point. The second category is the time period. When representing the minimum time unit, the time representation of the corresponding time period is accumulated, and then other time units are represented. Finally, the representation of each time unit is accumulated to get the representation of the time period.

[0060] It should be noted that by constructing a temporal knowledge graph, temporal features, spatial features, and external features can be effectively organized and represented so that knowledge quadruples can be effectively utilized in related tasks.

[0061] S2: Multi-granularity temporal knowledge graph embedding framework based on tensor decomposition.

[0062] The embodiments mentioned in the present invention include a method for abstracting the knowledge graph into a four-dimensional tensor space. In this way, even if two facts are the same in three basic dimensions (head entity, relationship and tail entity), they can be distinguished by adding a time dimension. The computer executing these instructions can distinguish and identify different facts by adding a time dimension.

[0063] The multi-granularity time series knowledge graph embedding framework based on tensor decomposition includes: using the tensor decomposition method to embed the urban subway flow time series knowledge graph, extending the embedding model based on tensor decomposition to the static knowledge graph, and the embedding of each entity e in the new model T-SimplE has two vectors Each relation r also has two vectors And for each timestamp τ there is a single vector The similarity function of T-SimplE for fact quadruple is defined as:

[0064]

[0065] Among them, h ei ,t ej Represent the head entity and tail entity vectors, v r represents the relationship vector, ω τ Represents a timestamp vector. For T-Simple, considering that not all facts in the temporal knowledge graph are time-sensitive, we distinguish between the capture methods of static features and dynamic features. For time-sensitive features, we use the similarity function:

[0066]

[0067] Among them, h ei ,t ej Represent the head entity and tail entity vectors, v r represents the relationship vector, ω τ Represents a timestamp vector. For time-insensitive features, we use a similarity function:

[0068]

[0069] Among them, h ei ,t ej Represent the head entity and tail entity vectors, v r , v r-1 Represents the relationship vector. To capture different features, a hyperparameter α is introduced to control the ratio of time-sensitive features to time-insensitive features in the time dimension. The similarity function is:

[0070]

[0071] Among them, h ei ,t ej Represent the head entity and tail entity vectors, v r represents the relationship vector, ω τ represents the timestamp vector, α∈[1,d] and Since the features of the time dimension can be shared by parameters of other dimensions, after adding the hyperparameter α, there is no need to set time-sensitive feature embeddings for each entity and relationship, thus reducing the amount of computation. This improvement is significant if the number of embedded features is large.

[0072] Secondly, the fact quadruple q = (h, r, t, τ) is decomposed into fact triples (h, r, t) and time τ, and then the time representation is concatenated with the representations of entities and relations in the triples to obtain the representation of the fact quadruple. For the representation of time, the framework first represents each time unit in a time separately, and then accumulates the representation of each time unit to achieve the representation of a time. According to the tensor decomposition embedding method, the fact quadruple in the embedding space can be represented as a point in the tensor, and the coordinates of the point in each dimension correspond to the index of the corresponding element in the quadruple.

[0073] For multi-granularity time representation. It should be noted that since the spectrum analysis method is convenient for modeling time-structured data, it usually uses a combination of sine waves to represent time data. Therefore, we combine the tensor embedding method with the spectrum analysis method to design a new time representation method:

[0074]

[0075] To represent time, we represent each time unit of that time according to the above formula. Among them, W l k , is a learnable parameter vector with the representation for the kth time unit. k Represents the value of the kth time unit of a time. Indicates that the time in the kth time unit is represented by a combination of sine waves. By fusing the embedding vectors of a single time unit, we can get the following time representation:

[0076]

[0077] Among them, x represents the number of time values ​​of different time units. In order to achieve the representation of time periods, we fuse the representation vector of each time unit through the above formula to obtain the representation of time periods. The formula is as follows:

[0078]

[0079] Among them, N k The quantity representing the time corresponds to the value of the kth time unit. k,n Represents the nth value of the kth time unit. The above formula can realize complex time representation, which solves the problem that previous studies on time series knowledge graphs are based on only one time granularity and there are no different time granularities to constrain the relationship between entities in the time series knowledge graph, thus affecting the prediction accuracy.

[0080] Finally, the T-SimplE method is used to learn the representation of fact quadruplets.

[0081] It should be noted that the above formula can realize complex time representation, which solves the problem that previous studies on temporal knowledge graphs are based on only one time granularity and there are no different time granularities to constrain the relationship problem of entities in the temporal knowledge graph.

[0082] S3: Subway traffic prediction by integrating multi-granularity temporal knowledge graph embedding and LSTM.

[0083] Furthermore, the multi-granularity temporal knowledge graph embedding representation includes decomposing the relation tensor embedding R into a static relation tensor R s and the dynamic time relation tensor embedding; where the dynamic time relation tensor embedding can be expressed as the dynamic relation tensor embedding R t The Hadamard product with the time tensor embedding T, that is, R t e T; let the time tensor be embedded Let T be t b The product of t and the current timestamp t; then the relation tensor embedding R of the temporal knowledge graph can be calculated as follows:

[0084] R=R s +R t e T

[0085] Among them, R represents the relation embedding tensor embedding, R s represents the static relation tensor embedding, R t and T denote dynamic relation tensor embedding and temporal tensor embedding, respectively.

[0086] It should be noted that the above embedding representation method can solve the problem that the temporal attributes of the relationship change over time, that is, the relationship and entity of the same object entity may be different at different times.

[0087] The relationship R obtained by tensor decomposition embedding is input into LSTM. Predict the passenger flow data P for the next time period t+1 .

[0088] It should be noted that compared with directly inputting the original sequence data into LSTM, this method can better mine the correlation between distant sites. Experiments show that our method can significantly improve the prediction accuracy.

[0089] S4: Learning step, the facts in the knowledge graph are divided into training set, validation set and test set. The model parameters are learned by mini-batch stochastic gradient descent. For each fact f = (h, r, t, τ), we generate two queries: 1-(h, r, t, τ) and 2-(h, r, t, τ). For the first quadruple, we generate a candidate answer set C f,h, which contains h and n (hereafter referred to as negative ratio) other entities randomly selected from E. For the second quadruple, we generate a similar candidate answer set C f,t . Cross entropy is adopted as the loss function to minimize, which is commonly chosen for static and temporal knowledge graph completion.

[0090] The second aspect of the present invention is disclosed,

[0091] A subway flow prediction method based on multi-granularity time series knowledge graph embedding is provided, including:

[0092] Construct a time-series knowledge graph of urban subway traffic to describe the topological relationship of the subway network, the traffic at subway stations, and the number of POIs around subway stations;

[0093] A multi-time granularity knowledge graph embedding framework is proposed for the representation of time points and time periods.

[0094] A knowledge graph embedding model based on tensor decomposition is introduced and extended to a fourth-order tensor model to obtain the embedded relation tensor.

[0095] The multi-granularity time series knowledge graph is integrated with LSTM, and the embedded vector is input into LSTM to obtain the traffic prediction result.

[0096] Example 2

[0097] Reference Figure 4 and Figure 5 , which is the second embodiment of the present invention, provides a subway flow prediction method based on a knowledge graph of tensor decomposition. In order to verify its beneficial effects, comparison results of multiple schemes are provided.

[0098] The subway operates from 6:00 to 23:30, with 169 subway stations and 8 subway lines. Based on the coordinate information of the subway stations in the Amap API, we obtained POI information that affects subway passenger flow within 2 kilometers around the subway stations, such as hospitals, schools, airports, long-distance bus stations, ports, residential areas, industrial areas, government agencies, and bus stations. In addition, the traffic network information is used to obtain which line the station belongs to, the neighbors of the station, and the transfer information of the station. Our dataset contains 184,448 fact quaternions, 1,937 relations, and 217 entities.

[0099] In this example, we set d = 64, f = 36, which is the dimension of 100 in our embedding space. This paper uses the gradient descent method with a minimum batch for training. The batch size is 128, and the gradient descent optimization method is ADAM. We set the learning rate to 0.001. In addition, the prediction and clustering of this example are based on the experimental data of subway exit / flow.

[0100] In this example, we use the relational representation obtained by the knowledge graph embedding method to perform traffic prediction. In other words, we use In the representation of quaternion q = (h, r, t, τ) In addition, two evaluation indicators, mean absolute error (MAE) and root mean square error (RMSE), are used to compare the performance of the models.

[0101] The prediction accuracy based on knowledge graph embedding is better than the original time series data directly input into the predictor. The prediction accuracy based on temporal knowledge graph embedding is better than the static embedding method. The prediction ability of temporal knowledge graph embedding based on multiple time granularities is better than that of temporal knowledge graph. Therefore, an effective knowledge graph embedding method has a positive effect on downstream applications.

[0102] Example 3

[0103] Reference Figure 6 , which is the third embodiment of the present invention, provides a system for a subway flow prediction method based on a multi-granularity time series knowledge graph, including a construction module, an embedding module, and a prediction module;

[0104] The construction module is used to construct a multi-granularity time series knowledge graph of urban subway traffic;

[0105] The embedding module is used for embedding a multi-granularity temporal knowledge graph framework based on tensor decomposition;

[0106] The prediction module is used to integrate multi-granularity time series knowledge graph embedding and LSTM to predict subway traffic.

[0107] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0108] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0109] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0110] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

[0111] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A subway traffic prediction method based on a multi-granularity time series knowledge graph, characterized by: include, Obtain urban subway traffic data and build a multi-granularity time-series knowledge graph of urban subway traffic; Multi-granularity temporal knowledge graph embedding framework based on tensor decomposition; Subway traffic prediction by integrating multi-granularity time series knowledge graph embedding and LSTM; The multi-granularity time series knowledge graph for constructing urban subway traffic includes: Based on the POI data around the subway station, the subway station flow information and the subway line network topology information, the fact quadruple is obtained to build a subway flow time series knowledge graph; Based on the traffic information of the subway system, the fact quadruple is constructed with the inflow and outflow of subway stations as entities and the number of people as relations; Based on the subway network topology information, the fact quadruple is constructed with subway stations, line information, and whether to transfer as entities, and the connection status between stations, the relationship between stations and lines, and station types as relationships; The embedding of multi-granularity time series knowledge graph based on tensor decomposition includes: using tensor decomposition method to embed the urban subway flow time series knowledge graph, extending the embedding model based on tensor decomposition to the static knowledge graph, and forming a new model T-SimplE; the similarity function of T-SimplE for fact quadruplets is expressed as: Among them, h ei, t ej Represent the head entity and tail entity vectors, v r represents the relationship vector, ω τ represents the timestamp vector; the embedding of each entity e in the new model T-SimplE has two vectors Each relation r has two vectors And for each timestamp τ there is a single vector The multi-granularity temporal knowledge graph includes a multi-time granularity representation method. The multi-time granularity representation method includes randomly selecting two knowledge quadruplets of different granularities from the subway flow time series knowledge graph; a ,W b ,W c ,W s ,W e ,W l The time representation is performed, and the quadruple representation is obtained by concatenating the time representation and the triple representation; the asynchronous embedding method is combined with the spectrum analysis method to form an improved time representation method; the improved time representation method is: in, is a learnable parameter vector with the representation for the kth time unit; θ k Represents the value of the kth time unit of a time; Indicates that the time in the kth time unit is represented by a combination of sine waves; each time unit of time is represented separately according to the above formula; by fusing the embedding vectors of each time, the following time representation is obtained: Among them, x represents the number of time values ​​of different time units of a time; in order to realize the representation of the time period, the representation vector of each time unit is fused through the above formula to obtain the representation of the time period, and the formula is as follows: Among them, N k represents the value of the quantity of time corresponding to the kth time unit; θ k,n Represents the nth value of the kth time unit.

2. The subway flow prediction method based on multi-granularity time series knowledge graph according to claim 1 is characterized by: The multi-granularity temporal knowledge graph embedding representation includes decomposing the relation tensor embedding R into a static relation tensor R s and the dynamic time relation tensor embedding; where the dynamic time relation tensor embedding can be expressed as the dynamic relation tensor embedding R t The Hadamard product with the time tensor embedding T, that is, R t e T; let the time tensor be embedded Let T be t b The product of t and the current timestamp t; then the relation tensor embedding R of the temporal knowledge graph can be calculated as follows: R=R s +R t e T Among them, R represents the relation embedding tensor embedding, R s represents the static relation tensor embedding, R t and T denote dynamic relation tensor embedding and temporal tensor embedding, respectively.

3. The subway flow prediction method based on multi-granularity time series knowledge graph according to claim 2 is characterized by: The fusion of multi-granularity time series knowledge graph embedding and LSTM includes inputting the relationship R obtained by tensor decomposition embedding into LSTM; inputting the historical passenger flow data Predict the passenger flow data P for the next time period t+1 .

4. The subway flow prediction method based on multi-granularity time series knowledge graph as claimed in claim 3 is characterized by: It also includes a learning step, which includes dividing the facts in the knowledge graph into a training set, a verification set and a test set.

5. A system using the subway flow prediction method based on a multi-granularity time series knowledge graph as described in any one of claims 1 to 4, characterized in that: Includes building module, embedding module, and prediction module; The construction module is used to construct a multi-granularity time-series knowledge graph of urban subway traffic; The embedding module is used for embedding a multi-granularity temporal knowledge graph framework based on tensor decomposition; The prediction module is used to integrate multi-granularity time series knowledge graph embedding and LSTM to predict subway traffic.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the subway flow prediction method based on a multi-granularity time series knowledge graph described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the subway flow prediction method based on a multi-granularity time series knowledge graph described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Knowledge graph embedding method, system and equipment based on tensor decomposition

    CN111680162A

  • Knowledge dynamic evolution method based on multi-time granularity and application

    CN114117064A

  • Time sequence knowledge graph representation model construction method and time sequence knowledge graph completion method

    CN115203430A