Method and apparatus for event prediction based on timing chart rules
By integrating machine learning models and logical conditions into the time series graph through iterative training, a set of time series event prediction rules is generated, which solves the problems of limited expressive power and time interval constraints in existing technologies and achieves stronger event prediction capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INST OF COMPUTING SCI
- Filing Date
- 2022-09-02
- Publication Date
- 2026-07-14
Smart Images

Figure CN116029408B_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of time sequence graph association rules, and in particular to a method and apparatus for event prediction based on time sequence graph rules. Background Technology
[0002] A series of temporal association rules have been developed to represent temporal relationships in relational data. However, research on association rules for graph data is relatively limited, mainly falling into three categories. Graph Association Rules (GARs) are defined on static graphs and are primarily used to specify the correlations and patterns between entities in static graphs; they are not suitable for temporal graph processing. Graph Temporal Association Rules (GTARs) specify the relationships between events through two event patterns that share the same focal node and the same constant time interval, thus enabling event association analysis in temporal graphs. Similarly, Graph Evolution Rules (GERs) are defined using two connected sub-patterns, which are decomposed from a single graph pattern, thus representing local changes in a temporal graph. Therefore, graph evolution rules can be used to describe changes in node labels in a temporal graph.
[0003] Existing association rules for time series graphs have the following drawbacks: First, the association rules proposed by previous researchers cannot effectively integrate the results of machine learning algorithms for event prediction in time series graphs, which hinders the improvement of the accuracy of association rules for event prediction. Second, the association rules proposed by previous researchers for event prediction have too many restrictions and limited expressive power. For example, GAR can only be used for static graph data, GTAR requires setting the common focus of patterns, and GER can only express constant and consistent time intervals. Summary of the Invention
[0004] In view of the aforementioned problems, this application is proposed to provide a method and apparatus for event prediction based on time sequence graph rules that overcomes or at least partially solves the aforementioned problems, comprising:
[0005] A method for event prediction based on time series graph rules includes:
[0006] Obtain time series graph data, and add the event prediction results of the machine learning model to the time series graph data to obtain extended time series graph data;
[0007] Based on the validation ratio, extract subgraphs from the extended time series data to validate the confidence of the prediction rules;
[0008] The rule creator is trained based on the extended data of the time series graph and the subgraph to obtain a set of time series event prediction rules;
[0009] A set of predicted events is obtained based on the set of time-series event prediction rules and the time-series graph data.
[0010] Furthermore, the step of iteratively training the rule creator based on the extended data of the time series graph and the subgraph to obtain a set of time series event prediction rules includes:
[0011] The rule creator is pre-trained based on the extended time series data;
[0012] The rule creator is iteratively trained based on the extended time series data and the pre-training data.
[0013] Furthermore, the step of pre-training the rule creator based on the extended time series data includes:
[0014] The rule creator generates several candidate time-series event prediction rules based on local graph structure data extracted from the extended time-series graph data at preset positions.
[0015] The rule creator generates a graph pattern of the candidate time-series event prediction rules based on the time-series graph model and generates labels to obtain the candidate time-series event prediction rules in the graph pattern.
[0016] The rule creator uses a hierarchical expansion process to construct logical dependencies and form a set of candidate time-series event prediction rules for the graph pattern.
[0017] The rule critic adds the candidate time-series event prediction rules with support and confidence scores higher than a preset threshold from the candidate time-series event prediction rule set to a new set based on the subgraph, generating a time-series event prediction rule set.
[0018] Furthermore, the step of iteratively training the rule creator based on the extended time-series data and the pre-training data includes:
[0019] The rule creator generates several candidate time-series event prediction rules based on local graph structure data extracted from the extended time-series graph data at preset positions.
[0020] The rule creator generates a graph pattern of the candidate time-series event prediction rules based on the time-series graph model and generates labels to obtain the candidate time-series event prediction rules in the graph pattern.
[0021] The rule creator uses a hierarchical expansion process to construct logical dependencies and form a set of candidate time-series event prediction rules for the graph pattern.
[0022] The rule critic adds the candidate time series event prediction rules with support and confidence scores higher than a preset threshold from the candidate time series event prediction rule set to a new set based on the subgraph, generating a time series event prediction rule set.
[0023] The rule creator improves the time series graph model by iteratively training it based on the set of time series event prediction rules.
[0024] Furthermore, the time-series graph extended data and the local graph data used in the iterative training are both result data from the previous training.
[0025] Furthermore, the step of obtaining the predicted event set based on the time-series event prediction rule set and the time-series graph data includes:
[0026] The timing graph data is divided into several graph blocks based on the number of processors.
[0027] Assign a different processor to each graph block and designate one processor as the coordinating node;
[0028] The serial algorithm is invoked in parallel on all the processors to obtain all events predicted by the timing event prediction rules from the timing graph data set.
[0029] Furthermore, the step of dividing the timing graph data into several graph blocks based on the number of processors includes:
[0030] A set of segmentation points for the time interval is obtained based on the candidate time interval, the set of time sequence diagram sizes at each time point, the maximum timestamp, and the minimum timestamp;
[0031] The segmentation points are determined using dynamic programming based on the set of segmentation points and the number of processors, using a two-dimensional array;
[0032] The time series data is divided into time series segments according to the stated segmentation points.
[0033] An apparatus for event prediction based on time sequence graph rules, wherein the apparatus implements the steps of the event prediction method based on time sequence graph rules described above, comprising:
[0034] The acquisition module is used to acquire time series graph data and add event prediction results from a machine learning model to the time series graph data to obtain extended time series graph data.
[0035] The subgraph generation module is used to extract subgraphs from the extended time series data to verify the reliability of prediction rules based on the verification ratio.
[0036] The training module is used to train the rule creator based on the extended data of the time series graph and the subgraph to obtain a set of time series event prediction rules.
[0037] The event prediction module is used to obtain a set of predicted events based on the set of time-series event prediction rules and the time-series graph data.
[0038] An electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the event prediction method based on timing graph rules as described above.
[0039] A computer-readable storage medium on which a computer program is stored, wherein when executed by a processor, the computer program implements the steps of the event prediction method based on timing graph rules as described above.
[0040] This application has the following advantages:
[0041] This invention provides a method for event prediction based on time-series graph rules, comprising: acquiring time-series graph data and adding event prediction results from a machine learning model to the time-series graph data to obtain extended time-series graph data; extracting subgraphs from the extended time-series graph data to verify the reliability of prediction rules according to a validation ratio; training a rule creator based on the extended time-series graph data and the subgraphs to obtain a set of time-series event prediction rules; and obtaining a set of predicted events based on the set of time-series event prediction rules and the time-series graph data. This method unifies rule-based and machine learning-based event prediction methods by embedding the machine learning model for event prediction as a predicate into a rule-based association system. This allows the association rule TACO to not only utilize existing machine learning model event prediction results but also refine the prediction results of the machine learning model using logical conditions. Compared to previous graph association rules proposed for event prediction, TACO has stronger expressive power, does not require constant interval time constraints, and does not require common focus constraints on graph patterns. Attached Figure Description
[0042] To more clearly illustrate the technical solution of this application, the drawings used in the description of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a flowchart of the steps of an event prediction method based on time sequence graph rules provided in an embodiment of this application;
[0044] Figure 2This is a schematic diagram of the module structure of an event prediction device based on timing graph rules provided in an embodiment of this application;
[0045] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0046] To make the objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0047] It should be noted that, in any embodiment of the present invention, a temporal event prediction rule (TACO) is used. Defined as: ΔQ[x](X→(p0, τ)), where ΔQ[x] is the Δ graph pattern, X is the conjunction of the predicates of ΔQ[x], p0 is the predicate of ΔQ[x], and τ is a time window. When p0 = l(x, y), the edge represented by p0 is predicted by the rule, but may not necessarily be in ΔQ[x]. We call ΔQ[x], X, p0, and X→(p0, τ) respectively... The graph pattern, preconditions, events, and logical dependencies.
[0048] Definition of a Δ graph pattern: A Δ graph pattern is ΔQ[x] = (V Q E Q L Q T Q ,μ), where, V Q It is a set of graph pattern nodes, E Q It is the set of edges in the graph pattern; L Q For each graph pattern, node u∈V Q Assign a label, L Q Also for each graph pattern, edge e∈E Q Assign a label; T Q Assign a time window τ to each edge of the graph pattern. Specifically, for a given edge e... x τ is assigned to [0, 0] to represent the current time; x is a list of distinct variables; μ is a variable from x to V. Q The bijection, that is, it gives V Q Each node is assigned a different variable.
[0049] Definition of predicate: The predicate p of the Δ graph pattern ΔQ[x] has one of the following forms:
[0050] xA|l(x,y)|M(x,y,l,t)|xA⊕yB|xA⊕c|e1.t⊕e2.t|et⊕c, where x,
[0051] e1, e2, and e are In the graph pattern edge, xA represents the attribute A of the pattern node x, c is a constant, l(x, y) is an edge from x to y with label l, et is the timestamp of edge e, and ⊕ is one of =, ! =, <, ≤, >, ≥. If et ≥ t1 and et ≤ t2, then we denote it as et ∈ [t1, t2]. In this application, e1.t ⊕ e2.t and et ⊕ c are called temporal predicates.
[0052] Reference Figure 1 This illustrates an embodiment of an event prediction method based on time sequence graph rules provided in this application;
[0053] The method includes:
[0054] S110. Obtain time series graph data, and add the event prediction results of the machine learning model to the time series graph data to obtain extended time series graph data;
[0055] S120. Extract subgraphs from the extended time series data to verify the confidence of the prediction rules based on the verification ratio.
[0056] S130. The rule creator is trained based on the extended data of the time series graph and the subgraph to obtain a set of time series event prediction rules.
[0057] S140. Obtain the predicted event set based on the time series event prediction rule set and the time series graph data.
[0058] In this embodiment, a method for event prediction based on time-series graph rules is provided, comprising: acquiring time-series graph data and adding event prediction results from a machine learning model to the time-series graph data to obtain extended time-series graph data; extracting subgraphs from the extended time-series graph data for verifying the reliability of prediction rules according to a verification ratio; training a rule creator based on the extended time-series graph data and the subgraphs to obtain a set of time-series event prediction rules; and obtaining a set of predicted events based on the set of time-series event prediction rules and the time-series graph data. This method unifies rule-based and machine learning-based event prediction methods by embedding the machine learning model for event prediction as a predicate into a rule-based association system. This allows the association rule TACO to not only utilize existing machine learning model event prediction results but also refine the prediction results of the machine learning model using logical conditions. Compared to previous graph association rules proposed for event prediction, TACO has stronger expressive power, does not require constant interval time constraints, and does not require common focus constraints on graph patterns.
[0059] The method for event prediction based on timing graph rules in this exemplary embodiment will be further described below.
[0060] As described in step S110 above, time series graph data is obtained, and the event prediction results of the machine learning model are added to the time series graph data to obtain extended time series graph data.
[0061] In one embodiment of the present invention, the specific process of "acquiring time series graph data and adding the event prediction results of the machine learning model to the time series graph data to obtain extended time series graph data" in step S110 can be further described in conjunction with the following description.
[0062] It's important to note that after the time series graph data is input, this step prepares the graph data by calling the function MLExp, expanding the time series graph G into extended time series graph data GM. GM facilitates the discovery of time series event prediction rules with machine learning predicates, i.e., adding the edges predicted by the input machine learning model M. This step allows rule creators to incorporate the machine learning model M as a machine learning predicate into rule generation, accelerating the discovery of the time series event prediction rule TACO. Because the discovery process does not require repeated calls to the machine learning model M, this step only needs to use a pre-trained model and is highly efficient.
[0063] As described in step S120 above, a subgraph for verifying the confidence of the prediction rule is extracted from the extended time series graph data according to the verification ratio.
[0064] In one embodiment of the present invention, the specific process of "extracting a subgraph for verifying the confidence of prediction rules from the extended data of the time series graph according to the verification ratio" in step S120 can be further explained in conjunction with the following description.
[0065] It should be noted that this step uses the function VGraph to expand the data G in the timing diagram M Extract a subgraph G for verifying the rules v M . The function VGraph performs a timing BFS and extracts a subgraph G from G M for rule verification, making G v M = η|G v M |, which is used to effectively evaluate the quality of the candidate timing event prediction rules TACOs. The timing BFS extends the traditional breadth-first search (BFS) to find the shortest timing path, where the timestamps of all edges on the timing path fall within a given time window.
[0066] As described in the above step S130, the rule creator is trained based on the timing diagram expansion data and the subgraph to obtain a set of timing event prediction rules.
[0067] In an embodiment of the present invention, the specific process of "training the rule creator based on the timing diagram expansion data and the subgraph to obtain a set of timing event prediction rules" described in step S130 can be further described in combination with the following description.
[0068] As an example, the following steps are performed when executing this step operation:
[0069] Input: timing graph G, rule discovery requirement d = (α, β, γ, δ), machine learning model M, verification ratio η, sampling scale N, number of iterations I;
[0070] Calculate ε ← 0; Σ d ← 0; G M ← MLExp(G, M);
[0071] Calculate
[0072] Calculate
[0073] Calculate Σ ← GenerateRule(α, δ, Σ d );
[0074] Calculate
[0075] When ε < I;
[0076] Calculate
[0077] Calculate
[0078] Calculate Σ←GenerateRule(α,δ,Σ d );
[0079] calculate
[0080] Calculate Σ d ←Σ d ∪Σ′ d ;ε←ε+1;
[0081] Return Σ d ;
[0082] Output the set of TACOs mined from G Σ d , making Σ d Each rule in the list meets the requirements of d.
[0083] As described in the following steps, the rule creator is pre-trained based on the time series graph extended data.
[0084] It should be noted that the pre-training data is a local graph G sampled by the Localized Sample algorithm. s M This allows rule creators to begin generating rules that may meet the support and confidence thresholds required by the input requirement d. Rule creators generate a set Σ of candidate time-series event prediction rules (TACOs) using the Generate Rule algorithm; subsequently, rule critics validate the graph G. v M The evaluation Σ is performed, and high-quality TACOs are stored in the set Σ using the Select Rule function. d middle.
[0085] The function Localized Sample is obtained from G M \G v M Extract local graph structures and collect a set G containing multiple Δ graph patterns. s M This serves as training data for the rule creators in each iteration. When sampling G... s M ΔQ diagram pattern i At that time, Localized Sample uses a temporal random walk of a randomly selected source node v to sample the temporal path and returns the α-1 most frequently sampled nodes around v. Then ΔQ i It consists of these nodes and the edges connecting them. The input parameter α here is a constraint on the number of nodes in the graph pattern for each TACO. During pre-training, in G^ sM Guided by the Δ graph patterns in the graph, rule creators can learn to generate graph patterns that are more likely to find matches in the graph. This is because each ΔQ i It inherently has a match, because it is through G M \G v M Obtained from random walks, the generative model can learn to generate with ΔQ. i "New" graph patterns that are semantically and structurally similar. Without pre-training, a randomly initialized generative model in the creator may produce meaningless TACOs.
[0086] As described in the following steps, the rule creator is iteratively and interactively trained based on the extended time series data and the pre-training data.
[0087] It should be noted that the function Localized Sample obtains data from G. M \G v M Extract local graph structures and collect a set G containing multiple Δ graph patterns. s M This serves as training data for the rule creators in each iteration. When sampling G... s M ΔQ diagram pattern i At that time, Localized Sample uses a temporal random walk of a randomly selected source node v to sample the temporal path and returns the α-1 most frequently sampled nodes around v. Then ΔQ i It consists of these nodes and the edges connecting them. The input parameter α here is a constraint on the number of nodes in the graph pattern for each TACO.
[0088] The mining algorithm iteratively discovers high-quality TACOs and, through a multi-round iterative interactive training process, moves towards Σ. d Add more high-quality rules. Each iteration is similar to the pre-training phase, except that G is used in subsequent iterations. s M and Σ d They are all used to train and improve creators. Here Σ d TACOs are feedback from critics used to improve creators, and finally Σ d It was returned.
[0089] As described in the following steps, the rule creator generates several candidate time-series event prediction rules based on local graph structure data extracted from the time-series graph extension data at preset positions.
[0090] It should be noted that this step involves sampling the local graph data G using the Localized Sample algorithm.s M The local graph data obtained through sampling by this algorithm can ensure that the support and confidence of the rules generated by the rule creator are within the required threshold, thereby eliminating a large number of invalid rules and increasing work efficiency.
[0091] As described in the following steps, the rule creator generates a graph pattern of the candidate time-series event prediction rules based on the time-series graph model and generates labels to obtain the candidate time-series event prediction rules in the graph pattern.
[0092] It should be noted that the rule creator generates candidate temporal event prediction rules from graph patterns through two steps: structure generation and semantic label generation. These two steps employ a temporal graph GAN model and an LSTM network, respectively. First, the rule creator generates GAN models from graph patterns... s M and Σ d Each ΔQ pattern in the Δ graph i As input, it employs Tag Gen, an end-to-end time series graph deep generation framework, to derive candidate Δ graph patterns ΔQ. g i Because Tag Gen uses a GAN generative model, each generated ΔQ g i and the input ΔQ i They all have the same number of nodes (maximum alpha), and similar topologies and time window constraints. Since Tag Gen does not support tags, no tags are generated in this step. Therefore, tags need to be added to the pattern in the next step.
[0093] The rule creator uses the LSTM language model M L For each candidate Δ-graph pattern ΔQ g i Tag generation. An LSTM network is used to model the rich semantics of tags along paths in the knowledge graph. Specifically, it first trains M on a corpus C driven by disorder. L Each word is composed of edge labels and node labels:<L(e),L(v)> These are called "tag pairs". The corpus C consists of a sequence of tag pairs along a temporal path, and these tag pairs are obtained by assigning each ΔQ to a tag. i This is obtained by applying a temporal random walk. Here, a sequence of label pairs for a temporal path (v0, e1, v1, e2, ..., e...) s v s )yes After training, for ΔQ g i For each pair of nodes u and v, the shortest temporal path ρ, M from u to v LGenerate a sequence of label pairs using a random seed and assign this sequence of labels to ρ. Only the shortest path is considered here because the shortest path between two points generally has a stronger correlation in the graph compared to other longer paths. Finally, the creator uses ΔQ... g i A Δ graph pattern ΔQ′ was established in the middle. i It retains the most frequent labels attached to each node and edge.
[0094] As described in the following steps, the rule creator uses a hierarchical expansion process to construct logical dependencies and form a set of candidate time-series event prediction rules for the graph pattern.
[0095] It should be noted that, given a generated Δ graph pattern ΔQ, the creator uses a hierarchical expansion process to construct a set of effective logical dependencies X→(p0, τ), forming candidate TACOs in the Σ set. More specifically, for each possible event (p0, τ), it starts from... Initially, the precondition X is iteratively expanded for ΔQ. The rule creator also validated the candidate TACOs. Is it valid in G, i.e. Is it true? This algorithm... After generation, its validity is verified directly. The rule creator first checks... Is it redundant, i.e. Is it found in the set Σ of TACOs in previous iterations? d The implication if It is not superfluous, that is If this is not true, the algorithm will continue to verify and... When Included in Σ.
[0096] As described in the following steps, the rule critic adds the candidate time-series event prediction rules with support and confidence scores higher than a preset threshold from the candidate time-series event prediction rule set to a new set based on the subgraph, thereby generating a time-series event prediction rule set.
[0097] It should be noted that for each candidate generated in Σ Rule critics calculate and And select high-quality TACOs with support and trust scores above the threshold. These rules are added to Σ d The data is then provided to the rule creators so that they can improve the generative model in the next iteration.
[0098] As described in the following steps, the rule creator improves the time series graph model by iteratively training it based on the set of time series event prediction rules.
[0099] It should be noted that the extended time-series graph data and the local graph data used in the iterative training are both results from the previous training iteration. Through multiple iterative training iterations, the prediction rules for time-series events are continuously mined and filtered to obtain a more comprehensive machine learning model with stronger expressive power, capable of predicting all common situations.
[0100] As described in step S140 above, a subgraph for verifying the confidence of the prediction rule is extracted from the extended time series graph data according to the verification ratio.
[0101] In one embodiment of the present invention, the specific process of "obtaining the predicted event set based on the time series event prediction rule set and the time series graph data" in step S140 can be further described in conjunction with the following description.
[0102] It should be noted that the temporal sequence graph G can be partitioned based on temporal locality, which is a unique property of temporal pattern matching using TACOs. That is, the timestamps of the edges in each matching h(x) of the Δ graph pattern ΔQ are all within the local time range [t]. * +t min , t * +t max ], where t min Let t represent the smallest timestamp in ΔQ. max This represents the largest timestamp in ΔQ.
[0103] As an example, the following operation is performed when this step is executed:
[0104] Input: number of processors k, a timing graph G with k random blocks, TACOs set Σ, time window τ0;
[0105] Calculate [t0, t k )←RefTime(Σ,τ0); (t min ,t max )←ExtractTS(Σ);
[0106] For t∈[t0, t k Collect t-graphs G t Size | G t |;
[0107] Calculate {t1, ..., t} k-1}←BTPart([t0, t k ), {|G t ||t∈[t0,t k )},k,t min , t max );
[0108] calculate in,
[0109] calculate
[0110] for In each block F i Run SepEP(F) i ,Σ,τ0) to obtain R i ;
[0111] Return to ∪ i∈[1,k] R i ;
[0112] Calculate Function BTPart([t0, t) k ), {|G t ||t∈[t0,t k )},k,t min , t max );
[0113] Calculate for each t∈[t0, t... k )do
[0114]
[0115] Calculate for each i∈[2, t k )do
[0116] foreach t′∈[t0, t k )do
[0117]
[0118] Calculate for each i∈[2, t k Do in descending order
[0119]
[0120] Return {t1, ..., t} k-1};
[0121] Output: The set of edges R predicted by Σ, representing events occurring within τ0.
[0122] As described in the following steps, the timing graph data is divided into several graph blocks based on the number of processors.
[0123] It should be noted that the computation of parallel event prediction is based on the largest of these graph blocks, maxi∈[1,k]|F. i|Decision. Therefore, a good time interval partition needs to be found to minimize maxi∈[1,k]|F i |. To do this, the function BT Part is used as part of the algorithm. The inputs to the function are as follows: the candidate time interval is [t0, t k )(derived from the TACOs Σ and time window τ0 used in event prediction for matching specified edges), the set of sizes of the timing diagrams at each moment is {|G t ||t∈[t0, t k )}, the number of graph chunk processors is k, the maximum timestamp t max in Σ, and the minimum timestamp t min in Σ. Among them, G t refers to the t-graph composed of all edges in G with timestamp t. BT Part calculates a set {t1,..., t k} containing k - - 1 split points for the interval [t0, t k-1 ), such that the chunk F i for i∈[1,k] becomes G[t i-1 + t min , t i + t max )(which includes the edges in G with timestamps in the range [t i-1 + t min , t i + t max ). Here, t min and t max are to ensure the above entire coverage range.
[0124] The function BT Part adopts dynamic programming. It maintains a two-dimensional array S, where S[t][i] records the minimum size of the largest chunk obtained by splitting G[t0 + t min , t + t max ) into i subintervals. Therefore, S[t k [k] is our target value. BT Part first processes the base case i = 1, where S[t][1] = |G[t0 + t min , t + t max )| because there will be only one chunk for a single subinterval. The size here is obtained from the size of the input t-graph. For the case of i > 1, S[t′][i] is determined by checking the values of all possible ranges [t0, t) for t < t′ and their i - 1 subintervals. After calculating S[t k [k], the algorithm determines the corresponding k - 1 partition points and returns them as the result.
[0125] As described in the following steps, a different processor is assigned to each graph block, and one processor is designated as the coordinating node.
[0126] It should be noted that after time-series partitioning, the resulting k graph blocks have k+1 processors. Each graph block can be assigned to a processor. At the same time, a separate processor acts as a coordinating node, which collects the size of the t-graph from all processors and runs the function BT part.
[0127] As described in the following steps, the serial algorithm is invoked in parallel on all the processors to obtain all events predicted by the timing event prediction rule for the timing graph data set.
[0128] It should be noted that, given a time sequence graph G, a set of TACOs Σ, and a time window τ0, a sequential prediction algorithm (denoted as Seq EP) finds all edges (events) R in G predicted by Σ. For each TACO in Σ with τ = [t1, t2]... The serial algorithm finds ΔQ in ΔG through graph isomorphism. Q All matches. For each match h(x), it checks whether h(x)|=X holds true and checks the derived time window [t]. * +t1,t * Is [+t2] a subinterval of τ0, where t □ This refers to the current time. If all the above checks are true, the serial algorithm adds the edges connecting the nodes that match the variables in p0 to the set R.
[0129] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0130] Reference Figure 2 This illustrates an apparatus for event prediction based on timing graph rules, according to an embodiment of this application.
[0131] Specifically, it includes:
[0132] The acquisition module S210 is used to acquire time series graph data and add the event prediction results of the machine learning model to the time series graph data to obtain extended time series graph data;
[0133] The subgraph generation module S220 is used to extract subgraphs from the extended time series data to verify the confidence of prediction rules based on the verification ratio.
[0134] Training module S230 is used to train the rule creator based on the extended data of the time series graph and the subgraph to obtain a set of time series event prediction rules;
[0135] The event prediction module S240 is used to obtain a set of predicted events based on the set of time-series event prediction rules and the time-series graph data.
[0136] In one embodiment of the present invention, the training module S220 includes:
[0137] The pre-training submodule is used to pre-train the rule creator based on the time series graph extended data;
[0138] The iterative training submodule is used to perform iterative interactive training on the rule creator based on the extended data of the time series diagram and the pre-training data.
[0139] In one embodiment of the present invention, the pre-training submodule includes:
[0140] The sampling submodule is used by the rule creator to generate several candidate time-series event prediction rules based on the local graph structure data extracted from the time-series graph extension data at a preset position.
[0141] The graph pattern generation submodule is used by the rule creator to generate graph patterns of the candidate time series event prediction rules based on the time series graph model and generate labels to obtain the candidate time series event prediction rules of the graph pattern.
[0142] The logical dependency submodule is used by the rule creator to construct logical dependencies and form a set of candidate time-series event prediction rules for the graph pattern by applying a hierarchical expansion process.
[0143] The rule criticism submodule is used by the rule critic to add the candidate time-series event prediction rules with support and confidence scores higher than preset thresholds from the candidate time-series event prediction rule set to a new set, based on the subgraph, to generate a time-series event prediction rule set.
[0144] In one embodiment of the present invention, the iterative training submodule includes:
[0145] The sampling submodule is used by the rule creator to generate several candidate time-series event prediction rules based on the local graph structure data extracted from the time-series graph extension data at a preset position.
[0146] The graph pattern generation submodule is used by the rule creator to generate graph patterns of the candidate time series event prediction rules based on the time series graph model and generate labels to obtain the candidate time series event prediction rules of the graph pattern.
[0147] The logical dependency submodule is used by the rule creator to construct logical dependencies and form a set of candidate time-series event prediction rules for the graph pattern by applying a hierarchical expansion process.
[0148] The rule criticism submodule is used by the rule critic to add the candidate time-series event prediction rules with support and confidence scores higher than preset thresholds from the candidate time-series event prediction rule set to a new set, based on the subgraph, to generate a time-series event prediction rule set.
[0149] The feedback submodule is used by the rule creator to iteratively train the time series graph model based on the set of time series event prediction rules.
[0150] Reference Figure 3 The computer device illustrating an event prediction method based on time sequence graph rules according to the present invention may specifically include the following:
[0151] The computer device 12 described above is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0152] Bus 18 refers to one or more of several types of bus 18 architectures, including memory bus 18 or memory controller, peripheral bus 18, graphics acceleration port, processor, or local bus 18 using any of the various bus 18 architectures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus 18, Micro Channel Architecture (MAC) bus 18, Enhanced ISA bus 18, Audio / Video Electronics Standards Association (VESA) local bus 18, and Peripheral Component Interconnect (PCI) bus 18.
[0153] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0154] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as a "hard disk drive"). Figure 3Not shown, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42 configured to perform the functions of the embodiments of the present invention.
[0155] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory. Such program modules 42 include—but are not limited to—an operating system, one or more application programs, other program modules 42, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0156] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, camera, etc.), and with one or more devices that enable medical personnel to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN)), wide area network (WAN), and / or public networks (e.g., the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 3 Not shown, it can be combined with computer device 12 to use other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing unit 16, external disk drive array, RAID system, tape drive and data backup storage system 34, etc.
[0157] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the event prediction method based on time sequence diagram rules provided in the embodiments of the present invention.
[0158] That is, when the processing unit 16 executes the above program, it achieves event prediction based on timing diagram rules.
[0159] In this embodiment of the invention, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the event prediction method based on timing graph rules as provided in all embodiments of this application:
[0160] That is, it enables event prediction based on timing graph rules when the program is executed by the processor.
[0161] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-to-signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPOM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device.
[0162] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0163] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the healthcare worker's computer, partially on the healthcare worker's computer, as a standalone software package, partially on the healthcare worker's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the healthcare worker's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider). The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0164] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0165] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0166] The above provides a detailed description of the method and apparatus for event prediction based on time sequence graph rules provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for event prediction based on time series graph rules, characterized in that, include: Obtain time series graph data, and add the event prediction results of the machine learning model to the time series graph data to obtain extended time series graph data; Based on the validation ratio, extract subgraphs from the extended time series data to validate the confidence of the prediction rules; The rule creator is trained based on the extended time series graph data and the subgraph to obtain a set of time series event prediction rules. Specifically, the rule creator is pre-trained based on the extended time series graph data; the rule creator is iteratively trained based on the extended time series graph data and the pre-trained data; the rule creator generates several candidate time series event prediction rules by extracting local graph structure data at preset positions from the extended time series graph data; the rule creator generates graph patterns of the candidate time series event prediction rules based on the time series graph model and generates labels to obtain candidate time series event prediction rules with graph patterns; the rule creator uses a hierarchical expansion process to construct logical dependencies on the candidate time series event prediction rules with graph patterns and forms a set of candidate time series event prediction rules. The rule critic adds the candidate time series event prediction rules with support and confidence scores higher than a preset threshold from the candidate time series event prediction rule set to a new set based on the subgraph, generating a time series event prediction rule set. A set of predicted events is obtained based on the set of time-series event prediction rules and the time-series graph data. Specifically, the time-series graph data is divided into several graph blocks according to the number of processors. A set of splitting points for the time-series interval is obtained based on the candidate time interval, the set of time-series graph sizes at each time point, the maximum timestamp, and the minimum timestamp. The splitting points are determined by dynamic programming using a two-dimensional array based on the set of splitting points and the number of processors. The time-series graph data is divided into time-series blocks according to the splitting points. A different processor is assigned to each graph block, and a processor is designated as a coordinating node. A serial algorithm is called in parallel on all the processors to obtain all events predicted by the time-series event prediction rules for the time-series graph data group.
2. The method according to claim 1, characterized in that, The step of iteratively training the rule creator based on the extended time series data and the pre-training data includes: The rule creator generates several candidate time-series event prediction rules based on local graph structure data extracted from the extended time-series graph data at preset positions. The rule creator generates a graph pattern of the candidate time-series event prediction rules based on the time-series graph model and generates labels to obtain the candidate time-series event prediction rules in the graph pattern. The rule creator uses a hierarchical expansion process to construct logical dependencies and form a set of candidate time-series event prediction rules for the graph pattern. The rule critic adds the candidate time series event prediction rules with support and confidence scores higher than a preset threshold from the candidate time series event prediction rule set to a new set based on the subgraph, generating a time series event prediction rule set. The rule creator improves the time series graph model by iteratively training it based on the set of time series event prediction rules.
3. The method according to claim 2, characterized in that, The time-series graph extension data and the local graph structure data used in the iterative training are both result data from the previous training.
4. An apparatus for event prediction based on time sequence graph rules, characterized in that, The apparatus for event prediction based on time sequence graph rules implements the steps of the method for event prediction based on time sequence graph rules as described in any one of claims 1 to 3, including: The acquisition module is used to acquire time series graph data and add event prediction results from a machine learning model to the time series graph data to obtain extended time series graph data. The subgraph generation module is used to extract subgraphs from the extended time series data to verify the reliability of prediction rules based on the verification ratio. The training module is used to train the rule creator based on the extended data of the time series graph and the subgraph to obtain a set of time series event prediction rules. The event prediction module is used to obtain a set of predicted events based on the set of time-series event prediction rules and the time-series graph data.
5. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for event prediction based on timing graph rules as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the method for event prediction based on timing graph rules as described in any one of claims 1-3.