Method and device for predicting next event to occur
A method and a device for predicting an event to occur in a device are provided. The method includes identifying a plurality of events that occurred in the device; generating a plurality of sequence graphs based on a time-series order of the plurality of events; generating a sequence group graph by combining the plurality of sequence graphs based on relationships between nodes and edges in the plurality of sequence graphs; obtaining a computation graph by sampling the generated sequence group graph based on time-series order information of the plurality of events; and predicting the event to occur in the device using a graph neural network (GNN) based on the obtained computation graph.
1 . A method of predicting an event to occur, performed by a device, the method comprising:
identifying a plurality of events that occurred in the device, wherein the plurality of events include first events corresponding to a first sequence and second events corresponding to a second sequence;
generating a first sequence graph based on a time-series order of the first events and generating a second sequence graph based on a time-series order of the second events;
generating a sequence group graph by updating the first sequence graph based on the second sequence graph, based on relationships between nodes and edges in the first sequence graph and the second sequence graph, wherein generating the sequence group graph comprises registering, as a value corresponding to each node in the sequence group graph, an indicator value regarding an n-th next node that is subsequent to a preceding node by n hierarchies, and n is an integer greater than or equal to 2;
obtaining a computation graph corresponding to a reference node indicating a current event, by sampling the generated sequence group graph based on time-series order information of the plurality of events, wherein obtaining the computation graph comprises:
determining the reference node indicating the current event;
rearranging the sequence group graph based on the reference node; and
removing nodes that do not include the indicator value regarding the reference node as the indicator value regarding the n-th next node, from among nodes that are prior to the reference node by n hierarchies; and
predicting the event to occur in the device using a graph neural network (GNN) based on the obtained computation graph.
2 . The method of claim 1 , wherein generating the first sequence graph comprises:
generating first nodes corresponding to each of the first events;
registering a value of each of the first events as a value corresponding to each of the first nodes;
connecting the first nodes by first edges based on an order of occurrence of the first events; and
registering values indicating the time-series order of the first events as values corresponding to the first edges.
3 . The method of claim 1 , wherein the updating the first sequence graph based on the second sequence graph comprises:
registering, in response to a second node that matches an existing first node, a value registered in the second node, as a value corresponding to the matching first node,
generating, in response to the second node that matches a non-existing first node, the second node as an additional first node,
registering, in response to a second edge that matches an existing first edge, a value registered in the second edge, as a value corresponding to the matching first edge, and
generating, in response to the second edge that matches a non-existing first edge, the second edge as an additional first edge.
4 . The method of claim 1 , wherein the sequence group graph comprises an indicator value regarding an m-th next node as a value corresponding to one of the nodes,
wherein the obtaining the computation graph by sampling the sequence group graph based on the time-series order information of the plurality of events comprises:
rearranging the sequence group graph based on the reference node; and
removing nodes that do not include, as the indicator value regarding the m-th next node, an indicator value regarding at least one of nodes that are prior to the reference node by (n-m) hierarchies, from among the nodes that are prior to the reference node by n hierarchies, and
wherein m is an integer greater than or equal to 2 and less than n.
5 . The method of claim 1 , wherein the obtaining the computation graph comprises:
performing preliminary sampling on the generated sequence group graph based on the time-series order information of the plurality of events; and
performing random sampling on the sequence group graph on which the preliminary sampling is performed.
6 . The method of claim 1 , wherein the obtaining the computation graph comprises obtaining a first computation graph and a second computation graph that is different from the first computation graph, and
wherein the predicting the event to occur in the device comprises:
predicting a first next event to occur in the device from the first computation graph by using the GNN;
predicting a second next event to occur in the device from the second computation graph by using the GNN; and
combining the predicted first next event with the predicted second next event, and generating a prediction result with respect to the event to occur in the device.
7 . A device for predicting an event to occur, the device comprising:
a memory storing a program including one or more instructions; and
at least one processor configured to execute the one or more instructions stored in the memory to:
identify a plurality of events that occurred in the device, wherein the plurality of events include first events corresponding to a first sequence and second events corresponding to a second sequence;
generate a first sequence graph based on a time-series order of the first events and generating a second sequence graph based on a time-series order of the second events;
generate a sequence group graph by updating the first sequence graph based on the second sequence graph, based on relationships between nodes and edges in the first sequence graph and the second sequence graph;
obtain a computation graph corresponding to a reference node indicating a current event, by sampling the generated sequence group graph based on time-series order information of the plurality of events; and
predict the event to occur in the device using a graph neural network (GNN) based on the obtained computation graph,
wherein the at least one processor configured to execute the one or more instructions stored in the memory to generate the sequence group graph by registering, as a value corresponding to each node in the sequence group graph, an indicator value regarding an n-th next node that is subsequent to a preceding node by n hierarchies, and n is an integer greater than or equal to 2
wherein the at least one processor configured to execute the one or more instructions stored in the memory to obtain the computation graph by:
determining the reference node indicating the current event;
rearranging the sequence group graph based on the reference node; and
removing nodes that do not include the indicator value regarding the reference node as the indicator value regarding the n-th next node, from among nodes that are prior to the reference node by n hierarchies.
8 . The device of claim 7 , wherein the at least one processor is further configured to execute the one or more instructions to:
generate first nodes corresponding to each of the first events;
register a value of each of the first events as a value corresponding to each of the first nodes;
connect the first nodes by first edges based on an order of occurrence of the first events; and
register values indicating the time-series order of the first events as values corresponding to the first edges.
9 . The device of claim 7 , wherein the at least one processor is further configured to execute the one or more instructions to:
perform preliminary sampling on the generated sequence group graph based on the time-series order information of the plurality of events; and
perform random sampling on the sequence group graph on which the preliminary sampling is performed.
10 . The device of claim 7 , wherein the at least one processor is further configured to execute the one or more instructions to:
obtain a first computation graph and a second computation graph that is different from the first computation graph;
predict a first next event to occur in the device from the first computation graph by using the GNN;
predict a second next event to occur in the device from the second computation graph by using the GNN; and
combine the predicted first next event with the predicted second next event, and generate a prediction result with respect to the event to occur in the device.
11 . A non-transitory computer-readable medium having recorded thereon a program that, when executed by a processor, performs a method comprising:
identifying a plurality of events that occurred in a device, wherein the plurality of events include first events corresponding to a first sequence and second events corresponding to a second sequence;
generating a first sequence graph based on a time-series order of the first events and generating a second sequence graph based on a time-series order of the second events;
generating a sequence group graph by updating the first sequence graph based on the second sequence graph, based on relationships between nodes and edges in the first sequence graph and the second sequence graph, wherein generating the sequence group graph comprises registering, as a value corresponding to each node in the sequence group graph, an indicator value regarding an n-th next node that is subsequent to a preceding node by n hierarchies, and n is an integer greater than or equal to 2;
obtaining a computation graph corresponding to a reference node indicating a current event, by sampling the generated sequence group graph based on time-series order information of the plurality of events, wherein obtaining the computation graph comprises:
determining the reference node indicating the current event;
rearranging the sequence group graph based on the reference node; and
removing nodes that do not include the indicator value regarding the reference node as the indicator value regarding the n-th next node, from among nodes that are prior to the reference node by n hierarchies; and
predicting the event to occur in the device using a graph neural network (GNN) based on the obtained computation graph.