Streaming graph-oriented random walk acceleration method

By employing a hierarchical graph storage architecture, adaptive hybrid sampling, and a dual inverted index mechanism, the shortcomings in storage structure design, sampling mechanism, and path repair in streaming graph processing are addressed, enabling efficient random walk computation and improving the system's real-time performance and accuracy.

CN120909508APending Publication Date: 2025-11-07HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510995239.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing random walk systems in streaming graph processing suffer from problems such as storage structure design that is not adapted to random access characteristics, sampling mechanism that is difficult to dynamically adapt to graph structure evolution, and low efficiency of walk path repair, resulting in insufficient real-time performance and accuracy.

Method used

It adopts a hierarchical graph storage architecture, an adaptive hybrid sampling strategy, and a dual inverted index mechanism. It optimizes data storage through a cross-layer migration mechanism, and combines a cost-aware mechanism and an incremental update strategy to achieve efficient access to neighbor information and fast path repair.

Benefits of technology

It significantly improves the performance of random walk computation in streaming graph environments, and has good scalability, real-time performance and system efficiency, making it suitable for large-scale dynamic graph data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909508A_ABST
    Figure CN120909508A_ABST
Patent Text Reader

Abstract

The invention belongs to the related technical field of graph calculation and streaming data processing, and particularly relates to a streaming graph-oriented random walk acceleration method, which comprises the following steps of: storing vertex information by adopting a hierarchical graph storage architecture consisting of a base layer, a dynamic extension layer and a chain storage layer, enabling neighbor ID (Identity) intervals stored in each layer to be different, and according to the degree change of a target vertex, carrying out random walk acceleration on the target vertex; dispersing and storing neighbors in different layers through a cross-layer migration mechanism; dividing neighbor information of the target vertex into a plurality of independent partitions, and independently constructing an alias table for each partition; a DPST is constructed for each target vertex, and one node maintains one partition to accumulate and add all neighbor weight values; when the neighbor weight of the target vertex changes, modifying the alias table of the changed partition, and updating the DPST; resampling is started from the position where the target vertex appears for the first time in all the migration sequences, and a sampling mode is selected according to the size relation between the weight skew factor of the target vertex and the threshold value. According to the invention, the random walk speed can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of graph computing and stream data processing, and more particularly, relates to a random walk acceleration method for a stream graph. BACKGROUND

[0002] With the explosive growth of global data, traditional traversal graph algorithms face performance bottlenecks in processing large-scale graph data. In contrast, random walks have been widely used in personalized recommendation, relationship modeling and other tasks due to their efficient sampling characteristics, and have been deployed in actual systems by enterprises such as Google and Alibaba. However, existing random walk methods are mostly based on static graphs, which are difficult to adapt to the changing structure of stream graphs in reality. According to the prediction of the International Data Corporation (IDC), the proportion of real-time stream data will reach 78% in 2028, prompting a shift from batch processing to real-time computing. Taking e-commerce fraud detection as an example, thousands of edges are added to the transaction graph every second. If the walk path cannot be updated in time, the accuracy of abnormal path recognition will decrease by 17.07%. In the BitcoinAlpha trust network, the link prediction performance decreases by 18.5% when the walk fails to reflect the structural changes in real time. Similar challenges exist in weather forecasting, product recommendation, and large model retrieval enhancement scenarios. Therefore, developing a random walk acceleration method for stream graphs with real-time structure response and path update capabilities is of great significance to ensure the accuracy and real-time performance of downstream tasks.

[0003] To this end, a random walk system in a stream graph needs to meet three core capabilities: real-time maintenance of vertex neighbor information, dynamic reconstruction of sampling space, and rapid repair of walk paths affected by structural changes. However, current random walk systems have deficiencies in these three aspects.

[0004] First, in terms of vertex neighbor information storage structure design, existing systems do not support the sparse access pattern relied on by random walks well. Current solutions are mostly designed for deterministic graph algorithms, and their storage models are difficult to adapt to the single-point random access characteristics of random walks. Specifically, although the variant based on compressed sparse rows has sequential memory layout, it optimizes range queries, but requires a lot of data migration in insertion / deletion operations, resulting in high update overhead; the adjacency list structure supports flexible updates, but requires linear traversal of the linked list, resulting in high random access delay and low cache hit rate; the tree structure has concurrency and isolation capabilities, but the poor memory locality caused by hierarchical jumps makes it unsuitable for low-latency access; the hybrid structure tries to balance access efficiency through multi-level structure, but still shows significant fluctuations in the walk scenario. Therefore, existing storage modes lack coordination between updates and queries, making it difficult to support high-frequency access random walk tasks.

[0005] Secondly, the sampling mechanism is difficult to efficiently adapt to the dynamic evolution of the graph structure. Although rejection sampling has low spatial complexity and does not need to construct an index, when the edge weight distribution is uneven, the low acceptance rate leads to low efficiency; alias sampling and inverse transform sampling need to construct a global index (such as an alias table, a prefix sum), and when the neighbor relationship frequently changes, the index needs to be constantly reconstructed, and the maintenance overhead is linearly related to the vertex degree; the reservoir sampling avoids the index reconstruction overhead, but needs to traverse all adjacent edges to generate a candidate set, and in high-order nodes or delay-sensitive tasks, the performance bottleneck is significant. It can be seen that the current method has a structural contradiction between static index and dynamic graph evolution, and it is urgent to design a sampling mechanism with incremental update capability to reduce the reconstruction cost.

[0006] Finally, the rapid repair of abnormal walk paths is still one of the key challenges in the streaming graph random walk system. Since structural changes (such as edge deletion or attribute modification) can cause existing walk paths to fail, if they cannot be repaired in time, it will seriously affect the real-time performance of the system and the accuracy of the results. The current main coping strategies include: the full re-sampling method, although simple to implement, has large computational overhead and serious redundancy, and is difficult to meet the performance requirements of high-frequency update scenarios; the tree index method relies on path encoding and pruning strategies to optimize path maintenance, but its level jump and decoding process has large overhead, and is difficult to meet the performance requirements of sub-millisecond response; the append storage simplifies path maintenance through log recording, but lacks precise positioning ability and needs to scan the full amount of historical data to repair the path. The above methods have not established an efficient index mechanism to support rapid positioning and local repair, which has become a core bottleneck restricting the performance improvement of the system in large-scale streaming graph scenarios.

[0007] In summary, the existing streaming graph random walk system is not mature in the design of storage structure, dynamic sampling mechanism and walk path repair capability, which seriously restricts its real-time processing capability. In order to meet the actual application requirements of high throughput and low delay, it is urgent to make a systematic breakthrough in the cooperative optimization of storage and sampling mechanism, the design of update strategy and the efficiency of walk path repair. SUMMARY

[0008] In view of the above defects or improvement needs of the prior art, the present application provides a streaming graph-oriented random walk acceleration method, which aims to provide a method capable of accelerating the streaming graph-oriented random walk.

[0009] To achieve the above-mentioned purpose, according to one aspect of the present application, a streaming graph-oriented random walk acceleration method is provided, comprising:

[0010] The vertex information is stored by using a hierarchical graph storage architecture composed of a basic layer, a dynamic expansion layer and a chain storage layer. The basic layer adopts a vertex block structure. Each target vertex block includes a high-level data address pointer for pointing to an SPMA of the dynamic expansion layer or a chain block adjacency table of the chain storage layer, and a linear neighbor container for storing the first L neighbor information in ascending order of neighbor vertex ID. The dynamic expansion layer adopts a compressed memory array SPMA structure. Each SPMA is used for storing the (L+1)th to A-th neighbor information of a vertex in ascending order of neighbor vertex ID. The chain storage layer adopts a chain block adjacency table structure. Each chain block adjacency table is used for storing the (A+1)th and subsequent neighbor information of a vertex in ascending order of neighbor vertex ID. According to the vertex degree of the target vertex to be stored, when the vertex degree exceeds the threshold L of the basic layer or the threshold A of the dynamic expansion layer, a cross-layer migration mechanism is triggered. According to the high-level data address pointer, the neighbor information of the neighbor exceeding the threshold is migrated to the dynamic expansion layer or the chain storage layer in sequence.

[0011] The neighbor information of the target vertex is divided into multiple fixed-size partitions without vertex overlap. An alias table is independently constructed for each partition. The neighbor weight values of each partition are accumulated to form a leaf node. All leaf nodes are organized into a balanced binary tree structure as a dynamic prefix-sum tree (DPST) of the target vertex. When the neighbor weight of the target vertex changes, the alias table of the changed partition is modified. In the DPST, the value of the parent node is updated recursively along the path from the leaf node corresponding to the changed partition.

[0012] The position where the target vertex first appears in each walk sequence is determined. The corresponding walk sequence is updated by resampling from each first appearance position. When the weight skew factor of the target vertex is lower than a preset threshold, a rejection sampling method is used. When the weight skew factor exceeds the preset threshold, a partition alias sampling method is used. The weight skew factor is the ratio of the maximum weight value to the average value among all neighbors of the target vertex. The partition alias sampling method is as follows: a partition is selected by inverse transformation sampling according to the current DPST of the target vertex. Partition alias sampling is performed in the partition.

[0013] Further, when the vertex degree changes, a lightweight lock mechanism is used to update each vertex block in the order of storing neighbor information first and updating the vertex degree second.

[0014] Further, the implementation of querying and inserting a neighbor vertex in the SPMA of the target vertex in the dynamic expansion layer is as follows:

[0015] A linear interpolation method is used to preliminarily predict the position pos of the neighbor vertex ID to be inserted in the SPMA. Wherein, minKey and maxKey represent the minimum and maximum of the neighbor vertex IDs in the current SPMA, size is the total capacity of the SPMA of the target vertex; target represents the neighbor vertex ID to be inserted;

[0016] A symmetric window is constructed with the position pos as the center, and the window size is defined as window_size=log2size, and the window interval is I=[pos-window_size / 2,pos+window_size / 2]. In the window, from pos, bidirectional scanning is performed in the left and right directions respectively until the first non-empty element base_elem or the window boundary is encountered, and the base_elem or the window boundary corresponds to the neighbor ID, which is recorded as base.

[0017] The size of target and base is compared, if target=base, it indicates that the neighbor vertex ID to be inserted already exists, and no insertion is performed, otherwise, the initialized search interval [low, high]=[0, size-1] is updated: if target<base, the search interval is updated to [low, base-1]; if target>base, the search interval is updated to [base+1, high]; binary search is performed in the updated search interval to determine whether to insert and the insertion position.

[0018] Further, the implementation method of inserting or deleting the neighbor vertex in the chain block adjacency list of the target vertex in the chain storage layer is:

[0019] Each chain block adjacency list includes multiple adjacency blocks, each adjacency block uses continuous memory layout inside, and stores neighbor IDs in strictly increasing order, and the block header of each adjacency block stores the first neighbor ID and the number of valid elements count.

[0020] According to the skip list index of the hierarchical navigation structure, the ID of the neighbor vertex to be inserted or deleted is compared with the index ID at each level in size until the adjacency block where the neighbor vertex to be inserted or deleted should be located is located, which is the target adjacency block, the insertion or deletion position is determined in the block, and the count stored in the block header of the target block is updated.

[0021] Further, the total number of partitions k of the partition alias table is:

[0022]

[0023] Where, N(v) represents the neighbor set of the target vertex v, |N(v)| represents the number of neighbors in N(v), and ChunkSize is the partition size.

[0024] Further, the preset threshold is determined in the following manner:

[0025] A linear relationship model between the time cost and the weight bias factor η of the partition alias sampling mode and the rejection sampling mode is constructed:

[0026] t1=α1η+β1

[0027] t2=α2η+β2

[0028] In the formula, max(W v ) represents the maximum weight value in all neighbors of the target vertex v, avg(W v ) is the average value of all neighbor weights of the target vertex v; t1 represents the predicted total time cost required for performing the partition alias sampling, including the construction of the partition alias table, the construction of the DPST and the sampling process; t2 represents the predicted time cost of performing the rejection sampling;

[0029] The parameters α1, α2, β1 and β2 are fitted by the least square method in the offline training stage to minimize the sum of squares of errors between the predicted value and the actual observed value;

[0030] The critical threshold η0 is calculated as: η0 is the preset threshold.

[0031] Further, the target vertex first appears in the position of each walk sequence in the following manner:

[0032] According to the first index in the double inverted index, the walk sequence in which the target vertex is located is located, and according to the second index in the double inverted index, the position where the target vertex first appears in the walk sequence is located, wherein the first index is the mapping relationship from each target vertex to the walk sequence in which it participates; the second index is the first appearance position of each target vertex in the walk sequence.

[0033] According to another aspect of the present application, an electronic device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method as described above when executing the computer program.

[0034] According to another aspect of the present application, a computer readable storage medium is provided, which comprises a stored computer program, wherein the computer program controls the device where the storage medium is located to execute the steps of the method as described above when the computer program is run by a processor.

[0035] According to another aspect of the present application, a computer program product is provided, comprising a computer program or instructions, which implement the steps of the method as described above when executed by a processor.

[0036] Overall, compared with the prior art, the technical scheme provided by the present application has the following beneficial effects:

[0037] 1. The present application proposes a random walk acceleration method for streaming graph, in the design of data storage structure, a hierarchical graph storage architecture based on cross-layer migration mechanism is proposed, the neighbor ID interval stored in each layer is different, according to the degree change of the target vertex, the neighbor is dispersedly stored in different layers through the cross-layer migration mechanism, which effectively improves the access locality of neighbor information and the adaptive ability under dynamic evolution, while ensuring high-frequency update, it reduces the query delay. In terms of sampling efficiency, an adaptive hybrid sampling strategy combined with a cost-aware mechanism is proposed, first, a partition alias table is proposed and a DPST is constructed for the target vertex, when the neighbor weight of the target vertex changes, the alias table of the changed partition is modified, and the DPST is updated locally, on this basis, when the weight skew factor of the target vertex is lower than the preset threshold, the rejection sampling method is used, and when the weight skew factor of the target vertex is higher than the preset threshold, the partition alias sampling method is used based on the DPST. This mechanism significantly reduces the maintenance cost of the sampling index, dynamically responds to the change of the adjacent weight distribution, and improves the overall sampling throughput. In summary, the present application realizes the comprehensive optimization of key links such as storage and sampling in the streaming graph environment, has good scalability, real-time performance and system efficiency, and is suitable for high-performance random walk calculation tasks under large-scale dynamic graph data.

[0038] 2. The present application also proposes a determination method for the position of the first occurrence of the target vertex in each walk sequence in the path maintenance aspect, specifically: according to the first index in the double inverted index, the walk sequence in which the target vertex is located is located, and according to the second index in the double inverted index, the position of the first occurrence of the target vertex in the walk sequence is located, wherein the first index is the mapping relationship from each target vertex to the walk sequence it participates in; the second index is the first occurrence position of each target vertex in the walk sequence. This incremental update mechanism realizes accurate identification and local repair of abnormal paths through double inverted index, avoids the computational overhead caused by global resampling, and enhances the stability and scalability of the system.

[0039] 3. The present application also proposes a compressed memory array structure (SPMA) based on search optimization, which is used for efficiently storing its neighbor information, that is, in order to improve the query and insertion efficiency, an interpolation-guided window binary search algorithm (IWBS) is introduced in the dynamic expansion layer, which significantly shortens the query range by combining predictive positioning and local window search.

[0040] 4. The application also provides a search-optimized chain block adjacency list, in particular, a composite structure of a chain block adjacency list and a skip list index, the core idea of which is to realize update localization through data blocking and to establish efficient navigation between blocks by using a skip list to support fast range query and random access, reduce query complexity and improve cache locality. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 A flow graph-oriented random walk acceleration method flow chart is provided for the embodiment of the application.

[0042] Figure 2 A hierarchical graph storage structure diagram is provided for the embodiment of the application.

[0043] Figure 3 A basic layer implementation in the hierarchical graph storage structure is provided for the embodiment of the application.

[0044] Figure 4 A dynamic expansion layer implementation in the hierarchical graph storage structure is provided for the embodiment of the application.

[0045] Figure 5 A chain storage layer implementation in the hierarchical graph storage structure is provided for the embodiment of the application.

[0046] Figure 6 A cross-layer migration mechanism execution flow is provided for the embodiment of the application.

[0047] Figure 7 A partition alias representation intention is provided for the embodiment of the application.

[0048] Figure 8 An incremental update process diagram of a partition alias table is provided for the embodiment of the application.

[0049] Figure 9 A cost-aware adaptive hybrid sampling strategy flow is provided for the embodiment of the application.

[0050] Figure 10 A double inverted index diagram is provided for the embodiment of the application.

[0051] Figure 11 A whole design architecture diagram of a flow graph-oriented incremental random walk acceleration method is provided for the embodiment of the application. DETAILED DESCRIPTION

[0052] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application. In addition, the technical features involved in the various embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0053] Embodiment one

[0054] A flow graph oriented random walk acceleration method, as shown in Figure 1 , comprises:

[0055] The vertex information is stored by using a layered graph storage architecture composed of a basic layer, a dynamic expansion layer and a chain storage layer. The basic layer uses a vertex block structure. Each target vertex vertex block includes a high-level data address pointer for pointing to the SPMA of the dynamic expansion layer or the chain block adjacency table of the chain storage layer, and a linear neighbor container for storing the first L neighbor information in ascending order of neighbor vertex ID. The dynamic expansion layer uses a compressed memory array SPMA structure. Each SPMA is used to store the L+1th to Ath neighbor information of a vertex in ascending order of neighbor vertex ID. The chain storage layer uses a chain block adjacency table structure. Each chain block adjacency table is used to store the A+1th and subsequent neighbor information of a vertex in ascending order of neighbor vertex ID. According to the vertex degree of the target vertex to be stored, when the vertex degree exceeds the threshold L of the basic layer or the threshold A of the dynamic expansion layer, a cross-layer migration mechanism is triggered. According to the high-level data address pointer, the neighbor information of the neighbor exceeding the threshold is migrated to the dynamic expansion layer or the chain storage layer with the constraint of order.

[0056] The neighbor information of the target vertex is divided into multiple fixed-size partitions without vertex overlap. An alias table is independently constructed for each partition. The neighbor weight values of each partition are accumulated and added to form a leaf node. All leaf nodes are organized as a balanced binary tree structure, which is used as a dynamic prefix sum tree DPST of the target vertex. When the neighbor weight of the target vertex changes, the alias table of the changed partition is modified. In the DPST, the value of the parent node is updated recursively upwards along the path from the leaf node corresponding to the changed partition.

[0057] The position of the target vertex first appearing in each walk sequence is determined, and resampling is started from each first appearing position to complete the update of the corresponding walk sequence, wherein when the weight skewness factor of the target vertex is lower than a preset threshold, a rejection sampling method is adopted, and when the weight skewness factor exceeds the preset threshold, a partition alias sampling method is adopted, and the weight skewness factor is the ratio of the maximum weight value to the average value in all neighbors of the target vertex; the partition alias sampling method is: according to the current DPST of the target vertex, a partition is selected by inverse transform sampling, and partition alias sampling is performed in the partition.

[0058] The embodiment proposes an efficient incremental random walk acceleration method, aiming to solve three core problems of low storage efficiency, large sampling overhead and redundant walk path maintenance from the system level. The method mainly includes the following core steps:

[0059] (1) Hierarchical graph storage based on cross-layer migration mechanism: a hierarchical graph storage architecture composed of a basic layer, a dynamic expansion layer and a chain storage layer is constructed, and through the cross-layer migration mechanism, the elastic storage and efficient access of neighbor information are supported, and high-frequency update and low-latency query are considered.

[0060] (2) Adaptive hybrid sampling based on cost perception: a partition alias sampling algorithm is proposed, combined with a local incremental index reconstruction mechanism to adapt to the dynamic changes of the graph structure; and a sampling cost prediction model is constructed based on linear regression, and a threshold-driven strategy switching mechanism is designed to realize dynamic adaptive selection of the sampling method.

[0061] (3) Incremental update based on double inverted index: using vertex-centered walk index and walk-centered position index, abnormal walk paths are quickly located and locally repaired, effectively avoiding global resampling, and improving path update efficiency and accuracy.

[0062] First, to address the problem that existing streaming graphs are difficult to balance between update and query, a hierarchical graph storage architecture based on cross-layer migration mechanism is proposed to balance between high-frequency update and low-latency access:

[0063] (1) Basic layer: a vertex block structure aligned with cache lines is used to store metadata and the first L neighbor information of each vertex. Each vertex block contains three types of substructures: basic metadata field (records vertex degree, weight skewness factor, etc.), high-layer data address pointer (points to SPMA or chain block adjacency list) and linear neighbor container (stores low-degree neighbors), to support fast and direct access to neighbors.

[0064] (2) Dynamic expansion layer: based on search-optimized compressed memory array (SPMA) construction, used to manage the L+1th to A-th neighbor information of each vertex. Combined with interpolation-guided windowed binary search algorithm (IWBS) and dynamic rebalancing mechanism, efficient insertion and query can be realized when the neighbor relationship frequently changes.

[0065] (3) Chain storage layer: adopts chain block adjacency list structure, used to manage the A+1th and subsequent neighbor information of each vertex, and introduces skip list index to support fast positioning of adjacency block, significantly reducing access delay and improving cache hit rate.

[0066] (4) Degree-driven cross-layer migration mechanism: according to the dynamic change of vertex degree, automatically adjust the distribution of neighbor information between different storage layers, construct local ordered data layout for walk task, improve access locality and adaptive performance in streaming environment.

[0067] Through this way of partition storage, local query can be performed during query, improving query efficiency and in turn improving update efficiency.

[0068] Secondly, to solve the problem of insufficient scalability and adaptability of existing sampling methods in streaming graph scenarios, an adaptive hybrid sampling strategy based on cost perception is proposed, which dynamically selects the optimal sampling mechanism to improve efficiency and reduce reconstruction overhead:

[0069] (1) Partition alias sampling algorithm: the adjacency list of the vertex is divided into several fixed-size partitions, and an independent alias table is constructed for each partition. Combined with the local incremental update mechanism supported by dynamic prefix sum tree (DPST), fast response to neighbor relationship changes can be realized, and the sampling index can be efficiently repaired without global reconstruction, thereby significantly reducing the sampling maintenance overhead in streaming graph environment.

[0070] (2) Linear regression-based sampling cost prediction model: Given that a single sampling strategy cannot effectively cope with the continuous changes in the distribution of adjacent edges in a streaming graph, a sampling strategy selection controller is proposed to achieve adaptive switching between multiple sampling methods. In this mechanism, the system integrates two sampling methods, partition alias sampling and rejection sampling. Specifically, when the weight distribution of adjacent edges is relatively smooth (low skew factor), rejection sampling has higher sampling efficiency due to fewer rejections and lower index overhead. However, when the skew degree is high, the efficiency of rejection sampling decreases significantly, and partition alias sampling has a stronger performance advantage, although it involves certain index reconstruction costs. Therefore, when the weight skew factor of a vertex is below a threshold, the rejection sampling strategy is preferred. When the skew factor exceeds the threshold, the system automatically switches to the partition alias sampling algorithm. This cost-aware mechanism effectively avoids the performance bottleneck caused by frequent global reconstruction and can adaptively balance sampling efficiency and index overhead according to data distribution, thereby improving overall sampling performance.

[0071] As a preference, the sampling costs of the two methods under different weight skew factors can be predicted by a pre-trained linear regression model, generating a judgment threshold for strategy switching. The determination method of the above preset threshold is as follows:

[0072] A linear relationship model between the time cost of partition alias sampling and rejection sampling and the weight skew factor η is constructed:

[0073] t1 = α1η + β1

[0074] t2 = α2η + β2

[0075] In the formula, max(W v ) represents the maximum weight value among all neighbors of the target vertex v, and avg(W v ) is the average value of all neighbor weights of the target vertex v; t1 represents the predicted total time cost of executing partition alias sampling, including the construction of the partition alias table, the construction of DPST, and the sampling process; t2 represents the predicted time cost of executing rejection sampling.

[0076] The parameters α1, α2, β1, and β2 are fitted by the least squares method in the offline training phase to minimize the sum of squared errors between the predicted values and the actual observed values.

[0077] The critical threshold η0 is calculated as: η0 is the preset threshold.

[0078] Finally, to address the issue of walk path invalidation caused by graph structure evolution, an incremental update mechanism based on dual inverted index is designed to quickly locate the affected path segments and achieve efficient and low-redundancy local repair:

[0079] (1)Dual inverted index structure: In the process of dynamic evolution, the neighbor relationship may change, which in turn causes part of the generated walk sequence to be invalid. Therefore, the system designs a dual inverted index structure to realize the rapid positioning and efficient repair of abnormal walks. The first index is a vertex-centered walk index, which establishes a mapping relationship between the vertex and the walk sequence it participates in, and is used to quickly identify the affected path. The second index is a walk-centered position index, which only records the first occurrence position of each vertex in the walk sequence, avoiding redundant storage, while meeting the positioning information required for path repair, significantly improving the index query efficiency.

[0080] (2)Incremental update mechanism of abnormal walks: When the system detects abnormal walks, it first accurately locates the affected walk sequence and its abnormal starting position using the dual inverted index, then performs local resampling from this position, and replaces the original segment with a new path, achieving accurate repair of abnormal walks and synchronous update of the index structure, thereby effectively avoiding the computational overhead and delay caused by full recalculation.

[0081] Therefore, the method of the embodiment effectively improves the access locality of neighbor information and the adaptive ability under dynamic evolution based on the hierarchical graph storage architecture of the cross-layer migration mechanism in the design of data structure, reduces the query delay while ensuring high-frequency updates. In terms of sampling efficiency, the adaptive hybrid sampling strategy combined with the cost-aware mechanism significantly reduces the maintenance cost of the sampling index, dynamically responds to changes in adjacency weight distribution, and improves the overall sampling throughput. In terms of path maintenance, the incremental update mechanism realizes accurate identification and local repair of abnormal paths through the dual inverted index, avoiding the computational overhead caused by global resampling, and enhancing the stability and scalability of the system. In summary, the embodiment realizes comprehensive optimization of key links such as storage, sampling, and path maintenance in a streaming graph environment, has good scalability, real-time performance, and system efficiency, and is suitable for high-performance random walk computation tasks on large-scale dynamic graph data.

[0082] In specific implementation, in terms of data management, the embodiment constructs a hierarchical graph storage structure based on a cross-layer migration mechanism, which adopts a hierarchical storage strategy to manage the vertex neighbor set in stages, as shown in Figure 2 . Specifically, the storage structure consists of a basic layer, a dynamic expansion layer, and a chain storage layer, which store neighbor information of different neighbor IDs. In addition, to improve the response capability of the system in dynamic scenarios, a cross-layer migration mechanism for random walk tasks is proposed, which can automatically adjust the storage location of the neighbor information according to the dynamic changes of the vertex degree, thereby significantly enhancing the query efficiency while ensuring the update performance, realizing the cooperative optimization of update and access.

[0083] The implementation of the basic layer is as follows Figure 3The base layer allocates a vertex block aligned with the cache line for each vertex to store the metadata of the vertex and the first L neighbors. The structure mainly consists of the following three core parts: (1) basic metadata field: used to record the basic information of the vertex, such as vertex degree, weight skew factor, etc.; (2) high-level data address pointer: used to point to the dynamic expansion layer or the chain storage layer, facilitating cross-layer access; (3) linear neighbor container: using the remaining space in the vertex block, the neighbor information of low-degree vertices is stored in a linear manner. When the vertex degree exceeds the threshold L of the base layer, the cross-layer migration mechanism will be triggered to automatically migrate the neighbor information exceeding the threshold to the dynamic expansion layer. When updating the vertex block, in order to ensure the consistency of the data in the block, a lightweight lock mechanism can be introduced to protect the update operation. The specific process follows the order of "writing neighbor information first, then updating degree information" to avoid the inconsistency problem caused by concurrent modification. This strategy not only effectively guarantees thread safety, but also takes into account the scalability of structure update and the simplicity of implementation.

[0084] The implementation of the dynamic expansion layer is shown in Figure 4 This layer is mainly used to manage the L+1th to the L+Dth neighbors of each vertex. For this part of neighbor information, a compressed memory array structure (SPMA) is designed to efficiently store the neighbor information. To improve query and insertion efficiency, the layer introduces an interpolation-guided window binary search algorithm (IWBS), which significantly shortens the query range by combining predictive positioning and local window search. IWBS contains two core steps:

[0085] First, perform the initial positioning of the interpolation-guided. Use linear interpolation to predict the possible position pos of the target key value target in SPMA, the calculation formula is as follows:

[0086]

[0087] Where minKey and maxKey represent the minimum and maximum values of the key values in the current SPMA, and size is the total capacity of SPMA. The initial query interval is [low, high] = [0, size-1].

[0088] Then, a bidirectional search strategy within the window is performed. A symmetric window is constructed with the predicted position pos as the center. The window size is defined as window_size = log2size. Thus, the window interval is obtained as I = [pos-window_size / 2, pos+window_size / 2]. Within the window, a bidirectional scan is performed from pos to the left and right directions respectively until the first non-empty element base_elem is encountered or the window boundary is reached. The bidirectional pinching strategy can locate the valid element in O(window_size) time, and the index of the valid element is recorded as base.

[0089] Next, the size of target and base is compared, and the search interval is updated. If target = base, it indicates that the element already exists, and repeated writing is avoided; if target < base, the interval is updated as [low, base-1]; if target > base, the interval is updated as [base+1, high]. Finally, a standard binary search is performed within the updated interval to determine whether to insert and the insertion position. If it is found in the process that target already exists, the insertion operation is also skipped.

[0090] Overall, IWBS effectively overcomes the access offset problem caused by empty slots in the sparse structure through the strategy of "interpolation prediction + local window correction", and balances the stability and efficiency in the high-frequency writing scenario. The method significantly improves the neighbor query and insertion performance of moderate vertices while maintaining logarithmic time complexity.

[0091] The implementation of the chain storage layer is shown in Figure 5 The layer is mainly used to manage the neighbor information of the A+1th and subsequent vertices. As a preferred embodiment, a composite structure of a chain block adjacency table and a skip list index is used. The core idea is to realize localized updating through data blocking and to use a skip list to establish efficient navigation between blocks to support fast range queries and random access, reduce query complexity, and improve cache locality.

[0092] A continuous memory layout is used within each data block to store neighbor key values in strictly increasing order. The block header contains metadata: headKey (first element key) for skip list navigation and count (number of valid elements) for update and query assistance. This design brings the following optimizations: (1) Local efficient update: after the target block is quickly located by the skip list, the insertion / deletion position is determined by binary search within the block, and only local elements need to be adjusted without global reconstruction. (2) Accelerate query access: the ordered nature within the block supports efficient binary search, combined with the hierarchical indexing mechanism of the skip list, to achieve logarithmic complexity of the search. At the same time, the continuous memory layout improves the cache hit rate and reduces random access delay.

[0093] Skip list exploits the order between data blocks to construct a hierarchical navigation structure: the bottom index forms a complete linked list, and the upper layer establishes a sparse index path through probabilistic sampling to achieve fast range positioning and jumping. In the insertion operation, the skip list first locates the target block, and then determines the insertion position through in-block search, right-shifts the elements and atomically updates the count to ensure the order and concurrent safety of the structure.

[0094] In summary, the chain storage layer effectively manages the highly vertex neighbor relationship through the design of "in-block order + skip list navigation", and balances the update efficiency, query performance and concurrent access ability, which is suitable for random walk applications in streaming graphs.

[0095] To maintain the global order of neighbor data in the dynamic evolution process of the graph, the embodiment proposes a degree-driven cross-layer migration mechanism that can adaptively migrate neighbor data between hierarchical graph storage structures according to the change of vertex degree. The execution process of the mechanism is shown in Figure 6 As shown in the figure, taking a newly inserted neighbor vertex v * as an example, first judge the interval range of the degree d of the source vertex after insertion, and decide the insertion strategy accordingly. When d≤L, directly perform ordered insertion in the vertex block, insert v * in ascending order to the appropriate position, and synchronously update the metadata information, without cross-layer operation. When L<d≤A, the cross-layer migration protocol needs to be triggered at this time to maintain the overall order. Specifically, if the maximum element v vmax in the vertex block is v * , directly insert v vmax into the SPMA and maintain the order; otherwise, first migrate v vmax to the SPMA and complete the insertion, and then insert v * into the vacancy vacated by the vertex block, and reorder the vertex block. When d>A, the vertex neighbor needs to be further migrated to the chain block adjacency table of the chain storage layer. At this time, the migration strategy is that if the maximum element v smax in the SPMA is v * , directly insert v * into the chain block adjacency table; otherwise, first migrate v smax to the chain block adjacency table, and complete the ordered insertion, and then insert v * into the SPMA to ensure that the data order between the chain block adjacency table and the SPMA is correctly connected.

[0096] The cross-layer migration mechanism dynamically selects the storage level according to the real-time change of the vertex degree, and through the element (i.e. neighbor ID) migration and order maintenance operation, effectively guarantees the global order of neighbor data in the hierarchical structure, and provides a structural basis for subsequent efficient query and update.

[0097] Regarding the sampling decision, the embodiment proposes an adaptive hybrid sampling strategy based on cost perception, aiming to effectively balance the contradiction between sampling efficiency and index maintenance overhead in the streaming graph scenario. First, a partition alias sampling algorithm is designed. This algorithm constructs an alias table divided by partition, and only updates the local partition affected by topology changes incrementally, avoiding frequent reconstruction of the global sampling index, and significantly reducing the index maintenance cost. Second, to realize the dynamic optimization selection of the sampling strategy, an intelligent sampling decision model based on cost perception is introduced. In the running stage, the sampling decision model can evaluate the cost of each sampling strategy in real time according to the current vertex state, and adaptively select the strategy with the lowest estimated overhead for execution, thereby dynamically adapting to the changes in the graph structure. Through the above strategy, the embodiment realizes real-time switching and resource efficient scheduling of the sampling strategy on the basis of ensuring the accuracy of sampling, and exhibits good real-time performance, efficiency and system stability in the high-frequency update and random walk tasks of the streaming graph, significantly improving the overall performance of the sampling module and the system throughput.

[0098] The partition alias representation intends as shown in Figure 7 The algorithm divides the neighbor set of a vertex into partitions of fixed size, and constructs a separate alias table for each partition. Each partition is logically independent of each other, and when the topology changes, only the affected partitions need to be updated incrementally, while the remaining partitions can directly reuse the original sampling probability distribution, thereby avoiding the high overhead of reconstructing the global sampling index. As a preferred embodiment, the total number of partition alias tables is as follows:

[0099]

[0100] where N(v) represents the neighbor set of vertex v, and ChunkSize is the partition size.

[0101] To further optimize the sampling performance, the partition alias table constructs a dynamic prefix sum tree (DPST) with a partition granularity. Assuming that there are k partitions, the DPST organizes the weight values of the k partitions into a balanced binary tree structure, where each node maintains the weight sum in its subtree range. Through the balanced binary tree characteristics, the following core operations can be completed in O(logk) time complexity: (1) weight update: dynamically update the weight sum of the nodes from bottom to top, maintain the balance of the tree, and ensure global consistency; (2) fast partition positioning: based on the in-order traversal sequence of the prefix sum, the target partition is quickly located through binary search, supporting O(logk) complexity partition selection operation; (3) incremental weight adjustment: through local subtree rotation and weight rebalancing mechanism, avoid the calculation overhead of full reconstruction.

[0102] The incremental update process of the partition alias table is as shown in Figure 8 The embodiment adopts a hybrid mechanism combining padding priority and end expansion when processing the insertion operation of the newly added neighbor of the vertex, so as to improve the space utilization and reduce the maintenance overhead. Specifically, for the new neighbor vertex of the current vertex, firstly, it is detected whether there is a partition that has not been filled in the existing neighbor set of the new neighbor vertex. If there is, the first partition with insertion space is selected preferentially, the new element is inserted into the partition, and the alias table corresponding to the partition and the weight accumulation value of the DPST are locally updated. If all the partitions have reached the capacity upper limit, the new element is inserted into the last partition in the append mode. Only when the last partition exceeds the preset ChunkSize, the expansion operation is triggered, that is, a new partition is created and the insertion is completed, and a new node is inserted into the balanced binary tree structure corresponding to the DPST, so as to continuously maintain the global weight distribution. For the deletion operation, the target element is directly located in the partition and removed. If other elements are retained in the partition after the deletion, only the alias table and the weight of the corresponding subtree in the DPST need to be locally updated; if the deletion operation causes the partition to be completely idle, the system removes the partition and combines the adjacent subtree nodes in the DPST, so as to maintain the compactness and balance of the tree structure. The strategy fully reuses the fragmented space generated by the deletion operation in the insertion process, effectively reduces the creation of redundant partitions, and at the same time, with the balance of the DPST, the calculation complexity of the weight update and the structure adjustment can be controlled within O (logk). Compared with the way of full reconstruction of the index in the traditional alias sampling, the partition alias sampling proposed in the embodiment adopts an incremental update strategy, which takes into account the update efficiency and resource utilization, and the time complexity of the overall reconstruction operation is O (logk+ChunkSize).

[0103] In the random walk process, the selection of the sampling strategy has a key influence on the overall performance, especially in the streaming graph scene where the graph structure and edge weight frequently change. The traditional method usually adopts a fixed single sampling method, which is difficult to fully exert the advantages of different sampling methods in different scenes. To overcome this deficiency, the embodiment proposes a cost-aware adaptive hybrid sampling decision, which can dynamically switch to the partition alias sampling or the rejection sampling strategy according to the real-time sampling cost, so as to realize the optimal sampling effect. The overall decision flow of the mechanism is as shown in Figure 9 .

[0104] The embodiment found in the research that the efficiency of the partition alias sampling and the rejection sampling is closely related to the edge weight distribution characteristics of the vertex. To quantitatively describe the distribution characteristics, the weight skewness factor η is proposed, which is used to measure the concentration degree of the edge weight of the vertex. The calculation formula is as follows:

[0105]

[0106] max(Wv ) represents the maximum edge weight value in all out edges of vertex v, avg(W v ) is the average value of out edge weights. When η is close to 1, it indicates that the edge weight distribution is relatively uniform, and the larger the value of η, the more skewed the edge weight distribution.

[0107] Based on a large number of experimental observations, in the preprocessing stage, the running overhead of rejection sampling and partition alias sampling under different vertices is fitted and modeled respectively based on the linear regression method, thereby establishing a linear relationship model between the time cost of partition alias sampling and rejection sampling and η:

[0108] t1=α1η+β1

[0109] t2=α2η+β2

[0110] Wherein, t1 represents the total time cost required for performing partition alias sampling, including the construction of sampling index structure (such as partition alias table and DPST) and sampling process; t2 represents the expected time cost of performing rejection sampling. The parameters α1, α2, β1 and β2 in the model are fitted by least squares method in the offline training stage to minimize the sum of squared errors between the predicted value and the actual observed value.

[0111] The experimental results show that the model coefficients satisfy the condition: α1<α2, and α1 and β2 are close to 0. This relationship reveals that there is a critical threshold η0. When η is lower than the threshold, rejection sampling is better, and when η is higher than the threshold, partition alias sampling is more efficient. The critical threshold can be calculated by the following formula:

[0112]

[0113] In order to improve the accuracy and generalization ability of the model, the present application carries out 10 6 sampling experiments in the system preprocessing stage, and obtains the above model parameters by analyzing the historical sampling log, so as to realize accurate prediction of the actual sampling overhead.

[0114] Based on the above mechanism, the system can dynamically select the optimal sampling strategy according to the edge weight skew factor η value of the current vertex: when the value of η is high, partition alias sampling is adopted to avoid the full reconstruction overhead of sampling index in traditional method, and to reduce the frequent retry problem caused by rejection sampling; when the value of η is low, the rejection sampling mode is retained to utilize its high efficiency under uniform distribution and avoid redundant index construction.

[0115] The adaptive sampling mechanism effectively improves the response ability and resource utilization efficiency of the system in the streaming graph scenario, while ensuring the sampling accuracy, and significantly optimizes the overall execution performance of the random walk task.

[0116] It should be noted that the threshold value can also be determined by fitting other costs such as space cost.

[0117] Regarding the walk update, the change of the graph structure can cause the existing walk path to be invalid, affecting the accuracy of subsequent tasks. To achieve efficient and low-cost repair of abnormal walk paths, as a preferred embodiment, the present embodiment proposes a walk incremental update mechanism based on double inverted index, which can quickly locate and incrementally update the affected path.

[0118] The schematic diagram of the double inverted index is shown in Figure 10 The first index is a vertex-centered walk index, which is used to establish the mapping from vertex to walk sequence and quickly locate all walk paths containing a certain vertex. Its formal definition is as follows:

[0119]

[0120] Where w i represents the walk sequence containing vertex v k , represents the set of all walk sequences.

[0121] The second index is a walk-centered position index, which is used to record the first occurrence position of each vertex in the walk path, so as to quickly locate the affected point. Its formal definition is as follows:

[0122] pI i (v k )={(pos j )|v k ∈w i}

[0123] Where pos j represents the first occurrence position of vertex v k in walk path w i . By recording only the first occurrence position, redundant storage is avoided and the index query efficiency is improved.

[0124] When the graph update causes the transition probability of certain vertices to change, first locate all affected walk paths through the walk index, then use the position index to get the first occurrence position of the vertex in each path, and start local resampling from this position, avoiding full reconstruction of the entire path, thereby greatly reducing the computational overhead.

[0125] After locating all affected walk paths, a MAV (Map of Affected Vertices) is constructed, which is defined as follows:

[0126] MAV={(w,(v minp min ))

[0127] where w is the affected walk, v min is the first affected vertex in the path, p min is the first occurrence of the vertex in the path. With the MAV structure, local resampling can be started from p min without reconstructing the entire walk sequence, while the index structure is updated synchronously to ensure index consistency and sampling correctness.

[0128] In summary, the walk incremental update mechanism based on dual inverted index realizes the rapid positioning and accurate repair of abnormal walk paths by constructing a composite structure of "walk index + position index". Compared with traditional methods, this mechanism significantly reduces the consumption of computing resources and improves the update efficiency of random walks in streaming graph scenarios.

[0129] The method of the embodiment involves a comprehensive graph as shown in Figure 11 .

[0130] The query interface module serves as the unified entrance of the system to provide standardized and highly available API interfaces, facilitating users to flexibly configure parameters and efficiently obtain random walk results. The interface module proposed in the embodiment supports users to customize the following core parameters: (1) initial vertex set: supporting specifying a single vertex, multiple vertices, or generating a starting point set based on attribute filtering; (2) termination condition: such as maximum step length or termination probability, used to control the length of the walk path; (3) walk model parameters: such as sampling times, jump probability, etc., used to refine the walk strategy.

[0131] The module has a flexible algorithm container mechanism built-in, which can dynamically load and execute mainstream random walk algorithms such as DeepWalk and Node2Vec, and has good expansion ability. The walk results are output in the form of structured data stream, supporting streaming return and real-time processing, which can seamlessly connect downstream tasks such as node classification and relationship prediction, meeting the needs of online learning and large-scale graph analysis.

[0132] It should be noted that the method of the embodiment aims to improve the acceleration of the walk sequence update of the streaming graph, and solves a technical problem. As to the specific scene application, for example, (1) in the financial risk control scene, the vertex in the method means a user, a device, an IP address, or a transaction account, etc.; the edge means an interaction event between two objects, such as a transfer, a login, a receipt, a comment, etc.; the edge weight means an interaction frequency, an amount size, or a risk level, etc.; the edge insertion operation involved in the method represents a new transaction or interaction behavior (such as a new order, a new login); the edge deletion operation involved in the method represents an event invalidation or cancellation (such as order cancellation); and the edge weight change involved in the method represents a transaction amount fluctuation or a risk score model update, etc.; (2) in the social network analysis scene, the vertex in the method means a user, an account, or a group, etc.; the edge means a follow, a like, a forward, or a chat, etc.; the edge weight means an interaction intensity (such as the number of comments), an intimacy (such as the number of common friends), or a content similarity, etc.; the edge insertion involved in the method represents a new follow, a new private message, or a new comment, etc.; the edge deletion operation involved in the method represents a cancel follow or a deletion record, etc.; and the edge weight change involved in the method represents a change in interaction frequency over time or a change in common interest, etc.

[0133] Embodiment Two

[0134] The application also relates to an electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the above method when executing the computer program.

[0135] The electronic device can be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The processor can be a central processing unit (CPU), and can also be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The memory can be used to store a computer program and / or a module, and the processor can implement various functions of the electronic device by running or executing the computer program and / or the module stored in the memory, and by calling data stored in the memory.

[0136] The related technical solutions are the same as above, and will not be described again here.

[0137] Embodiment Three

[0138] The application also relates to a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the above method.

[0139] Specifically, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.

[0140] The related technical solutions are the same as above, and will not be repeated here.

[0141] Embodiment Four

[0142] The embodiment of the application provides a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of the method of the above embodiment of the application.

[0143] The related technical solutions are the same as above, and will not be repeated here.

[0144] Those skilled in the art can easily understand that the above description is only the preferred embodiment of the application, and is not intended to limit the application. Any modification, equivalent replacement and improvement made within the spirit and principle of the application shall be included in the protection scope of the application.

Claims

1. A method for accelerating random walk on a stream graph, the method comprising: The application comprises the following: The vertex information is stored by using a layered graph storage architecture composed of a basic layer, a dynamic expansion layer and a chain storage layer, wherein the basic layer adopts a vertex block structure, each vertex block of a target vertex comprises a high-level data address pointer for pointing to a compressed memory array SPMA of the dynamic expansion layer or a chain block adjacency list of the chain storage layer, and a linear neighbor container for storing the first L neighbor information in ascending order of neighbor vertex ID; the dynamic expansion layer adopts an SPMA structure, each SPMA is used for storing the (L+1)th to A-th neighbor information of a vertex in ascending order of neighbor vertex ID; the chain storage layer adopts a chain block adjacency list structure, each adjacency list is used for storing the (A+1)th and subsequent neighbor information of a vertex in ascending order of neighbor vertex ID; according to the vertex degree of a target vertex to be stored, when the vertex degree exceeds a threshold L or a threshold A, a cross-layer migration mechanism is triggered, and the neighbor information of the part of neighbors exceeding the threshold is migrated to the dynamic expansion layer or the chain storage layer in sequence as a constraint according to the high-level data address pointer; The neighbor information of the target vertex is divided into multiple fixed-size partitions without vertex overlap, an alias table is independently constructed for each partition, all neighbor weight values of each partition are accumulated to form a leaf node, and all leaf nodes are organized into a balanced binary tree structure as a dynamic prefix sum tree DPST of the target vertex; when the neighbor weight of the target vertex changes, the alias table of the changed partition is modified, and the parent node value is updated recursively along the path upwards from the leaf node corresponding to the changed partition in the DPST; The position of the first occurrence of the target vertex in each walk sequence is determined, and the corresponding walk sequence is updated by resampling from each first occurrence position, wherein when the weight skew factor of the target vertex is lower than a preset threshold, a rejection sampling method is adopted, and when the weight skew factor exceeds the preset threshold, a partition alias sampling method is adopted, and the weight skew factor is the ratio of the maximum weight value to the average value in all neighbors of the target vertex; the partition alias sampling method is: according to the current DPST of the target vertex, a partition is selected by inverse transformation sampling, and partition alias sampling is performed in the partition based on the current alias table.

2. The random walk acceleration method of claim 1, wherein, When the vertex degree changes, a lightweight lock mechanism is used to update each vertex block in the order of storing neighbor information first and updating the vertex degree later.

3. The random walk acceleration method of claim 1, wherein, The implementation method of querying and inserting the neighbor vertex in the SPMA of the target vertex in the dynamic expansion layer is as follows: Using linear interpolation method, the position pos of the neighbor vertex ID to be inserted in the SPMA is preliminarily predicted; wherein, minKey and maxKey respectively represent the minimum value and the maximum value of the neighbor vertex ID in the current SPMA, size is the total capacity of the SPMA of the target vertex; and target represents the neighbor vertex ID to be inserted. A symmetric window is constructed with the position pos as the center, the window size is defined as window_size=log2size, and the window interval is I=[pos-window_size / 2,pos+window_size / 2]; in the window, bidirectional scanning is performed from pos to the left and right directions respectively until the first non-empty element base_elem or the window boundary is encountered, and the neighbor ID corresponding to base_elem or the window boundary is an effective element, which is recorded as base. Comparing the size of target and base, if target = base, it means that the neighbor vertex ID to be inserted already exists, and no insertion is performed, otherwise, the initialized search interval [low, high] = [0, size-1] is updated: if target < base, the search interval is updated to [low, base-1]; if target > base, the search interval is updated to [base+1, high]; binary search is performed in the updated search interval to determine whether to insert and the insertion position.

4. The random walk acceleration method of claim 1, wherein, The implementation of inserting or deleting a neighbor vertex in the chain block adjacency list of the target vertex in the chain storage layer is as follows: Each chain block adjacency list includes a plurality of adjacency blocks, each of which uses continuous memory layout to store neighbor IDs in strictly increasing order, and the block header of each adjacency block stores the first neighbor ID and the number of valid elements count; According to the skip list index of the hierarchical navigation structure, the ID of the neighbor vertex to be inserted or deleted is compared with the index ID at each level in size until the adjacency block where the neighbor vertex to be inserted or deleted should be located is located as the target adjacency block, and the insertion or deletion position is determined in the block and the count stored in the block header is updated.

5. The random walk acceleration method of claim 1, wherein, The total number of partitions k of the partition alias table is: Wherein, N(v) represents the neighbor set of the target vertex v, |N(v)| represents the number of neighbors in N(v), and ChunkSize is the partition size.

6. The random walk acceleration method of claim 1, wherein, The determination method of the preset threshold is: A linear relationship model between the time cost and the weight skew factor η of the partition alias sampling method and the rejection sampling method is constructed: t1 = α1η + β1 t2 = α2η + β2 In the formula, max(W v ) represents the maximum weight value in all neighbors of the target vertex v, avg(W v ) is the average value of all neighbor weights of the target vertex v; t1 represents the total predicted time cost required for performing partition alias sampling, including the construction of the partition alias table, the construction of the DPST, and the sampling process; t2 represents the predicted time cost of performing rejection sampling; The parameters α1, α2, β1 and β2 are fitted by least squares method in the offline training stage to minimize the sum of squared errors between the predicted value and the actual observed value; The critical threshold η0 is calculated as: η0 is the preset threshold.

7. The random walk acceleration method of claim 1, wherein, The determination method of the position where the target vertex first appears in each walk sequence is: According to the first index in the double inverted index, the walk sequence where the target vertex is located is located, and according to the second index in the double inverted index, the position where the target vertex first appears in the walk sequence is located, wherein the first index is the mapping relationship from each target vertex to the walk sequence it participates in; the second index is the first appearance position of each target vertex in the walk sequence. 8.An electronic device comprising a memory and a processor, the memory storing a computer program, wherein, The processor executes the computer program to realize the steps of the method of any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored computer program, wherein when the computer program is run by the processor, the device where the storage medium is located is controlled to execute the steps of the method of any one of claims 1 to 7.

10. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to realize the steps of the method of any one of claims 1 to 7.

Citation Information

Cited By

  • Fine-grained resource access control method based on ACL (access control list)

    CN121256832A

  • Multi-layer memory management method and device, storage medium and electronic equipment

    CN121957911A