This application provides a method and apparatus for generating a
knowledge graph for cross-layer
data processing activities. The method includes: defining entities and relationships corresponding to the
business logic layer, data operation layer, and technical implementation layer, as well as cross-layer relationships between entities in adjacent
layers; generating an entity-relationship model based on entities, relationships, and cross-layer relationships; extracting entity data from the
data processing activity documents corresponding to the
business logic layer, data operation layer, and technical implementation layer to obtain entity-relationship data; and generating a
knowledge graph based on the entity-relationship model and entity-relationship data. This application achieves full-link association analysis through three-layer cross-layer entity modeling, forming a structured, traceable, high-quality
knowledge graph. This provides accurate reference and data support for risk analysis of
data processing behavior, helping to quickly identify abnormal operations and potential risks.