Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart illustrating a method for extending a node relationship diagram according to an embodiment of the present application, where the method may be performed by an electronic device, such as a terminal device or a server device. In other words, the method may be performed by software or hardware installed in the terminal device or the server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. As shown, the method may include the following steps.
Step S10: and acquiring an initial node relation graph.
The embodiment of the application aims to track and monitor the specified event, and focuses on a target account (node) for implementing the specified event and the specified event elements corresponding to the specified event, such as the time, the place, the behavior and the like of the specified event. The designated event element corresponding to the designated event can be reflected in the target account, for example, the transfer action involved in the gambler's account can reflect the designated event element of gambling.
The initial node relationship graph includes at least one node, and one node is used for indicating one target account, in other words, in the embodiment of the present application, when a specified event is monitored, at least one node of the specified event needs to be obtained in advance to serve as a starting point of monitoring or tracking.
For example, in monitoring gambling for specified events, this step obtains an initial node relationship graph that includes at least one node, such as a gambler node, that indicates a target account for a gambler.
Step S20: and acquiring an edge sequence of the candidate node relative to the at least one node in the initial node relation graph.
And the component in the edge sequence is used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph. The number of the partial vectors in the edge sequence is the same as the number of the nodes in the initial node relation graph, and whether the edge relation exists between the candidate nodes and the nodes in the initial node relation graph is respectively represented.
In this step, for example, the user node in the whole network may be used as a candidate node, an edge sequence of the candidate node relative to at least one node included in the initial node relationship graph is obtained, and a reasonable tracking condition is preset to screen the user node to be tracked.
Step S30: and when the edge sequence meets a preset condition, adding the candidate node and the edge relation corresponding to the edge sequence in the initial node relation graph based on the edge sequence.
Fig. 2 shows a schematic diagram of generating a node relationship diagram after candidate nodes are added in the node relationship diagram, as shown in the diagram, starting from node 1, the node relationship diagram is expanded by 1 node each time for 5 times, where an edge sequence Si is a one-dimensional vector and represents the relationship between the i +1 th node that needs to be expanded and all current nodes, for example, the 1 st row and 1 st column element of Si represents whether there is an edge between node i +1 and node 2, and 1 represents that there is an edge 0 and no edge. Specifically, when node 2 is extended based on existing node 1, there is an edge between node 2 and node 1, so the component vector of S1 is 1 at this time; when the node 3 is expanded based on the existing nodes 1 and 2, the S2 vectors are respectively 1 and 0 at this time because the node 3 has an edge with the node 1 and no edge with the node 2; when node 4 is expanded, node 4 has edges with nodes 2 and 3 and no edge with node 1, so the component of S3 is 0, 1; when node 5 is expanded, since node 5 has edges with nodes 3 and 4, the components of the edge sequence S4 are 0, 1, and 1. It can be seen that every time a node is extended, all previous { Si } sets are obtained. For example, when expanding the 3 rd node, the inputs are { S1, S2} and the set of candidate nodes.
While the embodiments of the present application are illustrated with specific events being gambling events, those skilled in the art will appreciate that the embodiments of the present application will be applicable not only to gambling events, but also to tracking and monitoring specific events such as sales, fraud, drug trafficking, etc.
Therefore, according to the method for expanding the node relationship graph provided by the embodiment of the application, the initial node relationship graph is obtained, the initial node relationship graph comprises at least one node, and one node is used for indicating one target account; acquiring an edge sequence of a candidate node relative to the at least one node in the initial node relationship graph, wherein component quantities in the edge sequence are used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph; when the edge sequence accords with the preset condition, the candidate nodes and the edge relation corresponding to the edge sequence are added in the initial node relation graph based on the edge sequence, the data of the specified event can be comprehensively tracked and monitored, and the data processing efficiency of the edge sequence is far higher than that of the two-dimensional matrix because the edge sequence provided by the embodiment of the application is a one-dimensional vector rather than a two-dimensional matrix, so that the data of the specified event can be efficiently and comprehensively tracked and monitored.
Fig. 3 is another flowchart illustrating a method for extending a node relationship diagram according to an embodiment of the present application, where the method may be performed by an electronic device, for example, a terminal device or a server device. In other words, the method may be performed by software or hardware installed in the terminal device or the server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. As shown, the method may include the following steps.
Step S11: determining that the specified event element of the edge relationship exists.
In one possible implementation, this step may include presetting a specified event element in which the edge relationship exists. Some specific events have some relationship between specific event elements that can be expected, for example, in a gambling event, the side relationship between the specific event element gambling and the specific event element gambling can be preset.
In another possible implementation manner, this step may include determining, based on a specified event element in a target account corresponding to the at least one node in the initial node relationship diagram, that a specified event element of the edge relationship exists. In the whole process of tracing the specified event along the vine and the melon field, the target of the next tracing can be determined based on the expanded nodes. For example, in a gambling event, if the existing node is the "banker", then characteristic elements for which there is an edge relationship may be determined based on the element "transfer" of the banker node, such as determining an edge relationship between "transfer, collection", looking for a financial staff in the gambling, etc.
Therefore, the designated event elements with the edge relationship are determined based on the designated event elements in the target account corresponding to the at least one node in the initial node relationship graph, and a new extension dimension is introduced every time a new existing node is extended, so that the whole process of the designated event can be sequentially and gradually tracked and monitored based on the existing nodes.
Step S10: and acquiring an initial node relation graph.
The embodiment of the application aims to track and monitor the specified event, and focuses on a target account (node) for implementing the specified event and the specified event elements corresponding to the specified event, such as the time, the place, the behavior and the like of the specified event. The designated event element corresponding to the designated event can be reflected in the target account, for example, the transfer action involved in the gambler's account can reflect the designated event element of gambling.
The initial node relationship graph includes at least one node, and one node is used for indicating one target account, in other words, in the embodiment of the present application, when a specified event is monitored, at least one node of the specified event needs to be obtained in advance to serve as a starting point of monitoring or tracking.
For example, in monitoring gambling for specified events, this step obtains an initial node relationship graph that includes at least one node, such as a gambler node, that indicates a target account for a gambler.
Step S21: and judging whether an edge relationship is formed between the specified event element in the target account corresponding to the candidate node and the specified event element in the target account corresponding to the at least one node in the initial node relationship graph or not based on the specified event element with the edge relationship so as to generate the component vector in the edge sequence.
If there is an edge relationship determined in the above step, the vector may be scored as 1, and vice versa as 0.
Step S20: and acquiring an edge sequence of the candidate node relative to the at least one node in the initial node relation graph.
And the component in the edge sequence is used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph. The number of the partial vectors in the edge sequence is the same as the number of the nodes in the initial node relation graph, and whether the edge relation exists between the candidate nodes and the nodes in the initial node relation graph is respectively represented.
In this step, for example, the user node in the whole network may be used as a candidate node, an edge sequence of the candidate node relative to at least one node included in the initial node relationship graph is obtained, and a reasonable tracking condition is preset to screen the user node to be tracked.
Step S30: and when the edge sequence meets a preset condition, adding the candidate node and the edge relation corresponding to the edge sequence in the initial node relation graph based on the edge sequence.
In a possible implementation manner, the preset condition may include that the number of components indicating that the edge relationship is formed in the edge sequence is greater than a first preset threshold; or the component quantity proportion indicating the edge relation in the edge sequence is larger than a second preset threshold value.
Thus, candidate nodes having high relevance to the nodes in the initial node relation graph can be expanded into the node relation graph, and other candidate nodes which are less relevant to the nodes in the initial node relation graph are eliminated. For example, in a gambling event, if a number of gambler nodes transfer money to a node, then the node is suspect of the gambler. The node may be expanded into the node relationship graph in this step.
Fig. 2 shows a schematic diagram of generating a node relationship diagram after candidate nodes are added in the node relationship diagram, as shown in the diagram, starting from node 1, the node is expanded 1 time and 5 times, where a Si vector is a one-dimensional vector and represents the relationship between the i +1 th node that needs to be expanded and all current nodes, for example, the 1 st row and 1 st column element of Si represents whether there is an edge between node i +1 and node 2, and 1 represents that there is an edge 0 representing no edge. Therefore, every time a node is extended, all previous { Si } sets can be obtained; for example, when expanding the 3 rd node, the inputs are { S1, S2} and the set of candidate nodes.
This step may include taking the initial node relationship graph and the edge sequence as inputs to a neural network to add the candidate node and the edge relationship corresponding to the edge sequence in the initial node relationship graph.
In one possible implementation, the neural network includes at least one of a recurrent neural network RNN, a long term memory LSTM network, or a gated cyclic unit GRU network.
Taking RNN as an example, the state of the graph obtained by the ith expansion is hiThen the expansion process can be expressed as:
wherein,representing the edge sequence representation from the first i-1 expansions, ftrans() Representing an arbitrary transfer function or network structure, the final output is:
θi=fout(hi)
wherein f isout() The output function is expressed, for example softmax ().
Therefore, according to the method for expanding the node relationship graph provided by the embodiment of the application, the initial node relationship graph is obtained, the initial node relationship graph comprises at least one node, and one node is used for indicating one target account; acquiring an edge sequence of a candidate node relative to the at least one node in the initial node relationship graph, wherein component quantities in the edge sequence are used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph; when the edge sequence accords with the preset condition, the candidate nodes and the edge relation corresponding to the edge sequence are added in the initial node relation graph based on the edge sequence, the data of the specified event can be comprehensively tracked and monitored, and the data processing efficiency of the edge sequence is far higher than that of the two-dimensional matrix because the edge sequence provided by the embodiment of the application is a one-dimensional vector rather than a two-dimensional matrix, so that the data of the specified event can be efficiently and comprehensively tracked and monitored.
Further, according to the method for expanding the node relationship graph provided in the embodiment of the present application, the specified event elements having the edge relationship are determined based on the specified event elements in the target account corresponding to the at least one node in the initial node relationship graph, and a new expansion dimension is introduced every time a new existing node is expanded, so that the overall process of the specified event can be sequentially and gradually tracked and monitored based on the nodes in the node relationship graph.
Further, in the method for extending a node relationship graph provided in the embodiment of the present application, the preset condition includes: the number of component quantities indicating the edge relation in the edge sequence is greater than a first preset threshold value; or the component proportion indicating that the edge relation is formed in the edge sequence is larger than a second preset threshold, the candidate nodes with high correlation with the nodes in the node relation graph can be brought into the expansion nodes, and other candidate nodes which are not correlated with the nodes in the node relation graph are eliminated, so that the important nodes of the specified event are positioned and tracked.
Fig. 4 is a schematic structural diagram of an apparatus for extending a node relationship graph according to an embodiment of the present application, where the apparatus 100 includes: an acquisition module 110, an expansion module 120, and a generation module 130.
The obtaining module 110 obtains an initial node relationship graph, where the initial node relationship graph includes at least one node, and one node is used to indicate one target account. The extension module 120 obtains an edge sequence of a candidate node relative to the at least one node in the initial node relationship graph, where component quantities in the edge sequence are used to characterize whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, where the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph. When the edge sequence meets a preset condition, the generation module 130 adds the candidate node and the edge relationship corresponding to the edge sequence in the initial node relationship graph based on the edge sequence.
In one possible implementation, the extension module 120 further determines that the specified event element of the edge relationship exists before the obtaining of the initial node relationship graph.
In one possible implementation, the extension module 120 presets the specified event elements for which the edge relationship exists.
In one possible implementation, the extension module 120 determines the designated event element having the edge relationship based on the designated event element in the target account corresponding to the at least one node in the initial node relationship diagram.
In a possible implementation manner, before obtaining the edge sequence of the candidate node relative to the at least one node in the initial node relationship diagram, the extension module 120 further determines, based on the specified event element having the edge relationship, whether an edge relationship is formed between the specified event element in the target account corresponding to the candidate node and the specified event element in the target account corresponding to the at least one node in the initial node relationship diagram to generate the component vector in the edge sequence.
In one possible implementation manner, the preset condition includes: the number of component quantities indicating the edge relation in the edge sequence is greater than a first preset threshold value; or the component quantity proportion indicating the edge relation in the edge sequence is larger than a second preset threshold value.
In one possible implementation, the generating module 130 uses the initial node relationship graph and the edge sequence as input of a neural network to add the candidate node and the edge relationship corresponding to the edge sequence in the initial node relationship graph.
In one possible implementation, the neural network includes at least one of a recurrent neural network RNN, a long term memory LSTM network, or a gated cyclic unit GRU network.
The apparatus 100 provided in this embodiment of the application can perform the methods described in the foregoing method embodiments, and implement the functions and beneficial effects of the methods described in the foregoing method embodiments, which are not described herein again.
Fig. 5 is a schematic diagram illustrating a hardware structure of an electronic device for executing a method for extending a node relationship graph according to an embodiment of the present application, and referring to the diagram, at a hardware level, the electronic device includes a processor, and optionally includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a Random-access memory (RAM), and may further include a non-volatile memory, such as at least 1 disk memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an extended EISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in the figure, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form a device for positioning the target user on a logic level. The processor executes the program stored in the memory, and is specifically used for executing: obtaining an initial node relation graph, wherein the initial node relation graph comprises at least one node, and one node is used for indicating one target account; acquiring an edge sequence of a candidate node relative to the at least one node in the initial node relationship graph, wherein component quantities in the edge sequence are used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph; and when the edge sequence meets a preset condition, adding the candidate node and the edge relation corresponding to the edge sequence in the initial node relation graph based on the edge sequence.
The method disclosed in the embodiment of fig. 1 of the present application may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute each method described in the foregoing method embodiments, and implement the functions and beneficial effects of each method described in the foregoing method embodiments, which are not described herein again.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present application also provide a computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform operations comprising: obtaining an initial node relation graph, wherein the initial node relation graph comprises at least one node, and one node is used for indicating one target account; acquiring an edge sequence of a candidate node relative to the at least one node in the initial node relationship graph, wherein component quantities in the edge sequence are used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph; and when the edge sequence meets a preset condition, adding the candidate node and the edge relation corresponding to the edge sequence in the initial node relation graph based on the edge sequence.
The computer-readable storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Further, embodiments of the present application also provide a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, which when executed by a computer, implement the following process: obtaining an initial node relation graph, wherein the initial node relation graph comprises at least one node, and one node is used for indicating one target account; acquiring an edge sequence of a candidate node relative to the at least one node in the initial node relationship graph, wherein component quantities in the edge sequence are used for characterizing whether an edge relationship is formed between the candidate node and the at least one node in the initial node relationship graph, and the edge relationship corresponds to a specified event element in a target account corresponding to the candidate node and a specified event element in a target account corresponding to the at least one node in the initial node relationship graph; and when the edge sequence meets a preset condition, adding the candidate node and the edge relation corresponding to the edge sequence in the initial node relation graph based on the edge sequence.
In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.