Binary counting summary method, device and computer equipment based on graph data stream

By using two-dimensional array summary structure and hash function processing in the graph data stream, the problem that traditional abstract methods cannot handle binary relationships is solved, efficient access and weight calculation of graph data streams are realized, and the scalability of the system is improved and processing capabilities.

CN114722242BActive Publication Date: 2024-11-22NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210248361.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2024-11-22
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

The traditional counting summary method cannot effectively process binary relationships in graph data streams, especially in computer systems with limited storage and processing capabilities, and cannot apply the access operation of graph data streams.

Method used

Using a two-dimensional array summary structure based on graph data flow, the source vertex and destination vertex of the weighted directed edge are calculated by two hash functions to obtain the row index and column index of the bucket, and the counter is updated using algebra and rules. Implement the construction and query of binary counting digests.

Benefits of technology

It realizes online insertion and query of weighted directed edges of graph data flow, supports flexible access operations, and approximate calculation of weight results through algebra and weighted algebra and two types of aggregation operators, improving processing scalability and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114722242B_ABST
    Figure CN114722242B_ABST
Patent Text Reader

Abstract

The present application relates to a binary counting summary method, device, computer equipment and storage medium based on graph data stream. The method comprises: constructing a two-dimensional array summary structure; inserting weighted directed edges into the two-dimensional array summary structure, using two hash functions to respectively calculate the source vertex and destination vertex of the weighted directed edge, obtaining the row index and column index of the bucket of the weighted directed edge, then finding the corresponding bucket in the two-dimensional array summary structure, updating the counter of the corresponding bucket using the algebraic sum rule and the weighted algebraic sum rule, obtaining the updated two-dimensional array summary structure; respectively calculating the weight prediction value of the counter of the updated bucket according to the algebraic sum rule and the weighted algebraic sum rule, and updating the updated two-dimensional array summary structure using the obtained weight prediction value of the directed edge, obtaining the binary counting summary. The present method can realize the graph data stream access of binary relations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a binary counting summary method, apparatus, computer equipment and storage medium based on graph data stream. Background Art

[0002] With the development of network communication technology, graph data streams have emerged. Graph data streams are a general data stream model that represents an infinite sequence of data records that continue to arrive, and each data record corresponds to a weighted directed edge in the graph. Many data streams in the field of network communication can be classified as graph data streams. For example, a network flow in a computer network corresponds to a data transmission from a source host to a specific destination host, and a message in a social network corresponds to an information interaction between two online accounts. Due to the limited storage and processing capabilities of computer systems, how to use economical storage space to calculate a fixed-size summary of a graph data stream has become an important means to improve the scalability of graph data stream processing.

[0003] Traditional counting summaries are composed of one-dimensional arrays and can only access one-dimensional relationships. That is, for a key-value pair, the input key is calculated through a hash function, a random position of the array is output, and then the array element at that position is updated or queried. Graph data streams reflect the binary relationship between vertices, and each time a directed edge needs to be accessed instead of a one-dimensional input key. Therefore, traditional counting summaries are no longer applicable. Summary of the invention

[0004] Based on this, it is necessary to provide a binary counting summary method, device, computer equipment and storage medium based on graph data stream that can realize graph data stream access of binary relations in order to solve the above technical problems.

[0005] A binary counting summary method based on graph data stream, the method comprising:

[0006] Build a two-dimensional array summary structure; the two-dimensional array summary structure contains multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter;

[0007] Insert weighted directed edges into the two-dimensional array summary structure, use two hash functions to calculate the source vertex and destination vertex of the weighted directed edge respectively, and obtain the row index and column index of the bucket of the weighted directed edge;

[0008] Find the corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, update the counter of the corresponding bucket by using the algebraic sum rule and the weighted algebraic sum rule, and obtain the updated two-dimensional array summary structure;

[0009] The source vertex and the destination vertex of the directed edge of the updated two-dimensional array summary structure are calculated according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; the weight prediction value of the counter of the updated bucket is calculated according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge;

[0010] The updated two-dimensional array summary structure is updated using the weight prediction values ​​of the directed edges to obtain a binary count summary.

[0011] In one embodiment, the counter of the corresponding bucket is updated by using the algebraic sum rule and the weighted algebraic sum rule to obtain an updated two-dimensional array summary structure, including:

[0012] Using the algebraic sum rule and the weighted algebraic sum rule to update the counter of the corresponding bucket, to obtain the updated counter of the bucket;

[0013] Construct an updated two-dimensional array summary structure based on the updated bucket's counter.

[0014] In one embodiment, the algebraic sum rule is:

[0015] Among them, I[l] represents the lth two-dimensional array, Represents the index of the bucket, Row, No. In the bucket of column (t), s represents the source vertex, t represents the destination vertex, and c represents the weight.

[0016] In one embodiment, the weighted algebraic sum rule is:

[0017] Where, sign(s,t)=H r (s)×H c (t), sign(s,t)∈±1, sign(s,t) represents a random value calculated based on the directed edge, H r (·),H c (·) represents 2 hash functions.

[0018] In one embodiment, weight prediction values ​​are calculated for the counters of the buckets updated according to the algebraic sum rule and the weighted algebraic sum rule to obtain weight prediction values ​​for the directed edges, including:

[0019] For the counter of the bucket updated by the algebraic sum rule, the minimum value of each bucket is taken as the weight prediction value of the directed edge

[0020]

[0021] Among them, x represents the aggregate value of the bucket counter, u represents the source vertex of the directed edge, and v represents the destination vertex of the directed edge. Represents the row and column indices of the buckets corresponding to the directed edges, and k represents the number of two-dimensional arrays.

[0022] In one embodiment, for the counters of the buckets updated by the weighted algebraic sum rule, the median of each bucket is taken as the weight prediction value of the directed edge:

[0023]

[0024] A binary counting summary device based on graph data stream, the device comprising:

[0025] A two-dimensional array summary structure building module is used to build a two-dimensional array summary structure; the two-dimensional array summary structure contains multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter;

[0026] A weighted directed edge insertion module is used to insert a weighted directed edge into the two-dimensional array summary structure, and to calculate the source vertex and the destination vertex of the weighted directed edge respectively using two hash functions to obtain the row index and column index of the bucket of the weighted directed edge;

[0027] A two-dimensional array summary structure updating module is used to find a corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, and update the counter of the corresponding bucket by using the algebraic sum rule and the weighted algebraic sum rule to obtain an updated two-dimensional array summary structure;

[0028] The binary counting summary construction module is used to calculate the source vertex and destination vertex of the directed edge of the updated two-dimensional array summary structure according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; calculate the weight prediction value of the counter of the updated bucket according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge; and use the weight prediction value of the directed edge to update the updated two-dimensional array summary structure to obtain the binary counting summary.

[0029] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] Build a two-dimensional array summary structure; the two-dimensional array summary structure contains multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter;

[0031] Insert weighted directed edges into the two-dimensional array summary structure, use two hash functions to calculate the source vertex and destination vertex of the weighted directed edge respectively, and obtain the row index and column index of the bucket of the weighted directed edge;

[0032] Find the corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, update the counter of the corresponding bucket by using the algebraic sum rule and the weighted algebraic sum rule, and obtain the updated two-dimensional array summary structure;

[0033] The source vertex and the destination vertex of the directed edge of the updated two-dimensional array summary structure are calculated according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; the weight prediction value of the counter of the updated bucket is calculated according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge;

[0034] The updated two-dimensional array summary structure is updated using the weight prediction values ​​of the directed edges to obtain a binary count summary.

[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0036] Build a two-dimensional array summary structure; the two-dimensional array summary structure contains multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter;

[0037] Insert weighted directed edges into the two-dimensional array summary structure, use two hash functions to calculate the source vertex and destination vertex of the weighted directed edge respectively, and obtain the row index and column index of the bucket of the weighted directed edge;

[0038] Find the corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, update the counter of the corresponding bucket by using the algebraic sum rule and the weighted algebraic sum rule, and obtain the updated two-dimensional array summary structure;

[0039] The source vertex and the destination vertex of the directed edge of the updated two-dimensional array summary structure are calculated according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; the weight prediction value of the counter of the updated bucket is calculated according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge;

[0040] The updated two-dimensional array summary structure is updated using the weight prediction values ​​of the directed edges to obtain a binary count summary.

[0041] The above-mentioned binary counting summary method, device, computer equipment and storage medium based on graph data flow first construct a two-dimensional array summary structure, each position in the array is called a "bucket", each bucket maintains a counter for aggregating the count value of the weighted directed edge, and each bucket can be accessed through row and column indexes in constant time; insert the weighted directed edge into the two-dimensional array summary structure, use two hash functions to calculate the source vertex and destination vertex of the weighted directed edge respectively, and obtain the row index and column index of the bucket of the weighted directed edge; find the corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, use the algebraic sum rule and the weighted algebraic sum rule to update the counter of the corresponding bucket, and obtain the updated two-dimensional array summary structure; according to the hash function, the updated two-dimensional array summary is calculated. The source vertex and the destination vertex of the directed edge of the structure are calculated to obtain the row index and column index of the bucket corresponding to the directed edge; the weight prediction value is calculated for the counter of the bucket after the algebraic sum rule and the weighted algebraic sum rule are respectively updated to obtain the weight prediction value of the directed edge; the updated two-dimensional array summary structure is updated using the weight prediction value of the directed edge to obtain the binary counting summary. The present invention constructs a two-dimensional array summary structure, and adds insertion operations and query operations to the two-dimensional array summary structure to obtain a binary counting summary, which can flexibly support the access of graph data streams, realizes the online insertion and query of weighted directed edges of graph data streams, and uses two types of aggregation operators, algebraic sum and weighted algebraic sum, to flexibly support the approximate calculation of weight results. When there are few hash conflicts when inserting directed edges, the weighted algebraic sum operator has higher precision than the algebraic sum operator. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flowchart of a binary counting summary method based on graph data flow in one embodiment;

[0043] Figure 2 A schematic diagram of a two-dimensional array summary structure in one embodiment;

[0044] Figure 3 is a structural block diagram of a binary counting summary device based on graph data stream in one embodiment;

[0045] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] In one embodiment, Figure 1As shown, a binary counting summary method based on graph data flow is provided, comprising the following steps:

[0048] Step 102, construct a two-dimensional array summary structure; the two-dimensional array summary structure contains multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter.

[0049] The summary structure is used to store graph data streams, which is a general data flow model that represents an infinite sequence of data records that continue to arrive. Many data flows in the field of network communications can be classified as graph data streams. For example, a network flow in a computer network corresponds to a data transmission from a source host to a specific destination host, and a message in a social network corresponds to an information interaction between two online accounts.

[0050] A two-dimensional array summary structure consists of k two-dimensional arrays, each of which consists of m r *m c Buckets (m r Corresponding to the number of rows in the current two-dimensional array, m c Corresponding to the number of columns of the current two-dimensional array, both are pre-configured parameters of the system). Each position in the array is called a "bucket". Each bucket maintains a counter for aggregating the count values ​​of weighted directed edges. Each bucket can be accessed by row and column indexes in constant time. The i-th two-dimensional array is represented by I[i], and the p-th row and q-th column in the two-dimensional array are represented by I[i](p,q) (p∈[1,m r ],q∈[1,m c ], p and q are both positive integers). The larger the number of rows or columns, the more storage resources a two-dimensional array requires. Each bucket contains a counter count. The two-dimensional array summary structure supports insert operations (insert a weighted directed edge into the two-dimensional array summary structure) and query operations (query the weight of a directed edge). Each two-dimensional array needs to select two hash functions to calculate the index of rows and columns. A two-dimensional array summary structure requires a total of 2k hash functions as a hash function family. ( represents the hash function for calculating row index, The hash function representing the computed column index, ∈[1,k]), is used for inserting and querying directed edges.

[0051] Step 104 , inserting a weighted directed edge into the two-dimensional array summary structure, using two hash functions to calculate the source vertex and the destination vertex of the weighted directed edge respectively, and obtaining the row index and column index of the bucket of the weighted directed edge.

[0052] Insert a weighted directed edge to a 2D array summary structure<s,t,v> When (s represents the source vertex, t represents the destination vertex, and c represents the weight), the hash function refers to a function that maps the key value of an element in the hash table to the storage location of the element. It is used to calculate the storage address of the element in the element table. The hash function family is used to calculate the row and column indexes of the weighted directed edge in the two-dimensional array summary structure. For k two-dimensional arrays, the index of the bucket of the weighted directed edge is marked as For the lth array, the bucket index is Representative Row, No. Column of barrels.

[0053] Step 106, find the corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, update the counter of the corresponding bucket using the algebraic sum rule and the weighted algebraic sum rule, and obtain the updated two-dimensional array summary structure.

[0054] Each position in the array is called a "bucket", and the position represents the number of rows and columns. According to the row index and column index of the bucket of the weighted directed edge, the position of the row index and column index in the two-dimensional array summary structure is found. This position is the bucket corresponding to the row index and column index of the bucket of the weighted directed edge. The algebraic and rule and the weighted algebraic and rule are used to update the counter of the corresponding bucket to obtain the updated two-dimensional array summary structure, that is, the two-dimensional array summary structure that supports insertion operations.

[0055] Step 108, calculate the source vertex and destination vertex of the directed edge of the updated two-dimensional array summary structure according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; calculate the weight prediction value of the counter of the updated bucket according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge; use the weight prediction value of the directed edge to update the updated two-dimensional array summary structure to obtain a binary counting summary.

[0056] The query operation is executed after the insertion operation is completed. The query operation is performed for any given directed edge.<u,v> , first use the hash function family to calculate the row and column indices of the updated two-dimensional array summary structure as

[0057]

[0058] The index of the lth bucket is Then, for the two insertion rules, the weight prediction values ​​of the counters of the updated buckets are calculated respectively. By calculating the weight prediction values ​​of the directed edges in the updated two-dimensional array summary structure, the graph data stream is convenient for querying directed edges.

[0059] In the above-mentioned binary counting summary method based on graph data flow, a two-dimensional array summary structure is first constructed. Each position in the array is called a "bucket". Each bucket maintains a counter for aggregating the count values ​​of weighted directed edges. Each bucket can be accessed through row and column indexes in constant time; weighted directed edges are inserted into the two-dimensional array summary structure, and two hash functions are used to calculate the source vertex and destination vertex of the weighted directed edge respectively to obtain the row index and column index of the bucket of the weighted directed edge; the corresponding bucket is found in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, and the counter of the corresponding bucket is updated using the algebraic and rule and the weighted algebraic and rule to obtain the updated two-dimensional array summary structure; the directed edge of the updated two-dimensional array summary structure is calculated according to the hash function. The source vertex and the destination vertex are calculated to obtain the row index and column index of the bucket corresponding to the directed edge; the weight prediction value is calculated for the counter of the bucket updated according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge; the updated two-dimensional array summary structure is updated using the weight prediction value of the directed edge to obtain the binary counting summary. The present invention constructs a two-dimensional array summary structure, and adds insertion operations and query operations to the two-dimensional array summary structure to obtain a binary counting summary, which can flexibly support the access of graph data streams, realizes the online insertion and query of weighted directed edges of graph data streams, and uses two types of aggregation operators, algebraic sum and weighted algebraic sum, to flexibly support the approximate calculation of weight results. When there are few hash conflicts when inserting directed edges, the weighted algebraic sum operator has higher accuracy than the algebraic sum operator.

[0060] In one embodiment, the counter of the corresponding bucket is updated by using the algebraic sum rule and the weighted algebraic sum rule to obtain an updated two-dimensional array summary structure, including:

[0061] Using the algebraic sum rule and the weighted algebraic sum rule to update the counter of the corresponding bucket, to obtain the updated counter of the bucket;

[0062] Construct an updated two-dimensional array summary structure based on the updated bucket's counter.

[0063] like Figure 2 As shown, the counters of the buckets in the two-dimensional array summary structure are updated using the algebraic sum operator and the weighted algebraic sum operator.

[0064] In one embodiment, the algebraic sum rule is:

[0065] Among them, I[l] represents the lth two-dimensional array, Represents the index of the bucket, Row, No. In the bucket of column (t), s represents the source vertex, t represents the destination vertex, and c represents the weight.

[0066] In one embodiment, the weighted algebraic sum rule is:

[0067] Where, sign(s,t)=H r (s)×H c (t), sign(s,t)∈±1, sign(s,t) represents a random value calculated based on the directed edge, H r (·),H c (·) represents 2 hash functions.

[0068] In one embodiment, weight prediction values ​​are calculated for the counters of the buckets updated according to the algebraic sum rule and the weighted algebraic sum rule to obtain weight prediction values ​​for the directed edges, including:

[0069] For the counter of the bucket updated by the algebraic sum rule, the minimum value of each bucket is taken as the weight prediction value of the directed edge

[0070]

[0071] Among them, x represents the aggregate value of the bucket counter, u represents the source vertex of the directed edge, and v represents the destination vertex of the directed edge. Represents the row and column indices of the buckets corresponding to the directed edges, and k represents the number of two-dimensional arrays.

[0072] If multiple directed edges are inserted into the same bucket, the bucket counter must not be less than the weight of any inserted edge, so the minimum value of each bucket is taken as the weight prediction value of the directed edge.

[0073] In one embodiment, for the counters of the buckets updated by the weighted algebraic sum rule, the median of each bucket is taken as the weight prediction value of the directed edge:

[0074]

[0075] For the counter of the bucket updated by weighted algebra and rule, the value of each bucket is close to the true value by offsetting the positive and negative signs, so the median is selected as the weight prediction value of the directed edge.

[0076] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0077] In one embodiment, Figure 3 As shown, a binary count summary device based on graph data flow is provided, comprising: a two-dimensional array summary structure construction module 302, a weighted directed edge insertion module 304, a two-dimensional array summary structure update module 306 and a binary count summary construction module 308, wherein:

[0078] A two-dimensional array summary structure building module 302 is used to build a two-dimensional array summary structure; the two-dimensional array summary structure includes multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter;

[0079] The weighted directed edge insertion module 304 is used to insert the weighted directed edge into the two-dimensional array summary structure, and use two hash functions to calculate the source vertex and the destination vertex of the weighted directed edge respectively to obtain the row index and column index of the bucket of the weighted directed edge;

[0080] A two-dimensional array summary structure updating module 306 is used to find a corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, and update the counter of the corresponding bucket by using the algebraic sum rule and the weighted algebraic sum rule to obtain an updated two-dimensional array summary structure;

[0081] The binary counting summary construction module 308 is used to calculate the source vertex and destination vertex of the directed edge of the updated two-dimensional array summary structure according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; calculate the weight prediction value of the counter of the updated bucket according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge; and use the weight prediction value of the directed edge to update the updated two-dimensional array summary structure to obtain the binary counting summary.

[0082] In one embodiment, the two-dimensional array summary structure updating module 306 is further used to update the counter of the corresponding bucket using the algebraic sum rule and the weighted algebraic sum rule to obtain an updated two-dimensional array summary structure, including:

[0083] Using the algebraic sum rule and the weighted algebraic sum rule to update the counter of the corresponding bucket, to obtain the updated counter of the bucket;

[0084] Construct an updated two-dimensional array summary structure based on the updated bucket's counter.

[0085] In one embodiment, the algebraic sum rule is:

[0086] Among them, I[l] represents the lth two-dimensional array, Represents the index of the bucket, Row, No. In the bucket of column (t), s represents the source vertex, t represents the destination vertex, and c represents the weight.

[0087] In one embodiment, the weighted algebraic sum rule is:

[0088] Where, sign(s,t)=H r (s)×H c (t), sign(s,t)∈±1, sign(s,t) represents a random value calculated based on the directed edge, H r (·),H c (·) represents 2 hash functions.

[0089] In one embodiment, the binary count summary construction module 308 is further used to calculate weight prediction values ​​of the counters of the buckets updated according to the algebraic sum rule and the weighted algebraic sum rule, respectively, to obtain weight prediction values ​​of the directed edges, including:

[0090] For the counter of the bucket updated by the algebraic sum rule, the minimum value of each bucket is taken as the weight prediction value of the directed edge

[0091]

[0092] Among them, x represents the aggregate value of the bucket counter, u represents the source vertex of the directed edge, and v represents the destination vertex of the directed edge. Represents the row and column indices of the buckets corresponding to the directed edges, and k represents the number of two-dimensional arrays.

[0093] In one embodiment, for the counters of the buckets updated by the weighted algebraic sum rule, the median of each bucket is taken as the weight prediction value of the directed edge:

[0094]

[0095] For the specific definition of a binary counting summary device based on graph data stream, please refer to the definition of a binary counting summary method based on graph data stream above, which will not be repeated here. Each module in the above-mentioned binary counting summary device based on graph data stream can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0096] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a binary counting summary method based on a graph data stream is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0097] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0098] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

[0099] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.

[0100] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0101] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0102] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A binary counting summarization method based on graph data stream, characterized in that: The method comprises: Construct a two-dimensional array summary structure; the two-dimensional array summary structure includes multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter; Inserting a weighted directed edge into the two-dimensional array summary structure, using two hash functions to respectively calculate the source vertex and the destination vertex of the weighted directed edge to obtain the row index and the column index of the bucket of the weighted directed edge; Finding a corresponding bucket in the two-dimensional array summary structure according to the row index and the column index of the bucket of the weighted directed edge, and updating the counter of the corresponding bucket by using an algebraic sum rule and a weighted algebraic sum rule to obtain an updated two-dimensional array summary structure; Calculating the source vertex and the destination vertex of the directed edge of the updated two-dimensional array summary structure according to the hash function to obtain the row index and the column index of the bucket corresponding to the directed edge; calculating the weight prediction value of the counter of the updated bucket according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge; The updated two-dimensional array summary structure is updated using the weight prediction value of the directed edge to obtain a binary count summary.

2. The method according to claim 1, characterized in that The counter of the corresponding bucket is updated by using the algebraic sum rule and the weighted algebraic sum rule to obtain an updated two-dimensional array summary structure, including: Using an algebraic sum rule and a weighted algebraic sum rule to update the counter of the corresponding bucket, to obtain an updated counter of the bucket; An updated two-dimensional array summary structure is constructed according to the updated counter of the bucket.

3. The method according to claim 2, characterized in that The method further comprises: The algebraic sum rule is: Among them, I[l] represents the lth two-dimensional array, Represents the index of the bucket, Row, No. The bucket of the column, s represents the source vertex, t represents the destination vertex, and c represents the weight.

4. The method according to claim 3, characterized in that The method further comprises: The weighted algebraic sum rule is: Where, sign(s,t)=H r (s)×H c (t), sign(s,t)∈±1, sign(s,t) represents a random value calculated based on the directed edge, H r (·),H c (·) represents 2 hash functions.

5. The method according to claim 4, characterized in that The weight prediction values ​​of the counters of the buckets updated according to the algebraic sum rule and the weighted algebraic sum rule are calculated respectively to obtain the weight prediction values ​​of the directed edges, including: For the counter of the bucket updated by the algebraic sum rule, the minimum value of each bucket is taken as the weight prediction value of the directed edge Among them, x represents the aggregate value of the bucket counter, u represents the source vertex of the directed edge, and v represents the destination vertex of the directed edge. Represents the row and column indices of the buckets corresponding to the directed edges, and k represents the number of two-dimensional arrays.

6. The method according to claim 5, characterized in that The method further comprises: For the counter of the bucket updated by the weighted algebraic sum rule, the median of each bucket is taken as the weight prediction value of the directed edge 7. A binary counting summary device based on graph data stream, characterized in that: The device comprises: A two-dimensional array summary structure building module is used to build a two-dimensional array summary structure; the two-dimensional array summary structure includes multiple two-dimensional arrays; each position in the two-dimensional array is called a bucket, and each bucket maintains a counter; A weighted directed edge insertion module is used to insert a weighted directed edge into the two-dimensional array summary structure, and use two hash functions to calculate the source vertex and the destination vertex of the weighted directed edge respectively to obtain the row index and column index of the bucket of the weighted directed edge; A two-dimensional array summary structure updating module, used for finding a corresponding bucket in the two-dimensional array summary structure according to the row index and column index of the bucket of the weighted directed edge, and updating the counter of the corresponding bucket by using an algebraic sum rule and a weighted algebraic sum rule to obtain an updated two-dimensional array summary structure; A binary counting summary construction module is used to calculate the source vertex and destination vertex of the directed edge of the updated two-dimensional array summary structure according to the hash function to obtain the row index and column index of the bucket corresponding to the directed edge; calculate the weight prediction value of the counter of the bucket updated according to the algebraic sum rule and the weighted algebraic sum rule to obtain the weight prediction value of the directed edge; and update the updated two-dimensional array summary structure using the weight prediction value of the directed edge to obtain a binary counting summary.

8. The device according to claim 7, characterized in that The two-dimensional array summary structure updating module is also used to update the counter of the corresponding bucket using the algebraic sum rule and the weighted algebraic sum rule to obtain the updated bucket counter; and construct an updated two-dimensional array summary structure according to the updated bucket counter.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.