Method and system used for establishing data model for relational data

The invention provides a method and a device for establishing a data model for relational data, wherein the relational data are based on multiple first types of entities and multiple second types of entities. The method comprises the following step: determining multiple variables for describing the data model, wherein the multiple variables include a first variable set and a second variable set; first variables represent characteristics, which influence the relationship between the first types of entities and the second types of entities, of the first types of entities; second variables represent characteristics, which influence the relationship between the first types of entities and the second types of entities, of the second types of entities. The method also comprises the following steps: selecting approximate distribution aiming at each variable of the multiple variables; moreover, iteratively updating parameters of the approximate distributions until the data model is converged.