Social network repetitive event detection method based on repetitive sub-graph pattern mining
By constructing an auxiliary data structure based on hash function mapping, the problem of detecting repetitive patterns in social networks was solved, achieving efficient and accurate detection of repetitive events.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT UNIV OF DEFENSE TECH
- Filing Date
- 2024-04-19
- Publication Date
- 2026-07-24
AI Technical Summary
Existing methods are unable to effectively mine time-related information of recurring patterns in social networks and cannot accurately detect recurring events.
Two auxiliary data structures are constructed: the first auxiliary data structure is used to detect the frequency of subgraph patterns in real time, and the second auxiliary data structure is used to directly calculate the repetition of patterns. Subgraph patterns are mapped through a hash function to improve detection efficiency and accuracy.
It enables efficient detection of duplicate events in social network flow graphs, reduces memory usage and avoids redundant calculations, thereby improving the accuracy and efficiency of detection.
Smart Images

Figure CN118153673B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data mining technology, and in particular to a method for detecting recurring events in social networks based on recurring subgraph pattern mining. Background Technology
[0002] Recently, there has been a surge in high-throughput, dynamic graph data in many applications, such as social media streams. This dynamic graph data is organized as flow graphs. A flow graph is an infinite series of items, each representing an edge between two nodes. Flow graph analysis is becoming increasingly important in various domains, such as triangle counting, frequent pattern mining, and subgraph matching, where repetition is a common phenomenon in social interactions. The key characteristics of these patterns are: 1) they can start, stop, and restart at any point within a period of time; 2) they only exhibit periodic behavior within specific time intervals. Repetitive patterns exhibit periodic repetition only within a series of specific time intervals, such as weekly retweets on Twitter during summer and winter holidays. Each repetitive pattern is associated with temporal information related to the duration of its periodic occurrence over a period of time. Mining repetitive patterns is crucial for providing valuable information about seasonal or temporal correlations between recurring events, as they often provide useful information about seasonal or temporal correlations and can indicate interesting relationships between individuals involved in the interaction.
[0003] However, existing methods only consider periodic behavior mining over a certain period, and they cannot obtain temporal information about the time periods in which patterns occur periodically, thus limiting their application to finding recurring patterns. Therefore, advanced techniques are needed to effectively discover recurring patterns in flow graphs in order to detect recurring events in social networks in a timely and accurate manner. Summary of the Invention
[0004] Therefore, it is necessary to provide a method for detecting repeated events in social networks based on the mining of repeating subgraph patterns to address the aforementioned technical problems.
[0005] A method for detecting recurring events in social networks based on recurring subgraph pattern mining, the method comprising:
[0006] Obtain the social network snapshot graph with the current timestamp, and use the first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets of the first auxiliary data structure, and update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets; the first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function;
[0007] The frequency of the updated subgraph pattern is obtained. When the frequency is greater than or equal to the support threshold σ, the four-element information corresponding to the subgraph pattern is mapped to the corresponding unit of the second auxiliary data structure using the second hash function, and the four-element information in the corresponding unit is updated. The second auxiliary data structure includes a hash array consisting of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern.
[0008] Based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure, the recurring events in the current social network are obtained.
[0009] A device for detecting recurring events in a social network based on recurring subgraph pattern mining, the device comprising:
[0010] The subgraph pattern frequency calculation module is used to obtain the social network snapshot graph with the current timestamp, and use a first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets of the first auxiliary data structure, and update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets; the first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function;
[0011] The subgraph pattern repetition calculation module is used to obtain the frequency of the updated subgraph pattern. When the frequency is greater than or equal to the support threshold σ, the module uses a second hash function to map the four-element information corresponding to the subgraph pattern to the corresponding unit of the second auxiliary data structure, and updates the four-element information in the corresponding unit. The second auxiliary data structure includes a hash array composed of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern.
[0012] The results output module is used to obtain the recurring events in the current social network based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure.
[0013] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0014] Obtain the social network snapshot graph with the current timestamp, and use the first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets of the first auxiliary data structure, and update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets; the first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function;
[0015] The frequency of the updated subgraph pattern is obtained. When the frequency is greater than or equal to the support threshold σ, the four-element information corresponding to the subgraph pattern is mapped to the corresponding unit of the second auxiliary data structure using the second hash function, and the four-element information in the corresponding unit is updated. The second auxiliary data structure includes a hash array consisting of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern.
[0016] Based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure, the recurring events in the current social network are obtained.
[0017] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0018] Obtain the social network snapshot graph with the current timestamp, and use the first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets of the first auxiliary data structure, and update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets; the first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function;
[0019] The frequency of the updated subgraph pattern is obtained. When the frequency is greater than or equal to the support threshold σ, the four-element information corresponding to the subgraph pattern is mapped to the corresponding unit of the second auxiliary data structure using the second hash function, and the four-element information in the corresponding unit is updated. The second auxiliary data structure includes a hash array consisting of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern.
[0020] Based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure, the recurring events in the current social network are obtained.
[0021] The aforementioned method for detecting recurring events in social networks based on recurring subgraph pattern mining ensures accuracy and efficiency in calculating the frequency and recurrence of each pattern by constructing two auxiliary data structures. The first auxiliary data structure can detect valid patterns and their frequencies in real time, achieving high accuracy and reducing memory usage, while avoiding redundant subgraph matching calculations. The second auxiliary data structure directly calculates pattern recurrence without the need for indirect calculation or storage of intermediate sets. By utilizing these two constructed auxiliary data structures to detect recurring subgraph patterns in the current social network flow graph, recurring events in the current social network flow graph are detected. This embodiment of the invention enables efficient detection of recurring events in social network flow graphs. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of a potential repetitive pattern detection process in one embodiment;
[0023] Figure 2 This is a flowchart illustrating a social network duplicate event detection method based on repeating subgraph pattern mining in one embodiment.
[0024] Figure 3 This is a schematic diagram of the findRP-S framework in one embodiment;
[0025] Figure 4 This is a schematic diagram illustrating the F1 scores and throughput of three methods on three datasets under default parameters in one embodiment. Figure 4 (a) is a diagram of the F1 score. Figure 4 (b) is a throughput diagram;
[0026] Figure 5 This is a schematic diagram of the RR, PR, and KIPS curves for three algorithms in one embodiment, wherein, Figure 5 (a) is a schematic diagram of the RR curves of the three algorithms. Figure 5 (b) is a schematic diagram of the PR curves of the three algorithms. Figure 5 (c) is a schematic diagram of the KIPS curves for the three algorithms;
[0027] Figure 6 This is a structural block diagram of a social network duplicate event detection device based on repeating subgraph pattern mining in one embodiment;
[0028] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0030] This invention proposes a novel model, called (θ,δ)-repetitive pattern, to describe subgraph patterns that occur at least θ times periodically over at least δ periods. Here, θ represents the periodicity of the subgraph pattern within one period, and δ represents the repetitiveness of the pattern. Notably, when δ = 1, the traditional periodic pattern mining problem is a special case of this model.
[0031] Given a flow graph G, a parameter θ, and the θ-periodic time support set of pattern P, denoted as ω θ (P), is a maximal continuous subset of the time support set T(P) that satisfies: (1)ω θ (P)={t i , t i+1 , ..., t j}, where ji≥θ-1, and (2)t k+1 -t k ≤τ(k∈[i,j-1]), where τ is a user-defined time interval threshold. Since very large graphs are typically constructed over very long time spans, it has been observed that users may impose constraints on the minimum number of support sets for period θ.
[0032] The repeatability of pattern P represents the number of its θ-period time support sets. Ω δ θ (P)={ω θ 1 (P), ω θ 2 (P), ..., ω θ n (P)} is the set of support sets for the θ-period time. The repeatability of the pattern θ- is denoted as REC(P) = |Ω δ θ (P)|. If REC(P)≥δ, then P is a (θ,δ)-repetitive pattern, where δ is the user-specified minimum repetition threshold.
[0033] The determination of (θ, δ)-repetitive patterns is illustrated through an example: Figure 1 The diagram shown illustrates the potential repetitive pattern detection process, where... Figure 1 The left image shows schematic diagrams of subgraph patterns P1 and P2. Figure 1 The right figure shows the frequency distribution of P1 and P2 at different timestamps. Figure 1In the left image, patterns P1 and P2 are shown as the 3-edge patterns found at timestamp 1. Figure 1 The right figure shows the frequencies of P1 and P2 at different timestamps, and their θ-periodic time support sets. For P1, let σ = 9, τ = 2, θ = 3, and δ = 2. The time support set T(P1) of P1 is T(P1) = {t1 = 1, t2 = 2, t3 = 3, t4 = 4, t5 = 8, t6 = 9, t7 = 11, t8 = 13}, because the frequency of P1 at these timestamps is greater than or equal to σ. The set {1, 2, 3, 4} is the θ-periodic time support set of P1. Similarly, ω θ 2 (P1) = {8, 9, 11, 13}. Therefore, REC(P1) = |Ω δ θ (P1)|=2=δ, P1 is a (θ,δ)-repetitive pattern. For P2, P2 has only one θ-periodic time support set, i.e., ω θ 1 (P2) = {4, 5, 6, 7, 8, 10}. Therefore, P2 is not a (θ, δ)-repetitive pattern.
[0034] Specifically, given a flow graph G and an integer m, the continuous repetitive pattern discovery problem is to find m-edge subgraph patterns in the graph that satisfy the (θ,δ)-repetitive pattern model.
[0035] Classical pattern mining algorithms fail to discover recurring patterns in flow graphs. Existing gSpan-like pattern mining algorithms follow an exploration-decision paradigm: 1) exploring the candidate pattern space in a tree structure; 2) determining whether each candidate pattern satisfies some frequency-based constraints. This process can be extended to support the discovery of (θ,δ)-recurring patterns: 1) exploring all m-edge subgraphs associated with the inserted edge to calculate the frequency of each pattern at each timestamp and recording the corresponding time support set T(P); 2) checking...<P,T(P)> The algorithm identifies (θ,δ)-repeating patterns by satisfying repeatability constraints. However, finding all m-edge subgraphs for each new edge is too time-consuming, and the large scale and high dynamics of flow graphs make accurate discovery of repeating patterns challenging. To overcome this problem, an edge sampling method (baseline method) is adopted, which randomly samples inserted edges at each time stamp and explores only the m-edge subgraphs associated with the sampled edges. However, this method may lead to serious estimation errors in pattern frequency due to its dependence on sampled edges. In addition, the algorithm needs to perform expensive subgraph matching to estimate the frequency of each pattern at each time stamp, making it time-consuming. Furthermore, maintaining the time support set and θ-cycle time support set for each pattern in the decision phase consumes a lot of memory and is not a straightforward approach, thus being costly.
[0036] This invention provides the first solution to the problem of discovering recurring patterns in flow graphs. It proposes a framework called findRP-S for detecting recurring patterns, comprising two auxiliary data structures. First, findRP-S transforms each subgraph into a sequence and maps it to a corresponding position in the first auxiliary data structure based on a hash function, enabling efficient calculation of its frequency at each timestamp and selection of potential recurring patterns. Then, each frequent pattern and its corresponding timestamp are mapped to a second auxiliary data structure based on a hash function to calculate the recurrence of the pattern. Furthermore, this invention proposes a deduplication strategy to achieve higher accuracy and space utilization. Extensive experiments on real-world datasets demonstrate the superiority of the proposed method.
[0037] In one embodiment, such as Figure 2 As shown, a method for detecting recurring events in social networks based on recurring subgraph pattern mining is provided, including the following steps:
[0038] Step 202: Obtain the social network snapshot graph with the current timestamp, use the first hash function to map the m-edge subgraph related to the newly inserted edge e in the social network snapshot graph to the corresponding bucket in the first auxiliary data structure, and update the frequency of the subgraph pattern and the frequency counter state in the corresponding bucket.
[0039] A social network snapshot graph refers to a snapshot of the social network flow graph G at timestamp t, denoted as G. t G is an induced graph consisting of edges observed from the start time up to timestamp t. In a social network flow graph G, each edge consists of two vertices connected, where each vertex represents a user and the edge represents an event resulting from an interaction between users. t The subgraph g induced by m edges in ’ m =(V g E g This is called an m-edge subgraph. At time t, an insertion edge e is added to G. t In the middle, for G t For each inserted edge e in the diagram, use the symbol S. m (e) represents the inclusion of e in G. t The set of m-edge subgraphs in the graph.
[0040] Subgraph pattern P(V) P E P L) is a graph isomorphic to all members of ψ, ψ is the set of m-edge subgraphs with isomorphic relations, and V P E is the set of nodes in P. P Let L be a directed edge set of size m, and let L(·) be a set of edges of size V. PA function that assigns a label to each node in ψ. Note that P can be obtained by deleting the node IDs (or timestamps) of any m-edge subgraph in ψ. The existence of isomorphisms between subgraphs means that if there exists a bijective function f:V g’m →V g”m , so that: 1) And 2) Then the two subgraphs g' m and g” m They are isomorphic.
[0041] Given G t The newly inserted edge e and edge m in the subgraph pattern P are represented by match(e,P) to indicate whether there exists a subgraph pattern P in S. m (e) For subgraphs isomorphic to P, if so, set match(e,P)←1. G t The sum of match(e,P) for each edge e that satisfies t(e) = t is the frequency fre(P,t) of P at timestamp t.
[0042] The first auxiliary data structure (EFSketch) includes at least one bucket array, each bucket array containing l buckets. Each bucket stores the subgraph pattern, the frequency of the subgraph pattern, and the frequency counter state. Each array corresponds to a first hash function. For example... Figure 3 As shown, EFSketch includes d bucket arrays A1, A2, ..., A d Each contains l buckets. Let A i [j] represents the j-th bucket in the i-th array. At the end of each timestamp, all arrays are cleaned up. The state field of each bucket counter indicates whether the frequency of the pattern generated by the inserted edge e has increased. The state field has two states: On (enabled) and Off (disabled). Each bucket includes a subgraph pattern P (key), a frequency counter fre(P,t), and the state of the frequency counter. Initially, all keys are empty, all state fields are On, and all counters are zero. d hash functions h1(·),...,h d (·) is associated with d bucket arrays, according to the hash function h i (·)(i∈[1,d]) will transfer each m-edge subgraph g m Mapped to array A i One of the fixed buckets.
[0043] Step 204: Obtain the frequency of the updated subgraph pattern. When the frequency is greater than or equal to the support threshold σ, use the second hash function to map the quaternary information corresponding to the subgraph pattern to the corresponding cell of the second auxiliary data structure and update the quaternary information in the corresponding cell.
[0044] Given a flow graph G, an m-edge pattern P, and a support threshold σ, the temporal support set T(P) of P is the sum of all timestamps t. i The set of fre(P,t) i )≥σ. Σ is used to avoid infrequent patterns that do not occur often.
[0045] The second auxiliary data structure (RPSketch) consists of a hash array of u buckets, associated with a second hash function. Each bucket contains λ cells, each storing four-element information about a subgraph pattern. This four-element information includes the subgraph pattern, the current timestamp, the time interval count, and the repetition rate of the subgraph pattern. RPSketch can be viewed as a hash table containing u buckets B[1…u], associated with a hash function h(·). Each bucket has λ cells. Each cell stores a pattern P, the latest timestamp t of P, the time interval count N, and the repetition rate of P. Therefore, each cell actually stores the four-element information of pattern P:<P,t,N,REC(P)> .
[0046] Step 206: Obtain the recurring events in the current social network based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure.
[0047] By analyzing recurring patterns in social networks, we can understand user behavior and trends, and predict future trends. For example, if a topic or activity frequently appears on Twitter during holidays, it may mean that the same trend or topic is likely to reappear during future holidays. For social network platforms, observing user behavior patterns over specific time periods allows for a better understanding of user interests and preferences. This helps social media platforms or other online services provide more personalized content and experiences. Social network platforms can use these patterns to improve their recommendation algorithms and content ranking. By understanding when users are more likely to engage with and share content, they can provide more relevant and engaging content, thereby increasing user engagement and retention rates.
[0048] In the aforementioned method for detecting recurring events in social networks based on recurring subgraph pattern mining, two auxiliary data structures are constructed to ensure accuracy and efficiency in calculating the frequency and recurrence of each pattern. The first auxiliary data structure can detect valid patterns and their frequencies in real time, achieving high accuracy and reducing memory usage, while avoiding redundant subgraph matching calculations. The second auxiliary data structure directly calculates pattern recurrence without the need for indirect calculation or storage of intermediate sets. By utilizing these two constructed auxiliary data structures to detect recurring subgraph patterns in the current social network flow graph, recurring events in the current social network flow graph are detected. This embodiment of the invention enables efficient detection of recurring events in social network flow graphs.
[0049] In one specific embodiment, such as Figure 3 The diagram shown is of the findRP-S framework. Figure 3 In the process, Phase 1 mines the m-edge subgraph associated with each inserted edge e. To avoid storing the subgraph, Phase 2 uses a hash function to map each newly generated m-edge subgraph to a fixed location in the auxiliary data structure EFSketch. This allows for direct calculation of the frequency of a pattern at each timestamp without storing the subgraph and avoiding redundant subgraph isomorphic calculations. Only frequently occurring patterns are forwarded to Phase 3 for (θ, δ)-repetitive pattern detection, using the auxiliary data structure RPSketch to calculate the repetitiveness of the pattern in real time. findRP-S avoids storing a large θ-period time support set for all patterns, is direct and efficient, and can detect (θ, δ)-repetitive patterns. RPSketch is traversed to report (θ, δ)-repetitive patterns based on their repetitiveness. The baseline random sampling method heavily relies on the sampling rate; findRP-S addresses this issue, improving accuracy.
[0050] Phase 1: Enumeration of m-edge subgraphs. Whenever an edge e is inserted, Phase 1 uses findSubgraph to generate an m-edge subgraph corresponding to e. Each time an m-edge subgraph is generated, it is sent to Phase 2.
[0051] Phase 2: Frequency Estimation. Phase 2 uses the auxiliary data structure EFSketch to estimate the frequency of each pattern at each timestamp. Phase 2 uses a support threshold σ to determine whether a pattern is a potentially recurring pattern.
[0052] Phase 3: Estimating Recurrence. Phase 3 uses the auxiliary data structure RPSketch to estimate the recurrence of each pattern. The updateRPSketch function receives data from Phase 2.<P,t> In other words, it sends a pattern P that meets the support threshold σ and the current timestamp t to stage 3.
[0053] In one embodiment, mapping the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets in the first auxiliary data structure using a first hash function, and updating the frequency and frequency counter state of the subgraph patterns in the corresponding buckets, includes: when the newly inserted edge e occurs, obtaining the m-edge subgraphs related to the current newly inserted edge e in the social network snapshot graph; traversing each m-edge subgraph, if the subgraph pattern of the current m-edge subgraph is in the corresponding unit of the second auxiliary data structure, and the current timestamp is the same as the timestamp recorded in the corresponding unit, then traversing the next m-edge subgraph; otherwise, mapping the current m-edge subgraph to the corresponding buckets in the first auxiliary data structure using the first hash function, and updating the frequency and frequency counter state of the subgraph patterns in the corresponding buckets; the buckets include the subgraph patterns corresponding to the current m-edge subgraphs and the frequency and frequency counter state of the subgraph patterns.
[0054] In one embodiment, mapping the current m-edge subgraph to the corresponding bucket in the first auxiliary data structure using a first hash function, and updating the frequency and frequency counter state of the subgraph pattern in the corresponding bucket includes: determining whether the subgraph pattern corresponding to the current m-edge subgraph is in a bucket of the first auxiliary data structure; if so, and the frequency counter state is on, then updating the frequency of the subgraph pattern using the frequency counter and setting the frequency counter state to off; the method further includes: if the subgraph pattern corresponding to the current m-edge subgraph is not in a bucket of the first auxiliary data structure, then determining whether there is an empty bucket in the first auxiliary data structure; if there is an empty bucket in the first auxiliary data structure, then inserting the subgraph pattern into the empty bucket, setting the frequency of the subgraph pattern to 1 using the frequency counter, and setting the frequency counter state to off; if there is no empty bucket in the first auxiliary data structure, then decrementing the frequency of the subgraph pattern stored in each bucket by 1, clearing the buckets whose frequency drops to 0, inserting the subgraph pattern into the empty bucket, setting the frequency of the subgraph pattern to 1 using the frequency counter, and setting the frequency counter state to off.
[0055] In this embodiment, the m-edge subgraph g is... m In the process of mapping to the auxiliary data structure, graph invariants are used to encode it as a string representation of g. m str This invariant maps isomorphic subgraphs to the same locations. Specifically, first, a new label l(v) is created by concatenating the degree and label of each node, and then (l(v)) is used to map the degree and label of each node to the same location. i ),l(v j Mark each edge e = (v i ,v j ,t(e)). Then, a weight is assigned to each edge, which is equal to the order in which the corresponding one-sided patterns appear. The updateEFSketch function receives the m-edge subgraph g generated in phase 1. m First, calculate g. m The pattern P (line 1). If pattern P is in stage 3 and t = B[h(P)][P].t, then updateEFSketch jumps to the next subgraph (lines 2-3).
[0056] Otherwise, updateEFSketch hashes P to d mapping buckets in EFSketch: A1[h1(P)], A2[h2(P)], ..., A d [h d (P)] In. For each bucket, there are three cases:
[0057] Case 1: P is in the bucket, and the counter is on. `updateEFSketch` simply increments the frequency of P by 1. If `fre(P,t)≥σ`, then `updateEFSketch` attempts to...<P,t> Insert into stage 3 and empty the bucket (lines 5-9).
[0058] Case 2: P is not in the bucket, and the bucket is empty. updateEFSketch inserts P into the bucket with a frequency of 1 and sets the state to Off (lines 10-11).
[0059] Case 3: P is not in the bucket, and the bucket is not empty. In this case, updateEFSketch reduces the frequency of the bucket by 1. If the frequency is reduced to 0, updateEFSketch will empty the bucket. updateEFSketch uses a replacement strategy, i.e., Frequent[4], to allow new potentially frequent patterns to enter when the bucket is hashed to full (lines 12-16).
[0060]
[0061]
[0062] In one embodiment, after mapping the quadratic information corresponding to the subgraph pattern to the corresponding unit of the second auxiliary data structure using the second hash function, the method further includes: clearing the bucket corresponding to the subgraph pattern in the first auxiliary data structure.
[0063] In one embodiment, the four-element information corresponding to the subgraph pattern is mapped to the corresponding unit of the second auxiliary data structure using the second hash function. Updating the four-element information in the corresponding unit includes: determining whether the subgraph pattern is in a unit of the second auxiliary data structure; if so, calculating the timestamp difference between the current timestamp and the timestamp recorded in the corresponding unit; if the timestamp difference is less than or equal to the time interval threshold τ, updating the timestamp recorded in the corresponding unit to the current timestamp and incrementing the time interval number by 1; if the timestamp difference is greater than the time interval threshold τ, updating the four-element information in the corresponding unit according to the relationship between the time interval number and the period-related threshold θ.
[0064] In one embodiment, updating the quaternion information in the corresponding unit according to the relationship between the number of time intervals and the periodicity threshold θ includes: if the number of time intervals is greater than or equal to the periodicity threshold θ, then the timestamp recorded in the corresponding unit is updated to the current timestamp, the number of time intervals is updated to 0, and the repetition of the subgraph pattern is increased by 1; if the number of time intervals is less than the periodicity threshold θ, then the timestamp recorded in the corresponding unit is updated to the current timestamp, and the number of time intervals is updated to 0.
[0065] In one embodiment, the method further includes: if the subgraph pattern is not in a cell of the second auxiliary data structure, then determining whether there is an empty cell in the second auxiliary data structure; if there is an empty cell in the second auxiliary data structure, then inserting the subgraph pattern into the empty cell, updating the timestamp recorded in the corresponding cell to the current timestamp, updating the time interval number to 0, and updating the repetition of the subgraph pattern to 0; if there is no empty cell in the second auxiliary data structure, then finding the cell with the minimum repetition, and replacing the content in the cell with the four-element information of the subgraph pattern.
[0066] In this embodiment, updateRPSketch uses the hash function h(·) to map P to B[h(P)]. If P is in a cell of B[h(P)], there are three cases (row 1):
[0067] Case 1: If the difference between the current timestamp t and the time stored in B[h(P)][P].t does not exceed the interval threshold τ, updateRPSketch will update B[h(P)][P].t to the current timestamp t and increment B[h(P)][P].N by 1 (lines 2-3).
[0068] Case 2: If tB[h(P)][P].t>τ and B[h(P)][P].N≥θ, updateRPSketch updates B[h(P)][P].t=t, B[h(P)][P].N=0, and increments B[h(P)][P].REC(P) by 1 (lines 5-6).
[0069] Case 3: If tB[h(P)][P].t>τ and B[h(P)][P].N<θ, updateRPSketch updates B[h(P)][P].t=t and sets B[h(P)][P].N=0 (lines 7-8).
[0070] if Furthermore, B[h(P)] has an empty cell. updateRPSketch directly inserts P into an empty cell and updates B[h(P)][P].t = t, B[h(P)][P].N = 0, and B[h(P)][P].REC(P) = 0 (rows 9-10).
[0071] Otherwise, if B[h(P)] has no empty cells, updateRPSketch attempts to use a kick-out strategy to remove the pattern P with the least repetition in B[h(P)]. i Replace with P (lines 11-12). RPSketch uses the GuaranteedSoft Uniform replacement strategy proposed in [3] to probabilistically select patterns with high repetition probability.
[0072] Theorem 3. Suppose that M subgraphs are generated at time t, and P∈A i [j], let f P Let be the frequency of mode P at time t. For 0 < ∈ <f P ,have
[0073]
[0074]
[0075] In one specific embodiment, with Figure 3 Using the data in the example above, we can illustrate the algorithm as follows: When edge e is inserted, stage 1 generates all m-edge subgraphs corresponding to e. In stage 2, EFSketch contains a single bucket array A1. Consider a bucket with (P1, 3, On), where 3 represents the frequency of P1 at the current timestamp t, and On represents the state of the counter. Assume σ = 10 and t = 13. 1) For the subgraph g1 mined in stage 1 m Use hash function h1 to hash g1 m Pattern P1 is mapped to a specific bucket A1[h1(P1)]. Since P1∈A1[h1(P1)] and A1[h1(P1)].state=On, increment A1[h1(P1)].fre(P,t) by 1 and update A1[h1(P1)].state to Off. 2) For subgraph g7 m Although subgraph g7 can be found in stage 3 m The pattern is P5, but since t = B[h(P5)][P5].t, P5 is mapped to A1[h1(P5)] using h1. Since A1[h1(P1)].state = Off, no operation is performed. 3) For subgraph g5 m Using h1 to g5 m Pattern P2 is mapped to A1[h1(P2)]. Since P2∈A1[h1(P2)] and A1[h1(P2)].state=On, increment A1[h1(P2)].fre(P,t) by 1 and update A1[h1(P2)].state to Off. At this time, fre(P2,t)=σ, so P2 with t=13 is sent to stage 3 and the mapped bucket is cleared. 4) For subgraph g9 m Since it cannot be found in either stage, the frequency of the pattern in the mapping bucket will be reduced by 1. Because the frequency counter in the mapping bucket is now 0, the bucket will be cleared.
[0076] In phase 3, RPSketch consists of u buckets, each containing λ cells. Assume τ = 2, θ = 3, and δ = 2. 1) Phase 3 receives...<P2,t=13> Since fre(P2,t)=σ. Use the hash function h(·) to map P2 to B[h(P2)]. Since P2 is found in B[h(P2)] and the current timestamp B[h(P2)].t is 11, it indicates that P2 is a frequent pattern. Since tB[h(P2)].t=2=τ, increment B[h(P2)].N by 1 and set B[h(P2)].t=13. 2) For P3, tB[h(P3)].t=3>2, indicating that the interval [10,13] is invalid. Since B[h(P3)].N=4>θ, set B[h(P3)].t=13 and B[h(P3)].N=0, and increment B[h(P3)].REC(P3) by 1. Since B[h(P3)].REC(P3)=δ, P3 is a recurring pattern. 3) For P6, tB[h(P6)].t = 4 > 2 and B[h(P6)].N = 1, so set B[h(P6)].t = 13 and clear B[h(P6)].N to 0.
[0077] findRP-S uses a hash function to map each m-edge subgraph to a fixed bucket in EFSketch, eliminating the need to store subgraphs, significantly reducing memory consumption, and avoiding redundant subgraph matching calculations. Furthermore, findRP-S does not require storing intermediate results to indirectly calculate the repetitive periodicity support set for each pattern. Moreover, findRP-S is a method for directly calculating (θ, δ)-repetitive patterns via RPSketch.
[0078] In another embodiment, the present invention also provides two comparison methods:
[0079] 1. Baseline method: using a set of PS m This is used to store the generated m-edge patterns and their frequency at each timestamp from the start time to the current time. PS m Each item in the array is a triple. FS(P)), where P is an m-edge pattern. FS(P) represents the estimated frequency at time t, and is a function of size (t). end -t start A queue is used to store the frequency set of P. Initially, `initializeFre` is called to initialize PS. m Since the process of finding all m-edge subgraphs for each newly inserted edge to calculate the frequency of each pattern is time-consuming, the PS is updated using the edge sampling method by calling estimateFre. m For PS mFor each pattern P in the dataset, if pattern P is at timestamp t... i If it is frequent, then t i Add it to the time support set T(P) of P. Then, for each pattern P, call computeRP to compute the θ-cycle time support set Ω. δ θ (P) and repetition REC(P). If the repetition of pattern P is greater than or equal to δ, then pattern P is a (θ, δ)-repetitive pattern. Use a set RPSet to store (θ, δ)-repetitive patterns and their repetition. Finally, return all (θ, δ)-repetitive patterns in G.
[0080] estimateFre processes inserted edges sequentially. Define E. t Let be the set of inserted edges at time t, which is initially empty, and let b be the number of elements in each FS(·) at t, calculated as b←t. current -t begin At each timestamp t, estimateFre calculates E by calling findEdge. t When the insertion edge e occurs at time t, computeFre samples it randomly using a fixed probability ρ. An indicator (e) is used to indicate whether the insertion edge e has been sampled, where if... If e is sampled, then Indicator(e) = 1; otherwise, it is 0. If e is sampled, findSubgraph explores the tree-like candidate subgraph space to compute all m-edge subgraphs containing e, denoted as S. m (e). Estimate Fre and then from S m (e) Calculate m-edge pattern P m (e) set, and add these patterns to PS m Update it (lines 9-14). For P m For each pattern P in (e), estimateFre will match(e,P)←1, indicating that S is associated with the inserted edge e. m (e) m-edge subgraph g m Matching pattern P. Next, for the m-edge pattern P, consider two cases: (1) If P is in PS m middle, Will be updated to (2) If P is not in PS m In the middle, add b zeros to FS(P), and then... Insert PS m After processing the last inserted edge at each timestamp, for PS m Each pattern P in, It will be added to FS(P). Finally, the updated PS m It was returned.
[0081] Theorem 1. It is an unbiased estimate of fre(P,t) at timestamp t, i.e. Expected value It is fre(P,t).
[0082] Theorem 2. For parameters 0 < α, β < 1,
[0083] Complexity analysis. The findRP-B algorithm consists of three main steps. (1) During the subgraph enumeration process, findSubgraph requires O(2^3) time complexity. n2 (1) It takes time to find the m-edge subgraph, where n is the number of nodes in the subgraph. (2) During the frequency update process, estimateFre requires O((|S m (e)| 3 -|S m (e)|)·η) to calculate P m (e), where η is the average unit time for verifying two isomorphic subgraphs, and requires To update the frequency of each mode. (3) During the loop calculation, calculating T(P) requires O(1·|T|·M), where M is the frequency of PS. m The number of patterns in the middle, calculating REC(P) requires O(1·|Ω) δ θ |·M), and verifying whether the pattern is a (θ, δ)-repetitive pattern requires O(1) time. Therefore, findRP-S is designed to solve the problem of computational complexity of the baseline method.
[0084] 2. findRP-S opt In phase 2 of findRP-S, the fastest arriving pattern is recorded for each bucket. However, high-speed patterns may occupy multiple buckets; therefore, reducing duplicate high-speed patterns can save EFSketch memory. Therefore, findRP-S... opt The update process for phase 2 has been modified. Given a pattern P, if pattern P is not found in phase 3 or t = B[h(P)].t, P is mapped to the d mapping buckets of phase 2 according to three cases:
[0085] Case 1: If P is not in any bucket and there are no empty buckets, decrement the frequency of each bucket by 1. If the frequency reaches 0, empty the bucket.
[0086] Scenario 2: If P is not in any bucket, but there is at least one empty bucket, insert P into the empty bucket.
[0087] Case 3: If P is in a bucket and the bucket is in the On state, then move A... i [h i The frequency of (P) is increased by 1. If the frequency after the increase is greater than or equal to σ, try inserting P into stage 3. Using a deduplication strategy can effectively improve the accuracy of findRP-S because it allows storing more potentially frequent patterns. It should be noted that in findRP-S... opt In this context, d is 1. Users can also adjust the parameter d in stage 2 according to their specific application requirements to balance accuracy and speed.
[0088] In one specific embodiment, three real-world application datasets were used in the experiment:
[0089] Enron is an email communication network containing 86K entities (e.g., employees) and 297K edges (e.g., emails), with timestamps corresponding to the communication data.
[0090] Twitter is a social network containing 4.9M entities (such as users) and 32M edges (such as “mentions”), with timestamps for the “mention” dates.
[0091] • Citation is a citation network containing 4.3M entities (e.g., papers) and 21.7M edges (e.g., published on), with timestamps corresponding to the publication dates.
[0092] Please note that the entire flow graph needs to be stored for the experiment, with space reserved for storing all edges for each dataset. Each edge has two node IDs, two node labels, and a timestamp, each occupying 8 bytes. Since the edges are organized as linked lists, each edge also requires additional pointers. Therefore, each edge requires 48 bytes. For this purpose, the total memory size for Enron, Twitter, and Citation is fixed at 20MB, 1.5GB, and 1GB respectively. We have implemented all solutions in C++ and run them on a PC with an Intel i7 3.50GHz CPU and 32GB of RAM. The following three solutions are compared:
[0093] • findRP-B: A benchmark method for mining (θ, δ)-repetitive patterns. To build a benchmark, the algorithm findRP-B is used to identify (θ, δ)-repetitive patterns by replacing sampled edges with all inserted edges.
[0094] • findRP-S: An advanced algorithmic framework that uses two auxiliary data structures, EFSketch and RPSketch;
[0095] findRP-S opt findRP-S is an improvement through the integration of deduplication strategies.
[0096] The three methods were evaluated using the following four metrics:
[0097] • Recall (RR): The ratio of the number of correctly reported (θ, δ)-repetitive patterns to the number of correct (θ, δ)-repetitive patterns.
[0098] • Precision (PR): The ratio of the number of correctly reported (θ, δ)-repetitive patterns to the total number of reported (θ, δ)-repetitive patterns.
[0099] F1 score: It is calculated based on the precision and recall of the test, and is also a measure of test accuracy.
[0100] • Throughput: Thousands of insertions per second (KIPS).
[0101] Compare findRP-S with findRP-B and the optimized findRP-S on three real datasets using a limited amount of memory. opt Performance on the following metrics. Results are as follows. Figure 4 As shown, findRP-B requires more memory to achieve high performance, averaging 1.13 times more than findRP-S. Figure 4 This demonstrates three methods (findRP-S) with default parameters. opt A schematic diagram showing the F1 scores and throughput of findRP-S and findRP-B on three datasets, where... Figure 4 (a) is a diagram of the F1 score. Figure 4 (b) is a throughput diagram. Figure 4 (a) It can be seen that the F1 score of findRP-S exceeds the F1 score of findRP-B, while findRP-S opt The F1 score is also higher than findRP-S. opt The F1 score exceeded 0.9 on all three datasets. Figure 4 (b) It can be seen that the insertion throughput of findRP-B is consistently higher than that of other algorithms, while the throughput of findRP-S is also higher than that of findRP-S. opt Specifically, on the Enron dataset, findRP-B outperforms findRP-S by up to 2.1 times, and on the Citation dataset, findRP-S outperforms findRP-S by [missing data type]. opt Up to 1.32 times higher. Experimental results show that findRP-S and findRP-S optHigh accuracy can be achieved with limited memory. In contrast, the baseline solution requires more memory due to the use of adjacency lists, which consumes a significant amount of space. findRP-S, however, uses only two auxiliary data structures to record the approximate state of each pattern, thus saving considerable space. Furthermore, the accuracy of the baseline solution depends on the sampling rate ρ, while the sketch-based method of this invention guarantees accuracy.
[0102] The memory size was changed from 40MB to 80MB. Figure 5 The diagrams show the RR, PR, and KIPS curves for three algorithms. Figure 5 (a) is a schematic diagram of the RR curves of the three algorithms. Figure 5 (b) is a schematic diagram of the PR curves of the three algorithms. Figure 5 (c) shows a schematic diagram of the KIPS curves for the three algorithms. From Figure 5 (a) and Figure 5 (b) It can be seen that increasing the memory size can improve findRP-S opt RR and PR of findRP-S, for findRP-S opt The impact of findRP-S is relatively small. Results show that findRP-S achieves a PR approximately 27% higher than the benchmark solution. opt The PR of findRP-S is about 2.6% higher than that of findRP-B. Compared to findRP-B, the PR of findRP-S is on average about 16% higher. opt Compared to findRP-S, this improves the PR by approximately 1.5%. The algorithm of this invention achieves competitive performance while occupying less space. Figure 5 (c) It can be seen that increasing the memory size can reduce the throughput of findRP-B, and for findRP-S and findRP-S... opt The impact is relatively small. The results show that findRP-S and findRP-S... opt The robustness of findRP-B is low when the memory size is small, as there is insufficient space to store the subgraph associated with the sampling edges to accurately estimate the frequency of each mode. Meanwhile, findRP-S and findRP-S... opt Use two auxiliary data structures, EFSketch and RPSketch, without storing any subgraphs.
[0103] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0104] In one embodiment, such as Figure 6 As shown, a social network duplicate event detection device based on repeating subgraph pattern mining is provided, comprising:
[0105] The subgraph pattern frequency calculation module 602 is used to obtain the social network snapshot graph with the current timestamp, and use a first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets in the first auxiliary data structure, and update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets; the first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function;
[0106] The subgraph pattern repetition calculation module 604 is used to obtain the frequency of the updated subgraph pattern. When the frequency is greater than or equal to the support threshold σ, the second hash function is used to map the four-element information corresponding to the subgraph pattern to the corresponding unit of the second auxiliary data structure, and the four-element information in the corresponding unit is updated. The second auxiliary data structure includes a hash array composed of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern.
[0107] The result output module 606 is used to obtain the recurring events in the current social network based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure.
[0108] Specific limitations regarding the social network duplicate event detection device based on repeating subgraph pattern mining can be found in the limitations of the social network duplicate event detection method based on repeating subgraph pattern mining mentioned above, and will not be repeated here. Each module in the aforementioned social network duplicate event detection device based on repeating subgraph pattern mining can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0109] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores social network duplicate event detection data based on repeating subgraph pattern mining. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a social network duplicate event detection method based on repeating subgraph pattern mining.
[0110] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0111] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.
[0112] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0113] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0114] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0115] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this invention should be determined by the appended claims.
Claims
1. A method for detecting repeated events in a social network based on the mining of repeating subgraph patterns, characterized in that, The method includes: Obtain a social network snapshot graph with the current timestamp, and use a first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets in a first auxiliary data structure. Update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets. The first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function. The frequency of the updated subgraph pattern is obtained. When the frequency is greater than or equal to the support threshold σ, the four-element information corresponding to the subgraph pattern is mapped to the corresponding unit of the second auxiliary data structure using the second hash function, and the four-element information in the corresponding unit is updated. The second auxiliary data structure includes a hash array consisting of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern. Based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure, the recurring events in the current social network are obtained.
2. The method according to claim 1, characterized in that, The step of using the first hash function to map the m-edge subgraph related to the newly inserted edge e in the social network snapshot graph to the corresponding bucket in the first auxiliary data structure, and updating the frequency and frequency counter state of the subgraph pattern in the corresponding bucket includes: When a new edge e is inserted, obtain the m-edge subgraph related to the current newly inserted edge e in the social network snapshot graph; Traverse each m-edge subgraph. If the subgraph pattern of the current m-edge subgraph is in the corresponding unit of the second auxiliary data structure, and the current timestamp is the same as the timestamp recorded in the corresponding unit, then traverse the next m-edge subgraph. Otherwise, the first hash function is used to map the current m-edge subgraph to the corresponding bucket of the first auxiliary data structure, and the frequency and frequency counter status of the subgraph pattern in the corresponding bucket are updated; the bucket includes the subgraph pattern corresponding to the current m-edge subgraph and the frequency and frequency counter status of the subgraph pattern.
3. The method according to claim 2, characterized in that, The first hash function is used to map the current m-edge subgraph to the corresponding bucket of the first auxiliary data structure. Updating the frequency of the subgraph pattern and the frequency counter state in the corresponding bucket includes: Determine whether the subgraph pattern corresponding to the current m-edge subgraph is in the bucket of the first auxiliary data structure. If it is, and the frequency counter is in the on state, then update the frequency of the subgraph pattern using the frequency counter and update the frequency counter state to the off state.
4. The method according to claim 3, characterized in that, The method further includes: If the subgraph pattern corresponding to the current m-edge subgraph is not in the bucket of the first auxiliary data structure, then determine whether there is an empty bucket in the first auxiliary data structure. If there is an empty bucket in the first auxiliary data structure, insert the subgraph pattern into the empty bucket, use the frequency counter to set the frequency of the subgraph pattern to 1, and set the state of the frequency counter to the off state. If the first auxiliary data structure does not have an empty bucket, then the frequency of the subgraph pattern stored in each bucket is reduced by 1, the bucket with the frequency reduced to 0 is cleared, the subgraph pattern is inserted into the empty bucket, the frequency of the subgraph pattern is set to 1 using a frequency counter, and the frequency counter is set to the off state.
5. The method according to claim 1, characterized in that, After mapping the four-element information corresponding to the subgraph pattern to the corresponding unit of the second auxiliary data structure using the second hash function, the process also includes: Clear the bucket corresponding to the subgraph pattern in the first auxiliary data structure.
6. The method according to claim 1, characterized in that, The step of mapping the four-element information corresponding to the subgraph pattern to the corresponding unit of the second auxiliary data structure using the second hash function, and updating the four-element information in the corresponding unit includes: Determine whether the subgraph pattern is in a unit of the second auxiliary data structure. If so, calculate the timestamp difference between the current timestamp and the timestamp recorded in the corresponding unit. If the timestamp difference is less than or equal to the time interval threshold τ, update the timestamp recorded in the corresponding unit to the current timestamp and increment the time interval by 1. If the timestamp difference is greater than the time interval threshold τ, then the quaternary information in the corresponding unit is updated according to the relationship between the number of time intervals and the period-related threshold θ.
7. The method according to claim 6, characterized in that, The step of updating the quaternion information in the corresponding unit based on the relationship between the time interval and the periodic threshold θ includes: If the number of time intervals is greater than or equal to the periodic correlation threshold θ, then update the timestamp recorded in the corresponding cell to the current timestamp, update the number of time intervals to 0, and increase the repetition of the subgraph pattern by 1. If the number of time intervals is less than the periodic threshold θ, then the timestamp recorded in the corresponding unit is updated to the current timestamp, and the number of time intervals is updated to 0.
8. The method according to claim 6, characterized in that, The method further includes: If the subgraph pattern is not in a cell of the second auxiliary data structure, then determine whether there is an empty cell in the second auxiliary data structure. If there is an empty cell in the second auxiliary data structure, then insert the subgraph pattern into the empty cell, update the timestamp recorded in the corresponding cell to the current timestamp, update the time interval number to 0, and update the repetition of the subgraph pattern to 0. If the second auxiliary data structure does not have empty cells, then find the cell with the least repetition and replace the content in the cell with the quadratic information of the subgraph pattern.
9. A device for detecting recurring events in a social network based on recurring subgraph pattern mining, characterized in that, The device includes: The subgraph pattern frequency calculation module is used to obtain the social network snapshot graph with the current timestamp, and use a first hash function to map the m-edge subgraphs related to the newly inserted edge e in the social network snapshot graph to the corresponding buckets of the first auxiliary data structure, and update the frequency and frequency counter status of the subgraph patterns in the corresponding buckets; the first auxiliary data structure includes at least one bucket array, each bucket array includes l buckets, each bucket is used to store the subgraph pattern, the frequency of the subgraph pattern and the frequency counter status, and each array corresponds to a first hash function; The subgraph pattern repetition calculation module is used to obtain the frequency of the updated subgraph pattern. When the frequency is greater than or equal to the support threshold σ, the module uses a second hash function to map the four-element information corresponding to the subgraph pattern to the corresponding unit of the second auxiliary data structure, and updates the four-element information in the corresponding unit. The second auxiliary data structure includes a hash array composed of u buckets, which is associated with the second hash function. Each bucket includes λ units, and each unit is used to store the four-element information of the subgraph pattern. The four-element information includes the subgraph pattern, the current timestamp, the time interval, and the repetition of the subgraph pattern. The results output module is used to obtain the recurring events in the current social network based on the events corresponding to the subgraph patterns in the updated second auxiliary data structure.
10. 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, it implements the steps of the method according to any one of claims 1 to 8.