A method for extracting an industry-to-public credit subgraph and related equipment
By performing steps such as meta-path group partitioning, feature transfer, and random walk on the full knowledge graph, an industry-specific corporate credit subgraph is extracted, which solves the problems of entity feature loss and low computational efficiency in existing technologies, and achieves more efficient credit and risk assessment.
Patent Information
- Application Number
- CN202411736580.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing technologies, when using the Odgca algorithm for coarsening, fail to effectively preserve entity feature information and have low computational efficiency, thus limiting the real-time performance and efficiency of corporate credit business analysis.
By dividing the meta-path groups and performing steps such as feature transfer, structure transfer, industry similarity calculation, and random walk, the industry corporate lending subgraph is extracted, important entity features are retained, and unimportant entities and long-standing edges are deleted, thereby reducing the complexity of the graph.
This approach achieves the goal of retaining sufficient entity features while reducing graph size, thereby improving compression speed and enhancing the real-time performance and efficiency of analysis.
Smart Images

Figure CN119669483B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method and related equipment for extracting corporate credit subgraphs in an industry. Background Technology
[0002] Knowledge graphs can model and identify complex relationships between entities, such as those between banks and customers, customers and customers, enterprises and supply chain partners, and enterprises and competitors. These relationships are crucial for corporate lending analysis because credit and risk often propagate through them. Furthermore, knowledge graphs can integrate data from multiple sources and dimensions, including publicly available corporate information, news reports, and market data. This fusion of multi-dimensional data provides a more comprehensive perspective on credit and risk assessment, reducing biases and errors that may arise from single data sources. Therefore, using knowledge graphs for corporate lending analysis is a relatively effective method. However, knowledge graphs are generally large in scale, and analyzing directly on the entire knowledge graph involves high computational complexity and resource consumption, which can affect the real-time performance and efficiency of the analysis.
[0003] In existing technologies, the Odgca algorithm is used to coarse out the relevant business subgraphs, but it does not consider all the feature information of the entities. After compression, a lot of entity feature information is lost, and the Odgca algorithm is relatively slow to compute. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method and related equipment for extracting corporate credit subgraphs in the industry, so as to improve the compression speed and retain a sufficient number of entity features.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of this invention discloses a method for extracting industry corporate loan subgraphs, the method comprising:
[0007] Obtain the full knowledge graph; the full knowledge graph includes multiple entities divided into important entities and non-important entities;
[0008] The meta-paths corresponding to each edge in the full knowledge graph are divided into a first meta-path group, a second meta-path group, and a third meta-path group. The meta-paths in the first meta-path group contain only the important entities, the meta-paths in the second meta-path group contain both the important entities and the non-important entities, and the meta-paths in the third meta-path group contain only the non-important entities.
[0009] For each meta-path in the third meta-path group on the full knowledge graph, if the non-important entity in the meta-path is adjacent to the important entity, then feature transfer is performed on the non-important entity; if the non-important entity in the meta-path is not adjacent to the important entity, then the non-important entity is deleted to obtain the first graph.
[0010] For each meta-path in the second meta-path group on the first graph, the feature transfer and structure transfer are performed on the important entities in the meta-path, and the non-important entities in the meta-path are deleted to obtain the second graph;
[0011] For each entity in the second graph, calculate the industry similarity between the industry corresponding to the entity and the pre-specified target industry. If the industry similarity is less than the similarity threshold, delete the entity and obtain the third graph.
[0012] For each entity in the third graph, the entity is taken as the starting entity, and a random walk operation is performed in the second graph based on the starting entity to obtain multiple entities to be supplemented. Each entity to be supplemented is then added to the third graph to obtain the fourth graph.
[0013] For each edge in the fourth graph, if the corresponding edge category is not in the pre-defined whitelist, weighted compression is performed to obtain the industry corporate lending subgraph.
[0014] Preferably, each entity in the full knowledge graph has multiple candidate lists, and each candidate list corresponds to an entity category; for each meta-path in the third meta-path group on the full knowledge graph, if the non-important entity in the meta-path is adjacent to the important entity, feature transfer is performed on the non-important entity; if the non-important entity in the meta-path is not adjacent to the important entity, the non-important entity is deleted to obtain the first graph, including:
[0015] For each meta-path in the third meta-path group on the full knowledge graph, the two non-important entities in the meta-path are added to each other's candidate list of corresponding entity categories.
[0016] For each non-important entity adjacent to the important entity in the third path group, the non-important entity is used as the transfer target entity for feature transfer. The feature transfer process includes: sorting the non-important entities in each candidate list corresponding to the transfer target entity according to the interaction frequency from high to low, selecting the non-important entities that are ranked before the preset order, fusing the entity features of the selected non-important entities using mean-pooling to obtain the fused features corresponding to each candidate list; concatenating the fused features, and weighting the concatenated fused features with the features of the transfer target entity.
[0017] For each non-important entity in the third path group that is not adjacent to the important entity, it is deleted from the full knowledge graph to obtain the first graph.
[0018] Preferably, the step of performing feature transfer and structure transfer on the important entities in the meta-path group of the second meta-path on the first graph, and deleting the non-important entities in the meta-path to obtain the second graph includes:
[0019] For each metapath in the second metapath group on the first graph, according to the entity category of the non-important entity in the metapath, the non-important entity is added to the candidate list corresponding to the important entity in the metapath;
[0020] For each important entity in the second metapath group, the important entity is used as the target entity for feature transfer. For each non-important entity selected in the feature transfer process that is ranked before a preset order, the edges associated with the non-important entity in the first graph are transferred to the important entity, so that the edges associated with the non-important entity are associated with the important entity and other important entities. The non-important entity is then deleted from the first graph to obtain the second graph.
[0021] Preferably, for each entity in the second map, calculating the industry similarity between the industry corresponding to the entity and a pre-specified target industry includes:
[0022] For each entity in the second graph, industry features are calculated based on the corresponding industry attributes, and the cosine similarity between the industry features and the target industry features is calculated as the industry similarity.
[0023] Preferably, the method further includes:
[0024] If there is a special entity that does not possess the industry attribute, then from all entities that possess the industry attribute, the industry attribute corresponding to the entity that is closest to the special entity and has the highest interaction frequency is selected and used as the industry attribute of the special entity.
[0025] Preferably, for each entity in the third graph, the entity is used as a starting entity, and a random walk operation is performed in the second graph based on the starting entity to obtain multiple entities to be supplemented. Each of the entities to be supplemented is then added to the third graph to obtain the fourth graph, including:
[0026] For each entity in the third graph, the entity is taken as the starting entity, and a random walk operation is performed in the second graph based on the starting entity to obtain multiple similar entities; the similar entities are connected to the starting entity in the second graph through multiple edges;
[0027] Select entities that do not exist in the third atlas from among the similar entities;
[0028] Each entity to be supplemented and the edges connecting the entity to be supplemented to other entities in the third graph are added to the third graph to obtain the fourth graph.
[0029] Preferably, for each edge in the fourth graph, if the corresponding edge category is not in a pre-defined whitelist, weighted compression is performed to obtain an industry-specific corporate lending sub-graph, including:
[0030] For each edge in the fourth graph, if the corresponding edge category is not in the pre-defined whitelist, it is determined to be a target edge;
[0031] Calculate the difference between the current time and the target time corresponding to the target edge; the target time is the time when the association relationship indicated by the target edge occurs;
[0032] The difference is compared with a preset time range, and the target edge is weighted based on the comparison result;
[0033] When the weight of the target edge is 0, the target edge is deleted from the fourth graph to obtain the industry corporate credit subgraph.
[0034] A second aspect of this invention discloses an apparatus for extracting sub-graphs of corporate loans in the industry, the apparatus comprising:
[0035] An acquisition unit is used to acquire the full knowledge graph; the full knowledge graph includes multiple entities divided into important entities and non-important entities;
[0036] The partitioning unit is used to partition the meta-paths corresponding to each edge in the full knowledge graph to obtain a first meta-path group, a second meta-path group, and a third meta-path group; the meta-paths in the first meta-path group only contain the important entities, the meta-paths in the second meta-path group contain both the important entities and the non-important entities, and the meta-paths in the third meta-path group only contain the non-important entities.
[0037] The first meta-path compression unit is used to perform feature transfer on each meta-path in the third meta-path group on the full knowledge graph if the non-important entity in the meta-path is adjacent to the important entity, and delete the non-important entity if the non-important entity in the meta-path is not adjacent to the important entity, thereby obtaining the first graph.
[0038] The second meta-path compression unit is used to perform feature transfer and structure transfer on the important entities in the meta-path for each meta-path in the second meta-path group on the first graph, and delete the non-important entities in the meta-path to obtain the second graph.
[0039] A semantic compression unit is used to calculate the industry similarity between the industry corresponding to each entity in the second graph and a pre-specified target industry. If the industry similarity is less than a similarity threshold, the entity is deleted to obtain the third graph.
[0040] Supplementing similar entity units is used to, for each entity in the third graph, take the entity as the starting entity, perform a random walk operation in the second graph based on the starting entity to obtain multiple entities to be supplemented, and supplement each entity to be supplemented into the third graph to obtain a fourth graph;
[0041] The edge weighting and compression unit is used to perform weighting and compression on each edge in the fourth graph if the corresponding edge category is not in the pre-set whitelist, so as to obtain the industry corporate credit subgraph.
[0042] A third aspect of the present invention discloses a storage medium for storing a computer program, which, when executed, is specifically used to implement the method for extracting industry corporate credit subgraphs as described in any of the first aspects of the present invention.
[0043] A fourth aspect of this invention discloses an electronic device, comprising: a memory and a processor;
[0044] The memory is used to store computer programs;
[0045] The processor is used to execute the computer program, specifically to implement the method for extracting industry corporate credit subgraphs as described in any of the first aspects of the embodiments of the present invention.
[0046] Based on the above embodiments of the present invention, a method and related equipment for extracting industry corporate credit subgraphs are provided to obtain a full knowledge graph. The full knowledge graph includes multiple entities divided into important and non-important entities. The meta-paths corresponding to each edge in the full knowledge graph are divided to obtain a first meta-path group, a second meta-path group, and a third meta-path group. The meta-paths in the first meta-path group only contain the important entities, the meta-paths in the second meta-path group contain both the important and non-important entities, and the meta-paths in the third meta-path group only contain the non-important entities. For each meta-path in the third meta-path group on the full knowledge graph, if the non-important entity in the meta-path is adjacent to the important entity, feature transfer is performed on the non-important entity; if the non-important entity in the meta-path is not adjacent to the important entity, the non-important entity is deleted. The process involves: obtaining a first graph; for each meta-path in the second meta-path group on the first graph, performing feature transfer and structure transfer on the important entities in the meta-path, and deleting the non-important entities in the meta-path to obtain a second graph; for each entity in the second graph, calculating the industry similarity between the industry corresponding to the entity and a pre-specified target industry; if the industry similarity is less than a similarity threshold, deleting the entity to obtain a third graph; for each entity in the third graph, using the entity as a starting entity, performing a random walk operation in the second graph based on the starting entity to obtain multiple entities to be supplemented, and supplementing each entity to be supplemented into the third graph to obtain a fourth graph; for each edge in the fourth graph, if the corresponding edge category is not in a pre-set whitelist, performing weighted compression to obtain an industry-specific corporate lending subgraph. In this scheme, meta-path compression not only preserves the predetermined semantic information, but also transfers the deleted entity information to the retained entities through feature transfer, reducing the scale while minimizing information loss. Semantic compression preserves relevant entities from an industry perspective, and random walks are used to select entities with high relevance. Edge weighting and compression are used to delete older edges, reducing the complexity of the subgraph, thereby improving compression speed and preserving enough entity features. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0048] Figure 1 This is a flowchart of a method for extracting industry corporate credit subgraphs according to an embodiment of the present invention;
[0049] Figure 2 This is an example diagram showing the sorting of various candidate queues for a transfer target entity, as disclosed in an embodiment of the present invention.
[0050] Figure 3 This is a schematic diagram of a structural transformation disclosed in an embodiment of the present invention;
[0051] Figure 4 This is a schematic diagram of a weighted compression method disclosed in an embodiment of the present invention;
[0052] Figure 5 This is a structural diagram of an industry corporate credit sub-graph extraction device disclosed in an embodiment of the present invention;
[0053] Figure 6 This is a structural diagram of an electronic device disclosed in an embodiment of the present invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0056] As can be seen from the background technology, in the existing technology, the Odgca algorithm is used to coarse out the relevant business subgraphs without considering all the feature information of the entities. After compression, a lot of entity feature information is lost, and the Odgca algorithm is relatively slow to calculate.
[0057] Therefore, this invention discloses a method and related equipment for extracting industry-specific corporate credit subgraphs. In this solution, meta-path compression not only preserves the predetermined semantic information, but also transfers the deleted entity information to the retained entities through feature transfer, reducing the scale while minimizing information loss. Semantic compression preserves relevant entities from an industry perspective, and edge weighting and compression remove older edges, reducing the complexity of the graph, thereby achieving the goal of improving compression speed and preserving sufficient entity features.
[0058] like Figure 1 The diagram shown is a flowchart of a method for extracting industry corporate credit subgraphs according to an embodiment of the present invention, including the following steps:
[0059] Step S101: Obtain the full knowledge graph.
[0060] It should be noted that the financial knowledge graph contains several categories of entities, including companies, legal persons, accounts, addresses, and equipment. Among these entities, those that are important for corporate lending are called important entities, while other entities are called non-important entities.
[0061] The full knowledge graph includes multiple entities that are divided into important entities and non-important entities.
[0062] For a full knowledge graph G0 containing corporate credit entities and relationships, it includes a set of nodes (Node), a set of edges (Edge), and node features (X).
[0063] The node set Node contains important entities Ent = {ent1, ent2, ..., entk} and non-important entities IEnt = {ient1, ient2, ..., ientl}.
[0064] Edge set contains edges that are relevant to corporate credit analysis, and these edges are set to a whitelist.
[0065] Node feature X contains features of all entities, including attributes such as id and industry. For a specific entity, if a specific attribute value exists, it is directly filled in. If no corresponding attribute value exists, it is filled in using the same rule, such as based on the mode, the mean, or a specific value.
[0066] Industry is an attribute of an entity. Some entities, such as the company category, have a value for this attribute, while others, such as the address category, do not.
[0067] Step S102: Divide the meta-paths corresponding to each edge in the full knowledge graph to obtain the first meta-path group, the second meta-path group, and the third meta-path group.
[0068] In step S102, the meta-path information is first loaded, which includes meta-path, meta-path type, etc. A typical meta-path is as follows: meta-path "address -> person", meta-path type "non-important entity - important entity".
[0069] Then, traverse all the meta-paths corresponding to the edges in the graph and divide them into three groups: the first meta-path group contains only important entities, the second meta-path group contains both important and non-important entities, and the third meta-path group contains only non-important entities.
[0070] For example,
[0071] Metapaths in the first metapath group include "company-person", metapaths in the second metapath group include "person-device", and metapaths in the third metapath group include "device-address".
[0072] As shown in the table below:
[0073] Serial Number Metapath Metapath type Metapath Group 1 Company - Person Important Entities - Important Entities First-order path group 2 Human-equipment Important entities - Non-important entities Secondary path group 3 Device-Address Non-essential entities - Non-essential entities Third-order path group 4 … … …
[0074] Step S103: For each meta-path in the third meta-path group on the full knowledge graph, if a non-important entity in the meta-path is adjacent to an important entity, then perform feature transfer on the non-important entity; if a non-important entity in the meta-path is not adjacent to an important entity, then delete the non-important entity to obtain the first graph.
[0075] In step S103, a non-important entity is adjacent to an important entity, which means that the two entities are directly related through some type of edge (relationship).
[0076] In one embodiment, in order to achieve feature transfer between entities, each entity in the full knowledge graph is provided with multiple candidate lists, and each candidate list corresponds to an entity category.
[0077] For example, if there are 3 different types of entities: entity type a, entity type b, and entity type c, then there are 3 alternative lists for any entity in entity type a, namely alternative list 1, alternative list 2, and alternative list 3. Alternative list 1 corresponds to entity type a, alternative list 2 corresponds to entity type b, and alternative list 3 corresponds to entity type c.
[0078] In the specific implementation of step S103, firstly, for each meta-path in the third meta-path group on the full knowledge graph, the two non-important entities in the meta-path are added to each other's candidate list of corresponding entity categories.
[0079] For example, if a metapath contains two non-essential entities: non-essential entity 1 and non-essential entity 2, with entity categories a and c respectively, then non-essential entity 1 is added to the candidate list corresponding to entity category a in each candidate list of non-essential entity 2, and non-essential entity 2 is added to the candidate list corresponding to entity category c in each candidate list of non-essential entity 1.
[0080] Then, for each non-important entity adjacent to an important entity in the third path group, the non-important entity is used as the transfer target entity for feature transfer.
[0081] It should be noted that the target entity for transfer refers to the object that receives non-critical entity characteristic information that needs to be deleted.
[0082] The feature transfer process includes the following steps:
[0083] Step S201: Sort the non-important entities in each candidate list corresponding to the target entity according to their interaction frequency from high to low, and select the non-important entities that are ranked before the preset order.
[0084] In step S201, the interaction frequency refers to the interaction frequency between the target entity and each non-important entity in its corresponding candidate list.
[0085] like Figure 2 The diagram shown is an example of sorting the candidate queues of a transfer target entity according to an embodiment of the present invention.
[0086] Here, the non-critical entity x refers to the target entity for transfer. The first m non-critical entities, where m is a positive integer, are selected from the candidate queue corresponding to each category.
[0087] Step S202: The entity features of the selected non-important entities are fused using mean-pooling to obtain the fused features corresponding to each candidate list.
[0088] In the specific implementation of step S202, taking a non-important entity x as the target entity for transfer as an example, the characteristic of non-important entity x is emb, and the list of frequently interacting entities in its i-th category candidate list is list. i , list i The features of entities in the dataset are fused using mean-pooling to obtain fused features. The formula for mean-pooling is as follows:
[0089]
[0090] in, The feature vector obtained through mean-pooling, emb j These are the characteristics of entity j, list i It is the feature set of m frequently interacting entities selected from the candidate list, |list i | is a collection list i Size.
[0091] Step S203: Concatenate the various fused features and perform weighted processing on the concatenated fused features and the features of the target entity to be transferred.
[0092] In the specific implementation of step S203, the fusion features obtained from the candidate lists of non-important entities x different entity categories are concatenated, as shown in the following formula:
[0093]
[0094] || indicates concatenating two vectors, where label is the set of labels in the full knowledge graph, and the resulting feature emb is... pool It is a vector of length |label|*len(emb), where len represents the length calculation. pool The input is fed into a multilayer perceptron (MLP) network for feature extraction and dimensionality reduction, resulting in a vector of length len(emb). The MLP calculation formula is as follows:
[0095] emb mlp =f(W*emb pool +b)
[0096] Where W is the parameter matrix with size len(emb)*(|label|*len(emb)), b is the bias vector with length len(emb), and f is the activation function, here we choose the sigmoid function, whose formula is:
[0097]
[0098] emb mlp The new entity feature vector Emb is obtained by weighting and averaging the vectors Emb and Emb, as follows:
[0099] Emb = a * emb pool +emb
[0100] st: a+b=1, a≥0, b≥0
[0101] Step S104: For each meta-path in the second meta-path group on the first graph, perform feature transfer and structure transfer on the important entities in the meta-path, and delete the non-important entities in the meta-path to obtain the second graph.
[0102] In step S104, the metapaths in the second metapath group are traversed on the first graph, and the non-important entities in the metapaths are added to the candidate list of the corresponding category of the important entities.
[0103] Taking the "device-person" meta-path as an example, the device is a non-critical entity, while the person is a critical entity. The device information is then transferred to the attributes of the person.
[0104] Generally, relationships in metapaths are many-to-many. Information from less important entities is transferred to the most important entities with which they have the most relationships. For the "device-person" metapath, device information is transferred to the entity attribute of the person who interacts with the device the most. When there are multiple metapaths, they are processed in a given order. For example, if there are two metapaths, "device-person" and "device-company", device information is transferred to the person first. If a device entity does not have a "device-person" relationship, the device entity's information is transferred to the company entity, and the device entity is added to the company entity's candidate list.
[0105] In the specific implementation of step S104, firstly, for each metapath in the second metapath group on the first graph, according to the entity category of the non-important entity in the metapath, the non-important entity is added to the candidate list corresponding to the important entity in the metapath.
[0106] It should be noted that the addition process is similar to the addition process between non-important entities mentioned above, except that in step S104, the non-important entity is unilaterally added to the candidate list corresponding to the important entity.
[0107] Then, for each important entity in the second path group, the important entity is used as the target entity for feature transfer. For each non-important entity selected in the feature transfer process that is ranked before the preset order, the edges associated with the non-important entity in the first graph are transferred to the important entity, so that the edges associated with the non-important entity are associated with the important entity and other important entities. Then, the non-important entity is deleted from the first graph to obtain the second graph.
[0108] It should be noted that after the traversal is complete, important entities select m frequently interacting non-important entities from each candidate list according to entity category. Information from the selected non-important entities is transferred to the important entities, and all non-important entities are deleted from the first graph to obtain the second graph. Information transfer methods include feature transfer and structure transfer, as detailed below:
[0109] Feature Transfer: The entity features (Emb) of the selected non-important entities are fused using mean-pooling, and the fused features are weighted proportionally with the features of the target entity. Please refer to the above-described embodiment of the invention for the processing procedure. The updated features are still denoted as Emb.
[0110] Structure transfer: This involves transferring relationships from non-important entities to important entities. Specifically, all edges associated with a non-important entity are transferred to the important entity, and the important entity is used instead of the non-important entity on the edges. The attributes of the two edges connected to the non-important entity are averaged and used as the attributes of the newly generated edge.
[0111] like Figure 3 The diagram shown is a schematic representation of a structural transformation disclosed in an embodiment of the present invention.
[0112] In this diagram, entities 1 and 2 are important entities, while entities 3 and 4 are unimportant entities. After structural transfer, entities 1 and 2 are connected, and the newly generated edge c is represented by a dashed line in the graph. The attributes on edges a and b are averaged and used as the attributes of edge c. Finally, entities 3 and 4 are deleted.
[0113] Understandably, the second graph only contains edges between important entities.
[0114] Step S105: For each entity in the second graph, calculate the industry similarity between the industry corresponding to the entity and the pre-specified target industry. If the industry similarity is less than the similarity threshold, delete the entity and obtain the third graph.
[0115] In step S105, the industry characteristics of the target industry are derived from the specified industry and enterprise information. Users can directly specify the industry of interest or specify the enterprise of interest; the industry to which the enterprise of interest belongs is the industry of interest.
[0116] In one embodiment, the industry similarity between the industry corresponding to each entity in the previously calculated second map and the target industry is obtained.
[0117] If there are entities whose industry similarity has not been calculated in the past, or if the time point at which the similarity was calculated in the past does not meet the requirements, i.e., it has expired, then the industry similarity needs to be recalculated.
[0118] In the specific implementation of step S105, for each entity in the second graph, industry features are calculated based on the corresponding industry attributes, and the cosine similarity between the industry features and the target industry features is calculated as the industry similarity.
[0119] The industry of each entity is determined based on its industry attribute, and the average industry attribute of all entities in the same industry is taken as the industry characteristic of that industry. If an entity does not have an industry attribute, it is not included in the calculation.
[0120] Preferably, the industry similarity between the industry of each entity and the target industry is calculated and stored, and the time when the industry similarity is obtained is recorded.
[0121] Preferably, if there is a special entity that does not have industry attributes, then from all entities that have industry attributes, the industry attribute corresponding to the entity that is closest to the special entity and has the highest interaction frequency is selected as the industry attribute of the special entity.
[0122] Step S106: For each entity in the third graph, take the entity as the starting entity, perform a random walk operation in the second graph based on the starting entity to obtain multiple entities to be supplemented, and supplement each entity to be supplemented into the third graph to obtain the fourth graph.
[0123] In step S106, starting from an entity in the third graph, a random walk is performed on the second graph to find a set of real points (nodeSet) closely related to the entities in the third graph. The entities in nodeSet, along with the edges connecting them to other entities in the third graph, are then added to the third graph to obtain the fourth graph. The specific implementation process is as follows:
[0124] In the specific implementation of step S106, firstly, for each entity in the third graph, the entity is taken as the starting entity, and a random walk operation is performed in the second graph based on the starting entity to obtain multiple similar entities.
[0125] It should be noted that similar entities are connected to the starting entity in the second graph through multiple edges, meaning that the relationship between similar entities and the starting entity in the second graph is close.
[0126] Then, select entities that do not exist in the third graph from among the similar entities to be added.
[0127] It is understandable that, since each entity in the third graph is used as the starting entity, each close entity may contain entities that already exist in the third graph. These entities do not need to be added to the third graph, so they need to be filtered to obtain the entities to be added.
[0128] Finally, each entity to be supplemented and the edges connecting the entity to be supplemented to other entities in the third graph are added to the third graph to obtain the fourth graph.
[0129] In one embodiment, random walks are performed based on multiple starting entities, and parallel computation can be performed using a multi-core CPU or GPU. For each computation unit, the random walk algorithm is run independently, and entities not in the third graph are filtered out. Finally, the results from all computation units are aggregated and deduplicated. During the computation process, since no modifications are made to the second graph, multiple computation units can share the same second graph.
[0130] Step S107: For each edge in the fourth graph, if the corresponding edge category is not in the pre-set whitelist, weighted compression is performed to obtain the industry corporate credit subgraph.
[0131] In step S107, the edge categories in the whitelist are those strongly related to credit, such as credit and guarantee. All edges of the specified categories in the whitelist are retained, while edges that do not belong to the categories in the whitelist are weighted and compressed, ultimately resulting in the industry corporate credit subgraph.
[0132] The specific implementation of step S107 includes the following steps:
[0133] Step S301: For each edge in the fourth graph, if the corresponding edge category is not in the pre-set whitelist, it is determined as the target edge.
[0134] Step S302: Calculate the difference between the current time and the target time corresponding to the target edge.
[0135] The target time is the time when the association relationship of the target edge indicator occurs.
[0136] Step S303: Compare the difference with a preset time range, and perform a weighting operation on the target edge based on the comparison result.
[0137] In step S303, the target edge is weighted using a weighting formula, which is as follows:
[0138] When T-ET≤t1, w=w o ;
[0139] When t1 < T - ET ≤ t2, w = w o e -c(T-t1) ;
[0140] When t2 < T-ET, w = 0.
[0141] w o The original weights are set according to the type of edge. ET is the time on the edge (i.e., the target time). t1 and t2 are two time thresholds. t1 to t2 is the preset time range. c is the parameter in exponential decay.
[0142] Step S304: When the weight of the target edge is 0, delete the target edge from the fourth graph to obtain the industry corporate credit subgraph.
[0143] like Figure 4 The diagram shown is a schematic of a weighted compression method disclosed in an embodiment of the present invention.
[0144] Among them, the edge categories of T1 and T4 are whitelisted and are retained, while other edges are weighted and compressed. If the difference between the target time and the current time T corresponding to T5 is greater than the threshold t2, then edge T5 is deleted.
[0145] Based on the above-described method for extracting industry-specific corporate credit subgraphs, this solution uses meta-path compression to not only preserve predetermined semantic information but also transfers deleted entity information to the retained entities through feature transfer, reducing the scale while minimizing information loss. Semantic compression preserves relevant entities from an industry perspective, and random walks are used to select entities with high relevance. Edge weighting and compression are used to delete older edges, reducing the complexity of the graph. Finally, a more efficient and smaller graph is obtained through compression, thereby improving compression speed and preserving sufficient entity features.
[0146] Corresponding to the method for extracting industry corporate credit subgraphs disclosed in the above embodiments of the present invention, such as... Figure 5 The diagram shown is a structural diagram of an industry-specific corporate credit subgraph extraction device disclosed in an embodiment of the present invention, including: an acquisition unit 501, a partitioning unit 502, a first meta-path compression unit 503, a second meta-path compression unit 504, a semantic compression unit 505, a supplementary similar entity unit 506, and an edge weighting and compression unit 507.
[0147] The acquisition unit 501 is used to acquire the full knowledge graph; the full knowledge graph includes multiple entities that are divided into important entities and non-important entities.
[0148] The partitioning unit 502 is used to partition the meta-paths corresponding to each edge in the full knowledge graph to obtain the first meta-path group, the second meta-path group, and the third meta-path group. The meta-paths in the first meta-path group contain only important entities, the meta-paths in the second meta-path group contain both important and non-important entities, and the meta-paths in the third meta-path group contain only non-important entities.
[0149] The first meta-path compression unit 503 is used to perform feature transfer on each meta-path in the third meta-path group on the full knowledge graph if a non-important entity in the meta-path is adjacent to an important entity, and delete the non-important entity if the non-important entity in the meta-path is not adjacent to an important entity, thereby obtaining the first graph.
[0150] The second metapath compression unit 504 is used to perform feature transfer and structure transfer on important entities in each metapath of the second metapath group on the first graph, and delete non-important entities in the metapath to obtain the second graph.
[0151] The semantic compression unit 505 is used to calculate the industry similarity between the industry corresponding to each entity in the second graph and the pre-specified target industry. If the industry similarity is less than the similarity threshold, the entity is deleted and the third graph is obtained.
[0152] Supplementing similar entity units 506 is used to, for each entity in the third graph, take the entity as the starting entity, perform a random walk operation in the second graph based on the starting entity to obtain multiple entities to be supplemented, and supplement each entity to be supplemented into the third graph to obtain the fourth graph.
[0153] The edge weighting and compression unit 507 is used to perform weighting and compression on each edge in the fourth graph if the corresponding edge category is not in the pre-set whitelist, so as to obtain the industry corporate credit subgraph.
[0154] In one embodiment, each entity in the full knowledge graph has multiple candidate lists, and each candidate list corresponds to an entity category. Accordingly, the first meta-path compression unit 503 is specifically used for:
[0155] For each meta-path in the third meta-path group on the full knowledge graph, add the two non-important entities in the meta-path to each other's candidate list of corresponding entity categories.
[0156] For each non-important entity adjacent to an important entity in the third path group, the non-important entity is used as the transfer target entity for feature transfer. The feature transfer process includes: sorting the non-important entities in each candidate list corresponding to the transfer target entity according to the interaction frequency from high to low, selecting the non-important entities that are ranked before the preset order, fusing the entity features of the selected non-important entities using mean-pooling to obtain the fused features corresponding to each candidate list; concatenating the fused features, and weighting the concatenated fused features with the features of the transfer target entity.
[0157] For each non-important entity in the third path group that is not adjacent to an important entity, it is deleted from the entire knowledge graph to obtain the first graph.
[0158] Correspondingly, the second-order path compression unit 504 is specifically used for:
[0159] For each metapath in the second metapath group on the first graph, based on the entity category of the non-important entity in the metapath, the non-important entity is added to the candidate list corresponding to the important entity in the metapath.
[0160] For each important entity in the second path group, the important entity is used as the target entity for feature transfer. For each non-important entity selected in the feature transfer process that is ranked before the preset order, the edges associated with the non-important entity in the first graph are transferred to the important entity, so that the edges associated with the non-important entity are associated with the important entity and other important entities. Then, the non-important entity is deleted from the first graph to obtain the second graph.
[0161] In one embodiment, the semantic compression unit is specifically used for:
[0162] For each entity in the second graph, industry features are calculated based on the corresponding industry attributes. The cosine similarity between the industry features and the target industry features is calculated as the industry similarity. If the industry similarity is less than the similarity threshold, the entity is deleted, and the third graph is obtained.
[0163] If there are special entities that do not have industry attributes, then from all entities that have industry attributes, the industry attribute corresponding to the entity that is closest to the special entity and has the highest interaction frequency will be selected as the industry attribute of the special entity.
[0164] In one embodiment, the edge weighting and compression unit 507 is specifically used for:
[0165] For each edge in the fourth graph, if the corresponding edge category is not in the pre-defined whitelist, it is determined to be the target edge;
[0166] Calculate the difference between the current time and the target time corresponding to the target edge; the target time is the time when the association relationship indicated by the target edge occurs;
[0167] The difference is compared with a preset time range, and the target edge is weighted based on the comparison result.
[0168] When the weight of the target edge is 0, the target edge is deleted from the fourth graph to obtain the industry corporate lending subgraph.
[0169] In one embodiment, a supplementary adjacent entity unit 506 is specifically used for:
[0170] For each entity in the third graph, the entity is taken as the starting entity. A random walk operation is performed on the second graph based on the starting entity to obtain multiple similar entities. The similar entities are connected to the starting entity in the second graph through multiple edges.
[0171] Select entities that do not exist in the third graph from among the similar entities to be added;
[0172] Each entity to be supplemented and the edges connecting the entity to be supplemented to other entities in the third graph are added to the third graph to obtain the fourth graph.
[0173] Based on the above-described industry-specific corporate credit subgraph extraction device disclosed in the embodiments of the present invention, this solution uses meta-path compression to not only preserve the predetermined semantic information, but also to transfer the deleted entity information to the retained entities through feature transfer, reducing the scale while minimizing information loss. Semantic compression preserves relevant entities from an industry perspective, and random walks are used to select entities with high relevance. Edge weighting and compression are used to delete older edges, reducing the complexity of the graph. Finally, a more efficient and smaller-scale graph is obtained through compression, thereby achieving the goal of improving compression speed and preserving sufficient entity features.
[0174] This invention also provides an electronic device, please refer to... Figure 6 The electronic device includes a memory 601 and a processor 602.
[0175] Among them, memory 601 is used to store computer programs;
[0176] The processor 602 is used to execute computer programs, specifically to implement the method for extracting industry corporate credit subgraphs provided in any embodiment of this application.
[0177] This application also provides a computer storage medium for storing a computer program, which, when executed, is specifically used to implement the method for extracting industry corporate credit sub-graphs provided in any embodiment of this application.
[0178] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0179] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0180] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for extracting sub-graphs of corporate loans in an industry, characterized in that, The method includes: Obtain the full knowledge graph; the full knowledge graph includes multiple entities divided into important entities and non-important entities; The meta-paths corresponding to each edge in the full knowledge graph are divided into a first meta-path group, a second meta-path group, and a third meta-path group. The meta-paths in the first meta-path group contain only the important entities, the meta-paths in the second meta-path group contain both the important entities and the non-important entities, and the meta-paths in the third meta-path group contain only the non-important entities. For each meta-path in the third meta-path group on the full knowledge graph, if the non-important entity in the meta-path is adjacent to the important entity, then feature transfer is performed on the non-important entity; if the non-important entity in the meta-path is not adjacent to the important entity, then the non-important entity is deleted to obtain the first graph. For each meta-path in the second meta-path group on the first graph, the feature transfer and structure transfer are performed on the important entities in the meta-path, and the non-important entities in the meta-path are deleted to obtain the second graph; For each entity in the second graph, calculate the industry similarity between the industry corresponding to the entity and the pre-specified target industry. If the industry similarity is less than the similarity threshold, delete the entity and obtain the third graph. For each entity in the third graph, the entity is taken as the starting entity, and a random walk operation is performed in the second graph based on the starting entity to obtain multiple entities to be supplemented. Each entity to be supplemented is then added to the third graph to obtain the fourth graph. For each edge in the fourth graph, if the corresponding edge category is not in the pre-defined whitelist, weighted compression is performed to obtain the industry corporate lending subgraph.
2. The method according to claim 1, characterized in that, Each entity in the full knowledge graph has multiple candidate lists, and each candidate list corresponds to an entity category. For each meta-path in the third meta-path group on the full knowledge graph, if a non-important entity in the meta-path is adjacent to an important entity, feature transfer is performed on the non-important entity; if the non-important entity in the meta-path is not adjacent to the important entity, the non-important entity is deleted, resulting in a first graph, including: For each meta-path in the third meta-path group on the full knowledge graph, the two non-important entities in the meta-path are added to each other's candidate list of corresponding entity categories. For each non-important entity adjacent to the important entity in the third path group, the non-important entity is used as the transfer target entity for feature transfer. The feature transfer process includes: sorting the non-important entities in each candidate list corresponding to the transfer target entity according to the interaction frequency from high to low, selecting the non-important entities that are ranked before the preset order, fusing the entity features of the selected non-important entities using mean-pooling to obtain the fused features corresponding to each candidate list; concatenating the fused features, and weighting the concatenated fused features with the features of the transfer target entity. For each non-important entity in the third path group that is not adjacent to the important entity, it is deleted from the full knowledge graph to obtain the first graph.
3. The method according to claim 2, characterized in that, The step of performing feature transfer and structure transfer on each meta-path in the second meta-path group on the first graph, and deleting the non-important entities in the meta-path to obtain the second graph includes: For each metapath in the second metapath group on the first graph, according to the entity category of the non-important entity in the metapath, the non-important entity is added to the candidate list corresponding to the important entity in the metapath; For each important entity in the second metapath group, the important entity is used as the target entity for feature transfer. For each non-important entity selected in the feature transfer process that is ranked before a preset order, the edges associated with the non-important entity in the first graph are transferred to the important entity, so that the edges associated with the non-important entity are associated with the important entity and other important entities. The non-important entity is then deleted from the first graph to obtain the second graph.
4. The method according to claim 1, characterized in that, For each entity in the second map, calculating the industry similarity between the industry corresponding to that entity and a pre-specified target industry includes: For each entity in the second graph, industry features are calculated based on the corresponding industry attributes, and the cosine similarity between the industry features and the target industry features is calculated as the industry similarity.
5. The method according to claim 4, characterized in that, The method further includes: If there is a special entity that does not possess the industry attribute, then from all entities that possess the industry attribute, the industry attribute corresponding to the entity that is closest to the special entity and has the highest interaction frequency is selected and used as the industry attribute of the special entity.
6. The method according to claim 1, characterized in that, For each entity in the third graph, the entity is used as a starting entity. A random walk operation is performed in the second graph based on the starting entity to obtain multiple entities to be supplemented. Each of the entities to be supplemented is then added to the third graph to obtain a fourth graph, including: For each entity in the third graph, the entity is taken as the starting entity, and a random walk operation is performed in the second graph based on the starting entity to obtain multiple similar entities; the similar entities are connected to the starting entity in the second graph through multiple edges; Select entities that do not exist in the third atlas from among the similar entities; Each entity to be supplemented and the edges connecting the entity to be supplemented to other entities in the third graph are added to the third graph to obtain the fourth graph.
7. The method according to any one of claims 1 to 6, characterized in that, For each edge in the fourth graph, if the corresponding edge category is not in a pre-defined whitelist, weighted compression is performed to obtain an industry-specific corporate lending sub-graph, including: For each edge in the fourth graph, if the corresponding edge category is not in the pre-defined whitelist, it is determined to be a target edge; Calculate the difference between the current time and the target time corresponding to the target edge; the target time is the time when the association relationship indicated by the target edge occurs; The difference is compared with a preset time range, and the target edge is weighted based on the comparison result; When the weight of the target edge is 0, the target edge is deleted from the fourth graph to obtain the industry corporate credit subgraph.
8. A device for extracting sub-graphs of corporate loans in an industry, characterized in that, The device includes: An acquisition unit is used to acquire the full knowledge graph; the full knowledge graph includes multiple entities divided into important entities and non-important entities; The partitioning unit is used to partition the meta-paths corresponding to each edge in the full knowledge graph to obtain a first meta-path group, a second meta-path group, and a third meta-path group; the meta-paths in the first meta-path group only contain the important entities, the meta-paths in the second meta-path group contain both the important entities and the non-important entities, and the meta-paths in the third meta-path group only contain the non-important entities. The first meta-path compression unit is used to perform feature transfer on each meta-path in the third meta-path group on the full knowledge graph if the non-important entity in the meta-path is adjacent to the important entity, and delete the non-important entity if the non-important entity in the meta-path is not adjacent to the important entity, thereby obtaining the first graph. The second meta-path compression unit is used to perform feature transfer and structure transfer on the important entities in the meta-path for each meta-path in the second meta-path group on the first graph, and delete the non-important entities in the meta-path to obtain the second graph. A semantic compression unit is used to calculate the industry similarity between the industry corresponding to each entity in the second graph and a pre-specified target industry. If the industry similarity is less than a similarity threshold, the entity is deleted to obtain the third graph. Supplementing similar entity units is used to, for each entity in the third graph, take the entity as the starting entity, perform a random walk operation in the second graph based on the starting entity to obtain multiple entities to be supplemented, and supplement each entity to be supplemented into the third graph to obtain a fourth graph; The edge weighting and compression unit is used to perform weighting and compression on each edge in the fourth graph if the corresponding edge category is not in the pre-set whitelist, so as to obtain the industry corporate credit subgraph.
9. A storage medium, characterized in that, Used to store computer programs, which, when executed, are specifically used to implement the method for extracting industry corporate credit subgraphs as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is used to execute the computer program, specifically to implement the method for extracting industry corporate credit subgraphs as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Knowledge graph construction method and device for public business
CN117151754A
Knowledge graph inductive relationship prediction method, system and device and medium
CN117787395A