Architecture and Algorithm Practices for an Equity Penetration Analysis System

    Equity penetration analysis is a foundational capability for financial risk control, corporate credit assessment, supply chain due diligence, and compliance review. This article examines how to design such a system from a general engineering perspective, covering the definition of calculation standards, data modeling of entities and relationships, path enumeration and ratio aggregation algorithms, control relationship identification, graph query services, incremental updates, and accuracy and compliance governance. Illustrative SQL schemas and pseudocode are included, along with practical recommendations for making penetration results configurable, explainable, and traceable.

    Equity penetration analysis is a foundational capability in financial risk control, corporate credit assessment, supply chain due diligence, and compliance review. Its goal is not simply to draw a “shareholder–company–shareholder” graph, but to reliably compute direct ownership, indirect ownership, ultimate beneficial ownership ratios, and control chains under multi-layer holdings, cross-holdings, circular holdings, and complex control arrangements. From a general technical perspective, this article discusses the data model, core algorithms, graph query services, and engineering governance of an equity penetration analysis system, with illustrative code and implementation suggestions.

    1. Define the Business Semantics Before Writing Algorithms

    The most common problem in equity penetration is not that the code cannot be written, but that the semantics are inconsistent. The same term “penetration ratio” may have different definitions in different business scenarios:

    1. Direct ownership ratio: the direct contribution ratio of a shareholder in the invested entity, usually from business registration or capital contribution records.
    2. Indirect ownership ratio: the ratio formed through one or more holding paths, commonly computed by multiplying the direct ratios along the path.
    3. Aggregate ownership ratio: the combination of direct and indirect ratios under business rules, with attention to path deduplication and double counting.
    4. Control relationships: ratios alone are not enough. Ownership percentage, voting rights arrangements, board seats, contractual control, and concerted-action relationships may all affect control determination.
    5. Beneficial owner identification: typically requires a combined judgment of ownership thresholds, control chain length, actual control relationships, and source credibility.

    Therefore, the system should make “calculation semantics” configurable rather than hard-coding a threshold or aggregation rule into the algorithm. The data model should record relationship type, source, effective time, expiration time, confidence level, and evidence identifiers, so that penetration results are explainable and traceable.

    2. Data Model: Entities, Relationships, and Versions

    The foundation of equity penetration is an entity-relationship network. A minimal viable model can be abstracted into three types of data:

    • Entity table: natural persons, enterprises, and organizations, with fields such as unique identifier, name, status, and registration location.
    • Equity relationship table: records investor, investee, direct ratio, relationship type, validity interval, source, and confidence.
    • Control relationship table: records non-ratio relationships such as contractual control, voting rights delegation, and concerted action, which participate in control determination together with equity relationships.

    Illustrative table structures:

    1. -- Entity table (illustrative)
    2. CREATE TABLE entity (
    3. entity_id VARCHAR(64) PRIMARY KEY,
    4. entity_type VARCHAR(16) NOT NULL,
    5. display_name VARCHAR(256) NOT NULL,
    6. status VARCHAR(16),
    7. updated_at TIMESTAMP
    8. );
    9. -- Equity relationship table (illustrative)
    10. CREATE TABLE equity_edge (
    11. edge_id VARCHAR(64) PRIMARY KEY,
    12. investor_id VARCHAR(64) NOT NULL,
    13. investee_id VARCHAR(64) NOT NULL,
    14. direct_ratio DECIMAL(9,6) NOT NULL,
    15. relation_type VARCHAR(32) NOT NULL,
    16. valid_from DATE,
    17. valid_to DATE,
    18. source_id VARCHAR(64),
    19. confidence DECIMAL(5,4),
    20. updated_at TIMESTAMP
    21. );

    Three points matter here. First, use fixed-point decimals for ratio fields to avoid floating-point errors. Second, relationships must carry validity intervals to support historical replay and point-in-time penetration. Third, source and confidence cannot be omitted, otherwise results cannot be audited. When multiple relationships exist between the same pair of entities, the system should keep the detail records and aggregate them at the computation layer according to rules, rather than overwriting them at the ingestion layer.

    3. Penetration Algorithms: Path Enumeration and Ratio Aggregation

    Multi-layer holding computation can be abstracted as path search on a directed graph. Nodes are entities, edges are holding relationships, and edge weights are direct ratios. Starting from a shareholder, enumerate paths to the target entity; the path weight is the product of the edge ratios. Pseudocode:

    1. function penetrate(startId, targetId, graph, maxDepth, minRatio):
    2. results = []
    3. stack = [(startId, 1.0, [startId], {startId}, 0)]
    4. while stack is not empty:
    5. node, weight, path, visited, depth = stack.pop()
    6. if depth >= maxDepth:
    7. continue
    8. for edge in graph.outEdges(node):
    9. nextWeight = weight * edge.directRatio
    10. if nextWeight < minRatio:
    11. continue
    12. nextPath = path + [edge.investeeId]
    13. if edge.investeeId == targetId:
    14. results.append({
    15. path: nextPath,
    16. ratio: nextWeight,
    17. edges: ...
    18. })
    19. continue
    20. if edge.investeeId not in visited:
    21. nextVisited = visited + {edge.investeeId}
    22. stack.push((edge.investeeId, nextWeight,
    23. nextPath, nextVisited, depth + 1))
    24. return aggregate(results)

    This pseudocode only solves “finding paths.” Engineering must also answer three questions:

    1. How to aggregate paths: take the maximum path ratio, sum all paths, or present them layer by layer? Different semantics must be determined by configurable rules.
    2. How to handle circular holdings: truncate cycles using the visited set, and record the truncated cycles for manual review.
    3. How to avoid double counting in cross-holdings: the same entity may be reached through multiple paths. Aggregation should deduplicate by path identifier and retain path details, avoiding naive summation that inflates the ratio.

    For “aggregate indirect ownership,” a common approach is to compute the product of each valid path and then combine them under business rules. If the business requires “merging at the same level,” a level field must be added to the path results; if “shortest control chain first” is required, paths should be sorted by length and a representative path selected. The algorithm itself is not hard—what is hard is turning the semantics into testable rules.

    4. Control Relationship Identification: Rules Beyond Ratios

    Penetration based only on ownership ratios can miss contractual control, voting rights delegation, and concerted action. It is recommended to split control determination into “feature extraction + rule evaluation”:

    • Feature extraction: direct ratio, cumulative indirect ratio, path length, whether the entity is the largest shareholder, whether contractual relationships exist, and whether concerted-action flags are present.
    • Rule evaluation: a rule engine combines features according to business policies and outputs the control relationship, control strength, and explanation chain.

    For example, the system can output: “Entity A holds a certain aggregate ratio of the target through a three-layer path, and a voting rights delegation relationship exists, therefore A is determined to be in control.” Such results must carry explanations, not just a boolean. The explanation chain includes the path, edges, ratios, sources, and rule identifiers, facilitating audit and review.

    5. Graph Query Services and Engineering Architecture

    At the service layer, it is recommended to separate penetration computation from graph queries. The query service handles retrieval by entity, path, level, and point in time; the computation service handles batch penetration, incremental updates, and rule evaluation. A general architecture:

    • Data ingestion layer: receives registration data, contribution data, and control relationship data; performs cleaning, entity resolution, and versioning.
    • Storage layer: relational storage for detail records and versions, graph storage for adjacency relationships, and object storage for raw materials and evidence files.
    • Computation layer: path enumeration, ratio aggregation, control determination, batch jobs, and incremental jobs.
    • Service layer: entity queries, path queries, penetration reports, permission checks, and audit interfaces.
    • Governance layer: logging, monitoring and alerting, job scheduling, data quality checks, and data masking management.

    On Baidu AI Cloud, object storage can hold raw materials, message queues can decouple data changes, a container platform can run computation jobs, and logging and monitoring services can provide observability. These are all general categories; specific choices should depend on data scale, latency requirements, and the team’s technology stack.

    Incremental updating is an engineering priority. Equity relationships change, and historical results must remain replayable. A recommended approach is “change events + versioned snapshots + incremental recomputation”: relationship changes enter a message queue, the computation service identifies the affected subgraph, recomputes only the relevant paths, and writes results into a snapshot table with version numbers. Queries select the snapshot according to the business point in time, avoiding full recomputation.

    6. Accuracy Validation and Compliance Governance

    Once penetration results enter risk control or compliance workflows, accuracy requirements are high. At minimum, establish the following checks:

    1. Ratio conservation check: the sum of direct ownership ratios for the same investee should not exceed a reasonable range without cause; anomalies must be flagged.
    2. Cycle detection: identify circular holding chains and output cycle details to avoid infinite recursion.
    3. Isolated node and broken-chain checks: find records with one-sided relationships, missing entity information, or missing sources.
    4. Time consistency check: relationship validity intervals must be consistent with entity status and historical snapshots.
    5. Result explainability check: every penetration result must be traceable to its edges, sources, and rules.

    On the compliance side, personal information should follow the principle of minimum necessity, query interfaces should be authorized by role, sensitive fields should be masked, and all penetration reports should retain audit logs. In external output, distinguish “computed results” from “factual data,” and avoid presenting inferred relationships as confirmed facts.

    7. Conclusion

    The core of an equity penetration analysis system is not a graph, but a complete set of engineering capabilities: configurable semantics, explainable paths, traceable results, and incremental updates. The data model must preserve relationship details and versions; the algorithms must handle path aggregation and circular holdings; control determination requires a rule engine; and the service layer must support point-in-time queries and permission auditing. Only when business semantics, algorithm implementation, and governance mechanisms are all clearly designed can equity penetration capabilities operate reliably within complex corporate relationship networks.