A timing diagram sampling method and system based on secure virtual machine container

By performing graph sampling based on neighbor discovery and user-defined functions asynchronously in parallel in a secure virtual machine container, the problem of insufficient real-time and accurate dynamic timing chart data sampling is solved, and an efficient, flexible and secure timing chart data sampling method is realized.

CN117193935BActive Publication Date: 2025-02-07ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311044209.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2025-02-07
Estimated Expiration
2043-08-18

AI Technical Summary

Technical Problem

When processing dynamic timing chart data, the sampling results are not real-time enough, and when considering the time dimension, the sampling results are not accurate and representative enough, the use of computing resources is not scientific and efficient enough, and the flexibility is lacking.

Method used

Using the timing diagram sampling method based on the secure virtual machine container, the user-provided UDF functions are obtained to generate the underlying code available for the secure virtual machine container, and the graph sampling based on neighbor discovery and UDF functions is performed in a coordinated and parallel manner in the secure virtual machine container, in real time Update the sampling results in the maintenance queue to realize streaming update graph data processing.

Benefits of technology

Real-time and accuracy of timing chart data sampling, improve the efficiency of computing resources, supports asynchronous parallel sampling, provides flexibility and security, and is suitable for real-time data processing of dynamic timing charts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117193935B_ABST
    Figure CN117193935B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for sampling a time sequence graph based on a secure virtual machine container, including: a client establishes a session with a management server, and initiates a graph sampling calculation request through the session, wherein the request parameters include a UDF function; a calculation server executes a calculation service, which uses CodeGen technology to convert the UDF function into the underlying code of a secure virtual machine container, and schedules the secure virtual machine container to asynchronously execute a sampling script; the required graph data comes from a data server; the sampling service maintains the real-time nature of the sampling result based on the graph data updated in a streaming manner before the client retrieves the sampling result. The present invention can respond to data change states in real time for sampling of time sequence graph data, can flexibly design data processing schemes during the sampling process, and can adapt to high throughput in big data scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed large-scale graph data processing, and in particular to a timing graph sampling method and system based on a secure virtual machine container. Background Art

[0002] With the development of the information age, human interaction based on information has become more and more common, which has objectively caused a sharp increase in the scale of data. Graphs can be used to model the associations between existing objects. It is a common method to use graph neural networks (GNNs) or traditional graph theory algorithms to train and reason based on these large-scale graph data to solve practical problems. Most graph data in real life are large in scale, and traditional graph theory algorithms usually use graph data sampling to simplify calculations. For GNNs, graph data sampling is also needed, and small batch training replaces full graph training. The small batch training technology of graphs is based on graph data sampling technology. Graph data sampling technology is referred to as graph sampling. It refers to sampling nodes and edges from some points in a fixed and static full graph based on some limited conditions. These nodes and edges form a subgraph, so graph sampling is also called subgraph sampling. The sampled subgraph is used as a small batch for subsequent processing, such as training or reasoning.

[0003] Traditional graph data sampling methods usually use batch processing to sample static graph data. However, in real-world scenarios such as financial transaction networks, graph data is usually not static, but real-time data that is always changing. This type of graph with real-time updates of nodes and edges is called a time series graph, also known as a dynamic graph. Therefore, there are some problems with sampling static graph data, such as the sampling results are not real-time enough, and the sampling results are not accurate and representative enough when considering the time dimension.

[0004] Existing graph sampling systems usually use a simple sampling process, alternating with other computing processes. The use of computing resources is not scientific and efficient, and the overall efficiency of the program is not high enough. In addition, the data processing scheme in existing graph sampling methods is usually fixed and lacks flexibility. On the other hand, if the dynamic graph is simply sampled when sampling is needed to ensure real-time performance, batch processing and parallel optimization cannot be achieved. Summary of the invention

[0005] The present invention aims to address the deficiencies of the prior art and to propose a timing diagram sampling method based on a secure virtual machine container.

[0006] The object of the present invention is to achieve the following technical solution: a timing diagram sampling method based on a secure virtual machine container, the method comprising:

[0007] S1. Obtain the UDF function provided by the user and generate the underlying code that can be used by the secure virtual machine container;

[0008] S2. Asynchronously and in parallel perform graph sampling based on neighbor discovery and UDF functions in the secure virtual machine container, and place the sampling results into the maintenance queue for real-time maintenance;

[0009] S3, filtering and maintaining the sampling results that need to be updated in the queue based on the graph data updated in streaming mode;

[0010] S4. According to the screening results, the streaming updated graph data is used to update the sampling results in the maintenance queue in real time to obtain a real-time updated timing graph sampling subgraph.

[0011] Furthermore, the obtaining of the UDF function provided by the user is specifically as follows: establishing a session, sending graph sampling calculation request parameters, deserializing the graph sampling calculation request parameters sent by the upper-layer user, parsing and obtaining the parameters and UDF function used for graph sampling, and obtaining the UDF function provided by the upper-layer user.

[0012] Furthermore, the code language used by the UDF function obtained in S1 includes: using C++ language to describe the content of the user-defined UDF function, using a custom concise language to describe the content of the user-defined UDF function, or using other programming languages ​​to describe the content of the user-defined UDF function;

[0013] The secure virtual machine container includes a WASM container or other lightweight secure virtual machine container; if the secure virtual machine is a WASM container, the compilation tool provided by WASM or the underlying CodeGen technology such as LLVM is used for compilation; if the secure virtual machine is other lightweight secure virtual machine containers, a direct compilation tool or the underlying CodeGen technology such as LLVM is used for compilation.

[0014] Furthermore, the graph sampling based on neighbor discovery and UDF function in S2 is specifically as follows:

[0015] Call the interface to obtain the attribute of all neighbors of a certain point, traverse the neighbors for each output node, process or filter the neighbors according to the data processing scheme defined by the UDF function, and pull attributes for the sampling results; if multi-layer sampling is required, the sampling results need to be used as input nodes and this process needs to be repeated multiple times.

[0016] Furthermore, the maintenance queue has a limited size, and sampling is suspended when the maintenance queue is full.

[0017] Furthermore, the S3 is specifically:

[0018] Determine whether the graph data involves the point set of sampling results that currently need to be maintained in real time. If not, it is considered that no update is required. If so, determine whether the bar graph data exceeds the sampling time period defined by the user. If it exceeds the sampling time period, no update is required. If it does not exceed the sampling time period, an update is required. If the user does not define a sampling time period, the sampling results will be updated to the latest in real time.

[0019] Furthermore, the update content of the real-time update of the sampling results in the maintenance queue includes: whether the node exists, whether the neighbor of the node exists, and whether other attributes of the node are changed.

[0020] On the other hand, the invention also provides a timing diagram sampling system based on a secure virtual machine container, the system comprising: a client module, a secure virtual machine module, a management server module, a computing server module and a data server module;

[0021] The client module is used to initiate a sampling request and extract sampling results according to the sampling service.

[0022] The management server module is used to obtain the UDF function provided by the user; schedule the computing server to start the secure virtual machine container to execute sampling, and manage computing resources, create and maintain sessions with the client module, and maintain the cluster status;

[0023] The secure virtual machine module is a secure virtual machine container, and based on the underlying code available to the secure virtual machine container generated by the UDF function, graph sampling based on neighbor discovery and UDF function is performed asynchronously and in parallel;

[0024] The computing server module is used to generate the underlying code available to the secure virtual machine container and allocate resources to the secure virtual machine module to safely execute the underlying code of the UDF function conversion; and the computing server module performs graph sampling based on neighbor discovery and UDF functions in the secure virtual machine module, obtains the sampling results and places them in the maintenance queue, and maintains and updates the sampling results that have not been requested by the client;

[0025] The data server module is used to read and write the graph database, filter the graph data and sampling results that need to be updated according to the streaming updated graph data, and implement data caching. It is necessary to deploy a graph database suitable for the real-time update characteristics of the time series graph in the data server module, and configure the streaming updated data to flow through the data server module.

[0026] Furthermore, the computing server module synchronizes computing resource status with the management server each time sampling is completed.

[0027] Furthermore, the data cache of the data server module contains a plurality of subgraphs consisting of frequently accessed points in the graph database and their neighbors.

[0028] Beneficial effects:

[0029] The present invention explores the method of sampling time-series graph data from the perspective of time-series graphs. Compared with the general batch-processing graph data sampling method for sampling static graphs, the sampling results of the present invention are real-time. Considering the time dimension, the sampling results of the present invention are more accurate and representative. Compared with simple sampling functions, the present invention implements an asynchronous parallel sampling system, which uses computing resources more scientifically and efficiently. Asynchronous parallelism also improves the overall efficiency of the program, and the unique update mechanism can also hand over a batch of sampling tasks to the sampling system at the beginning without losing the real-time nature of the sampling results.

[0030] Compared with the fixed sampling data processing flow, the present invention provides a user-defined UDF function, which, with the help of CodeGen technology and secure virtual machine container technology, enables the program to be flexibly executed while ensuring security, and also realizes that the UDF function is platform-independent. This makes the timing diagram data sampling method of the present invention more flexible in practical application and has important significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flow chart of a timing diagram sampling method provided by an embodiment of the present invention;

[0032] Figure 2 A timing diagram provided for an embodiment of the present invention;

[0033] Figure 3 A module diagram of a timing diagram sampling system provided by an embodiment of the present invention;

[0034] Figure 4 A schematic diagram of implementing real-time update provided by an embodiment of the present invention;

[0035] Figure 5 A sampling process diagram of a timing diagram sampling system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings.

[0037] Embodiment 1:

[0038] like Figure 1 As shown, the present invention provides a timing diagram sampling method based on a secure virtual machine container, the method comprising the following steps:

[0039] S1. Obtain the UDF function provided by the user, generate the underlying code that can be used by the secure virtual machine container, and allocate resources to the virtual machine container to safely execute the generated underlying code; specifically, obtain the UDF function provided by the upper-level user, deserialize the request parameters sent by the upper-level user, parse and obtain the parameters and UDF functions used for graph sampling, and schedule the secure virtual machine container based on the obtained information. The UDF function is used to design the data processing scheme in the sampling process. The achievable data processing schemes include but are not limited to: assigning different probabilities of being sampled to different edges during the sampling process; filtering out some nodes and edges during the sampling process; and performing calculations during the sampling process.

[0040] In S1, the code language and secure virtual machine used by the acquired UDF function include:

[0041] a. Use C++ to describe the content of the user-defined UDF function, use WASM container as a secure virtual machine container, and use C++ to WASM bytecode compilation tools to implement the process of converting UDF function to WASM bytecode;

[0042] b. Use C++ to describe the content of the user-defined UDF function, use other lightweight and secure virtual machine containers, and use direct compilation tools if available. If not, use LLVM and other underlying CodeGen technologies to parse and compile;

[0043] c. Use custom concise language to explain the content of user-defined UDF functions, use WASM container as a secure virtual machine container, and use LLVM and other underlying CodeGen technologies to parse and compile custom languages ​​to generate WASM bytecode to implement the process of converting UDF functions to WASM bytecode;

[0044] d. Use other programming languages ​​to describe the content of user-defined UDF functions, use other lightweight and secure virtual machine containers, and use direct compilation tools if available. If not, use LLVM and other underlying CodeGen technologies to parse and compile.

[0045] S2. Perform graph sampling based on neighbor discovery and UDF functions in the secure virtual machine container to obtain sampling results;

[0046] The specific steps of graph sampling based on neighbor discovery and UDF functions are: call the interface to obtain the attribute of all neighbors of a certain point, traverse the neighbors for each output node, process or filter the neighbors according to the data processing scheme defined by the UDF function, and pull attributes for the sampling results. If multi-layer sampling is required, the sampling results need to be used as input nodes and this process needs to be repeated multiple times.

[0047] S3. Filter out the graph data that needs to be updated based on the sampling results and the stream-updated graph data; specifically:

[0048] It is necessary to hold a node set of sampling results that currently need to be maintained in real time and a user-defined sampling time period. If the user does not define the sampling time period, the sampling results need to be updated to the latest in real time by default. First, determine whether the bar chart data involves the point set of sampling results that currently need to be maintained in real time. If not, it is not considered necessary to update. Secondly, if the bar chart data exceeds the sampling time period defined by the user, it is not considered necessary to update. If the bar chart data involves the point set of sampling results that currently need to be maintained in real time and is within the sampling time period defined by the user, it is determined that the sampling results need to be updated.

[0049] S4. Based on the screening results, the sampling results are updated in real time using the stream-updated graph data. Specifically, the program will dynamically update the sampling results in the maintenance queue based on the screened stream-updated graph data. The real-time update of the sampling results in the maintenance queue includes: whether the node exists, whether the node's neighbors exist, and whether other attributes of the node have changed.

[0050] In another aspect, an embodiment of the present invention provides a timing diagram sampling system based on a secure virtual machine container, the system comprising: a client module, a secure virtual machine module, a management server module, a computing server module and a data server module.

[0051] The client module is used to initiate a sampling request and extract the sampling results.

[0052] The management server module is used to obtain the UDF function provided by the user; schedule the computing server to start the secure virtual machine container to execute sampling, and manage computing resources, create and maintain sessions with the client module, and maintain the cluster status;

[0053] The secure virtual machine module is a secure virtual machine container, and based on the underlying code available to the secure virtual machine container generated by the UDF function, graph sampling based on neighbor discovery and UDF function is performed asynchronously and in parallel;

[0054] The computing server module is used to generate the underlying code available to the secure virtual machine container and allocate resources to the secure virtual machine module to safely execute the underlying code of the UDF function conversion; and the computing server module performs graph sampling based on neighbor discovery and UDF functions in the secure virtual machine module, obtains the sampling results and places them in the maintenance queue, and maintains the sampling results that have not been requested by the client;

[0055] The data server module is used to read and write the graph database, filter the graph data that needs to be updated according to the streaming updated graph data, and implement data caching. It is necessary to deploy a graph database suitable for the real-time update characteristics of the time series graph in the data server module, and configure the streaming updated data to flow through the data server module.

[0056] In the described timing diagram sampling system based on a secure virtual machine container, the initiation of a sampling request is implemented as follows: the client requests the management server to open a session, and after the session is successfully created, the client and the sampling service successfully establish a connection; the client initiates a sampling request, which includes session information, user-defined UDF, and other information required for sampling; after receiving the request, the management server schedules the computing server to open the secure virtual machine container to perform sampling; the computing server needs to maintain the sampling results that have not been requested by the client in the maintenance queue; when the client needs the sampling results, it sends a request to obtain the sampling results to the management server; when the management server receives the request to obtain the sampling results, it schedules the corresponding computing server to return the sampling results; when sampling is not needed, the client sends a request to close the session to close the connection.

[0057] In the timing diagram sampling system based on the secure virtual machine container, the real-time update of the sampling result is implemented as follows:

[0058] The computing server is responsible for dynamically modifying the sampled results according to the received update content, and the data server is responsible for filtering the graph data that needs to be updated according to the streaming updated graph data, and transmitting the updated content to the computing server. The function of filtering the graph data that needs to be updated according to the streaming updated graph data is based on the fact that the computing server and the data server need to synchronously hold the node set of the sampling results currently maintained in real time and the user-defined sampling time period. If the points involved in the streaming updated graph data exist in this node set to be maintained and the graph data belongs to the user-defined sampling time period, it is judged that it needs to be updated.

[0059] In the timing graph sampling system based on secure virtual machine containers, the management server needs to obtain user-defined UDF functions, manage computing resources, create and maintain sessions with clients, and maintain cluster status. After each sampling, the computing server will synchronize the computing resource status with the management server. The session has a timeout mechanism, and it will be closed if there is no sampling request for a period of time. The allocated computing resources will automatically shrink if they are not fully used. The cluster status is maintained through a heartbeat mechanism between the management server and the computing server and data server.

[0060] In the described timing graph sampling system based on a secure virtual machine container, the computing server needs to schedule the secure virtual machine container to execute the sampling script and maintain the sampling results. Before opening the virtual machine container, the computing server converts the user-defined UDF function into the underlying code available to the secure virtual machine. The computing server needs to open or schedule the secure virtual machine container to execute the sampling request according to the request from the management server. After obtaining the sampling results, the sampling results are placed in the maintenance queue, and the node set involved in these sampling results is synchronized with the data server. The computing server accepts the data update request from the data server, and updates the sampling results in the maintenance queue in real time according to the updated graph data transmitted by the data server. The computing server accepts the request to obtain the sampling results from the management server, transmits the corresponding sampling results to the client and removes them from the maintenance queue. The size of the maintenance queue is limited. When the maintenance queue is full, the sampling of the Session is suspended, waiting for a vacancy in the maintenance queue.

[0061] In the described sequential graph sampling system based on a secure virtual machine container, the data server needs to read and write the graph database, implement the data caching function, and filter the nodes that need to be updated according to the graph data updated in a streaming manner. The data server provides the computing server with a point attribute query interface, and the neighbor of the point is one of the attributes of the point. At the same time, in order to efficiently return data, the data server maintains a cache in memory, which contains multiple subgraphs consisting of frequently accessed points and their neighbors. The data server and the computing server synchronously hold the node set of the sampling results in the maintenance queue and the user-defined sampling time period, which are used to filter the graph data that needs to be updated according to the graph data updated in a streaming manner. The data server accepts the graph data updated in a streaming manner, verifies whether the updated data exists in the user-defined time period, whether it involves nodes in the node point set of the sampling results in the maintenance queue, and transmits the graph data judged to need to be updated to the computing server.

[0062] Embodiment 2:

[0063] Taking a timing graph sampling method and system based on a secure virtual machine container implemented in a financial transaction network as an example, the timing graph in this embodiment uses transaction entities as nodes and transaction behaviors as directed edges. Nodes are labeled to represent their respective roles, such as merchants, customers, logistics, and third-party platforms. A directed edge represents a transaction, and its weight represents the transaction amount. Since transactions are conducted in real time, the financial transaction network is a timing graph. The financial transaction network can be defined as follows: timing graph G = (V, E), where: V = {(v, ts, te, A)}, where v is a node of the graph, and ts, te are the start and end timestamps of the node's existence (where ts≤te), respectively, and A is the node's attribute set, including all neighbors of the node. E = {(u, v, ts, te, A)}, where u, v∈V, ts, te are the start and end timestamps of the edge's existence (where ts≤te), respectively, and A is the edge's attribute set. As Figure 2 , at time t1, point c transfers money to point b, and point d transfers money to point e. At time t2, point c transfers money to point d, point e transfers money to point a, and point a transfers money to point b. At time t3, point a transfers money to point f, and point f transfers money to point g. At time t4, point a transfers money to point g, and point f transfers money to point e. The properties of nodes and edges are Figure 2 In the figure, no user has withdrawn the transaction, and the end timestamps of all nodes and edges are infinite. In financial transaction networks, a transaction is rarely withdrawn after it is completed, so the end timestamp is generally infinite.

[0064] In practical applications, common graph sampling techniques often treat the graph data of the financial transaction network at a certain moment as static and unchanging data for sampling to obtain the required small batches. However, the financial transaction network is a time-series graph that changes over time, so this sampling is outdated. Since applications of financial transaction networks such as fraud analysis, pattern matching, and fraud pattern discovery often require long-term, non-stop real-time training or reasoning after being started, streaming data updates during this process cause the graph structure and information on the graph to change continuously. The data sampled at the beginning of training or reasoning may no longer be the real data at the current moment, so sampling also needs to be updated in real time.

[0065] Applying the timing graph sampling method based on secure virtual machine containers on financial transaction networks Figure 1 As shown in the figure, firstly, the user-defined UDF function is obtained from the parameters, and the UDF function is compiled using CodeGen technology to obtain the underlying code available to the secure virtual machine container. Then, based on neighbor discovery and the data processing scheme defined by the UDF function, the sampling task is asynchronously and parallelly executed in the secure virtual machine container. After obtaining the sampling results, the sampling results are placed in the maintenance queue, and the graph data that needs to be updated is filtered out based on the streaming updated graph data, and the sampling results in the maintenance queue are updated in real time based on these filtered graph data.

[0066] In order to support the application of the above-mentioned timing graph sampling method in financial transaction networks, it is necessary to build a Figure 3 The module diagram shows a timing graph sampling system based on a secure virtual machine container. The system includes a client module, a secure virtual machine container module, a management server module, a computing server module, and a data server module. A session connection is established between the client and the sampling service through the management server; the client initiates a sampling request, which includes session connection information, user-defined UDF, and other related information; the management server receives the request and parses it to obtain the user-defined UDF function and other parameters and schedules the computing server to convert the UDF function into the underlying code available to the virtual machine and start the secure virtual machine container to perform sampling, and the sampling results are stored in the maintenance queue; the data server is responsible for filtering the streaming updated graph data to obtain the graph data to be updated; the computing server is responsible for maintaining and updating the sampling results in the maintenance queue that have not been requested by the client based on the graph data to be updated filtered by the data server; the client initiates a request to obtain the sampling result when extracting the sampling result; the management server receives the request and schedules the corresponding computing server to return the sampling result and remove it from the maintenance queue.

[0067] In this system, the management server is responsible for obtaining user-defined UDF functions, managing computing resources, creating and maintaining session connections with clients, and maintaining cluster status. The computing server will synchronize the computing resource status with the management server after each sampling. The session connection has a timeout mechanism. If no sampling request is received within a period of time, the connection will be automatically disconnected. If the computing resources allocated to the session are not fully utilized, the system will automatically shrink the resources. The management server maintains the cluster status through a heartbeat mechanism with the computing server and data server.

[0068] The computing server is responsible for scheduling the secure virtual machine container to execute the sampling script and maintain the sampling results. According to the request from the management server, the computing server first converts the user-defined UDF function into the underlying code available to the secure virtual machine, and then opens or schedules the secure virtual machine to execute the sampling request. The computing server places the sampling results in the maintenance queue and synchronizes the node set involved in these sampling results and the corresponding user-defined sampling time period with the data server. The computing server accepts the data update request from the data server and updates the sampling results in the maintenance queue in real time. The computing server accepts the request to obtain the sampling results from the management server, returns the corresponding sampling results to the client and removes them from the maintenance queue. The size of the maintenance queue is limited. When the maintenance queue is full, the sampling of the session is suspended, waiting for a vacancy in the maintenance queue.

[0069] The data server is responsible for reading and writing the graph database, implementing data caching functions, and streaming graph data filtering functions. The data server provides a point attribute query interface for the computing server, where the point attributes include the neighbors of the point. The data server maintains a cache in memory, which contains multiple subgraphs consisting of high-frequency access points and their neighbors. The machine where the data server is located needs to deploy a graph database suitable for the real-time update feature of the time-series graph, and configure the streaming updated data to flow through the data server. The data server and the computing server synchronously hold the node set of the sampling results in the maintenance queue and the user-defined sampling time period data. The data server accepts the graph data updated by streaming, and if there is optional sampling time period data, it verifies whether the updated data exists in the time period. At the same time, it verifies whether it involves the nodes in the above point set. The updated data of the graph data that meets both conditions will be transmitted to the computing server.

[0070] The real-time update of sampling is achieved as follows Figure 4 As shown, after obtaining the sampling results, the sampling results are put into a limited-size maintenance queue on the computing server for maintenance. The maintenance queue corresponds one-to-one with the node set queue on the data server. Figure 4 , assuming that the set of all nodes of the i-th sampling result in the maintenance queue in the program is the node set V i , the size of the maintenance queue is n, then the node set of each sampling result in the maintenance queue is V1, V2,..., V n These node sets are stored in the node set queue. The program is based on V1, V2, ..., V n These node sets update the sampling results in the maintenance queue in real time. The program filters out the sampling time periods that meet the user-defined sampling time requirements and involve V1, V2, ..., V n The graph data of these node sets are updated, and the selected graph data to be updated is used to maintain the sampling results corresponding to the updated node set. When each sampling result i is put into the maintenance queue, its corresponding node set V iand the optional sampling time period are synchronously placed in the node set queue. Whenever a sampling result is extracted, the sampling result is removed from the maintenance queue, and the corresponding node set is also removed from the node set queue. In the time-series graph sampling system, the maintenance queue is located on the computing server, the node set is located on the data server, and the streaming updated graph data flows through the data server. The data server determines whether the maintenance queue needs to be updated based on the streaming updated graph data, each node set queue, and the optional sampling time period. If necessary, the update request is sent to the computing server for real-time update. The update request includes the nodes to be updated and the update data. For example, in a financial network, a new transaction is received: point A transfers 100 yuan to point B. The transaction first passes through the data server to perform the streaming graph data screening function to determine whether the sampling result needs to be updated, that is, first determine whether the transaction is in the user-defined sampling time period, and then determine whether point A and point B are in a node set V of a certain sampling result. i If point B passes these two judgments, point B needs to be updated, and the data server will transmit the updated data of point B to the computing server. After receiving the message, the computing server will update the corresponding sampling result V i Make updates to maintain the real-time nature of sampling results.

[0071] The operation process of the timing diagram sampling system based on the secure virtual machine container is as follows: Figure 5 As shown, the client first initiates a request to the management server to start the sampling session. The management server determines whether there are idle resources. If there are idle resources, the creation is successful and the session information is returned. If there are no idle resources, the creation fails and an error message is returned. After that, the client cyclically initiates a computing request to the management server and verifies the identity. If the verification is successful, the request passes and the calculation continues. If the verification fails, the request is illegal and an error message is returned. If the request passes, the management server schedules the computing server to run the sampling script. The sampling script is the timing diagram sampling method based on the secure virtual machine mentioned above. The sampling script cyclically reads data from the data server, returns the results, and organizes the generation of sampling results. After obtaining the sampling results, use Figure 4 The method maintains the sampling results in real time and waits for the client to retrieve them. When the client does not need to perform sampling, it sends a request to the management server to close the sampling session. After receiving the request, the management server ends the executing sampling task and releases the resources, and then returns the closed status to the client.

[0072] Through the above steps, a method and system for sampling a time sequence graph based on a secure virtual machine container can be implemented. The method and system can safely execute user-defined functions, support graph sampling and graph data processing based on neighbor discovery and UDF functions, and can update the sampling results in real time. It has the advantages of flexibility, security, and real-time performance, and can be widely used in various scenarios.

[0073] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A timing diagram sampling method based on a secure virtual machine container, characterized in that: The method includes: S1. Establish a session, send graph sampling calculation request parameters, deserialize the graph sampling calculation request parameters sent by the upper-layer user, parse and obtain the parameters and UDF functions used by graph sampling, thereby obtaining the UDF function provided by the upper-layer user, and compile and generate the underlying code that can be used by the secure virtual machine container based on the UDF function; S2. Asynchronously and in parallel perform graph sampling based on neighbor discovery and UDF functions in the secure virtual machine container, and place the sampling results into the maintenance queue for real-time maintenance; S3, filtering and maintaining the sampling results that need to be updated in the queue based on the graph data updated in streaming mode; S4. According to the screening results, the streaming updated graph data is used to update the sampling results in the maintenance queue in real time to obtain a real-time updated timing graph sampling subgraph.

2. A timing diagram sampling method based on a secure virtual machine container according to claim 1, characterized in that: In S1, the code language used by the UDF function includes: using C++ language to describe the content of the user-defined UDF function, using a custom concise language to describe the content of the user-defined UDF function, or using other programming languages ​​to describe the content of the user-defined UDF function; The secure virtual machine container includes a WASM container or other lightweight secure virtual machine container; if the secure virtual machine is a WASM container, the compilation tool provided by WASM or the underlying CodeGen technology is used for compilation; if the secure virtual machine is other lightweight secure virtual machine containers, a direct compilation tool is used or the underlying CodeGen technology is used for compilation.

3. The timing diagram sampling method based on a secure virtual machine container according to claim 1 is characterized in that: The graph sampling based on neighbor discovery and UDF function in S2 is specifically as follows: Call the interface to obtain the attribute of all neighbors of a certain point, traverse the neighbors for each output node, process or filter the neighbors according to the data processing scheme defined by the UDF function, and pull attributes for the sampling results; if multi-layer sampling is required, the sampling results need to be used as input nodes and this process needs to be repeated multiple times.

4. The timing diagram sampling method based on a secure virtual machine container according to claim 1, characterized in that: The maintenance queue has a limited size, and sampling is suspended when the maintenance queue is full.

5. The timing diagram sampling method based on a secure virtual machine container according to claim 1, characterized in that: The S3 is specifically: Determine whether the graph data involves the point set of sampling results that currently need to be maintained in real time. If not, it is considered that no update is required. If so, determine whether the bar graph data exceeds the sampling time period defined by the user. If it exceeds the sampling time period, no update is required. If it does not exceed the sampling time period, an update is required. If the user does not define a sampling time period, the sampling results will be updated to the latest in real time.

6. A timing diagram sampling method based on a secure virtual machine container according to claim 1, characterized in that: The real-time update of the sampling results in the maintenance queue includes: whether the sampling node in the maintenance queue exists, whether the neighbor of the sampling node in the maintenance queue exists, and whether other attributes of the sampling node in the maintenance queue are changed.

7. A timing diagram sampling system for a secure virtual machine container for implementing the method according to any one of claims 1 to 6, characterized in that: The system includes: a client module, a secure virtual machine module, a management server module, a computing server module and a data server module; The client module is used to initiate sampling requests and extract sampling results. The management server module is used to obtain the UDF function provided by the user; schedule the computing server to start the secure virtual machine container to execute sampling, and manage computing resources, create and maintain sessions with the client module, and maintain the cluster status; The secure virtual machine module is a secure virtual machine container, and based on the underlying code available to the secure virtual machine container generated by the UDF function, graph sampling based on neighbor discovery and UDF function is performed asynchronously and in parallel; The computing server module is used to generate the underlying code available to the secure virtual machine container and allocate resources to the secure virtual machine module to safely execute the underlying code of the UDF function conversion; and the computing server module performs graph sampling based on neighbor discovery and UDF functions in the secure virtual machine module, obtains the sampling results and places them in the maintenance queue, and maintains and updates the sampling results that have not been requested by the client; The data server module is used to read and write the graph database, filter the graph data and sampling results that need to be updated according to the streaming updated graph data, and implement data caching. It is necessary to deploy a graph database suitable for the real-time update characteristics of the time series graph in the data server module, and configure the streaming updated data to flow through the data server module.

8. A timing diagram sampling system based on a secure virtual machine container according to claim 7, characterized in that: The computing server module will synchronize computing resource status with the management server after each sampling.

9. A timing diagram sampling system based on a secure virtual machine container according to claim 7, characterized in that: The data cache of the data server module contains multiple subgraphs consisting of frequently accessed points in the graph database and their neighbors.

Citation Information

Patent Citations

  • Graph data sampling method and system

    CN114647765A

  • Traveling controller for autonomously traveling vehicle

    JP1995104847A