A Method and System for Identifying Parallel Motif Transition Patterns in Large-Scale Temporal Graphs
Through the combination of TZP algorithm and PTMT algorithm, efficient parallel recognition of large-scale timing chart motif transfer mode is achieved, solving the problems of high computational complexity and large memory usage, and improving processing efficiency and resource utilization.
Patent Information
- Application Number
- CN202510549562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The existing methods have high computational complexity, huge memory usage, low utilization of multi-core resources, and the problem of motif transfer duplicate counting when dealing with large-scale timing charts.
The TZP algorithm is used to perform area division, and multi-threaded parallel computing is performed in combination with the PTMT algorithm. The redundancy is eliminated through hash encoding, and the time window division and pruning strategy is combined to achieve efficient parallelized motif transfer pattern recognition.
It significantly improves the efficiency and scalability of motif transfer pattern recognition, reduces memory footprint, supports ordinary server deployment, accelerates parallel computing by 50 times, and reduces memory footprint by 80%.
Smart Images

Figure CN120067652B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of pattern recognition technology, and in particular to a method and system for recognizing parallel motif transfer patterns in large-scale time sequence graphs. Background Art
[0002] A time-series graph is a dynamic network structure whose edges and nodes change over time, truly reflecting the dynamic evolution of interactions within complex systems. Motifs, as frequently occurring subgraph patterns in time-series graphs, reveal the dynamic nature of network structures through their transitions, making them crucial for applications such as anomaly detection and behavior prediction.
[0003] Despite the significant value of motif analysis, existing methods face the following challenges when processing large-scale time series graphs:
[0004] The computational complexity is high, and the time complexity of the best existing method (TMC) algorithm makes processing hundreds of millions of edges prohibitively long. Furthermore, memory usage is significant. For most public datasets, storing all candidate motif transition trajectories requires over 300GB of memory, making it difficult to deploy on standard servers. Furthermore, existing methods rely on global synchronization, resulting in a speedup of only 9.2% with 32 threads, resulting in low multi-core resource utilization. Simple time windowing leads to duplicate counting of motif transitions, such as the triangulation closure process across windows being counted multiple times by different threads. Summary of the Invention
[0005] In order to solve the above-mentioned problems, the present invention provides a method and system for parallelizing motif transition pattern recognition in a large-scale time sequence graph.
[0006] In a first aspect, the present invention provides a parallel motif transition pattern recognition method in a large-scale time sequence graph, which adopts the following technical solution:
[0007] A parallel motif transition pattern recognition method in a large-scale time series graph, comprising:
[0008] Get the original timing diagram;
[0009] Perform data preprocessing on the acquired original time series diagram and configure parameters;
[0010] Execution area division based on TZP algorithm;
[0011] Multi-threaded parallel computing based on PTMT algorithm to eliminate redundancy;
[0012] Result analysis.
[0013] Furthermore, the obtaining of the original timing diagram includes obtaining the original timing diagram =(V,E,T), where each edge e=(u,v,t) represents the interaction between node u and node v at timestamp t. The data file type is a text file with several lines of data. The three columns of numbers in each line represent the numerical sequence number corresponding to the first vertex, the sequence number corresponding to the second vertex, and the timestamp of each timing edge. The set of timing edges composed of all rows completely describes the timing graph.
[0014] Furthermore, the obtained original time series graph is preprocessed and parameters are configured, including unifying the timestamp t into seconds to avoid cross-granularity errors; arranging in ascending order by timestamp to ensure that subsequent partitioning is consistent with the processed time series; and removing timestamp anomalies and duplicate edges.
[0015] Furthermore, the data preprocessing and parameter configuration of the original timing diagram are performed on the obtained data, including setting the time constraint, the maximum transfer step, the expansion factor and the number of threads respectively, wherein the time constraint δ Determine the time window for motif transfer and the maximum transfer step Limit the number of motif conversions, determine the upper limit of the number of different motif edges in the final result, and the expansion factor ω Corresponding to the interval length determination parameter in the TZP partitioning algorithm.
[0016] Furthermore, the execution area division based on the TZP algorithm includes calculating the time span of the growth area and defining the current growth area. The time range is extracted and the edges that meet the time range are defined, and the boundary area is defined. Time range, by updating the boundary area The time range until the entire time axis is covered, and the partition set is output .
[0017] Furthermore, the multi-threaded parallel computing based on the PTMT algorithm is used to eliminate redundancy, including partitioning the set Each of Assign to a separate thread and traverse the current growth area in chronological order Edges in the thread are transformed into candidate sets by updating the thread-local motif ; Collect all threads After merging in the order of growth areas, each motif transfer instance is encoded into a unique string using hash coding, and the number of occurrences of each code is counted through the hash table to output a global frequency table. .
[0018] Furthermore, the result parsing includes analyzing the transfer relationship between digital string motifs through a pattern parsing algorithm and calculating the transfer ratio of a specific motif. In this process, the prefix of the motif is extracted, that is, the substring with the last two digits removed, and PrefixMap is traversed to perform classification statistics by prefix, and the number of motifs that have transferred and those that have not transferred is calculated. In the ratio calculation stage, the transfer ratio of a particular motif is calculated:
[0019] ,
[0020] ,
[0021] If you query "all", the transfer ratio of all motifs will be output; if you query a specific motif, the detailed transfer information of the motif will be output.
[0022] In a second aspect, a parallel motif transition pattern recognition system in a large-scale time series graph includes:
[0023] The data acquisition module is configured to obtain the original timing diagram;
[0024] A configuration module is configured to perform data preprocessing on the acquired original timing diagram and configure parameters;
[0025] The region partitioning module is configured to perform region partitioning based on the TZP algorithm;
[0026] The computing module is configured to perform multi-threaded parallel computing based on the PTMT algorithm to eliminate redundancy;
[0027] The parsing module is configured to parse the results.
[0028] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, for example, a method for parallelizing motif transfer pattern recognition in a large-scale timing graph.
[0029] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to perform the method for parallelizing motif transfer patterns in large-scale timing diagrams.
[0030] In summary, the present invention has the following beneficial technical effects:
[0031] This paper uses a temporal zone partitioning strategy (TZP) to partition time series graphs into independent regions that can be processed in parallel, combining it with a three-stage framework to achieve efficient computation and accurate counting. This paper discloses a large-scale time series graph motif counting strategy based on topological constraints. This strategy achieves efficient pruning through matrix operations. Combining time window partitioning with parallel computing significantly improves counting efficiency and scalability, making it suitable for large-scale dynamic graph analysis scenarios such as social networks and biological networks.
[0032] This method processes 120 million edges on a large public dataset in just 2,923 seconds using 32 threads, a 50x speedup compared to traditional methods. Peak memory usage is reduced from 320GB to 92GB, making it suitable for deployment on standard servers. The TZP strategy eliminates cross-zone duplicate counting, ensuring accurate statistical results. Streaming processing adapts to dynamic data, keeping peak memory usage below 150GB. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 1 is a schematic diagram of a parallelized motif transfer pattern recognition method in a large-scale time sequence diagram according to embodiment 1 of the present invention;
[0034] Figure 2 is a schematic diagram of a timing diagram of Example 1 of the present invention;
[0035] Figure 3 Schematic diagram of the TZP strategy of Example 1 of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below with reference to the accompanying drawings.
[0037] Explanation of terms:
[0038] Temporal Graph: A dynamic network structure consisting of nodes and edges that change over time, with edges carrying timestamps.
[0039] Motif transfer: the evolution of a specific subgraph pattern (motif) in a temporal graph over time.
[0040] TZP strategy (Temporal Zone Partitioning): A partitioning strategy that divides the time series graph into growth zones and boundary zones to ensure unique counts of motif transfers across zones.
[0041] Deterministic encoding: Map motif instances to unique strings to avoid graph isomorphism calculations.
[0042] Example 1
[0043] Reference Figure 1, a parallel motif transfer pattern recognition method in a large-scale time sequence graph of this embodiment includes:
[0044] Get the original timing diagram;
[0045] Perform data preprocessing on the acquired original time series diagram and configure parameters;
[0046] Execution area division based on TZP algorithm;
[0047] Multi-threaded parallel computing based on PTMT algorithm to eliminate redundancy;
[0048] Result analysis.
[0049] The specific steps include:
[0050] S1. Obtaining social network and other interaction data,
[0051] 1. System architecture,
[0052] Data collection layer: It consists of distributed crawlers or platform open APIs, which can pull logs from multiple sources such as Weibo, Twitter, Zhihu, etc. in parallel.
[0053] Message queue layer: Apache Kafka is used as a buffer, and topics are divided into raw_interactions (original) and clean_interactions (cleaned).
[0054] Data cleaning layer: Consumer programs subscribe to raw_interactions and write them to clean_interactions after formatting, deduplication, and exception removal.
[0055] Storage layer: After cleaning, the data is stored in HDFS (Parquet files) or NoSQL (such as HBase and MongoDB) databases and tables.
[0056] Scheduling and monitoring: Airflow is used to periodically trigger full-scale pull and incremental cleaning tasks, and Prometheus+Grafana monitors the throughput, latency, and error rate of each node.
[0057] 2. Field definition and format,
[0058] Required fields: u (ID of the active interacting user, Int64), v (ID of the interacted user, Int64), and t (Unix timestamp, Int64, in seconds, UTC).
[0059] Optional fields: type (interaction type, Int8, 1=Like, 2=Comment, 3=Private Message), content_id (content ID, String), geo (JSON object, lat / lng), app_version (client version, String).
[0060] As an example JSON:
[0061] {"u":1001,"v":2002,"t":1679788800,"type":2,"content_id":"post_84321","geo":{"lat":31.23,"lng":121.47},"app_version":"8.4.2"}
[0062] 3. Collection process,
[0063] 1) API pull: Use the platform batch interface and pull in pages when t > t_last_max, with 100,000 records per page.
[0064] 2) Distributed crawler: Based on Scrapy + Redis, multi-machine collaboration; sharding by user account and topic keyword;
[0065] 3) Cleaning logic: Time verification (discard records with t > current UTC+60s or t < 0); deduplication within the same second (keep the earliest one); formatted output (u, v, t, type) 4-tuple, with type=0 by default; write to clean_interactions.
[0066] S2. Build a timing diagram based on the acquired data.
[0067] 1. Data loading,
[0068] Reading HDFS Parquet using Spark:
[0069] val df = spark.read.parquet("hdfs: / / ... / clean_interactions / date=*")
[0070] Select fields u, v, t and convert them to DataFrame.
[0071] 2. Global sorting and micro-batching,
[0072] df_sorted = df.orderBy("t") completes global time series sorting;
[0073] Slice t by hour and write it into multiple small files to facilitate subsequent parallel processing.
[0074] 3. Node and edge table design,
[0075] Node table nodes:
[0076] CREATE TABLE nodes (node_id BIGINT PRIMARY KEY, first_seen BIGINT, last_seen BIGINT, degree INT);
[0077] Edges table:
[0078] CREATE TABLE edges (edge_id BIGINT PRIMARY KEY, src_id BIGINT, dst_idBIGINT, ts BIGINT, type TINYINT, INDEX(ts), INDEX(src_id,dst_id));
[0079] The edge table is stored by ts partition.
[0080] 4. Composition process,
[0081] 1) Node storage: All u and v are deduplicated and written to nodes, with first_seen=MIN(t) and last_seen=MAX(t).
[0082] 2) Edge storage: Write edges in batches and update nodes.degree in real time.
[0083] 3) Verification: Check that the minimum / maximum ts in edges are consistent with the corresponding fields in nodes.
[0084] 5. Image enhancement,
[0085] Add a prev_ts field to the edge table to calculate the time difference between the current edge and the previous edge on the same source node; count the number of (u,v) interactions within the window as a reference for pruning; add labels based on user profiles (registration time, number of followers, activity level, etc.).
[0086] 6. Example Pseudocode (Spark + GraphFrame)
[0087] from graphframes import GraphFrame
[0088] nodes = df.select("u").union(df.select("v")).distinct().withColumnRenamed("u","id")
[0089] edges = df_sorted.selectExpr("u as src","v as dst","t as ts","type")
[0090] graph = GraphFrame(nodes, edges)
[0091] 7. Output files,
[0092] Temporal Edge Set .txt:
[0093] #uvt 1001 2002 1679788800 1001 2003 1679788815 2003 2002 1679788900
[0097] S3. Preprocess the data of the constructed time series graph.
[0098] Input: Original timing diagram , where each edge represents the interaction between node u and node v at timestamp t.
[0099] The timestamp t is standardized to seconds (or milliseconds) to avoid cross-granularity errors. Timestamps are sorted in ascending order to ensure temporal consistency during subsequent partitioning and processing. Abnormal timestamps (such as future times or negative values) and duplicate edges (only one interaction between the same node pair at the same timestamp is retained) are removed.
[0100] Output: Normalized temporal edge set .
[0101] S4. Configuration parameters,
[0102] Time Constraints :Dynamically set according to the application scenario. For example:
[0103] Social network interaction: = 10 minutes (analyzing short-term user sessions).
[0104] Maximum transfer step length :
[0105] Control the maximum number of transfers according to demand, such as .
[0106] Expansion factor ω:
[0107] For sparse data, you can increase the parameter value of ω to reduce the number of partitions; for dense data, you can decrease the parameter value of ω to increase the parallel granularity.
[0108] Number of threads: Set according to hardware resources, such as 32 threads (make sure the number of threads is ≤ the number of CPU physical cores).
[0109] S5. Perform region partitioning (TZP algorithm)
[0110] Divide the timing diagram into:
[0111] 1. Growth Areas (Growth Zone):
[0112] The timing diagram is divided into multiple independently processed areas according to the time axis, and the time span is:
[0113] ,
[0114] Among them, ω is the thread expansion factor (used to determine the time span of the partition area), δ is the time constraint (a parameter of the motif transfer process, which determines the time limit of the motif conversion), is the maximum transfer step (a parameter of the motif transfer process that determines the limit on the number of steps of motif conversion).
[0115] Design intention: Balance partition granularity and parallel efficiency by adjusting ω.
[0116] 2. Boundary area (Boundary Zone):
[0117] Set overlap regions between adjacent growth regions with a time span of: ,
[0118] Uniqueness guarantee: The edge set of any motif transfer instance belongs entirely to a single growth region or its boundary region.
[0119] Lemma 1 (uniqueness proof):
[0120] Assumptions The time span is ,like Spanning multiple regions, its first side must belong to a growth area , subsequent edge factors The coverage is classified as The boundary area .therefore, Only Count once.
[0121] As a further embodiment,
[0122] Input: sorted edge set , time constraints , maximum transfer step length , expansion factor , number of threads .
[0123] Algorithm flow:
[0124] 1. Initialization:
[0125] Start time .
[0126] 2. TZP strategy division:
[0127] Calculate the growth region time span: .
[0128] Defining current growth areas The time range is) , extract all satisfying Define the boundary area The time range is ,in . Enumerate the timing edges of the timing edge area that is not currently added from the front to the back ,Will Satisfy the current or Time-constrained temporal edges are added to the corresponding regions to form a subset of edge sets. , repeat until the entire timeline is covered.
[0129] Output: Partition set ={ , , , ,…}.
[0130] More detailed explanation, first, the start time Initialized as a temporal edge set The earliest timestamp of all edges in the set. Then enter the loop and perform the following operations as long as the current start time does not exceed the latest timestamp in the edge set: Calculate the end time of the current growth area , whose value is the start time and preset parameters 、 and The sum of the products of Next, extract the timestamp from the edge set. All edges within the range constitute the current growth area Then, according to the formula Define the boundary area , whose time range is To ensure the unique ownership of cross-region motif transfer. and boundary areas After joining the partition set Q, update the start time For the current , in order to process the next time window. The above steps are repeated until the entire time axis is covered, and finally a set Q containing all partitions is returned, completing the dynamic partitioning of the time series graph.
[0131] S6. Execute Parallel Computing Framework (PTMT)
[0132] Among them, (1) Growth area parallel expansion input: the growth area assigned to thread k , set the current Transfer candidate set M k Is an empty set.
[0133] Process: Traverse the edge set in chronological order and retrieve the current edge With M k Each of Is there a common vertex, and judge whether it satisfies and Update candidates under equal constraints Transfer. And must meet the following two constraints, time constraint: adjacent edge interval . Step size constraint: transfer step size .when With M k Motif i When there are common vertices and the time and step constraints are met, Add motif i and the transfer is completed in one go; if e does not meet the above conditions, then directly Join M k Complete M k The final output is the local Transfer candidate set .
[0134] (2) Overlapping perception aggregation,
[0135] Principle: When merging the results of each thread, due to our partitioning method, repeated elements will only appear between two adjacent partitions. It is combined with the regional partitioning strategy to eliminate duplicate counting or omissions caused by ordinary parallel partitioning.
[0136] Example: If a Transfer in and 10 and 8 respectively, but in The repetition count is 5, so its global value is 10+8−5=13.
[0137] Process: Since there is no data dependency between non-adjacent partitions, overlap elimination can be efficiently completed by automatically allocating threads. The specific implementation method is as follows: In stage 1, each local motif transfer candidate set is obtained. , for the adjacent i-th and i+1-th candidate sets, use the formula Get the correct result and reduce it to the final set to get the global motif transformation set .
[0138] (3) Deterministic coding,
[0139] Encoding rules: After getting the global motif conversion set Then, various Mapping is a fixed-length string, which is formally expressed as follows:
[0140] ,
[0141] Where f(Ai):V→N is a continuous mapping function for node IDs (mapping node names into numbers for easier encoding), Ai represents all nodes that make up the motif in chronological order, and ⊕ represents string concatenation. This method aims to avoid the O(n!) complexity of graph isomorphism computation and achieve O(1) hash duplication detection.
[0142] (4) Dynamic load balancing and optimization,
[0143] Adaptive partitioning: Dynamically adjust the ω value according to data density:
[0144] ,
[0145] As one of the method's hyperparameters, ω controls the length of the rolling partition of the time window, supports incremental processing of tens of billions of edges, and reduces memory peak by 80%.
[0146] As a further embodiment,
[0147] (1) Parallel expansion of growth areas,
[0148] Thread allocation: Each of Assigned to independent threads, the number of threads is determined by the parameter set up.
[0149] Candidate generation:
[0150] Traverse in chronological order For each edge , call the edge extension conversion function:
[0151] The pseudo code is as follows:
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160] Update thread local Transformation candidate set .
[0161] (2) Overlapping perception aggregation,
[0162] Collect all threads , merge in the order of growing regions. and , apply the formula to correct the repeat count: Finally get the overall picture Transformation set.
[0163] (3) Deterministic coding,
[0164] First, hash coding is used to encode each motif transfer instance into a unique string.
[0165] ,
[0166] For example, for the motif sequence ⟨(A,B,1:00),(B,C,1:20)>, the mapping is: Code(⟨(A,B,1:00),(B,C,1:20)>)=f(A)⊕f(B)⊕f(B)⊕f(C)="0112" where f is the mapping of node IDs to consecutive integers (such as A→0, B→1, C→2).
[0167] Then the global frequency table M is obtained: the number of occurrences of each code is counted through the hash table, and the output format is: code: number
[0168] For example, 01010203: 1896181,
[0169] 01010101: 289241,
[0170] Among them, the PTMT algorithm divides the time series edge into multiple regions and processes them in parallel in the first stage, through try_to_transit(e,δ, , ) function in the δ time constraint, Expand candidate motifs under the constraints of maximum path length and node continuity; in the second stage, the candidate motif sets generated in each region are Merge into global collection , through the conflict resolution mechanism to eliminate duplicates generated by overlapping boundary areas; the third stage encodes the merged motif transfer process into a fixed-length string, and finally returns the frequency mapping table .
[0171] Step S7. Result analysis and application,
[0172] In practical applications, this method uses query parameters to parse motif (numeric string) transfer data and calculate its transfer ratio. The specific implementation includes the input data format, query method, algorithm execution process, and the final output structure.
[0173] First, the input data format is a text file (such as the global frequency table M obtained in step 4), where each line contains a motif (a string of numbers) and its number of occurrences, for example: 011212 10 011213 5 010102 7 0112 18
[0178] Here, 011212 represents the motif and 10 represents its occurrence count. Motifs in the data may share a common prefix. For example, 011212 and 011213 have the same prefix 0112, which indicates a possible motif shift.
[0179] Query parameter settings,
[0180] The user specifies the following parameters:
[0181] <input_file> : The path to the input data file.
[0182] <query>: Search for a specific motif prefix, or use "all" to search for all motifs.
[0183] [min_length max_length] (optional): specifies the minimum and maximum length of the motif, with the default range being 4 to 8.
[0184] For example, execute the command:
[0185] . / motif_analysis dataset.txt 0112 4 8
[0186] Indicates querying the motif transfer of prefix 0112 in dataset.txt, and the motif length is limited to between 4 and 8.
[0187] Algorithm execution process,
[0188] Data preprocessing,
[0189] Read dataset.txt, parse the motif and the number of occurrences, and extract the motif prefix (remove the last two digits, e.g., 011212 becomes 0112). Record the motif transfer data: PrefixMap["0112"]["011212"] = 10.
[0190] Accumulate the total number of transfers of the prefix CountMap["0112"] += 10.
[0191] Query the motif transfer ratio,
[0192] If you query "all", all prefixes are traversed in PrefixMap. If you query a specific motif, such as 0112, only PrefixMap["0112"] is calculated. Calculate the transfer ratio of each motif:
[0193] ,
[0194] ,
[0195] Output:
[0196] Generate the result file result_dataset.txt, the example is as follows:
[0197] Motif: 0112
[0198] 011212: 10 (66.67%)
[0199] 011213: 5 (33.33%)
[0200] Total Evolved: 15 (83.33%)
[0201] If the motif is not transferred, the output is "No data found for prefix: <query>".
[0202] Final output:
[0203] The final output of this method is the ratio of motif transfer, which helps users analyze the evolutionary relationships between motifs. For example, users can query global motif statistics using "all" or specify a query to query the transfer of specific motifs. The obtained analysis results can be used in the following areas:
[0204] High-frequency pattern recognition:
[0205] Wikipedia Collaboration Network:
[0206] For example, if the Motif 0101 path "010102" accounts for 30.72% of the time, it is identified as a relay edit by multiple people and marked as a high-quality collaborative entry. If the Motif 0112 path "011213" suddenly increases in frequency, administrators are automatically notified to review potential editing conflicts.
[0207] S8. Final output and application scenario implementation,
[0208] Outputs global motif frequency table (CSV), prefix transfer report (TXT / JSON), real-time API (e.g. / motif / report?prefix=0102).
[0209] Typical applications: anti-fraud detection, interest recommendation, and hot topic monitoring.
[0210] In the Wikipedia user talk page interaction data (WikiTalk dataset), we set Hour, , analyzing the motif transfer patterns of user editing behaviors, reveals the following key collaboration and conflict dynamics:
[0211] 1. Motif 0101 (Unilateral Dominant Interaction)
[0212] High frequency path:
[0213] "010101" (34.75%): A single user continuously edits the same discussion page, possibly for content maintenance or controversial changes.
[0214] "010102" (30.72%): After user A edits user B's talk page, user B quickly responds to user C, forming a chain interaction.
[0215] Anomaly detection: If the frequency of "010101" is abnormally high (for example, a single user accounts for more than 50%), it may involve malicious screen swiping or destructive editing.
[0216] Collaboration analysis: The "010102" path reflects relay discussions between users, which is common when multiple people collaborate to improve entry content.
[0217] 2. Motif 0102 (Triangle Collaboration Network)
[0218] Dominant Path:
[0219] "010203" (70.75%): The continuous editing of users A→B→C forms a triangular information flow, which may be a collaborative revision of controversial content by multiple people.
[0220] "010223" (1.51%): The closed-loop interaction of users A→B→C→A, reflecting whether consensus has been reached in the discussion.
[0221] Community governance: High-frequency triangulation paths can identify core editing groups and assist administrators in allocating permissions.
[0222] Conflict warning: If the closed-loop path "010223" is accompanied by an edit rollback, it may indicate excessive editing.
[0223] 3. Motif 0121 (Complex Collaboration Level)
[0224] Core Path:
[0225] "012123" (28.28%): Chain transmission of users A→B→C→D, which may be topic diffusion or cross-community collaboration.
[0226] "012131" (14.37%): The nested closed loop of user A→B→C→A reflects that the core users dominate the discussion agenda.
[0227] In the editing of a popular entry, the "012123" path accounts for more than 40%, indicating efficient collaboration across user groups; if the "012131" path surges in a short period of time, it may indicate that a small number of users have the right to speak and intervention is needed to balance the situation.
[0228] 4. Motif 0112 (Conflict Editing Mode)
[0229] Abnormal path:
[0230] "011213" (27.14%): User A→B→A→C's repeated modifications may be due to editing or content tug-of-war.
[0231] "011212" (14.80%): The cyclic confrontation of users A→B→A→B indicates an ongoing conflict between the two parties.
[0232] Detection rules:
[0233] If the "011213" path accounts for more than 30% of a discussion page, it will automatically trigger an administrator review;
[0234] Implement real-time monitoring of the "011212" path to prevent malicious damage.
[0235] As a further embodiment,
[0236] To further improve the efficiency of large-scale temporal motif transition discovery systems, this paper designs and introduces a pre-pruning module that runs before the system's main computational process. This module uses structural and frequency constraints to preemptively filter motif transition paths, significantly reducing the size of the candidate motif set and accelerating the discovery of high-frequency motif transitions. This method integrates the structural pruning concept with a time-aware mechanism to form a pruning framework tailored to motif transition scenarios.
[0237] Pruning strategies include three types of mechanisms: structural pruning, frequency pruning, and time pruning, as follows:
[0238] 1. Structural Pruning
[0239] This part is Based on the transfer relationship between nodes, the adjacency matrix analysis Whether specific structural constraints (such as triangle closure and star center) are met to eliminate invalid structures in advance combination.
[0240] Constructing a static transition graph adjacency matrix between motifs , where A[i][j] = 1 means Can evolve into ;
[0241] For a triangular closed structure, construct a pruning matrix: Used to identify the mutual reachability between three points;
[0242] For the star structure, construct the pruning matrix: S is used to identify the shared center Multi-point transfer mode;
[0243] If the value of the transfer pair (i, j) in the above matrix is 0, it means that it does not conform to the target structure and can be directly excluded to avoid participating in the main process calculation.
[0244] 1.1 Pruning of Triangle Motifs
[0245] Adjacency matrix definition:
[0246] Assume that the static adjacency matrix of the time series graph is ,use represents the element in the i-th row and j-th column of the matrix, where Represents a slave node arrive The number of edges.
[0247] The symmetric adjacency matrix of an undirected graph is defined as:
[0248] ,
[0249] in yes The transpose of represents a bidirectional edge.
[0250] Triangular topology matrix :
[0251] ,
[0252] Elements Representation node and The number of paths of length 2 between them.
[0253] It is a Hadamard product (element-wise multiplication), which requires that the end points of the path must be connected by a direct edge to ensure that a triangle is formed.
[0254] Pruning rules (Rule 1):
[0255] like , then the node and No triangular motifs could be formed.
[0256] Proof logic:
[0257] If and only if there is at least one node , making Form a closed triangle. , then no such path exists.
[0258] 1.2 Pruning of Star & Pair Motifs
[0259] Star topology matrix :
[0260] ,
[0261] Representation node and There are bidirectional edges between them.
[0262] Pruning rules (Rule 2):
[0263] node Conditions for being a star core or pairing motif node:
[0264] 1. , meeting any of the following conditions:
[0265] (There are bidirectional edges)
[0266] ( arrive There are multiple edges)
[0267] ( arrive There are multiple edges)
[0268] 2. Node Degree .
[0269] Proof logic:
[0270] The star motif requires that the central node is connected to at least three edges, and the pairing motif requires multiple interactions between nodes.
[0271] 1.3 Pruning Algorithm Implementation (Algorithm 3: getTCM)
[0272] 1. Calculate the matrix and .
[0273] 2. Traverse all nodes :
[0274] like ,mark It is a pruned node (cannot participate in the triangle motif).
[0275] like and and And degree < 3, mark It is a pruned node (cannot participate in star / pair motifs).
[0276] 3. Return the pruning map , guiding subsequent calculations to skip irrelevant nodes.
[0277] 2. Frequency-based Pruning
[0278] To avoid processing sporadic or extremely low-frequency motif transition paths, the system sets a lower frequency threshold (e.g., minimum occurrence count ≥ 5). If the frequency of a motif or its associated transition pair falls below this threshold, the corresponding path is removed from the transition graph, thereby reducing redundant candidates.
[0279] This mechanism can be roughly regarded as a "dimensionality reduction" operation in a high-dimensional sparse space, compressing the motif space into a subspace with stronger statistical stability, thereby improving the quality of candidate sampling.
[0280] 3. Integrate into the system pre-processing stage,
[0281] Steps:
[0282] 1. Input preprocessing:
[0283] Input Timing Diagram , time constraints , partition length .
[0284] 2. Time partition:
[0285] Generate a set Q of overlapping time partitions.
[0286] 3. Partition-level pruning:
[0287] For each partition :
[0288] a. Extract subgraph .
[0289] b. Apply Algorithm 1 (getTCM) to calculate the pruning mapping table .
[0290] c. Delete the nodes marked for pruning and keep the candidate node set ,in and The pruning mapping table The set of nodes that need to be pruned is obtained from .
[0291] 4. Output:
[0292] The candidate node set and subgraph of each partition are used by the subsequent motif counting module.
[0293] Mathematical tools and complexity,
[0294] Adjacency matrix exponentiation It is used for path counting and Hadamard product is used to constrain the closed structure. The complexity of the pruning stage is (matrix multiplication), but can be reduced to After partitioning, the size of each subgraph is reduced, further reducing the amount of computation.
[0295] System integration advantages,
[0296] Reduce the number of candidate nodes, reducing the search space for subsequent motif enumeration. Parallelization is achieved through time partitioning, improving overall throughput. Customizable pruning rules for specific motif types (such as triangles and stars) provide flexibility to meet system requirements.
[0297] like Figure 2 As shown in the figure, the interaction between nodes over time is shown through a timing diagram example. A, B, C, and D represent vertices, and 3:10, 10:10, etc. represent the timestamps corresponding to the directed timing edges.
[0298] like Figure 3 Shown is a schematic diagram of the TZP strategy.
[0299] Example 2
[0300] This embodiment provides a parallel motif transition pattern recognition system in a large-scale time sequence graph, including:
[0301] The data acquisition module is configured as follows:
[0302] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor of a terminal device and executing the method described.
[0303] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded by the processor and executing the method described.
[0304] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.< / query> < / query>
Claims
1. A parallel motif transfer pattern recognition method in large-scale time sequence graphs, characterized by: include: Get the original timing diagram; Perform data preprocessing on the acquired original time series diagram and configure parameters; Execution area division based on TZP algorithm; Multi-threaded parallel computing based on PTMT algorithm to eliminate redundancy; Result analysis; The execution area division based on the TZP algorithm includes calculating the time span of the growth area and defining the current growth area. The time range is extracted and the edges that meet the time range are defined, and the boundary area is defined. Time range, by updating the boundary area The time range is until the entire time axis is covered, and the partition set Q is output; The multi-threaded parallel computing based on the PTMT algorithm is used to eliminate redundancy, including partitioning the set Each of Assign to a separate thread and traverse the current growth area in chronological order Edges in the thread are transformed into candidate sets by updating the thread-local motif ; Collect all threads After merging in the order of growth areas, each motif transfer instance is encoded into a unique string using hash coding, and the number of occurrences of each code is counted through the hash table to output a global frequency table. ; The result parsing includes analyzing the transfer relationship between digital string motifs through a pattern parsing algorithm and calculating the transfer ratio of a specific motif. In this process, the prefix of the motif is extracted, that is, the substring with the last two digits removed, and PrefixMap is traversed to perform classification statistics by prefix, and the number of motifs that have transferred and those that have not transferred is calculated. In the ratio calculation stage, the transfer ratio of a specific motif is calculated: , , If you query "all", the transfer ratio of all motifs will be output; if you query a specific motif, the detailed transfer information of the motif will be output; Obtaining the original time-series graph includes obtaining social network interaction data, which is a text file; each row and three columns of numbers in the interaction data respectively represent the numerical sequence number corresponding to the first vertex of each time-series edge, the sequence number corresponding to the second vertex, and the timestamp; the time-series edge set consisting of all rows fully describes the time-series graph; Construct a timing diagram based on the acquired data: Original timing diagram =(V,E,T), each edge e=(u,v,t) represents the interaction between node u and node v at timestamp t, where u represents the ID of the active interacting user, v represents the ID of the interacted user, and t represents the timestamp of the interaction between u and v.
2. The method for parallelizing motif transition pattern recognition in a large-scale time sequence graph according to claim 1, characterized in that: The data preprocessing and parameter configuration of the obtained original time series graph include unifying the time stamp t into seconds to avoid cross-granularity errors; arranging in ascending order by time stamp to ensure that subsequent partitioning is consistent with the processed time series; Eliminate timestamp anomalies and duplicate edges. The timestamp unit is unified in the initial TXT text acquisition stage and the same lines are deleted to achieve the required task of removing duplicate edges. The ascending order of timestamps is implemented by the C++ programming language using the system library function sort(). The elimination of abnormal time values is achieved through the judgment statement in the program.
3. The method for parallelizing motif transition pattern recognition in a large-scale time sequence graph according to claim 2, characterized in that: The data preprocessing and parameter configuration of the original timing diagram are performed, including setting the time constraint, the maximum transfer step, the expansion factor and the number of threads respectively, wherein the time constraint δ Determine the time window for motif transfer and the maximum transfer step Limit the number of motif conversions and determine the upper limit of the number of different motif edges in the final result, the expansion factor ω Corresponding to the interval length determination parameter in the TZP partitioning algorithm.
4. A system for identifying parallel motif transition patterns in large-scale time sequence graphs, which executes the method for identifying parallel motif transition patterns in large-scale time sequence graphs according to claim 1, characterized in that: include: A data acquisition module is configured to acquire an original time sequence diagram, including acquiring social network interaction data, wherein the social network interaction data is a text file, and construct a time sequence diagram based on the acquired data; A configuration module is configured to perform data preprocessing on the acquired original timing diagram and configure parameters; The region partitioning module is configured to perform region partitioning based on the TZP algorithm; The computing module is configured to perform multi-threaded parallel computing based on the PTMT algorithm to eliminate redundancy; The parsing module is configured to parse the results.
5. A computer-readable storage medium storing a plurality of instructions, characterized in that: The instructions are suitable for being loaded by a processor of a terminal device and executing the method according to claim 1 .
6. A terminal device comprising a processor and a computer-readable storage medium, wherein the processor is configured to implement various instructions; and the computer-readable storage medium is configured to store a plurality of instructions, wherein: The instructions are suitable for being loaded by a processor and for executing the method according to claim 1 .
Citation Information
Patent Citations
Global maximization of time limit revenues by a travel provider
CA2793186A1
Parallel computer, communication control device and method of controlling communication
WO2012127625A1