Relational network layout method and system
By establishing a feature library of relationship network graphs and selecting known layout methods using feature value matching, the problem of inappropriate layout of relationship network graphs in the existing technology is solved, and the appropriate layout method is automatically selected, which improves layout applicability and visualization effect.
Patent Information
- Application Number
- CN202311868517.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, the layout of the relational network diagram usually depends on user preferences or experience, and it is difficult to adapt to the new relational network diagram, resulting in the problem of inappropriate layout.
By pre-establishing a feature library containing relational network diagram samples, determining similarity using feature value matching, selecting the better layout methods known in historical data, and automatically selecting the appropriate layout methods.
Without relying on manual experience, you can accurately choose the layout method suitable for the new relationship network diagram, which improves the applicability and visualization of the layout.
Smart Images

Figure CN120234449A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and particularly to a method and system for relationship network layout. Background Art
[0002] A relationship network diagram is a graphical structure composed of nodes and edges. When displaying and analyzing a relationship network diagram, it is usually necessary to perform visual display, that is, to visually display the nodes and the edges between the nodes in the relationship network through graph visualization. In this visualization, how to effectively display the topological structure of the relationship network is a problem involved in the layout method of the relationship network diagram.
[0003] There are various layout algorithms for the layout of relationship network diagrams, such as tree layout, force-directed layout, radial layout, hierarchical layout, circular layout, etc. Each layout method has its own characteristics and usage scenarios. Currently, the default layout method is usually based on user preferences or a layout method is randomly selected. However, these layout methods may not be suitable for the current new relationship network diagram. How to select a suitable layout method for the new relationship network diagram is an important problem that needs to be solved urgently at present. Summary of the Invention
[0004] In view of this, the embodiments of this specification provide a method for relationship network layout. One or more embodiments of this specification simultaneously relate to a relationship network layout system, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.
[0005] According to the first aspect of the embodiments of this specification, a method for relationship network layout is provided, including: determining a relationship network diagram to be laid out, calculating a target feature value of a preset feature dimension of the relationship network diagram, and determining, from the feature library, a known layout method corresponding to a relationship network diagram sample whose similarity meets a preset matching condition based on the similarity between the target feature value and the feature value of the relationship network diagram sample in the feature library as the layout method of the relationship network diagram, where the known layout method corresponding to the relationship network diagram sample is obtained based on historical relationship network diagram data.
[0006] According to the second aspect of the embodiments of this specification, a relational network layout method is provided, which is applied to an edge device and includes: sending a layout request to a cloud device, enabling the cloud device to receive the layout request, determining a relational network diagram to be laid out according to the layout request, calculating target feature values of a preset feature dimension of the relational network diagram, and determining, from the feature library, a known layout method corresponding to a relational network diagram sample whose similarity meets a preset matching condition as the layout method of the relational network diagram, where the known layout method corresponding to the relational network diagram sample is obtained based on historical relational network diagram data, and sending the layout method to the edge device; receiving the layout method returned by the cloud device; and visually displaying the relational network diagram in the layout method.
[0007] According to the third aspect of the embodiments of this specification, a relational network layout system is provided, including: a cloud device, configured to receive a layout request, determine a relational network diagram to be laid out according to the layout request, obtain the layout method of the relational network diagram by applying the relational network layout method described in any embodiment of this specification, and send the layout method to the edge device; and an edge device, configured to send the layout request to the cloud device, receive the layout method returned by the cloud device, and visually display the relational network diagram in the layout method.
[0008] According to the fourth aspect of the embodiments of this specification, a computing device is provided, including: a memory and a processor; the memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the above relational network layout method are implemented.
[0009] According to the fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above relational network layout method are implemented.
[0010] According to the sixth aspect of the embodiments of this specification, a computer program is provided, where when the computer program is executed on a computer, the computer is made to execute the steps of the above relational network layout method.
[0011] One embodiment of this specification implements a relational network layout method. After determining the relational network diagram to be laid out, this method calculates the target eigenvalue of the preset feature dimension of the relational network diagram, and determines, from the feature library, the known layout method corresponding to the relational network diagram sample whose similarity meets the preset matching condition based on the similarity between the target eigenvalue and the eigenvalue of the relational network diagram sample in the feature library, as the layout method of the relational network diagram. It can be seen that the method provided by the embodiment of this specification pre - establishes a feature library containing the known layout methods corresponding to the relational network diagram samples by using historical relational network diagram data. Since the relational network diagram is described by eigenvalues, when a new relational network diagram is input, it is possible to find a relational network diagram with a similar known better layout method in the feature library and adopt the same layout method, achieving the purpose of selecting a better layout method to display the relational network diagram without relying on manual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a framework diagram of a relational network layout system provided by an embodiment of this specification;
[0013] Figure 2 is a flowchart of a relational network layout method provided by an embodiment of this specification;
[0014] Figure 3 is a relational network diagram provided by an embodiment of this specification;
[0015] Figure 4 is a processing procedure flowchart of a relational network layout method provided by an embodiment of this specification;
[0016] Figure 5 is a structural schematic diagram of a relational network layout device provided by an embodiment of this specification;
[0017] Figure 6 is a flowchart of a relational network layout method provided by another embodiment of this specification;
[0018] Figure 7 is a framework diagram of a relational network layout system provided by an embodiment of this specification;
[0019] Figure 8 is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] Numerous specific details are set forth in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of this specification. Therefore, this specification is not limited by the specific implementations disclosed below.
[0021] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "the", and "said" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0022] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon" or "in response to determining".
[0023] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for the user to select to authorize or refuse.
[0024] The relational network layout method provided in one or more embodiments of this specification can be implemented using a machine learning model. Among them, the machine learning model can be a deep machine learning model with a large number of model parameters, usually containing hundreds of millions, tens of billions, hundreds of billions, trillions or even more than one quadrillion model parameters. The large model can also be called a Foundation Model. Through pre-training of the large model with a large amount of unlabeled corpus, a pre-trained model with more than one hundred million parameters is produced. This model can adapt to a wide range of downstream tasks and has good generalization ability. For example, large language models (LLMs), multi-modal pre-training models, etc.
[0025] When the large model is actually applied, only a small number of samples are needed to fine-tune the pre-trained model for application to different tasks. The large model can be widely applied in fields such as natural language processing (NLP), computer vision, etc. Specifically, it can be applied to tasks in the field of computer vision such as visual question answering (VQA), image captioning (IC), image generation, etc., and tasks in the field of natural language processing such as text-based sentiment classification, text summary generation, machine translation, etc. The main application scenarios of the large model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.
[0026] First, the noun terms involved in one or more embodiments of this specification are explained.
[0027] A graph is a data structure that contains a finite (which can be variable) set as the node set, and a set of unordered pairs (corresponding to undirected graphs) or ordered pairs (corresponding to directed graphs) as the set of edges (also called arcs in directed graphs). In the data structure of a graph, it can also contain a value associated with each edge, such as a label or a value (such as weight, weight; representing cost, capacity, length, etc.).
[0028] Relational network diagram. A relational network diagram is a graphical structure composed of nodes and edges, where nodes represent entities and edges represent the relationships between nodes. In a relational network diagram, nodes can have attributes, representing the characteristics or attribute information of the nodes. Edges can be directed or undirected. Directed edges indicate that the relationship has a direction, and undirected edges indicate that the relationship is symmetric. Relational networks can be represented by matrices or adjacency lists and can be subjected to various network analysis and mining. Common network analysis methods include degree centrality analysis, betweenness centrality analysis, clustering analysis, community detection, etc. Through the analysis of relational networks, the structure and dynamic characteristics of complex systems can be understood, the interactions and influences between nodes can be revealed, and support for decision-making and prediction can be provided.
[0029] Layout of relational network diagrams. There are various layout algorithms, such as tree layout, force-directed layout, radial layout, hierarchical layout, circular layout, etc. Each layout method has its own characteristics and usage scenarios. Currently, the layout method is usually set according to user preferences or experience. However, these layout methods may not be suitable for the current new relational network diagrams. How to select a suitable layout method for new relational network diagrams is an important problem that needs to be solved urgently.
[0030] In view of this, the embodiments of this specification have pre-established a feature library containing the known layout methods corresponding to relational network diagram samples using historical relational network diagram data. Since relational network diagrams are described by feature values, when a new relational network diagram is input, a relational network diagram with a similar known optimal layout method can be found in the feature library, and the same layout method can be adopted, without relying on manual experience, to achieve the purpose of selecting an optimal layout method to display the relational network diagram.
[0031] Specifically, in this specification, a relational network layout method is provided. This specification also relates to a relational network layout system, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments.
[0032] See Figure 1 , Figure 1 shows a framework diagram of a relational network layout system provided by an embodiment of this specification. Among them, the relational network layout system can include cloud-side devices and end-side devices.
[0033] In the case where there are multiple end-side devices, communication connections can be established between the multiple end-side devices through the cloud-side devices. In the machine learning model detection scenario, the cloud-side devices are used to provide relational network layout services between the multiple end-side devices. The multiple end-side devices can be used as senders or receivers respectively and communicate through the cloud-side devices.
[0034] Specifically, the edge device is used to send a layout request to the cloud device, and the layout request may carry relevant information about the relationship network diagram to be laid out;
[0035] The cloud device is used to receive the layout request, determine the relationship network diagram to be laid out according to the layout request, calculate the target feature value of the preset feature dimension of the relationship network diagram, and determine from the feature library the known layout method corresponding to the relationship network diagram sample whose similarity meets the preset matching condition based on the similarity between the target feature value and the feature value of the relationship network diagram sample in the feature library as the layout method of the relationship network diagram. The known layout method corresponding to the relationship network diagram sample is obtained based on historical relationship network diagram data, and send the layout method to the edge device.
[0036] The edge device is used to receive the layout method returned by the cloud device and visually display the relationship network diagram in the layout method.
[0037] Among them, a connection can be established between the edge device and the cloud device through a network. The network provides a medium for the communication link between the edge device and the cloud device. The network can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc. The data transmitted by the edge device may need to be processed such as encoded, transcoded, compressed, etc. before being sent to the cloud device.
[0038] The edge device can include a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5) application, or a light application (also known as a mini-program, a lightweight application program), or a cloud application, etc. The application of the edge device can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server side, such as developed based on the real-time communication (RTC) SDK. The edge device can be manifested as an electronic device or run depending on certain APPs in the device. The electronic device can, for example, have a display screen and support information browsing, etc., such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can usually be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0039] The cloud - side device may include servers that provide various services. For example, a server that provides communication services for multiple clients, or a server for background training that supports the models used on the client, or a server that processes the data sent by the client, etc. It should be noted that the cloud - side device can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with blockchain. The server can also be a cloud server of basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0040] It is worth noting that the relationship network layout method provided in the embodiments of this specification can be executed by the cloud - side device. In other embodiments of this specification, the edge - side device can also have similar functions to the cloud - side device, so as to execute the relationship network layout method provided in the embodiments of this specification; in other embodiments, the method for processing features based on a machine - learning model provided in the embodiments of this specification can also be jointly executed by the cloud - side device and the edge - side device.
[0041] The relationship network layout system provided in the embodiments of this specification pre - establishes a feature library containing the known layout methods corresponding to relationship network graph samples using historical relationship network graph data. Since the relationship network graph is described by feature values, when a new relationship network graph is input, it is possible to find a relationship network graph with a similar known better layout method in the feature library and adopt the same layout method, achieving the purpose of selecting a better layout method to display the relationship network graph without relying on manual experience.
[0042] See Figure 2 , Figure 2 shows a flowchart of a relationship network layout method according to an embodiment of this specification, which specifically includes the following steps.
[0043] Step 202: Determine the relationship network graph to be laid out.
[0044] For example, when the user issues a request to display the relationship network to determine the relationship network graph to be laid out, the relationship network graph to be laid out can be determined according to the user's request. The relationship network graph can be provided by the user, or based on the user's request, the relationship network graph to be laid out can be obtained locally or remotely.
[0045] Step 204: Calculate the target feature values of the preset feature dimensions of the relationship network graph.
[0046] The preset feature dimension refers to one or more feature dimensions that can be used to describe the relationship network diagram. For example:
[0047] The target feature value refers to a representation method in which the relationship network data of the relationship network diagram is mapped into a feature vector of a certain length through feature extraction, and is used to represent the feature information of the relationship network diagram. For example, the target feature value of the relationship network diagram is extracted through a machine learning model, and the target feature value can be represented as a vector of a certain length. The preset feature dimension may include any one or more of the following attribute dimensions: edges, nodes, between edges and nodes, between edges and edges, and between nodes and nodes.
[0048] Step 206: According to the similarity between the target feature value and the feature value of the relationship network diagram sample in the feature library, determine, from the feature library, the known layout method corresponding to the relationship network diagram sample whose similarity meets the preset matching condition, as the layout method of the relationship network diagram. The known layout method corresponding to the relationship network diagram sample is obtained based on historical relationship network diagram data.
[0049] When determining the known layout method corresponding to the relationship network diagram sample whose similarity meets the preset matching condition from the feature library, it can be directly selected from the feature library, or predicted based on the feature library using a neural network model. This specification does not limit this.
[0050] The method provided in the embodiments of this specification pre-establishes a feature library containing the known layout methods corresponding to the relationship network diagram samples using historical relationship network diagram data. Since the relationship network diagram is described by feature values, when a new relationship network diagram is input, it is possible to find a relationship network diagram with a similar known better layout method in the feature library and adopt the same layout method, without relying on manual experience, to achieve the purpose of selecting a better layout method to display the relationship network diagram.
[0051] In one or more embodiments of this specification, the preset feature dimension includes any one or more of the following feature dimensions:
[0052] The ratio of the number of nodes to the number of actual existing edges in the relationship network diagram;
[0053] The average degree of nodes in the relationship network diagram;
[0054] The variance of the degrees of nodes in the relationship network diagram;
[0055] The ratio of the number of actual existing edges to the maximum number of edges that can exist in the relationship network diagram;
[0056] The maximum value of the shortest path between any two nodes in the relationship network diagram;
[0057] The average value of the shortest paths between any two nodes in the relationship network diagram;
[0058] The number of triangle combinations formed by any three nodes that can form a triangle in the relationship network diagram;
[0059] The ratio of the number of actually existing triangle combinations in the relationship network diagram to the number of triangle combinations formed by any three nodes that can form a triangle;
[0060] The number of combinations of semi - triangles actually existing in the relationship network diagram;
[0061] The ratio of the number of actually existing triangle combinations to the number of combinations of semi - triangles in the relationship network diagram;
[0062] The number of independent clusters in the relationship network diagram, where the independent clusters are composed of directly or indirectly connected nodes, and the nodes between any two independent clusters are not connected;
[0063] The proportion of nodes that can be directly connected and have the same degree in all nodes in the relationship network diagram;
[0064] The attribute values of the nodes in the relationship network diagram.
[0065] A semi - triangle refers to a group formed by connecting three nodes with only two edges. For example, in the relationship network diagram shown as Figure 3 only the edges AD and AE connect three points. Therefore, the edges AD and AE form a semi - triangle.
[0066] For example: Assume the number of nodes in the relationship network diagram is N, the number of actually existing edges is M, and the maximum number of edges that can be constructed between all nodes is N(N - 1) / 2. Then: The ratio of the number of nodes to the number of actually existing edges in the relationship network diagram is N / M; The average degree of the nodes in the relationship network diagram can be understood as the average value of the number of edges actually connected to each node in the relationship network diagram; The variance of the degrees of the nodes in the relationship network diagram can be understood as the variance of the number of edges actually connected to each node in the relationship network diagram; The ratio of the number of actually existing edges to the maximum number of possible edges in the relationship network diagram is 2M / N(N - 1), and this ratio can also be understood as the density; The number of combinations of any three nodes that may form a triangle can be understood as the maximum number of triangle groups that exist in the relationship network diagram under the current number of N nodes; An independent cluster means that the nodes within a cluster are all directly or indirectly connected, and two independent clusters mean that the nodes of one cluster and the nodes of another cluster are not directly or indirectly connected to each other, as Figure 3In the relationship network diagram shown, nodes A - E form an independent cluster, and nodes G - I form another independent cluster; the attribute value can be understood as the attribute value corresponding to the attribute that the node has, and is usually used to represent the characteristics or attribute information of the node.
[0067] In the above - mentioned embodiment, the relationship network diagram is described by the feature values of multiple feature dimensions among edges, nodes, between edges and nodes, between edges and edges, and between nodes and nodes, which can fully and accurately describe the relationship network diagram. Thus, when a new relationship network diagram is input, the layout method of the most similar relationship network diagram can be accurately found in the feature library, and then the same layout method can be adopted for the new relationship network diagram, making the layout method of the new relationship network diagram more appropriate.
[0068] Correspondingly, when the feature library is pre - constructed, feature extraction is also performed according to the same preset feature dimensions. Specifically, the method further includes:
[0069] Obtain the relationship network diagram sample and the known layout method corresponding to the relationship network diagram sample;
[0070] Calculate the feature values of the preset feature dimensions of the relationship network diagram sample;
[0071] Add the feature values of the relationship network diagram sample and the corresponding known layout method to the feature library.
[0072] The layout method refers to a visual display method for presenting the topological structure of the relationship network. The layout method can include: tree - like layout, force - directed layout, radiation layout, hierarchical layout, circular layout, and any other layout methods. The acquisition method of the relationship network diagram sample is not limited. For example, all the relationship network diagrams created by all users in the system can be obtained as samples.
[0073] Suppose the set G of relationship network diagrams created by all users in the system is G = {G1, G2,..., Gn}, a total of n relationship network diagrams. The set L of all layout methods supported by the system includes: L = {L1, L2,..., Lm}, a total of m layout methods. The feature value of each relationship network diagram is F, and F is a k - dimensional feature vector <F1, F2,..., Fk>. For example, the k - dimensional feature can include any one or more of the feature dimensions provided in the above - mentioned embodiment.
[0074] In one or more embodiments of this specification, the prediction of the relationship network layout method can be based on a machine - learning model. In this embodiment, the method may further include the training process of the machine - learning model. Specifically, the method further includes:
[0075] Use the eigenvalue corresponding to the relationship network diagram sample in the feature library as the input sample, and the known layout method as the output label to train the machine learning model for predicting the layout method of the relationship network diagram based on similarity, and obtain the trained machine learning model.
[0076] For example, the processing process in the training stage is as Figure 4 shown and may include:
[0077] Step 402: Initialize the GFD set in the feature library.
[0078] The initialization may include: declaring an empty GFD set and the elements of the set.
[0079] Step 404: Determine whether the next relationship network diagram Gi can be obtained.
[0080] Step 406: If so, use the next relationship network diagram Gi as the input sample, and calculate the target eigenvalue Gli of Gi based on the machine learning model.
[0081] After calculating the target eigenvalue, use the known layout method corresponding to Gi as the output label, calculate the prediction loss of the machine learning model based on the prediction result of the relationship network diagram layout method and the output label, and fine-tune the model parameters of the machine learning model based on the prediction loss, so as to realize the training of the machine learning model for this input.
[0082] Step 408: Add the calculated target eigenvalue GFi of Gi and the layout method GLi selected by the user, <GFi, GLi> to the feature library set GFD.
[0083] Re-enter Step 404.
[0084] Step 410: If the next relationship network diagram cannot be obtained, determine that the training is over and obtain the trained machine learning model.
[0085] Through the processing of the above Step 404 - Step 410, obtain all the existing relationship network diagrams G = {G1, G2,..., Gn} in the system and the layout methods {GL1, GL2,..., GLn} selected by the user for these existing relationship network diagrams, and complete the training of the machine learning model, where Calculate the K-dimensional target eigenvalue GFi for each relationship network diagram Gi in G. As in the above embodiment, a 13-dimensional feature vector can be calculated for each relationship network diagram.
[0086] After obtaining the trained machine learning model, selecting, from the feature library, the known layout method corresponding to the relationship network graph sample whose similarity meets the preset matching condition as the layout method of the relationship network graph according to the similarity between the target feature value and the feature value of the relationship network graph sample in the feature library includes:
[0087] Input the target feature value into the trained machine learning model to obtain the layout method prediction result output by the trained machine learning model.
[0088] For example, combining the processing process in the above training stage, the processing process in the application stage is as Figure 4 shown and may include:
[0089] Step 412: Obtain the relationship network graph Gj newly made by the user.
[0090] Step 414: Use the machine learning model to calculate the target feature value GFj of the relationship network graph Gj.
[0091] Specifically, the target feature value GFj can be calculated according to the preset feature dimensions in the above embodiments.
[0092] Step 416: Use the machine learning model to calculate the feature value GFp in the feature library that is closest to GFj.
[0093] For example: The KNN (K-Nearest Neighbor) algorithm of the machine learning model can be used to find the feature value GFp in the feature library set GFD in the training stage that is closest to GFj.
[0094] Step 418: Obtain the layout method GLp corresponding to GFp.
[0095] Step 420: Set the layout method of the current relationship network graph Gj to GLp.
[0096] Furthermore, when the method provided in the embodiments of this specification is applied to the cloud-side device, the method may further include: sending the layout method of the relationship network graph to the end-side device, so that the end-side device visually displays the relationship network graph in the layout method.
[0097] For example: The end-side device may be pre-set with the interface generation methods corresponding to various layout methods. When receiving the layout method of the current relationship network graph from the cloud-side device, it can generate the visual display effect of the relationship network graph based on the corresponding interface generation method.
[0098] It should be noted that in the method provided by the embodiments of this specification, the preset feature dimensions of the relationship network diagram can be flexibly set according to the needs of the actual application scenario, and this specification does not limit this.
[0099] Corresponding to the above method embodiments, this specification also provides embodiments of a relationship network layout device. Figure 5 The structure diagram of a relationship network layout device provided by an embodiment of this specification is shown. As Figure 5 shown, the device includes:
[0100] A diagram determination module 502, configured to determine a relationship network diagram to be laid out.
[0101] A feature calculation module 504, configured to calculate the target feature value of the preset feature dimension of the relationship network diagram.
[0102] A feature matching module 506, configured to determine, from the feature library, the known layout method corresponding to the relationship network diagram sample whose similarity meets the preset matching condition as the layout method of the relationship network diagram according to the similarity between the target feature value and the feature value of the relationship network diagram sample in the feature library.
[0103] In one or more embodiments of this specification, the device further includes:
[0104] A layout acquisition module, configured to acquire the relationship network diagram sample and the known layout method corresponding to the relationship network diagram sample;
[0105] A sample calculation module, configured to calculate the feature value of the preset feature dimension of the relationship network diagram sample;
[0106] A layout addition module, configured to add the feature value of the relationship network diagram sample and the corresponding known layout method to the feature library.
[0107] In one or more embodiments of this specification, the device further includes: a training module, configured to use the feature value corresponding to the relationship network diagram sample as an input sample and the known layout method as an output label to train a machine learning model for predicting the layout method of the relationship network diagram based on similarity, and obtain a trained machine learning model.
[0108] In one or more embodiments of this specification, the feature matching module is configured to input the target feature value into the machine learning model to obtain the layout method prediction result output by the machine learning model.
[0109] In one or more embodiments of this specification, the device further includes: a layout sending module configured to send the layout mode of the relationship network diagram to the terminal device, so that the terminal device visually displays the relationship network diagram in the layout mode.
[0110] The above is a schematic solution of a relationship network layout device in this embodiment. It should be noted that the technical solution of this relationship network layout device and the technical solution of the above relationship network layout method belong to the same concept. For the details not described in the technical solution of the relationship network layout device, reference can be made to the description of the technical solution of the above relationship network layout method.
[0111] Corresponding to the above method embodiment, this specification also provides an embodiment of a relationship network layout method applied to a terminal device. Figure 6 The flowchart of a relationship network layout method provided by an embodiment of this specification is shown. As Figure 6 shown, the method includes:
[0112] Step 602: Send a layout request to the cloud device.
[0113] The feature processing requests the layout request to enable the cloud device to receive the layout request, determine the relationship network diagram to be laid out according to the layout request, calculate the target feature value of the preset feature dimension of the relationship network diagram, and determine, from the feature library, the known layout mode corresponding to the relationship network diagram sample whose similarity meets the preset matching condition based on the similarity between the target feature value and the feature value of the relationship network diagram sample in the feature library as the layout mode of the relationship network diagram. The known layout mode corresponding to the relationship network diagram sample is obtained based on historical relationship network diagram data, and sends the layout mode to the terminal device;
[0114] Step 604: Receive the layout mode returned by the cloud device, and visually display the relationship network diagram in the layout mode.
[0115] Correspondingly, this specification also provides an embodiment of a relationship network layout system. Figure 7 The structural schematic diagram of a relationship network layout system provided by an embodiment of this specification is shown. As Figure 7 shown, the system includes:
[0116] A cloud device 702, configured to receive a layout request, determine the relationship network diagram to be laid out according to the layout request, obtain the layout mode of the relationship network diagram by applying the relationship network layout method described in any of the above embodiments, and send the layout mode to the terminal device;
[0117] The edge device 704 is configured to send the layout request to the cloud device, receive the layout method returned by the cloud device, and visually display the relationship network diagram in the layout method.
[0118] The relationship network layout system uses the historically existing relationship network diagram, describes the relationship network diagram through eigenvalues, and when a new relationship network diagram is input, it can determine in the feature library a relationship network diagram with a similar known better layout method, and adopt the same layout method, so as to achieve the purpose of selecting a better layout method to display the relationship network diagram without relying on manual experience.
[0119] Figure 8 FIG. shows a structural block diagram of a computing device 800 according to an embodiment of the present specification. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 through a bus 830, and a database 850 is used to store data.
[0120] The computing device 800 further includes an access device 840, and the access device 840 enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interfaces (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC).
[0121] In an embodiment of the present specification, the above components of the computing device 800 and Figure 8 other components not shown therein may also be connected to each other, for example, through a bus. It should be understood that Figure 8The block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0122] The computing device 800 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 can also be a mobile or stationary server.
[0123] Among them, the processor 820 is used to execute the following computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the above-mentioned relationship network layout method are implemented.
[0124] The above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned relationship network layout method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above-mentioned relationship network layout method.
[0125] An embodiment of this specification also provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the above-mentioned relationship network layout method are implemented.
[0126] The above is a schematic solution of a computer-readable storage medium in this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned relationship network layout method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above-mentioned relationship network layout method.
[0127] An embodiment of this specification also provides a computer program, wherein when the computer program is executed on a computer, the computer is made to execute the steps of the above-mentioned relationship network layout method.
[0128] The above is a schematic solution of a computer program in this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above-mentioned relationship network layout method belong to the same concept. For the details not described in detail in the technical solution of the computer program, reference can be made to the description of the technical solution of the above-mentioned relationship network layout method.
[0129] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0130] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, removable hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0131] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the embodiments of this specification are not limited by the described order of actions, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this specification.
[0132] In the above embodiments, the descriptions of the various embodiments each have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0133] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The alternative embodiments do not elaborate on all the details and do not limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can well understand and utilize this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A method for relationship network layout, comprising: Determining a relationship network diagram to be laid out; Calculating target feature values of preset feature dimensions of the relationship network diagram; According to the similarity between the target feature values and the feature values of relationship network diagram samples in the feature library, determining, from the feature library, the known layout methods corresponding to the relationship network diagram samples whose similarity meets the preset matching conditions as the layout method of the relationship network diagram, and the known layout methods corresponding to the relationship network diagram samples are obtained based on historical relationship network diagram data.
2. The method according to claim 1, wherein the preset feature dimensions include any of the following multiple feature dimensions: The ratio of the number of nodes and the number of actual existing edges in the relationship network diagram; The average degree of the nodes in the relationship network diagram; The variance of the degrees of the nodes in the relationship network diagram; The ratio of the number of actual existing edges in the relationship network diagram to the maximum number of edges that can exist; The maximum value of the shortest paths between any two nodes in the relationship network diagram; The average value of the shortest paths between any two nodes in the relationship network diagram; The number of triangle combinations formed by any three nodes that can form a triangle in the relationship network diagram; The ratio of the number of actually existing triangle combinations in the relationship network diagram to the number of triangle combinations formed by any three nodes that can form a triangle; The number of combinations of actually existing semi - triangles in the relationship network diagram, where a semi - triangle refers to a group formed by connecting three nodes with only two edges; The ratio of the number of actually existing triangle combinations in the relationship network diagram to the number of combinations of semi - triangles; The number of independent clusters in the relationship network diagram, where the independent clusters are composed of directly or indirectly connected nodes, and the nodes between any two independent clusters are not connected; The ratio of the nodes that can be directly connected and have the same degree to all nodes in the relationship network diagram; The attribute values of the nodes in the relationship network diagram.
3. The method according to claim 2, further comprising: Obtaining the relationship network diagram samples and the known layout methods corresponding to the relationship network diagram samples; Calculating the feature values of the preset feature dimensions of the relationship network diagram samples; Adding the feature values of the relationship network diagram samples and the corresponding known layout methods to the feature library.
4. The method according to claim 1, further comprising: Using the feature values corresponding to the relationship network diagram samples as input samples and the known layout methods as output labels to train a machine learning model for predicting the layout method of the relationship network diagram based on similarity, and obtaining a trained machine learning model.
5. The method according to claim 4, wherein the step of determining, from the feature library, the known layout methods corresponding to the relationship network diagram samples whose similarity meets the preset matching conditions as the layout method of the relationship network diagram according to the similarity between the target feature values and the feature values of the relationship network diagram samples in the feature library includes: Inputting the target feature values into the trained machine learning model to obtain the layout method prediction result output by the trained machine learning model.
6. The method according to claim 1, further comprising: Send the layout method of the relationship network diagram to the terminal device, so that the terminal device visually displays the relationship network diagram in the layout method.
7. A relationship network layout method, applied to a terminal device, includes: Send a layout request to the cloud device, so that the cloud device receives the layout request, determines the relationship network diagram to be laid out according to the layout request, calculates the target feature value of the preset feature dimension of the relationship network diagram, and determines the similarity between the target feature value and the feature value of the relationship network diagram sample in the feature library. From the feature library, determine the known layout method corresponding to the relationship network diagram sample whose similarity meets the preset matching condition as the layout method of the relationship network diagram. The known layout method corresponding to the relationship network diagram sample is obtained based on historical relationship network diagram data, and send the layout method to the terminal device; Receive the layout method returned by the cloud device; Visually display the relationship network diagram in the layout method.
8. A relationship network layout system, includes: A cloud device, configured to receive a layout request, determine the relationship network diagram to be laid out according to the layout request, obtain the layout method of the relationship network diagram by applying the relationship network layout method according to any one of claims 1 to 6, and send the layout method to the terminal device; A terminal device, configured to send the layout request to the cloud device, receive the layout method returned by the cloud device, and visually display the relationship network diagram in the layout method.
9. A computing device, includes: A memory and a processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the relationship network layout method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the relationship network layout method according to any one of claims 1 to 6 are implemented.