CN110941746A - Graph data layering method and device and computer equipment - Google Patents

Graph data layering method and device and computer equipment Download PDF

Info

Publication number
CN110941746A
CN110941746A CN201911171342.9A CN201911171342A CN110941746A CN 110941746 A CN110941746 A CN 110941746A CN 201911171342 A CN201911171342 A CN 201911171342A CN 110941746 A CN110941746 A CN 110941746A
Authority
CN
China
Prior art keywords
calculation
entity
data
layering
algorithm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911171342.9A
Other languages
Chinese (zh)
Inventor
王海波
钟麒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunnan Smartq Beijing Mdt Infotech Ltd
Original Assignee
Yunnan Smartq Beijing Mdt Infotech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunnan Smartq Beijing Mdt Infotech Ltd filed Critical Yunnan Smartq Beijing Mdt Infotech Ltd
Priority to CN201911171342.9A priority Critical patent/CN110941746A/en
Publication of CN110941746A publication Critical patent/CN110941746A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Abstract

The invention provides a graph data layering method, which comprises the following steps: s100, selecting a layering algorithm according to the analysis requirement of data, wherein the layering algorithm comprises but is not limited to one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and community discovery clustering calculation; s200, performing layered calculation by using a selected layered algorithm, and calculating the graph data to obtain a grouping entity; s300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity; s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again. The embodiment of the invention can optimize the data of the graph data structure again to obtain the graph data with the least number of entities, is beneficial to the efficient display of the graph data, can feed back the entity relationship of big data, and finally meets the requirement of data analysis.

Description

Graph data layering method and device and computer equipment
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a graph data layering method and device and computer equipment.
Background
Nowadays, computer technology develops rapidly, and particularly, with the continuous growth of internet application scenes and the continuous breakthrough of storage technology, the application scenes accumulate massive data. Graph (Graph) is a flexible data storage structure that consists of vertices and edges between the vertices, whose model can be described by a solid-link model.
Entities (Entity) correspond to vertices in the graph, and links (Link) correspond to edges in the graph, both of which may contain properties (Property) to describe the internal structure of the entities and links. This model is also known systematically as an entity-relationship model.
At present, many data analysis methods convert structured data into graph data through an entity relationship model and then display the graph data. By visualizing the graph data, the relationship between the data can be conveniently observed. However, in the existing product for analyzing the data association relationship, after a general product displays tens of thousands of entities and tens of thousands of links, the whole displayed view begins to appear stuck. The better product can achieve about one hundred thousand data volume. Therefore, the visualization display capability of the graph data is always an important index of the data visualization capability. The visual display of the incidence relation data with large data volume is always a technical difficulty.
Disclosure of Invention
Embodiments of the present invention provide a graph data layering method and apparatus, a computer device, and a storage medium, so as to solve the problem that graph data is simplified most for massive data, and good graph data display is finally performed.
To solve the above problem, in a first aspect, an embodiment of the present invention provides a graph data layering method, where the method includes:
s100, selecting a layering algorithm according to the analysis requirement of data, wherein the layering algorithm comprises but is not limited to one or more of leaf node calculation, same-type entity calculation, same-attribute entity calculation and community discovery clustering calculation;
s200, performing layered calculation by using a selected layered algorithm, and calculating the graph data to obtain a grouping entity;
s300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity;
s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again.
Preferably, the determining whether the new layer data meets the analysis requirement specifically includes:
and calculating the number Sum of entities or links contained in the new layer data, comparing the number Sum with a preset number threshold N, and if Sum < equalto N, judging that the analysis requirement is met.
Preferably, the method further comprises:
s500, recording the entity quantity or the link quantity of the last layer data S0;
s600, calculating the entity quantity or the link quantity of the layer data at this time S1;
s700, when S0 is S1, the process ends.
Preferably, the method further comprises:
and calculating the execution times of the hierarchical algorithm, judging whether the execution times is greater than or equal to a preset time threshold, and if the execution times is greater than or equal to the time threshold, ending the operation.
Preferably, the selecting a hierarchical algorithm according to the analysis requirement of the data specifically includes:
and (3) utilizing a layering algorithm, wherein the layering algorithm comprises but is not limited to leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery clustering calculation and the like, sequentially carrying out layering calculation, taking the layer data with the least number of entities in the calculated layer data as final graph data, and taking the layering algorithm with the least number of entities in the calculated layer data as the final layering algorithm.
In a second aspect, an embodiment of the present invention further provides a graph data layering apparatus, where the apparatus includes:
the algorithm selection module is used for selecting a hierarchical algorithm according to the analysis requirement of the data, wherein the hierarchical algorithm comprises one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and community discovery clustering calculation;
the hierarchical calculation module is used for executing hierarchical calculation by utilizing a selected hierarchical algorithm and calculating the graph data to obtain a grouped entity;
the entity merging module is used for merging the entities in the same group to generate a new aggregation entity and constructing new layer data according to the aggregation entity;
and the convergence module is used for judging whether the new layer data meets the analysis requirement, if so, ending the analysis, and if not, enabling the algorithm selection module, the layering calculation module, the entity combination module and the convergence module to execute in sequence again.
Preferably, the determining, by the convergence module, whether the new layer data meets the analysis requirement specifically includes:
and calculating the number Sum of entities or links contained in the new layer data, comparing the number Sum with a preset number threshold N, and if Sum < equalto N, judging that the analysis requirement is met.
Preferably, the convergence module further comprises:
a recording unit, configured to record an entity number or a link number S0 of the previous layer data, and calculate an entity number or a link number S1 of the current layer data;
a determination is made as to whether S0 is equal to S1, and if so, the process is complete.
Preferably, the algorithm selection module uses a hierarchical algorithm, the hierarchical algorithm includes, but is not limited to, leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery cluster calculation, and the like, and the hierarchical calculation is sequentially performed, layer data with the minimum number of entities in the calculated layer data is used as final graph data, and the hierarchical algorithm with the minimum number of entities in the calculated layer data is used as a final hierarchical algorithm.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
one or more memories;
one or more modules stored in a memory and capable of being executed by at least one of the one or more processors to perform the steps of the graph data layering method according to the first aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the graph data layering method according to the first aspect.
According to the technical scheme of the graph data layering, the graph data are subjected to layered calculation according to the data analysis requirement, data of a graph data structure can be optimized again, the graph data with the least number of entities are obtained, efficient display of the graph data is facilitated, the entity relation of big data can be fed back, the data analysis requirement is met finally, and the data analysis efficiency and experience of a user are improved.
Drawings
The above features, technical features, advantages and implementations of the method for asynchronous system implementation, the computer device and the storage medium will be further explained in a clear and understandable manner by referring to the preferred embodiments and the accompanying drawings.
FIG. 1 is a flow chart of a graph data layering method in an embodiment of the invention;
FIG. 2 is a block diagram of a graph data hierarchy apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device of a graph data layering method according to an embodiment of the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will illustrate specific embodiments of the present invention with reference to the drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
As shown in fig. 1, an embodiment of the present invention provides a technical solution for graph data layering, where the technical solution is described as follows:
the general idea of the technical scheme of the embodiment of the invention is as follows: and converting the big data into graph data, selecting a layering algorithm based on the analysis requirement, and grouping and aggregating the graph data with large data volume to generate new graph data. The graph data is subjected to hierarchical calculation by using a hierarchical algorithm, entities which can be merged are merged, and a new aggregation entity is generated after a plurality of entities are merged, so that the number of the entities is decreased progressively, and new graph data consisting of new entities and links among the entities is formed. By the layered calculation method, the number of entities is continuously reduced, and the aim of smooth display is finally achieved.
S100, selecting a layering algorithm according to the analysis requirement of the data, wherein the layering algorithm comprises but is not limited to one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and community discovery clustering calculation.
The hierarchical algorithm is not limited to the above-mentioned algorithm, and can also be supplemented and expanded according to the needs of data analysis services.
S200, calculating to obtain a grouping entity by using the selected layering algorithm;
namely, the original graph data is calculated by using a layering algorithm to obtain a result: 1) the number of grouped entities; 2) each group contains which entities. For example: the number of original entities is 10000. After calculation, the entities are divided into 100 groups, each group containing 100 original entities.
S300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity;
s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again.
Preferably, the specific implementation of judging whether the new layer data meets the analysis requirement is as follows:
and calculating the number of entities or links contained in the new layer data as Sum, comparing the Sum with a preset number threshold N, and judging that the analysis requirement is met if Sum is less than N.
If Sum > N, steps S100-S400 are performed again.
For example, leaf node calculation, entity calculation of the same type, entity calculation of the same attribute, and community discovery clustering calculation are sequentially performed, then the entities of the same group are aggregated, new layer data is generated according to the aggregated entities, and whether the new layer data meets the analysis requirement or not is judged, that is, the graph data can finally meet the requirements of display of user data analysis and entity relationship analysis.
Preferably, the method further comprises:
and calculating the execution times of the hierarchical algorithm, judging whether the execution times is greater than or equal to a preset time threshold, and if the execution times is greater than or equal to the time threshold, ending the operation.
Preferably, the method further comprises:
recording the entity number or the link number of the last image layer data S0;
calculating the number of the layer data or the number of links at this time S1;
and when the S0 is equal to S1, the process is ended.
The number threshold and the number threshold are variable parameters and can be dynamically set according to actual needs.
Therefore, the number of layers is the least, the number of entities is the least, and the graph data is the most brief, which is beneficial to the subsequent data display and analysis.
And after the layering calculation is finished, generating final graph data according to the final graph layer data, and performing visual display.
Wherein, preferably, the leaf node calculation process is as follows:
and converting the structured data to be analyzed into graph data, namely nodes and edges, through a graph conversion algorithm. For example, the following examples: and converting the mobile phone call record data into graph data. When the data is less, the display can be directly carried out; if the data volume is large, according to the selected and configured layering algorithm, continuously performing layering calculation on the content of the graph, gradually decreasing, reducing the graph data to be displayed, and finally performing visual display by using the data with the minimum data volume.
Calculating the number of grouped entities, traversing all the entities, and recording leaf nodes (the node with only one link is called the leaf node); and traversing opposite end nodes (neighbor nodes) of the leaf nodes, and recording the neighbor nodes and the mapping relation between the leaf nodes and the neighbor nodes. And (4) carrying out de-duplication and combination on the neighbor nodes, and calculating to obtain the number of the neighbor nodes, wherein the number of the neighbor nodes is the grouping number.
A new aggregate entity is generated. And generating a new entity according to the grouping entity, merging the neighbor nodes and the leaf nodes with the mapping relation, and endowing the merged result to the new aggregation entity.
And generating new layer data according to the new aggregation entity. And after all entities in the same group are combined, new layer data is generated. Since all leaf nodes have been merged, the leaf node computation layering algorithm does not need to iterate again.
And carrying out visual display on the generated new layer data.
Preferably, the calculation process of the entities of the same type is as follows:
and converting the structured data to be analyzed into graph data, namely nodes and edges, through a graph conversion algorithm. The type of data imported may be of different types. For example: mobile phone call record data, payment treasures transfer record, logistics data, QQ and the like.
Calculating the number of packet entities: and traversing all the entities, recording the types of the entities, performing de-duplication combination on the entity types, and calculating the number of the entity types, wherein the number of the entity types is the packet number.
And generating a new aggregation entity, grouping the entities with the same type into a group, setting the group as a grouping entity, merging all the entities in the same group, and endowing the merged result to the new aggregation entity.
And generating new layer data according to the new aggregation entity. And after all entities in the same group are combined, new layer data is generated. Since all entities of the same type have been merged, the same type node computation layering algorithm does not need to iterate again.
And carrying out visual display on the generated new layer data.
Preferably, the calculation process of the same attribute entity is as follows:
the structured data to be analyzed is converted into graph data, i.e. nodes and edges, by a graph conversion algorithm, for example: and converting the mobile phone call record data into graph data.
And calculating the number of grouped entities, assuming that the selected entity attribute name is the 'identity card number', traversing the 'identity card number' attribute values of all the entities, and recording the corresponding identity card numbers of the entities. And (4) de-duplication and combination are carried out on the ID card numbers, the number of the ID card numbers is calculated, and the number of the ID card numbers is the number of the groups.
And generating a new aggregation entity, grouping the entities with the same identification number into a group, merging all the entities in the same group, and endowing the merged result to the new aggregation entity.
And generating new layer data according to the new aggregation entity. And after all entities in the same group are combined, new layer data is generated. Since all nodes of the same attribute have been merged, the computation of the hierarchical algorithm from the nodes of the same attribute does not need to be iterated again.
And carrying out visual display on the generated new layer data.
Preferably, the community discovery cluster calculation process is as follows:
and converting the structured data to be analyzed into graph data, namely nodes and edges, through a graph conversion algorithm. For example, the following examples: and converting the bank transaction record data into graph data.
Calculating the number of grouped entities, traversing all entities of the whole graph of the graph data, calculating by using a community discovery algorithm (K-Core), calculating to obtain the community number of the whole graph, and recording the mapping dependency relationship between the entities and the communities. The number of communities is the number of groups. The community discovery algorithm includes, but is not limited to: K-Core, FastUnfolding, etc.
A new aggregate entity is generated. And generating a new entity according to the grouped entities, merging the entities of the same community, and endowing a merged result to a new aggregation entity.
And generating new layer data according to the new aggregation entity. And after all entities in the same group are combined, new layer data is generated. Since all nodes of the same community have been merged, the community discovery cluster computation hierarchical algorithm does not need to iterate again.
And carrying out visual display on the generated new layer data.
Preferably, when the selection configuration of the selection layering algorithm is "sequential calculation, with good effect and priority", combined iterative layering calculation is generated, calculation is performed in sequence according to various selected layering algorithms including but not limited to leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery clustering calculation and the like, and the layer data with the minimum entity number in the last layer is selected as the last graph data.
The process is as follows:
and converting the structured data to be analyzed into graph data, namely nodes and edges, through a graph conversion algorithm. The type of data imported may be of different types. For example: mobile phone call record data, payment treasures transfer record, logistics data, QQ and the like.
The number of packet entities is calculated. Algorithms such as leaf node calculation, entity calculation of the same type, entity calculation of the same attribute, community discovery clustering calculation and the like are sequentially executed, and the result of each algorithm, namely the number of groups of each algorithm and the number of entities after combination, is respectively recorded. And selecting the result of the algorithm with the best effect as the grouping entity number calculated at this time, and recording the selected algorithm so as to execute the subsequent steps.
A new aggregate entity is generated. And generating a new entity according to the grouped entities, merging the entities in the same group, and endowing the merged result to the new aggregation entity.
And generating new layer data according to the new aggregation entity. And after all the time combinations in the same group are completed, new layer data are generated.
And judging whether convergence occurs or not. And judging whether to continue layering or generate final image data according to the newly generated image layer data.
The judgment conditions include:
1) the number of newly generated entities is less than a set number threshold;
alternatively, the first and second electrodes may be,
2) by performing algorithms such as leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery clustering calculation, etc., no graph data is reduced. When in use
When any of the above two conditions is satisfied, convergence is determined. Otherwise, jumping to execute the layered calculation again.
Because the convergence condition of the previous step is met and all needed nodes are merged, the layering algorithm does not need to iterate again to generate final layer data.
And carrying out visual display on the generated new layer data. By the optimal selection method of the algorithm, the layering of the graph data can be minimized, the graph data is simpler, and the subsequent analysis and display are facilitated.
Through the embodiment, the graph data layering method can optimize the data of the graph data structure again to obtain the graph data with the least number of entities, is beneficial to efficient display of the graph data, can better feed back the entity relation of the big data, and finally meets the requirement of data analysis.
As shown in fig. 2, an embodiment of the present invention further provides a graph data hierarchy apparatus, where the apparatus includes:
the algorithm selection module 100 is configured to select a hierarchical algorithm according to the analysis requirement of the data, where the hierarchical algorithm includes, but is not limited to, one or more of leaf node calculation, same type entity calculation, same attribute entity calculation, and social discovery clustering calculation;
the hierarchical computation module 101 is configured to perform hierarchical computation by using a selected hierarchical algorithm, and compute the graph data to obtain a grouped entity;
an entity merging module 102, configured to merge entities in the same group to generate a new aggregation entity, and construct new layer data according to the aggregation entity;
and the convergence module 103 is configured to determine whether the new layer data meets an analysis requirement, if so, end the process, and if not, enable the algorithm selection module, the hierarchical computation module, the entity combination module, and the convergence module to execute again in sequence.
Preferably, the determining, by the convergence module, whether the new layer data meets the analysis requirement specifically includes:
and calculating the number Sum of entities or links contained in the new layer data, comparing the number Sum with a preset number threshold N, and if Sum < equalto N, judging that the analysis requirement is met.
Preferably, the convergence module further comprises:
a recording unit 104, configured to record the entity number or the link number of the last image-layer data S0, and calculate the entity number or the link number of the current image-layer data S1;
a determination is made as to whether S0 is equal to S1, and if so, the process is complete.
According to the embodiment of the invention, big data are converted into graph data, then a layering algorithm is selected based on the analysis requirement, and the graph data with large data volume is grouped and aggregated to generate new graph data. The graph data is hierarchically calculated by using a hierarchical calculation method, entities which can be merged are merged, and a new aggregation entity is generated after a plurality of entities are merged, so that the number of the entities is decreased progressively, and the new graph data consisting of the new entities and links among the entities is formed. By the layered calculation method, the number of entities is continuously reduced, and the aim of smooth display is finally achieved.
Preferably, the algorithm selection module 100 uses a hierarchical algorithm, which includes, but is not limited to, leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery cluster calculation, and the like, to sequentially perform hierarchical calculation, and uses the layer data with the minimum number of entities in the calculated layer data as final graph data, and uses the hierarchical algorithm with the minimum number of entities in the calculated layer data as a final hierarchical algorithm.
Here, the hierarchical computation is performed by one or a combination of more than one of leaf node computation, same type entity computation, same attribute entity computation, community discovery clustering computation, and the like, and finally the graph data meeting the analysis requirement is obtained, and the implementation process of the final display is the same as that of the graph data hierarchical method, and is not repeated here.
Fig. 3 is a schematic physical structure diagram of a computer device according to an embodiment of the present invention, where the computer device is installed in a third-party device, such as a mobile terminal, a portable computer, an IPAD, and the like, and as shown in fig. 3, the server may include: one or more processors (processors) 610, a communication Interface (communication Interface)620, one or more memories (memories) 630 and a communication bus 640, wherein the processors 610, the communication Interface 620 and the memories 630 complete communication with each other through the communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform the method s100. depending on the analysis needs of the data, a hierarchical algorithm is selected, including but not limited to one or more of leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery cluster calculation;
s200, performing layered calculation by using a selected layered algorithm, and calculating the graph data to obtain a grouping entity;
s300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity;
s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again.
A communication bus 640 is a circuit that connects the described elements and enables transmission between the elements. For example, the processor 610 receives commands from other elements through the communication bus 640, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory 630 may include program modules such as a kernel (kernel), middleware (middleware), an Application Programming Interface (API), and an Application program. The program modules may be comprised of software, firmware, or hardware, or at least two of the same. Communication interface 620 connects the computer device with other network devices, clients, mobile devices, networks. For example, the communication interface 620 may be connected to a network by wire or wirelessly to connect to external other network devices or user devices. The wireless communication may include at least one of: wireless fidelity (WiFi), Bluetooth (BT), Near Field Communication (NFC), Global Positioning Satellite (GPS) and cellular communications, among others. The wired communication may include at least one of: universal Serial Bus (USB), high-definition multimedia interface (HDMI), asynchronous transfer standard interface (RS-232), and the like. The network may be a telecommunications network and a communications network. The communication network may be a computer network, the internet, an internet of things, a telephone network. The computer device may connect to the network through communication interface 620, and the protocol by which the computer device communicates with other network devices may be supported by at least one of an application, an Application Programming Interface (API), middleware, a kernel, and communication interface 620.
Further, embodiments of the present invention disclose a 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, the computer is capable of performing the methods provided by the above-mentioned method embodiments, for example, comprising: s100, selecting a layering algorithm according to the analysis requirement of data, wherein the layering algorithm comprises but is not limited to one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and social discovery clustering calculation; s200, performing layered calculation by using a selected layered algorithm, and calculating the graph data to obtain a grouping entity; s300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity; s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again.
Further, embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above-described method embodiments, for example, including: s100, selecting a hierarchical algorithm according to the analysis requirement of data, wherein the hierarchical algorithm comprises but is not limited to one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and community discovery clustering calculation; s200, performing layered calculation by using a selected layered algorithm, and calculating the graph data to obtain a grouped entity; s300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity; s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again.
Those of ordinary skill in the art will understand that: in addition, the logic instructions in the memory may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit the same, and the above embodiments can be freely combined according to the needs; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention. Without departing from the principle of the invention, several improvements and modifications can be made, and these improvements and modifications should also be construed as the scope of the invention.

Claims (10)

1. A graph data layering method, the method comprising:
s100, selecting a layering algorithm according to the analysis requirement of data, wherein the layering algorithm comprises but is not limited to one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and community discovery clustering calculation;
s200, performing layered calculation by using a selected layered algorithm, and calculating the graph data to obtain a grouping entity;
s300, combining the entities in the same group to generate a new aggregation entity, and constructing new layer data according to the aggregation entity;
s400, judging whether the new layer data meet the analysis requirements, if so, ending, and if not, executing the steps S100-S400 again.
2. The graph data layering method according to claim 1, wherein the determining whether the new graph layer data meets the analysis requirement specifically comprises:
and calculating the number Sum of entities or links contained in the new layer data, comparing the number Sum with a preset number threshold N, and if Sum < equalto N, judging that the analysis requirement is met.
3. The graph data layering method according to claim 1 or 2, characterized in that the method further comprises:
s500, recording the entity quantity or the link quantity of the last layer data S0;
s600, calculating the entity quantity or the link quantity of the layer data at this time S1;
s700, when S0 is S1, the process ends.
4. The graph data layering method of claim 3, wherein the method further comprises:
and calculating the execution times of the hierarchical algorithm, judging whether the execution times is greater than or equal to a preset time threshold, and if the execution times is greater than or equal to the time threshold, ending the operation.
5. The graph data layering method according to claim 1 or 2, wherein the selecting a layering algorithm according to the analysis requirements of the data specifically comprises:
and (3) utilizing a layering algorithm, wherein the layering algorithm comprises but is not limited to leaf node calculation, same-type entity calculation, same-attribute entity calculation, community discovery clustering calculation and the like, sequentially carrying out layering calculation, taking the layer data with the least number of entities in the calculated layer data as final graph data, and taking the layering algorithm with the least number of entities in the calculated layer data as a final layering algorithm.
6. A graph data layering apparatus, the apparatus comprising:
the algorithm selection module is used for selecting a hierarchical algorithm according to the analysis requirement of the data, wherein the hierarchical algorithm comprises one or more of leaf node calculation, same type entity calculation, same attribute entity calculation and community discovery clustering calculation;
the hierarchical calculation module is used for executing hierarchical calculation by utilizing a selected hierarchical algorithm and calculating the graph data to obtain a grouped entity;
the entity merging module is used for merging the entities in the same group to generate a new aggregation entity and constructing new layer data according to the aggregation entity;
and the convergence module is used for judging whether the new layer data meets the analysis requirement, if so, ending the analysis, and if not, enabling the algorithm selection module, the hierarchical calculation module, the entity combination module and the convergence module to execute in sequence again.
7. The graph data layering device according to claim 6, wherein the determining, by the convergence module, whether the new graph layer data meets the analysis requirement specifically includes:
and calculating the number Sum of entities or links contained in the new layer data, comparing the number Sum with a preset number threshold N, and if Sum < equalto N, judging that the analysis requirement is met.
8. The graph data layering apparatus according to claim 7 or 2, wherein the convergence module further comprises:
the recording unit is used for recording the entity number or the link number S0 of the last image layer data and calculating the entity number or the link number S1 of the current image layer data;
a determination is made as to whether S0 is equal to S1, and if so, the process is complete.
9. The graph data layering device according to claim 6 or 7, wherein the algorithm selection module uses a layering algorithm, the layering algorithm includes but is not limited to leaf node calculation, same type entity calculation, same attribute entity calculation, community discovery cluster calculation, and the like, the layering calculation is performed in sequence, the layer data with the minimum number of entities in the calculated layer data is used as final graph data, and the layering algorithm with the minimum number of entities in the calculated layer data is used as a final layering algorithm.
10. A computer device, characterized in that the computer device comprises:
one or more processors;
one or more memories;
one or more modules stored in a memory and capable of being executed by at least one of the one or more processors to perform the steps of the graph data layering method according to any one of claims 1 to 5.
CN201911171342.9A 2019-11-26 2019-11-26 Graph data layering method and device and computer equipment Pending CN110941746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911171342.9A CN110941746A (en) 2019-11-26 2019-11-26 Graph data layering method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911171342.9A CN110941746A (en) 2019-11-26 2019-11-26 Graph data layering method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN110941746A true CN110941746A (en) 2020-03-31

Family

ID=69908266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911171342.9A Pending CN110941746A (en) 2019-11-26 2019-11-26 Graph data layering method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN110941746A (en)

Similar Documents

Publication Publication Date Title
CN113642673B (en) Image generation method, device, equipment and storage medium
US20220385739A1 (en) Method and apparatus for generating prediction information, electronic device, and computer readable medium
CN110570279A (en) Strategic recommendation method and device based on real-time user behavior
CN108512817B (en) Multi-video transcoding scheduling method and device
CN110941746A (en) Graph data layering method and device and computer equipment
CN114723976A (en) Subgraph pattern matching method and device for computational graph
CN114092162B (en) Recommendation quality determination method, and training method and device of recommendation quality determination model
CN113630476B (en) Communication method and communication device applied to computer cluster
CN112507676B (en) Method and device for generating energy report, electronic equipment and computer readable medium
CN113850390A (en) Method, device, equipment and medium for sharing data in federal learning system
CN110704679A (en) Video classification method and device and electronic equipment
WO2023019427A1 (en) Method and apparatus for graph-based recommendation
WO2022121029A1 (en) Multipath routing method and device for supercomputing user experience quality
US20240134892A1 (en) Information generation method, apparatus, electronic device, and computer -readable medium
CN111582482B (en) Method, apparatus, device and medium for generating network model information
CN112100678B (en) Data processing method and device based on privacy protection and server
US20240064179A1 (en) Highly scalable four-dimensional geospatial data system for simulated worlds
CN113342998B (en) Multimedia resource recommendation method and device, electronic equipment and storage medium
CN115310008A (en) Data processing method and system
CN115797134A (en) Image processing method, device and storage medium
CN116028468A (en) Database tuning method, device, equipment, storage medium and program product
CN112785407A (en) Multi-population genetic algorithm-based method and device for optimizing distribution proportion of nodes
CN116916463A (en) Network resource scheduling method, device, computer equipment and storage medium
CN112667679A (en) Data relation determination method and device and server
CN115238137A (en) Node processing method and device based on graph neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200331