How to Parse Equity Change Data: From Business Registration to Shareholder Lookthrough
This article explains an engineering approach to parsing equity change data from public business registration into ultimate shareholder ownership. It covers a data model for entities, equity relationships, and snapshots; snapshot-based change detection; a depth-first lookthrough algorithm with cycle and depth controls; validation rules; implementation recommendations; and common pitfalls. The code examples use fictional data and focus on method, not legal conclusions.
1. Case Background and Analysis Goals
A company developing large models recently completed a financing round. Public business registration information showed changes in its shareholder structure. The registered capital increased by about 21%. One newly added shareholder is a partnership. Its registered contribution increased from RMB 6,000 to about RMB 3.439 billion, and the total number of partners reached 32, of which 31 were newly added in this round.
News reports often present only conclusions, such as “multiple industrial and financial shareholders were added.” From an engineering perspective, answering “who ultimately holds how much equity” requires three tasks: identify field-level differences in each change, expand multilayer holding relationships, and validate whether the results are self-consistent. This article focuses on these three steps and provides a data model, algorithms, and code examples. All example data is fictional and used only to illustrate the method.
2. Why Shareholder Lookthrough Is a Data Problem
Shareholder lookthrough is essentially graph traversal. A company’s direct shareholders may be natural persons, companies, or partnerships. The partners of a partnership may themselves be partnerships. Each layer carries a contribution or holding ratio. The effective ratio of a terminal holder equals the product of ratios along the path, summed across all paths to the same terminal holder.
This creates three practical issues:
- The number of layers is not fixed, so recursion depth needs an upper limit.
- The same entity may hold shares through multiple paths, so ratios must be accumulated rather than overwritten.
- Equity relationships may contain cycles, for example, A holds B and B holds A. Traversal must record visited nodes.
3. Data Model Design
It is advisable to split the data into three entity types and store them separately instead of placing all fields in one wide table.
| Entity | Key fields | Notes |
|---|---|---|
| Enterprise entity | Unified social credit code, name, registered capital | Use the credit code as the unique identifier, not the name as the primary key |
| Equity relationship | Holder, held entity, ratio, subscribed amount, effective date, expiry date | Each record has a time interval for historical tracing |
| Snapshot | Enterprise ID, collection time, raw field hash | Used to compare differences between two collections |
Time intervals are important. The same equity relationship may have different ratios on different dates. Storing only the latest value loses the change history.
4. Change Detection: Snapshot Comparison
The shareholder sets obtained from two collections can be represented as dictionaries, with shareholder identifiers as keys and ratios as values. Comparison results fall into three categories: added, removed, and changed.
def diff_shareholders(old: dict, new: dict):added = {k: new[k] for k in new.keys() - old.keys()}removed = {k: old[k] for k in old.keys() - new.keys()}changed = {k: (old[k], new[k])for k in old.keys() & new.keys()if old[k] != new[k]}return added, removed, changed
The registered capital change rate is calculated as follows:
def capital_change_rate(old_capital: float, new_capital: float) -> float:if old_capital <= 0:raise ValueError("Original registered capital must be positive")return (new_capital - old_capital) / old_capital
Floating-point comparison of ratios may produce tiny errors. In practice, set a tolerance, for example abs(a - b) < 1e-9. Amount calculations are better handled with fixed-point or decimal types.
5. Ratio Expansion Algorithm
The implementation below uses depth-first traversal. The graph is represented as a dictionary whose keys are held entities and whose values are lists of their shareholders. During traversal, visited nodes are recorded to prevent cycles, and a maximum depth limits infinite recursion caused by abnormal data.
from dataclasses import dataclass@dataclass(frozen=True)class Edge:holder: str # Shareholder or partner identifierratio: float # Contribution or holding ratio, from 0 to 1def penetrate(node, graph, share=1.0, depth=0, max_depth=5,visited=None, result=None):"""Expand multilayer equity relationships into effective ratios for terminal holders."""if result is None:result = {}if visited is None:visited = frozenset()if depth >= max_depth or node in visited:return resultvisited = visited | {node}for edge in graph.get(node, []):effective = share * edge.ratioif graph.get(edge.holder):penetrate(edge.holder, graph, effective, depth + 1,max_depth, visited, result)else:result[edge.holder] = result.get(edge.holder, 0.0) + effectivereturn resultgraph = {"Target Company": [Edge("Partnership A", 0.25), Edge("Individual A", 0.75)],"Partnership A": [Edge("Partner 1", 0.6), Edge("Partner 2", 0.4)],}print(penetrate("Target Company", graph))# {'Partner 1': 0.15, 'Partner 2': 0.1, 'Individual A': 0.75}
The ratios of all terminal holders in the example result sum to 1. This is a basic validation rule.
Note that a partnership’s contribution ratio may differ from its economic profit distribution ratio. Registration information only shows contribution relationships. Distribution rules usually require reviewing the partnership agreement and cannot be inferred directly from registration data.
6. Data Validation
Lookthrough results should pass the following checks before external use:
- The direct shareholder ratios of the same held entity should sum to approximately 1 or 100%. A large gap indicates missing data or data that has not yet been disclosed.
- The sum of terminal holder ratios obtained from lookthrough should be consistent with the aggregate value from the previous step.
- Registered capital units must be unified. Registration data often mixes units such as ten thousand yuan and hundred million yuan. Convert everything to yuan before storage.
- Entity matching must rely on the unified social credit code. Many enterprises share the same name, and merging solely by name can cause serious errors.
- Public registration information may be updated with delay. Results should record the collection time to avoid treating a stale snapshot as the current state.
7. Engineering Implementation Recommendations
A maintainable parsing pipeline usually includes the following stages:
- Collection layer: Use only lawful public channels, comply with data source terms, control request frequency, and retain raw responses for review.
- Cleaning layer: Unify field names, units, and date formats; remove duplicate records; and convert raw text into structured fields.
- Storage layer: Store snapshots and historical changes in relational storage for time-based queries. When the equity graph is large, add a graph structure for traversal.
- Computation layer: Trigger lookthrough calculations on demand and bind results to snapshot version numbers to ensure reproducibility.
- Alerting layer: Set monitoring rules for events such as new shareholders, abrupt ratio changes, and registered capital changes above thresholds, and notify relevant personnel.
8. Common Pitfalls
First, treating subscribed contribution as paid-in amount. Contribution amounts in registration data are mostly subscribed. The actual timing and amount of payment require other evidence.
Second, treating registered ratio as control. A high shareholding ratio does not necessarily mean voting control; articles of association and agreements also matter.
Third, treating news summaries as first-hand records. Media articles may cite data from a specific point in time. Formal conclusions should trace back to original records from the registry and note the query time.
Fourth, ignoring personal information protection. Even if information is visible in public channels, use it only within lawful purposes and do not aggregate or profile personal information beyond those purposes.
9. A Practical Implementation Path
First establish unified entity identifiers and snapshot tables, then implement comparison and lookthrough algorithms, and finally add validation rules and alerts. Following this order, each step can be verified independently. When issues arise, it is easier to locate whether collection, cleaning, or computation caused the problem.
