Enterprise beneficiary judgment method based on Neo4j
By processing enterprise industrial and commercial data in the Neo4j graph database, using graph processing capabilities and query algorithms, the problem of difficulty in querying enterprise beneficiaries in the existing technology is solved, and efficient processing of complex deep correlation data and simplification of beneficiary judgments is achieved. .
Patent Information
- Application Number
- CN202410924022.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-12
AI Technical Summary
It is difficult to effectively query and determine the ultimate beneficiary of the enterprise in the prior art, especially when the equity data is single and highly interrelated, it is difficult to calculate natural persons with a direct or indirect shareholding ratio of more than 25%.
By obtaining the original data of the enterprise industry and commerce, cleaning and importing it into the Neo4j graph database, using Neo4j's graph processing capabilities and query algorithms, we calculate natural persons with a direct or indirect shareholding ratio of more than 25% as the ultimate beneficiary of the enterprise.
The judgment process of corporate beneficiaries is simplified, the efficiency of querying complex deep correlation data is improved, and natural persons with direct or indirect holdings exceeding 25%.
Smart Images

Figure CN118939735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of enterprise management, and in particular to a method for determining an enterprise beneficiary based on Neo4j. Background Art
[0002] Unlike traditional relational databases that rely on expensive JOIN operations to traverse relationships, Neo4j's graph local storage and traversal algorithms enable fast queries even on highly interconnected data sets. Neo4j is also an open source NoSQL graph database that provides native graph data storage. It represents data as nodes, edges, and attributes. Nodes represent entities, edges represent relationships between entities, and attributes provide additional information about nodes and edges.
[0003] The ultimate beneficiary of an enterprise refers to a natural person who has control over the enterprise or enjoys economic benefits. The beneficial owner of the company is determined in accordance with the following criteria: a natural person who directly or indirectly owns more than 25% of the company's equity or voting rights; a natural person who controls the company through personnel, finance and other means; and a senior manager of the company. The equity data in the existing corporate business information is single, and the shareholder information data corresponding to the company is only a layer of direct investment relationship. It is difficult to complete the query of the depth of association and support relationship. A large amount of data and information needs to be queried to establish the association. Based on the single company shareholder information, it is difficult to query the shareholders with related relationships and the corresponding equity path and equity shareholding ratio. It is even more difficult to calculate the company equity that directly or indirectly owns more than 25%. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for determining corporate beneficiaries based on Neo4j.
[0005] The object of the present invention is achieved by the following technical solution: A method for determining an enterprise beneficiary based on Neo4j comprises the following steps:
[0006] S1: Obtain the original data information of the enterprise, clean up the Node entity table and equity relationship table, and then import them into Neo4j for storage;
[0007] S2: Enter the company's unique ID and investment relationship depth to query the data stored in Neo4j;
[0008] S3: Combined with the Neo4j result set, the algorithm is used to calculate and filter out natural persons who directly or indirectly hold more than 25% of the shares as the ultimate beneficiaries of the company.
[0009] Preferably, step S1 further includes the following steps:
[0010] S11: Receive the original incremental data of corporate business information every day, perform initial cleaning, verify the unique identification ID and investment relationship, and store the cleaned data in the data platform;
[0011] S12: Perform secondary cleaning on the data in the data platform to obtain the Node entity table and Relation relationship table;
[0012] S13: Export the Node entity table and Relation relationship table to generate two csv files;
[0013] S14: Import the csv file generated by the Node entity table into the Neo4j graph database to become the node data, and import the csv file generated by the Relation relationship table into the Neo4j graph database to become the Relation relationship data.
[0014] Preferably, in step S11 and step S12, the data is cleaned initially and secondarily by HiveQL. The initial cleaning cleans the following fields from the business information of the enterprise: company_id, company_name, stock_name_id, stock_name, is_personal, stock_proportion, and forms a new table.
[0015] Preferably, in step S12, the attribute fields constituting the Relation table include a start node, an end node, a relationship type and a shareholding ratio, and the start node and the end node are mapped correspondingly to the entity node ID in the node attributes.
[0016] Preferably, step S2 further includes the following steps:
[0017] S21: When the ultimate beneficiary of a company with an investment relationship needs to be queried, the unique identification ID of the company with the investment relationship and the investment relationship depth are input;
[0018] S22: using the input parameter as a conversion query Neo4j condition, querying the specified company node ID in Neo4j as a target company node, and the investment relationship depth as a depth range.
[0019] Preferably, step S3 further includes the following steps:
[0020] S31: matching the relationship path that meets the conditions from the Neo4j database, where the path consists of one or more nodes and the investment relationship between them;
[0021] S32: Query Neo4j data through cypher and obtain the Neo4j result set;
[0022] S33: Calculate the shareholding ratio of each shareholder through the result set of Neo4j;
[0023] S34: Filter the result set with direct or indirect shareholding ratio exceeding 25% and identify the ultimate beneficial owner of the company.
[0024] Preferably, step S33 further includes the following steps:
[0025] S33.1: Get all paths from the start node to the target node;
[0026] S33.2: traverse each path, obtain the share ratio attribute of each relationship on the path, and multiply it into the path product;
[0027] S33.3: Add the product of each path to the total share ratio to obtain the sum of the share ratios of all investment relationships from the starting node to the target node.
[0028] The present invention has the following advantages: the present invention is based on the graph processing capability of Neo4j and the establishment of highly interconnected data sets for rapid query, the single equity data in the business information of the enterprise cannot establish complex deep correlation data for cleaning, and then the node table and the relationship table are imported into Neo4j to establish Node node data and Relation relationship data; then, by querying the path result set of a company's investment deep correlation data in Neo4j, combined with the algorithm to calculate the natural person who directly or indirectly holds more than 25% of the shares is determined as the ultimate beneficiary of the company, thereby simplifying the determination method for obtaining the ultimate beneficiary. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a structural diagram of the determination principle of the enterprise beneficiary based on Neo4j;
[0030] Figure 2 This is a structural diagram of the process of determining the enterprise beneficiary based on Neo4j;
[0031] Figure 3 A schematic diagram of the structure of Neo4j storing node and relationship data. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0035] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0036] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, or the positions or positional relationships in which the product of the invention is usually placed when in use, or the positions or positional relationships commonly understood by those skilled in the art, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0037] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0038] In this embodiment, if Figure 1 As shown, the method for determining the enterprise beneficiary based on Neo4j includes the following steps:
[0039] S1: Obtain the original data information of the enterprise, clean up the Node entity table and equity relationship table, and then import them into Neo4j for storage;
[0040] S2: Enter the company's unique ID and investment relationship depth to query the data stored in Neo4j;
[0041] S3: Combined with the Neo4j result set, the algorithm is used to calculate and filter out natural persons with a direct or indirect shareholding ratio of more than 25% as the ultimate beneficiaries of the company. Based on the Neo4j graph processing capabilities and the establishment of highly interconnected data sets for rapid query, the equity data in the business information of the enterprise is single and cannot establish complex deep correlation data for cleaning, and then the node table and relationship table are imported into Neo4j to establish Node node data and Relation relationship data; then by querying the path result set of a company's investment deep correlation data in Neo4j, combined with the algorithm to calculate the natural person with a direct or indirect shareholding ratio of more than 25% as the ultimate beneficiary of the company, thereby simplifying the determination method of obtaining the ultimate beneficiary.
[0042] Further, such as Figure 2 As shown, step S1 also includes the following steps:
[0043] S11: Receive the original incremental data of corporate business information every day, perform initial cleaning, verify the unique identification ID and investment relationship, and store the cleaned data in the data platform;
[0044] S12: Perform secondary cleaning on the data in the data platform to obtain the Node entity table and Relation relationship table;
[0045] S13: Export the Node entity table and Relation relationship table to generate two csv files;
[0046] S14: Import the csv file generated by the Node entity table into the Neo4j graph database to become the Node data, and import the csv file generated by the Relation relationship table into the Neo4j graph database to become the Relation relationship data. Further, in both steps S11 and S12, the data is cleaned for the first time and the second time through HiveQL. The first cleaning cleans the following fields from the business information of the enterprise: company_id, company_name, stock_name_id, stock_name, is_personal, stock_proportion, and forms a new table. Specifically, the attributes of the Node entity table mainly have three fields, which identify whether the node is a person or a company. The entity ID, entity name, and label are fixed as Node, that is, by querying the field values company_id, company_name, stock_name_id, stock_name, and is_personal in step S11, company_id and stock_name_id are used as the node id in Neo4j. If it is company_id, the type field type is marked as company, and stock_name_id needs to look at is_personal. If is_personal=1, it is person, otherwise company, company_name, and stock_name are used as the name of Neo4j.
[0047] In this embodiment, in step S12, the attribute fields of the Relation table include the start node, the end node, the relationship type and the shareholding ratio, and the start node and the end node are mapped correspondingly to the entity node ID in the node attribute. Specifically, the Relation data is obtained by querying the field values company_id, stock_name_id and stock_proportion in step S11, stock_name_id is used as the start_id of the Relation in Neo4j, company_id is used as the end_id of the Relation in Neo4j, the type is fixed type: investment relationship, and stock_proportion is used as the shareholding ratio.
[0049] In this embodiment, step S2 further includes the following steps:
[0050] S21: When the ultimate beneficiary of a company with an investment relationship needs to be queried, the unique identification ID of the company with the investment relationship and the investment relationship depth are input;
[0051] S22: Use the input parameters as the conditions for transforming and querying Neo4j, query the specified company node ID in Neo4j as the target company node, and use the investment relationship depth as the depth range. Specifically, when you need to query the company beneficiaries, first determine the company to be queried, and then customize the depth of the investment relationship. That is, you need to query the investment relationship of several layers of shareholders to the company. For example, direct investment is a layer of relationship, and indirect investment is a multi-layer relationship. You can define the depth of the query yourself, that is, the investment relationship depth can be specified. The main meaning is to find a path from one node to another node through at least one to n continuous relationships marked as INVEST, such as: investment relationship A indirectly invests in F, A invests in B, B invests in C, C invests in D, and D invests in F, that is, A->B->C->D->F. Then the investment relationship depth from A to F is 4, because the starting node is A, and there are 4 continuous paths to D. The investment relationship here does not need to be known in advance, and you only need to customize the maximum value of the numerical range. If you enter 100, then only the result set of the path 1-maximum path actually stored in Neo4j will be queried.
[0052] Furthermore, step S3 further includes the following steps:
[0053] S31: Match the relationship path that meets the conditions from the Neo4j database. The path consists of one or more nodes and the investment relationship between them. The specific condition is that the starting node type is 'person' and has an investment relationship with the target company node within a certain depth range.
[0054] S32: Query Neo4j data through cypher and obtain the Neo4j result set;
[0055] S33: Calculate the shareholding ratio of each shareholder through the result set of Neo4j;
[0056] S34: Filter out the result set with direct or indirect shareholding ratio exceeding 25% and identify the ultimate beneficiary of the company. Figure 3 As shown, step S33 also includes the following steps:
[0057] S33.1: Get all paths from the start node to the target node;
[0058] S33.2: traverse each path, obtain the share ratio attribute of each relationship on the path, and multiply it into the path product;
[0059] S33.3: Add the product of each path to the total share ratio to obtain the sum of the share ratios of all investment relationships from the starting node to the target node. Specifically, here is an example of the investment relationship graph and algorithm: Figure 3For Neo4j storage node and relationship data graph, a certain company A is the target company, the investment relationship depth is 4, and the natural person whose direct or indirect shareholding ratio of a certain company A exceeds 25% is identified as the ultimate beneficiary of a certain company A.
[0060] 1. Shareholder p1:
[0061] The final shareholding ratio of shareholder p1 in company A = equity path 1 (accounting for about 47.32%) + equity path 2 (accounting for about 22.5%) + equity path 3 (accounting for about 9.9%) + equity path 4 (accounting for about 0.095%) = 79.815%;
[0062] Shareholder p1 has four paths to own all the shares of company A:
[0063] Equity path 1 (accounting for approximately 47.32% = 91% * 52%):
[0064] Shareholder p1—investment 91%—>Shareholder C3—investment 52%—> Company A;
[0065] Equity Path 2 (accounting for approximately 22.5%):
[0066] Shareholder p1—investment 22.5%—> Company A;
[0067] Equity Path 3 (accounting for approximately 9.9% = 99%*10%):
[0068] Shareholder p1—investment 99%—> Shareholder C2—investment 10%—> Company A;
[0069] Equity Path 4 (accounting for approximately 0.095% = 95%*1%*10%):
[0070] Shareholder p1—investment 95%—>Shareholder C1—investment 1%—>Shareholder C2—investment 10%—> Company A.
[0071] 2. Shareholder p2:
[0072] Shareholder p2's final shareholding ratio in Company A = Equity Path 1 (about 10.5%);
[0073] Shareholder p2 has 1 path for all equity interests in company A:
[0074] Equity Path 1 (about 10.5%):
[0075] Shareholder p2—investment 10.5%—> Company A.
[0076] 3. Shareholder p3:
[0077] The final shareholding ratio of shareholder p3 in company A = equity path 1 (accounting for about 3%) + equity path 2 (accounting for about 0.005%) = 3.0015%;
[0078] Shareholder p3 has two paths to own all the shares of company A:
[0079] Equity Path 1 (about 3%):
[0080] Shareholder p3—investment 3%—> Company A;
[0081] Equity Path 2 (about 0.005%):
[0082] Shareholder p1—investment 5%—>Shareholder C1—investment 1%—>Shareholder C2—investment 10%—> Company A.
[0083] 4. Shareholders p4:
[0084] Shareholder p4's final shareholding ratio in Company A = Equity Path 1 (about 2%);
[0085] Shareholder p4 has 1 path for all equity interests in company A:
[0086] Equity Path 1 (about 2%):
[0087] Shareholder p4—investment 2%—> Company A.
[0088] V. Shareholders p5:
[0089] The final shareholding ratio of shareholder p5 in Company A = Equity Path 1 (accounting for about 4.68%);
[0090] Shareholder p5 has 1 path for all equity interests in company A:
[0091] Equity path 1 (accounting for approximately 4.68% = 9% * 52%):
[0092] Shareholder p5—investment 9%—>Shareholder C3—investment 52%—>Company A.
[0093] To sum up, by filtering out shareholders whose direct or indirect shareholding ratio exceeds 25%, shareholder p1 is the ultimate beneficiary of Company A.
[0094] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. The method for determining the enterprise beneficiary based on Neo4j is characterized by: The following steps are involved: S1: Obtain the original data information of the enterprise, clean up the Node entity table and equity relationship table, and then import them into Neo4j for storage; S2: Enter the company's unique ID and investment relationship depth to query the data stored in Neo4j; S3: Combined with the Neo4j result set, the algorithm is used to calculate and filter out natural persons who directly or indirectly hold more than 25% of the shares as the ultimate beneficiaries of the company.
2. The method for determining the enterprise beneficiary based on Neo4j according to claim 1 is characterized in that: The step S1 further includes the following steps: S11: Receive the original incremental data of corporate business information every day, perform initial cleaning, verify the unique ID and investment relationship, and store the cleaned data in the data platform; S12: Perform secondary cleaning on the data in the data platform to obtain the Node entity table and Relation relationship table; S13: Export the Node entity table and Relation relationship table to generate two csv files; S14: Import the csv file generated by the Node entity table into the Neo4j graph database to become the node data, and import the csv file generated by the Relation relationship table into the Neo4j graph database to become the Relation relationship data.
3. The method for determining the enterprise beneficiary based on Neo4j according to claim 2 is characterized in that: In step S11 and step S12, HiveQL is used to perform primary and secondary cleaning on the data. The primary cleaning cleans the following fields from the business information of the enterprise: company_id, company_name, stock_name_id, stock_name, is_personal, stock_proportion, and forms a new table.
4. The method for determining the enterprise beneficiary based on Neo4j according to claim 3 is characterized in that: In the step S12, the attribute fields of the Relation table include the start node, the end node, the relationship type and the shareholding ratio, and the start node and the end node are mapped correspondingly to the entity node ID in the node attributes.
5. The method for determining the enterprise beneficiary based on Neo4j according to claim 4 is characterized in that: The step S2 further includes the following steps: S21: When the ultimate beneficiary of a company with an investment relationship needs to be queried, the unique identification ID of the company with the investment relationship and the investment relationship depth are entered; S22: using the input parameter as a conversion query Neo4j condition, querying the specified company node ID in Neo4j as a target company node, and the investment relationship depth as a depth range.
6. The method for determining the enterprise beneficiary based on Neo4j according to claim 5 is characterized in that: The step S3 further includes the following steps: S31: matching the relationship path that meets the conditions from the Neo4j database, where the path consists of one or more nodes and the investment relationship between them; S32: Query Neo4j data through cypher and obtain the Neo4j result set; S33: Calculate the shareholding ratio of each shareholder through the result set of Neo4j; S34: Filter the result set with direct or indirect shareholding ratio exceeding 25% and identify the ultimate beneficial owner of the company.
7. The method for determining the enterprise beneficiary based on Neo4j according to claim 6 is characterized in that: The step S33 further includes the following steps: S33.1: Get all paths from the start node to the target node; S33.2: Traverse each path, obtain the share ratio attribute of each relationship on the path, and multiply it into the path product; S33.3: Add the product of each path to the total share ratio to obtain the sum of the share ratios of all investment relationships between the starting node and the target node.
