技术领域Technical Field
本申请实施例涉及计算设备技术领域,尤其涉及一种元数据模型优化方法和计算设备。The embodiments of the present application relate to the technical field of computing devices, and in particular, to a metadata model optimization method and a computing device.
背景技术Background technique
元数据建模是目前最流行的数据库建模方式之一,元数据建模由于其具有对实体属性的可扩展性、对实体属性的共享性、以及对实体关系的分析等优点,可以被应用于数据库的数据管理和数据分析过程中。在元数据建模中,通常将数据模型分为数据层、元数据层和元-元数据层,这些数据层的定义将会使数据库层面的表变得复杂,在进行数据查询时,需要从不同的数据层中获取数据,并做数据组合,导致数据的查询过程复杂且效率较低。Metadata modeling is one of the most popular database modeling methods. Metadata modeling can be applied to the data management and data analysis process of the database due to its advantages such as scalability of entity attributes, sharing of entity attributes, and analysis of entity relationships. In metadata modeling, the data model is usually divided into the data layer, metadata layer, and meta-metadata layer. The definition of these data layers will make the database-level tables complicated. When querying data, it is necessary to obtain data from different data layers and combine the data, which makes the data query process complicated and inefficient.
在相关技术中,可以通过视图来显示数据表的数据,以简化数据的查询过程。In the related art, data in a data table can be displayed through a view to simplify the data query process.
然而,在数据库中除了对数据进行查询外,还存在对数据的增删改需求。当用户想要修改视图中的某个数据时,需要查找视图对应的数据表,并在数据表对该数据进行更新,再基于更新后的数据表对视图进行更新,这种方式将使得视图的更新过程复杂且维护成本过高。However, in addition to querying data, there is also a need to add, delete, and modify data in the database. When a user wants to modify a piece of data in a view, he needs to find the data table corresponding to the view, update the data in the data table, and then update the view based on the updated data table. This method will make the view update process complicated and the maintenance cost too high.
发明内容Summary of the invention
本申请实施例提供了一种元数据模型优化方法和计算设备,可以对对象视图进行更新,并在对象视图更新后,对元数据模型对应的数据表进行自适应更新,无需用户对每个对象视图单独进行维护,降低了维护成本。The embodiments of the present application provide a metadata model optimization method and computing device, which can update the object view and adaptively update the data table corresponding to the metadata model after the object view is updated. The user does not need to maintain each object view separately, thereby reducing maintenance costs.
第一方面,本申请实施例提供一种元数据模型优化方法,所述方法包括:In a first aspect, an embodiment of the present application provides a metadata model optimization method, the method comprising:
创建元数据模型对应的对象视图,所述对象视图用于展示所述元数据模型的至少一个对象的对象信息;响应于对所述对象视图的更新操作,获取所述对象视图的更新信息;基于所述对象视图的更新信息,对所述元数据模型对应的数据表进行更新。Create an object view corresponding to the metadata model, wherein the object view is used to display object information of at least one object of the metadata model; obtain update information of the object view in response to an update operation on the object view; and update a data table corresponding to the metadata model based on the update information of the object view.
在上述技术方案中,通过对象视图可以直观清晰地向用户展示元数据模型的至少一个对象的对象信息,便于用户对数据进行查询;可以对对象视图进行更新,并在对象视图更新后,还可以对元数据模型对应的数据表进行自适应更新,简化了对象视图的更新过程,且无需用户对每个元数据模型的对象视图和数据表单独进行维护,降低了维护成本。In the above technical solution, the object information of at least one object of the metadata model can be displayed to the user intuitively and clearly through the object view, which is convenient for the user to query the data; the object view can be updated, and after the object view is updated, the data table corresponding to the metadata model can also be adaptively updated, which simplifies the update process of the object view and eliminates the need for the user to separately maintain the object view and data table of each metadata model, thereby reducing maintenance costs.
在一种可能的实现方式中,创建元数据模型对应的对象视图,包括:In a possible implementation, creating an object view corresponding to the metadata model includes:
在监控到所述元数据模型创建成功后,根据所述元数据模型的模型索引,在所述元数据模型对应的数据表中,确定所述元数据模型的至少一个对象、以及每个对象的对象信息;根据所述模型索引和所述每个对象的对象信息,生成所述对象视图的视图创建语句;执行所述视图创建语句,创建所述对象视图。After monitoring that the metadata model is successfully created, at least one object of the metadata model and the object information of each object are determined in a data table corresponding to the metadata model according to the model index of the metadata model; a view creation statement of the object view is generated according to the model index and the object information of each object; and the view creation statement is executed to create the object view.
在上述技术方案中,当监控到元数据模型创建成功之后,可以自动生成该元数据模型对应的对象视图的视图创建语句,并自动执行该视图创建语句以创建对象视图,无需运维人员对每个对象视图进行更新维护,减少维护成本。In the above technical solution, after monitoring that the metadata model is successfully created, a view creation statement for the object view corresponding to the metadata model can be automatically generated, and the view creation statement can be automatically executed to create the object view. There is no need for operation and maintenance personnel to update and maintain each object view, thereby reducing maintenance costs.
在一种可能的实现方式中,各对象的对象信息包括:所述对象的对象索引,以及所述对象关联的至少一个属性中、每个属性的模型属性关系索引和属性值存储表的标识;根据所述模型索引和所述每个对象的对象信息,生成所述对象视图的视图创建语句,包括:In a possible implementation, the object information of each object includes: an object index of the object, and a model attribute relationship index and an identifier of an attribute value storage table of each attribute in at least one attribute associated with the object; generating a view creation statement of the object view according to the model index and the object information of each object includes:
根据所述每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成所述对象视图的属性查询语句;根据所述模型索引、所述每个对象的对象索引、以及所述每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成所述对象视图的联表查询语句;对所述属性查询语句和所述联表查询语句进行组合处理,得到所述视图创建语句。Generate an attribute query statement for the object view according to the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table; generate a joint table query statement for the object view according to the model index, the object index of each object, and the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table; combine the attribute query statement and the joint table query statement to obtain the view creation statement.
在上述技术方案中,可以在监控到元数据模型创建成功之后,自动获取元数据模型中每个对象的对象信息,并根据模型索引和每个对象的对象信息,生成该元数据模型对应的对象视图的属性查询语句和联表查询语句,并对属性查询语句和联表查询语句进行组装得到视图创建语句,无需运维人员对每个对象视图单独进行更新维护,减少了维护成本。In the above technical solution, after monitoring that the metadata model is successfully created, the object information of each object in the metadata model can be automatically obtained, and the attribute query statement and the joint table query statement of the object view corresponding to the metadata model can be generated according to the model index and the object information of each object, and the attribute query statement and the joint table query statement are assembled to obtain the view creation statement, which eliminates the need for operation and maintenance personnel to update and maintain each object view separately, reducing maintenance costs.
在一种可能的实现方式中,在创建所述元数据模型对应的对象视图之后,所述方法还包括:在监控到对所述元数据模型的删除操作时,删除所述对象视图。In a possible implementation, after creating the object view corresponding to the metadata model, the method further includes: deleting the object view when a deletion operation on the metadata model is monitored.
在上述技术方案中,可以在监控到对元数据模型的删除操作时,自动删除该元数据模型对应的对象视图,无需运维人员对每个对象视图单独进行更新维护,减少了维护成本。In the above technical solution, when a deletion operation on a metadata model is monitored, the object view corresponding to the metadata model can be automatically deleted, without the need for operation and maintenance personnel to update and maintain each object view separately, thereby reducing maintenance costs.
在一种可能的实现方式中,在删除所述对象视图之后,还包括:在所述元数据模型对应的数据表中,删除所述元数据模型的至少一个对象的对象信息;删除所述元数据模型。In a possible implementation manner, after deleting the object view, the method further includes: deleting object information of at least one object of the metadata model in a data table corresponding to the metadata model; and deleting the metadata model.
在上述技术方案中,在监控到对元数据模型的删除操作时,可以自动在该元数据模型对应的数据表中,对该元数据模型对应的至少一个对象的对象信息进行删除,以及在确定元数据模型对应的至少一个对象的对象信息删除完成后,对元数据模型进行删除,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, when a deletion operation on a metadata model is monitored, the object information of at least one object corresponding to the metadata model can be automatically deleted in the data table corresponding to the metadata model. After determining that the deletion of the object information of at least one object corresponding to the metadata model is completed, the metadata model is deleted. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,在创建所述元数据模型对应的对象视图之后,所述方法还包括:在监控到所述元数据模型发生更新时,根据所述元数据模型的模型索引,在所述元数据模型对应的数据表中,确定所述元数据模型的更新对象、以及所述更新对象的更新对象信息;根据所述模型索引和所述更新对象信息,重新生成所述对象视图的视图创建语句;执行重新生成的视图创建语句,更新所述对象视图。In a possible implementation, after creating the object view corresponding to the metadata model, the method further includes: when monitoring that the metadata model is updated, determining the update object of the metadata model and the update object information of the update object in the data table corresponding to the metadata model according to the model index of the metadata model; regenerating the view creation statement of the object view according to the model index and the update object information; and executing the regenerated view creation statement to update the object view.
在上述技术方案中,当对象视图创建完成之后,还可以根据元数据模型的更新情况,自动对元数据模型对应的对象视图进行更新,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护;并且通过重新生成对象视图的视图创建语句来重新创建新的对象视图,通过新的对象视图来替换旧的对象视图,使得视图更新逻辑更为简单,减少了对视图逻辑的维护成本。In the above technical solution, after the object view is created, the object view corresponding to the metadata model can be automatically updated according to the update status of the metadata model, without the need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately; and by regenerating the view creation statement of the object view to recreate a new object view, the old object view is replaced by the new object view, making the view update logic simpler and reducing the maintenance cost of the view logic.
在一种可能的实现方式中,所述更新信息包括模型索引、待新增对象、待新增对象的至少一个新增属性、以及每个新增属性的属性值;基于所述对象视图的更新信息,对所述元数据模型对应的数据表进行更新,包括:In a possible implementation, the update information includes a model index, an object to be added, at least one new attribute of the object to be added, and an attribute value of each new attribute; and updating a data table corresponding to the metadata model based on the update information of the object view includes:
根据所述模型索引,查询所述元数据模型的关联属性、以及所述关联属性的预设条件,并根据所述关联属性和所述预设条件,对所述至少一个新增属性、以及所述每个新增属性的属性值进行校验;若校验通过,则在所述元数据模型对应的数据表中,创建所述待新增对象的对象数据和所述至少一个新增属性的属性数据,所述对象数据包括所述模型索引和所述待新增对象的第一对象索引,所述属性数据包括:所述第一对象索引、以及所述至少一个新增属性的属性索引、属性值索引和属性值。According to the model index, the associated attributes of the metadata model and the preset conditions of the associated attributes are queried, and according to the associated attributes and the preset conditions, the at least one newly added attribute and the attribute value of each newly added attribute are verified; if the verification passes, the object data of the object to be added and the attribute data of the at least one newly added attribute are created in the data table corresponding to the metadata model, the object data includes the model index and the first object index of the object to be added, and the attribute data includes: the first object index, and the attribute index, attribute value index and attribute value of the at least one newly added attribute.
在上述技术方案中,在对象视图中新增待新增对象的至少一个新增属性、以及每个新增属性的属性值之后,可以自动在元数据模型对应的数据表中新增待新增对象对应的对象数据和至少一个属性数据,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, after adding at least one new attribute of the object to be added and the attribute value of each new attribute in the object view, the object data and at least one attribute data corresponding to the object to be added can be automatically added to the data table corresponding to the metadata model. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,所述更新信息包括待删除对象的第二对象索引;基于所述对象视图的更新信息,对所述元数据模型对应的数据表进行更新,包括:In a possible implementation, the update information includes a second object index of the object to be deleted; and based on the update information of the object view, updating a data table corresponding to the metadata model includes:
根据所述第二对象索引,在所述元数据模型对应的数据表中确定是否存在所述待删除对象;若确定存在所述待删除对象后,则在所述元数据模型对应的数据表中,查询所述待删除对象的至少一个属性中、每个属性对应的属性值存储表;针对任意一个属性,在所述属性的属性值存储表中,删除所述属性的属性数据,所述属性数据包括:所述第二对象索引和所述属性的属性索引、属性值索引和属性值;在所述元数据模型对应的数据表中,删除所述待删除对象的对象数据,所述对象数据包括所述元数据模型的模型索引和所述第二对象索引。According to the second object index, determine whether the object to be deleted exists in the data table corresponding to the metadata model; if it is determined that the object to be deleted exists, query the attribute value storage table corresponding to each attribute of at least one attribute of the object to be deleted in the data table corresponding to the metadata model; for any attribute, delete the attribute data of the attribute in the attribute value storage table of the attribute, and the attribute data includes: the second object index and the attribute index, attribute value index and attribute value of the attribute; in the data table corresponding to the metadata model, delete the object data of the object to be deleted, and the object data includes the model index of the metadata model and the second object index.
在上述技术方案中,在对象视图中删除待删除对象的对象信息之后,可以自动在元数据模型对应的数据表中删除该待删除对象的对象数据,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, after deleting the object information of the object to be deleted in the object view, the object data of the object to be deleted can be automatically deleted in the data table corresponding to the metadata model. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,所述更新信息包括待修改对象的第三对象索引、待修改属性和所述待修改属性的修改属性值;基于所述对象视图的更新信息,对所述元数据模型对应的数据表进行更新,包括:In a possible implementation, the update information includes a third object index of the object to be modified, a property to be modified, and a modified property value of the property to be modified; and updating a data table corresponding to the metadata model based on the update information of the object view includes:
根据所述第三对象索引,在所述元数据模型对应的数据表中确定是否存在所述待修改对象;若存在所述待修改对象,则确定所述待修改对象的属性是否包括所述待修改属性;在确定所述待修改对象的属性包括所述待修改属性后,在所述待修改属性对应的属性值存储表中,将所述待修改属性的属性值更新为所述修改属性值。According to the third object index, determine whether the object to be modified exists in the data table corresponding to the metadata model; if the object to be modified exists, determine whether the attributes of the object to be modified include the attribute to be modified; after determining that the attributes of the object to be modified include the attribute to be modified, update the attribute value of the attribute to be modified to the modified attribute value in the attribute value storage table corresponding to the attribute to be modified.
在上述技术方案中,在对象视图中将待修改对象的待修改属性的属性值修改为修改属性值之后,可以自动在元数据模型对应的数据表中将待修改属性的属性值更新为修改属性值,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, after the attribute value of the to-be-modified attribute of the to-be-modified object is modified to the modified attribute value in the object view, the attribute value of the to-be-modified attribute can be automatically updated to the modified attribute value in the data table corresponding to the metadata model. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
第二方面,本申请实施例提供一种元数据模型优化装置,所述装置包括:In a second aspect, an embodiment of the present application provides a metadata model optimization device, the device comprising:
创建模块,用于创建元数据模型对应的对象视图,所述对象视图用于展示所述元数据模型的至少一个对象的对象信息;A creation module, used to create an object view corresponding to the metadata model, wherein the object view is used to display object information of at least one object of the metadata model;
获取模块,用于响应于对所述对象视图的更新操作,获取所述对象视图的更新信息;an acquisition module, configured to acquire update information of the object view in response to an update operation on the object view;
更新模块,用于基于所述对象视图的更新信息,对所述元数据模型对应的数据表进行更新。An updating module is used to update the data table corresponding to the metadata model based on the update information of the object view.
在上述技术方案中,通过对象视图可以直观清晰地向用户展示元数据模型的至少一个对象的对象信息,便于用户对数据进行查询;可以对对象视图进行更新,并在对象视图更新后,还可以对元数据模型对应的数据表进行自适应更新,简化了对象视图的更新过程,且无需用户对每个元数据模型的对象视图和数据表单独进行维护,降低了维护成本。In the above technical solution, the object information of at least one object of the metadata model can be displayed to the user intuitively and clearly through the object view, which is convenient for the user to query the data; the object view can be updated, and after the object view is updated, the data table corresponding to the metadata model can also be adaptively updated, which simplifies the update process of the object view and eliminates the need for the user to separately maintain the object view and data table of each metadata model, thereby reducing maintenance costs.
在一种可能的实现方式中,所述创建模块具体用于:In a possible implementation, the creation module is specifically used to:
在监控到所述元数据模型创建成功后,根据所述元数据模型的模型索引,在所述元数据模型对应的数据表中,确定所述元数据模型的至少一个对象、以及每个对象的对象信息;根据所述模型索引和所述每个对象的对象信息,生成所述对象视图的视图创建语句;执行所述视图创建语句,创建所述对象视图。After monitoring that the metadata model is successfully created, at least one object of the metadata model and the object information of each object are determined in a data table corresponding to the metadata model according to the model index of the metadata model; a view creation statement of the object view is generated according to the model index and the object information of each object; and the view creation statement is executed to create the object view.
在上述技术方案中,当监控到元数据模型创建成功之后,可以自动生成该元数据模型对应的对象视图的视图创建语句,并自动执行该视图创建语句以创建对象视图,无需运维人员对每个对象视图进行更新维护,减少维护成本。In the above technical solution, after monitoring that the metadata model is successfully created, a view creation statement for the object view corresponding to the metadata model can be automatically generated, and the view creation statement can be automatically executed to create the object view. There is no need for operation and maintenance personnel to update and maintain each object view, thereby reducing maintenance costs.
在一种可能的实现方式中,各对象的对象信息包括:所述对象的对象索引,以及所述对象关联的至少一个属性中、每个属性的模型属性关系索引和属性值存储表的标识;所述创建模块具体还用于:In a possible implementation, the object information of each object includes: an object index of the object, and a model attribute relationship index and an identifier of an attribute value storage table of each attribute in at least one attribute associated with the object; the creation module is further configured to:
根据所述每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成所述对象视图的属性查询语句;根据所述模型索引、所述每个对象的对象索引、以及所述每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成所述对象视图的联表查询语句;对所述属性查询语句和所述联表查询语句进行组合处理,得到所述视图创建语句。Generate an attribute query statement for the object view according to the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table; generate a joint table query statement for the object view according to the model index, the object index of each object, and the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table; combine the attribute query statement and the joint table query statement to obtain the view creation statement.
在上述技术方案中,可以在监控到元数据模型创建成功之后,自动获取元数据模型中每个对象的对象信息,并根据模型索引和每个对象的对象信息,生成该元数据模型对应的对象视图的属性查询语句和联表查询语句,并对属性查询语句和联表查询语句进行组装得到视图创建语句,无需运维人员对每个对象视图单独进行更新维护,减少了维护成本。In the above technical solution, after monitoring that the metadata model is successfully created, the object information of each object in the metadata model can be automatically obtained, and the attribute query statement and the joint table query statement of the object view corresponding to the metadata model can be generated according to the model index and the object information of each object, and the attribute query statement and the joint table query statement are assembled to obtain the view creation statement, which eliminates the need for operation and maintenance personnel to update and maintain each object view separately, reducing maintenance costs.
在一种可能的实现方式中,所述元数据模型优化装置还包括删除模块;在创建所述元数据模型对应的对象视图之后;所述删除模块用于在监控到对所述元数据模型的删除操作时,删除所述对象视图。In a possible implementation, the metadata model optimization device also includes a deletion module; after creating the object view corresponding to the metadata model; the deletion module is used to delete the object view when monitoring the deletion operation of the metadata model.
在上述技术方案中,可以在监控到对元数据模型的删除操作时,自动删除该元数据模型对应的对象视图,无需运维人员对每个元数据模型的对象视图单独进行更新维护,减少了维护成本。In the above technical solution, when a deletion operation on a metadata model is monitored, the object view corresponding to the metadata model can be automatically deleted, eliminating the need for operation and maintenance personnel to update and maintain the object view of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,所述删除模块具体还用于:在所述元数据模型对应的数据表中,删除所述元数据模型的至少一个对象的对象信息;删除所述元数据模型。In a possible implementation manner, the deletion module is further specifically used to: delete object information of at least one object of the metadata model in a data table corresponding to the metadata model; and delete the metadata model.
在上述技术方案中,在监控到对元数据模型的删除操作时,可以自动在该元数据模型对应的数据表中,对该元数据模型对应的至少一个对象的对象信息进行删除,以及在确定元数据模型对应的至少一个对象的对象信息删除完成后,对元数据模型进行删除,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, when a deletion operation on a metadata model is monitored, the object information of at least one object corresponding to the metadata model can be automatically deleted in the data table corresponding to the metadata model. After determining that the deletion of the object information of at least one object corresponding to the metadata model is completed, the metadata model is deleted. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,在创建所述元数据模型对应的对象视图之后,所述更新模块还用于:在监控到所述元数据模型发生更新时,根据所述元数据模型的模型索引,在所述元数据模型对应的数据表中,确定所述元数据模型的更新对象、以及所述更新对象的更新对象信息;根据所述模型索引和所述更新对象信息,重新生成所述对象视图的视图创建语句;执行重新生成的视图创建语句,更新所述对象视图。In a possible implementation, after creating the object view corresponding to the metadata model, the update module is further used to: when monitoring that the metadata model is updated, determine the update object of the metadata model and the update object information of the update object in the data table corresponding to the metadata model according to the model index of the metadata model; regenerate the view creation statement of the object view according to the model index and the update object information; and execute the regenerated view creation statement to update the object view.
在上述技术方案中,当对象视图创建完成之后,还可以根据元数据模型的更新情况,自动对元数据模型对应的对象视图进行更新,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护;并且通过重新生成对象视图的视图创建语句来重新创建新的对象视图,并通过新的对象视图来替换旧的对象视图,使得视图更新逻辑更为简单,减少了对视图逻辑的维护成本。In the above technical solution, after the object view is created, the object view corresponding to the metadata model can be automatically updated according to the update status of the metadata model, without the need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately; and by regenerating the view creation statement of the object view to recreate a new object view, and replacing the old object view with the new object view, the view update logic is simpler and the maintenance cost of the view logic is reduced.
在一种可能的实现方式中,所述更新信息包括模型索引、待新增对象、待新增对象的至少一个新增属性、以及每个新增属性的属性值;所述更新模块具体还用于:根据所述模型索引,查询所述元数据模型的关联属性、以及所述关联属性的预设条件,并根据所述关联属性和所述预设条件,对所述至少一个新增属性、以及所述每个新增属性的属性值进行校验;若校验通过,则在所述元数据模型对应的数据表中,创建所述待新增对象的对象数据和所述至少一个新增属性的属性数据,所述对象数据包括所述模型索引和所述待新增对象的第一对象索引,所述属性数据包括:所述第一对象索引、以及所述至少一个新增属性的属性索引、属性值索引和属性值。In a possible implementation, the update information includes a model index, an object to be added, at least one new attribute of the object to be added, and the attribute value of each new attribute; the update module is specifically used to: query the associated attributes of the metadata model and the preset conditions of the associated attributes according to the model index, and verify the at least one new attribute and the attribute value of each new attribute according to the associated attributes and the preset conditions; if the verification passes, create object data of the object to be added and attribute data of the at least one new attribute in the data table corresponding to the metadata model, the object data includes the model index and the first object index of the object to be added, and the attribute data includes: the first object index, and the attribute index, attribute value index and attribute value of the at least one new attribute.
在上述技术方案中,在对象视图中新增待新增对象的至少一个新增属性、以及每个新增属性的属性值之后,可以自动在元数据模型对应的数据表中新增待新增对象对应的对象数据和至少一个属性数据,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, after adding at least one new attribute of the object to be added and the attribute value of each new attribute in the object view, the object data and at least one attribute data corresponding to the object to be added can be automatically added to the data table corresponding to the metadata model. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,所述更新信息包括待删除对象的第二对象索引;所述更新模块具体还用于:In a possible implementation manner, the update information includes a second object index of the object to be deleted; and the update module is further configured to:
根据所述第二对象索引,在所述元数据模型对应的数据表中确定是否存在所述待删除对象;若确定存在所述待删除对象后,则在所述元数据模型对应的数据表中,查询所述待删除对象的至少一个属性中、每个属性对应的属性值存储表;针对任意一个属性,在所述属性的属性值存储表中,删除所述属性的属性数据,所述属性数据包括:所述第二对象索引和所述属性的属性索引、属性值索引和属性值;在所述元数据模型对应的数据表中,删除所述待删除对象的对象数据,所述对象数据包括所述元数据模型的模型索引和所述第二对象索引。According to the second object index, determine whether the object to be deleted exists in the data table corresponding to the metadata model; if it is determined that the object to be deleted exists, query the attribute value storage table corresponding to each attribute of at least one attribute of the object to be deleted in the data table corresponding to the metadata model; for any attribute, delete the attribute data of the attribute in the attribute value storage table of the attribute, and the attribute data includes: the second object index and the attribute index, attribute value index and attribute value of the attribute; in the data table corresponding to the metadata model, delete the object data of the object to be deleted, and the object data includes the model index of the metadata model and the second object index.
在上述技术方案中,在对象视图中删除待删除对象的对象信息之后,可以自动在元数据模型对应的数据表中删除该待删除对象的对象数据,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, after deleting the object information of the object to be deleted in the object view, the object data of the object to be deleted can be automatically deleted in the data table corresponding to the metadata model. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
在一种可能的实现方式中,所述更新信息包括待修改对象的第三对象索引、待修改属性和所述待修改属性的修改属性值;所述更新模块具体还用于:In a possible implementation, the update information includes a third object index of the object to be modified, a property to be modified, and a modified property value of the property to be modified; and the update module is further configured to:
根据所述第三对象索引,在所述元数据模型对应的数据表中确定是否存在所述待修改对象;若存在所述待修改对象,则确定所述待修改对象的属性是否包括所述待修改属性;在确定所述待修改对象的属性包括所述待修改属性后,在所述待修改属性对应的属性值存储表中,将所述待修改属性的属性值更新为所述修改属性值。According to the third object index, determine whether the object to be modified exists in the data table corresponding to the metadata model; if the object to be modified exists, determine whether the attributes of the object to be modified include the attribute to be modified; after determining that the attributes of the object to be modified include the attribute to be modified, update the attribute value of the attribute to be modified to the modified attribute value in the attribute value storage table corresponding to the attribute to be modified.
在上述技术方案中,在对象视图中将待修改对象的待修改属性的属性值修改为修改属性值之后,可以自动在元数据模型对应的数据表中将待修改属性的属性值更新为修改属性值,无需运维人员对每个元数据模型的对象视图和数据表单独进行更新维护,减少了维护成本。In the above technical solution, after the attribute value of the to-be-modified attribute of the to-be-modified object is modified to the modified attribute value in the object view, the attribute value of the to-be-modified attribute can be automatically updated to the modified attribute value in the data table corresponding to the metadata model. There is no need for operation and maintenance personnel to update and maintain the object view and data table of each metadata model separately, thereby reducing maintenance costs.
第三方面,本申请实施例提供一种计算设备,包括处理器和存储器;In a third aspect, an embodiment of the present application provides a computing device, including a processor and a memory;
所述存储器用于,存储计算机程序;The memory is used to store computer programs;
所述处理器用于,执行所述存储器中存储的计算机程序,以实现如第一方面中任一项所述的方法。The processor is used to execute the computer program stored in the memory to implement the method as described in any one of the first aspects.
上述技术方案,通过对象视图可以直观清晰地向用户展示元数据模型的至少一个对象的对象信息,便于用户对数据进行查询;可以对对象视图进行更新,并在对象视图更新后,还可以对元数据模型对应的数据表进行自适应更新,无需用户手动维护,降低了维护成本。The above technical solution can intuitively and clearly display the object information of at least one object of the metadata model to the user through the object view, which is convenient for the user to query the data; the object view can be updated, and after the object view is updated, the data table corresponding to the metadata model can also be adaptively updated, without the need for manual maintenance by the user, thereby reducing maintenance costs.
第四方面,本申请实施例提供一种芯片,所述芯片用于执行第一方面任一项所述的方法。In a fourth aspect, an embodiment of the present application provides a chip, wherein the chip is used to execute any method described in the first aspect.
第五方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被计算机执行时实现如第一方面中任一项所述的方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer, the method as described in any one of the first aspects is implemented.
第六方面,本申请实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如第一方面中任一项所述的方法。In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements a method as described in any one of the first aspects.
本申请实施例提供了一种元数据模型优化方法和计算设备,该方法:可以创建元数据模型对应的对象视图,以通过该对象视图展示元数据模型的至少一个对象的对象信息;还可以响应于对对象视图的更新操作,获取对象视图的更新信息,并基于对象视图的更新信息,对元数据模型对应的数据表进行更新。在上述方法中,通过对象视图可以直观清晰地向用户展示元数据模型的至少一个对象的对象信息,便于用户对数据进行查询;可以对对象视图进行更新,并在对象视图更新后,还可以对元数据模型对应的数据表进行自适应更新,无需用户手动维护,降低了维护成本。The embodiment of the present application provides a metadata model optimization method and computing device, the method: can create an object view corresponding to the metadata model to display the object information of at least one object of the metadata model through the object view; can also obtain the update information of the object view in response to the update operation of the object view, and update the data table corresponding to the metadata model based on the update information of the object view. In the above method, the object information of at least one object of the metadata model can be displayed to the user intuitively and clearly through the object view, which is convenient for the user to query the data; the object view can be updated, and after the object view is updated, the data table corresponding to the metadata model can also be adaptively updated, without the need for manual maintenance by the user, thereby reducing maintenance costs.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请实施例的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
图1为本申请实施例提供的一种数据处理系统的架构示意图;FIG1 is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;
图2为本申请实施例提供的一种元数据模型优化方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a metadata model optimization method provided in an embodiment of the present application;
图3为本申请实施例提供的一种元数据模型对应的对象视图的自适应创建过程示意图一;FIG3 is a schematic diagram of a first process of adaptively creating an object view corresponding to a metadata model provided in an embodiment of the present application;
图4为本申请实施例提供的一种元数据模型对应的对象视图的自适应创建过程示意图二;FIG4 is a second schematic diagram of a process of adaptively creating an object view corresponding to a metadata model provided in an embodiment of the present application;
图5为本申请实施例提供的一种元数据模型对应的对象视图的自适应更新过程示意图;FIG5 is a schematic diagram of an adaptive update process of an object view corresponding to a metadata model provided in an embodiment of the present application;
图6为本申请实施例提供的元数据模型对应的对象视图的自适应删除过程示意图一;FIG6 is a schematic diagram of a first process of adaptively deleting an object view corresponding to a metadata model provided in an embodiment of the present application;
图7为本申请实施例提供的元数据模型对应的对象视图的自适应删除过程示意图二;FIG. 7 is a second schematic diagram of an adaptive deletion process of an object view corresponding to a metadata model provided in an embodiment of the present application;
图8为本申请实施例提供的更新操作为新增操作时元数据模型优化方法的流程示意图一;FIG8 is a flow chart of a metadata model optimization method when the update operation provided by an embodiment of the present application is a new addition operation;
图9为本申请实施例提供的更新操作为新增操作时元数据模型优化方法的流程示意图二;FIG9 is a second flow diagram of a metadata model optimization method when the update operation provided by an embodiment of the present application is a new addition operation;
图10为本申请实施例提供的更新操作为删除操作时元数据模型优化方法的流程示意图一;FIG10 is a flowchart diagram 1 of a metadata model optimization method when an update operation provided by an embodiment of the present application is a deletion operation;
图11为本申请实施例提供的更新操作为删除操作时元数据模型优化方法的流程示意图二;FIG11 is a second flow chart of a metadata model optimization method when an update operation provided by an embodiment of the present application is a deletion operation;
图12为本申请实施例提供的更新操作为修改操作时元数据模型优化方法的流程示意图一;FIG12 is a flowchart diagram 1 of a metadata model optimization method when an update operation provided by an embodiment of the present application is a modification operation;
图13为本申请实施例提供的更新操作为修改操作时元数据模型优化方法的流程示意图二;FIG13 is a second flow chart of a metadata model optimization method when the update operation provided by an embodiment of the present application is a modification operation;
图14为本申请实施例提供的一种元数据模型优化装置的结构示意图;FIG14 is a schematic diagram of the structure of a metadata model optimization device provided in an embodiment of the present application;
图15为本申请实施例提供的另一种元数据模型优化装置的结构示意图;FIG15 is a schematic diagram of the structure of another metadata model optimization device provided in an embodiment of the present application;
图16为本申请实施例提供的一种计算设备的硬件结构示意图。FIG16 is a schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请实施例的一些方面相一致的装置和方法的例子。Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present application. Instead, they are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
为了便于理解,首先对本申请实施例涉及的术语进行简单介绍:For ease of understanding, the terms involved in the embodiments of the present application are briefly introduced first:
对象管理组织(The Object Management Group,OMG):对象管理组织是一个国际协会,开始的目的是为分布式面向对象系统建立标准,现在致力于建立对程序、系统和业务流程的建模标准,以及基于模型的标准。The Object Management Group (OMG): The Object Management Group is an international association that was originally established to establish standards for distributed object-oriented systems and is now dedicated to establishing modeling standards for programs, systems, and business processes, as well as model-based standards.
实体联系(Entity–Relationship,E-R)模型:又称实体关系模型或实体联系模式图,是概念数据模型的高层描述所使用的数据模型或模式图。Entity-Relationship (E-R) model: also known as the entity-relationship model or entity-relationship pattern diagram, is a data model or pattern diagram used for the high-level description of the conceptual data model.
面向切面编程(Aspect Oriented Programming,AOP):面向切面程序设计,是计算机科学中的一种程序设计思想,旨在将交叉切入关注点与作为业务主体的核心关注点进行分离,以提高程序代码的模块化程度。Aspect Oriented Programming (AOP): Aspect Oriented Programming is a programming concept in computer science that aims to separate cross-cutting concerns from the core concerns of the business entity to improve the modularity of program code.
范式建模:范式建模就是将源表抽取为实体表或关系表,所以范式建模即是实体关系(E-R)模型。范式建模法主要用于解决关系型数据库的数据存储和利用的一种技术层面上的方法,可以采用范式建模法构建数据模型。Paradigm modeling: Paradigm modeling is to extract source tables into entity tables or relationship tables, so paradigm modeling is the entity-relationship (E-R) model. Paradigm modeling is a technical method mainly used to solve the data storage and utilization of relational databases. The paradigm modeling method can be used to build data models.
范式是数据库逻辑模型设计的基本理论,一个关系模型可以从第一范式到第五范式进行无损分解,这个过程也可称为规范化。目前关系数据库有六种范式:第一范式(1NF)、第二范式(2NF)、第三范式(3NF)、BCNF(Boyce-Codd)范式、第四范式(4NF)和第五范式(5NF)。目前,在关系型数据库中的范式建模法中通常采用三范式建模法。一个符合第三范式的关系需具备以下三个条件:每个属性值唯一,不具有多义性;每个非主属性完全依赖于整个主键,而非主键的一部分;每个非主属性不能依赖于其他关系中的属性。Paradigm is the basic theory of database logical model design. A relational model can be decomposed losslessly from the first normal form to the fifth normal form. This process can also be called normalization. At present, there are six paradigms for relational databases: the first normal form (1NF), the second normal form (2NF), the third normal form (3NF), the BCNF (Boyce-Codd) paradigm, the fourth normal form (4NF) and the fifth normal form (5NF). At present, the three-paradigm modeling method is usually used in the paradigm modeling method in relational databases. A relationship that conforms to the third normal form must meet the following three conditions: each attribute value is unique and not ambiguous; each non-primary attribute is completely dependent on the entire primary key, not a part of the primary key; each non-primary attribute cannot depend on attributes in other relationships.
为了便于理解,下面,以对图书管理系统中的图书和作者的建模为例,对范式建模过程进行说明。To facilitate understanding, the modeling of books and authors in a library management system is used as an example to illustrate the paradigm modeling process.
表1图书表-模板示例Table 1 Book table - template example
表2图书表-实际数据示例Table 2 Book table - actual data example
表3作者表-模板示例Table 3 Author table - Template example
表4作者表-实际数据示例Table 4 Author table - actual data example
范式建模法适合于模型属性无变化或业务稳定的场景。在一些模型属性动态调整或业务波动场景下,若使用范式建模法进行建模,在模型开发过程中将会出现经常修改表字段的操作,例如,对书籍新增一个出版社的字段,导致模型维护难度较大。The paradigm modeling method is suitable for scenarios where model attributes do not change or the business is stable. In some scenarios where model attributes are dynamically adjusted or the business fluctuates, if the paradigm modeling method is used for modeling, the table fields will be frequently modified during the model development process. For example, a new publisher field is added to the book, which makes model maintenance more difficult.
元数据建模:元数据建模为基于元数据平台构建符合公共仓库元模型(CommonWarehouse Metamodel,CWM)规范的元数据仓库,实现元数据模型统一、集中化管理,提供元数据模型的查询、增加、修改、删除、元数据关系管理和权限设置等功能,支持概念模型、逻辑模型和物理模型的采集和管理。Metadata modeling: Metadata modeling is to build a metadata warehouse that complies with the CommonWarehouse Metamodel (CWM) specification based on the metadata platform, realize unified and centralized management of metadata models, provide functions such as metadata model query, addition, modification, deletion, metadata relationship management and permission setting, and support the collection and management of conceptual models, logical models and physical models.
可以基于对象管理组织(The Object Management Group,OMG)定义的元模型规范来进行元数据建模,OMG将元数据从数据对象开始逐层抽象建模,依次为:数据(Data):初始数据,为物理世界中存在的原始数据,记为M0;元数据(Metadata):定义数据的数据,也称为Model,记为M1;元-元数据(Meta-metadata):定义元数据的数据,也称为Metamodel,记为M2;元-元-元数据(Meta-metametadata):定义元模型数据,也称为Meta-Metamodel,记为M3。Metadata modeling can be performed based on the metamodel specification defined by the Object Management Group (OMG). OMG abstracts metadata layer by layer starting from data objects, in order: Data: initial data, which is the original data existing in the physical world, denoted as M0; Metadata: data that defines data, also called Model, denoted as M1; Meta-metadata: data that defines metadata, also called Metamodel, denoted as M2; Meta-metametadata: data that defines metamodel, also called Meta-Metamodel, denoted as M3.
在本申请实施例中,将M0记作实体数据层,用于记录现实世界中实际某个对象实体的属性值;M1记作模型层,用于标记抽象的数据模型、数据模型与属性的关联关系、以及数据模型之间的关系;M2记作模型属性层,用于记录数据模型的属性;M3记作属性类型标记层,用于记录属性类型及属性长度等,可以参照数据库中预设的属性类型的标记,也可以根据需求定义属性类型的标记。In the embodiment of the present application, M0 is recorded as the entity data layer, which is used to record the attribute value of an actual object entity in the real world; M1 is recorded as the model layer, which is used to mark the abstract data model, the association between the data model and the attribute, and the relationship between the data models; M2 is recorded as the model attribute layer, which is used to record the attributes of the data model; M3 is recorded as the attribute type marking layer, which is used to record the attribute type and attribute length, etc., and the attribute type marking preset in the database can be referred to, or the attribute type marking can be defined according to the needs.
数据模型:数据模型是数据库系统的核心和基础,现有的数据库系统都是基于某种数据模型而创建起来的。在本申请实施例中,将现实事物的抽象描述为数据模型。Data model: Data model is the core and foundation of database system. All existing database systems are created based on some data model. In the embodiment of the present application, the abstract description of real things is described as data model.
对象实体:在面向对象的软件设计中,万物皆为对象,对象实体是关于对象在现实世界中的一个示例。对象实体存在标志,该标志可以用于确定该对象实体。Object entity: In object-oriented software design, everything is an object. An object entity is an example of an object in the real world. An object entity has a flag that can be used to identify the object entity.
对象实体数据:对象实体数据是对关联的对象实体的详细描述,例如,对象实体数据可以用于描述一个对象实体的长宽高,重量等。Object entity data: Object entity data is a detailed description of the associated object entity. For example, object entity data can be used to describe the length, width, height, weight, etc. of an object entity.
为了便于理解,下面以对图书管理系统中的图书和作者的建模为例,对元数据建模过程进行说明。To facilitate understanding, the metadata modeling process is explained below by taking the modeling of books and authors in a library management system as an example.
(1)模型属性表:位于元数据建模中的M2层,模型属性表用于存储数据模型的属性,可以对数据模型的数据进行描述。(1) Model attribute table: Located in the M2 layer of metadata modeling, the model attribute table is used to store the attributes of the data model and can describe the data of the data model.
表5 M2-模型属性表-模板示例Table 5 M2-Model attribute table-Template example
表6 M2-模型属性表-实际数据示例Table 6 M2-Model attribute table-actual data example
(2)数据模型表:位于元数据建模中的M1层,数据模型表用于存储模型数据,可以对数据模型进行描述。(2) Data model table: Located in the M1 layer of metadata modeling, the data model table is used to store model data and can describe the data model.
表7 M1-数据模型表-模板示例Table 7 M1-Data Model Table-Template Example
表8 M1-数据模型表-实际数据示例Table 8 M1-Data Model Table-Actual Data Example
(3)数据模型与属性关系表:位于元数据建模中的M1层,数据模型与属性关系表用于描述数据模型与属性之间的关联关系,可以对数据模型具备哪些属性进行描述。(3) Data model and attribute relationship table: Located in the M1 layer of metadata modeling, the data model and attribute relationship table is used to describe the relationship between the data model and the attributes, and can describe what attributes the data model has.
表9 M1-数据模型与属性关系表-模板示例Table 9 M1-Data model and attribute relationship table-Template example
表10M1-数据模型与属性关系表-实际数据示例Table 10M1 - Data model and attribute relationship table - actual data example
(4)数据模型关系表:位于元数据建模中的M1层,数据模型关系表用于描述两个数据模型之间的关联关系。(4) Data model relationship table: Located in the M1 layer of metadata modeling, the data model relationship table is used to describe the relationship between two data models.
表11M1-数据模型关系表-模板示例Table 11M1 - Data model relationship table - Template example
在表11中,数据模型关系表中的枚举类型字段可以用于说明两个数据模型之间的对比关系,其中,枚举类型对应的数值为1时,表示两个数据模型为1对1关系;枚举类型对应的数值为2时,表示两个数据模型为1对多关系;枚举类型对应的数值为3时,表示两个数据模型为多对多关系。数据模型关系表中的model1_attribute字段用于标识数据模型1与数据模型2中具备关联关系的模型属性关系;model2_attribute字段用于标识数据模型2与数据模型1中具备关联关系的模型属性关系,该属性关系不能重复。In Table 11, the enumeration type field in the data model relationship table can be used to illustrate the comparative relationship between two data models, where when the value corresponding to the enumeration type is 1, it indicates that the two data models are in a 1-to-1 relationship; when the value corresponding to the enumeration type is 2, it indicates that the two data models are in a 1-to-many relationship; when the value corresponding to the enumeration type is 3, it indicates that the two data models are in a many-to-many relationship. The model1_attribute field in the data model relationship table is used to identify the model attribute relationship that has an association relationship between data model 1 and data model 2; the model2_attribute field is used to identify the model attribute relationship that has an association relationship between data model 2 and data model 1, and the attribute relationship cannot be repeated.
假设数据模型1为表8中的书籍模型,数据模型2为表8中的作者模型,在表10所示的数据模型与属性关系表中,在id为3时,书籍模型与作者模型中的作者编码属性之间具有关联关系;在id为5时,作者模型与书籍模型中的书籍业务编码属性之间具有关联关系。因此,书籍模型和作者模型之间的数据模型关系表如表12所示:Assume that data model 1 is the book model in Table 8, and data model 2 is the author model in Table 8. In the data model and attribute relationship table shown in Table 10, when id is 3, there is an association relationship between the book model and the author code attribute in the author model; when id is 5, there is an association relationship between the author model and the book business code attribute in the book model. Therefore, the data model relationship table between the book model and the author model is shown in Table 12:
表12M1-数据模型关系表-实际数据示例Table 12M1 - Data model relationship table - actual data example
(5)对象实体表:位于元数据建模中的M0层,对象实体表用于描述现实世界中的某个物理实体,可以用来存储对象实体的对象数据。由于现实中的对象多种多样,为避免表的无限增大,可以按照数据模型名称对对象实体表进行分表处理。(5) Object entity table: Located at the M0 layer in metadata modeling, the object entity table is used to describe a physical entity in the real world and can be used to store object data of the object entity. Since there are many kinds of objects in reality, in order to avoid the unlimited growth of the table, the object entity table can be divided into tables according to the data model name.
表13 M0-对象实体表-模板示例Table 13 M0-Object Entity Table-Template Example
表14 M0-对象实体表-实际数据示例Table 14 M0-Object Entity Table-Actual Data Example
(6)对象实体数据表:位于元数据建模中的M0层,对象实体数据表用于存储对象实体各属性的属性数据,同样为保证属性值的类型统一,对象实体数据表按照属性的预设条件(例如,字符类型和字符长度)进行分表,当数据模型属性新增时,可以按照属性的预设条件创建对应的对象实体数据表。(6) Object entity data table: Located at the M0 layer in metadata modeling, the object entity data table is used to store the attribute data of each attribute of the object entity. To ensure the uniformity of the attribute value type, the object entity data table is divided according to the preset conditions of the attribute (for example, character type and character length). When a new data model attribute is added, the corresponding object entity data table can be created according to the preset conditions of the attribute.
表15 M0-对象实体数据表-模板示例Table 15 M0-Object Entity Data Table-Template Example
例如,在表6中,数据模型属性为名称和业务编码时,属性值的长度为50;数据模型属性为性别和出生年时,属性值的长度为30。可以根据属性值的长度创建两个对象实体数据表:对象实体数据表-String-50和对象实体数据表-String-30。For example, in Table 6, when the data model attributes are name and business code, the length of the attribute value is 50; when the data model attributes are gender and birth year, the length of the attribute value is 30. Two object entity data tables can be created based on the length of the attribute value: object entity data table-String-50 and object entity data table-String-30.
表16 M0-对象实体数据表-String-50-实体数据示例Table 16 M0-Object Entity Data Table-String-50-Entity Data Example
表17 M0-对象实体数据表-String-30-实体数据示例Table 17 M0-Object Entity Data Table-String-30-Entity Data Example
从表5到表17所示的元数据的建模过程可知,元数据建模中为适配不同对象的属性,新增了M2层和M1层,M2层用于对模型属性进行描述,M1层中各表用于对数据模型进行补充说明,M0层中各表用于描述物理世界中某个对象实体的对象数据和属性数据。From the metadata modeling process shown in Table 5 to Table 17, it can be seen that in metadata modeling, the M2 layer and the M1 layer are added to adapt to the attributes of different objects. The M2 layer is used to describe the model attributes, and the tables in the M1 layer are used to supplement the data model. The tables in the M0 layer are used to describe the object data and attribute data of an object entity in the physical world.
在元数据建模过程中,各数据的数据描述是离散的,数据散落分布在各个表中,使得基于元数据建模方法构建数据库时会导致代码层面的业务复杂度增加。In the metadata modeling process, the data description of each data is discrete, and the data is scattered in various tables, which increases the business complexity at the code level when building a database based on the metadata modeling method.
在一种示例中,基于元数据建模的元数据查询过程通常包括以下几个步骤:首先,明确用户的业务需求,将业务需求中的业务信息转换为对应的表和列;然后,根据确定的表、列属性和业务关系获取相应的元模型信息,并结合业务属性筛选条件构建查询语句;最后,执行查询语句,解析查询结果并反馈给用户。在这个过程中,元数据关联实现筛选查询,需要先根据对象实体编码查询关联的元数据,再结合元数据与对象实体编码查询对象实体数据,最后组合获取所需的对象实体数据。例如,假设用户查询需求为“查询张老师周二课堂答题准确率最高的前三名”。首先,明确业务需求的业务信息,包括教师、课程、排课、学生、成绩等,然后构建元数据模型,元数据模型包括编码、关系编码、列属性和描述,并将业务数据信息放入元数据模型中,建立索引编码。接下来,生成查询语句:获取存放的元数据信息(例如教师、课程等业务栏位信息对应的索引ID),结合不同实体存储数据表筛选对应索引ID下的信息(如姓名实体数据表中的教师姓名ID和学生姓名ID),并生成实体查询语句。最后,在实体数据表中添加过滤条件(如教师姓名等于“张老师”),生成查询SQL语句。执行查询SQL语句,按照业务需求“查询张老师周二课堂答题准确率最高的前三名”,返回查询结果。In one example, the metadata query process based on metadata modeling usually includes the following steps: first, clarify the user's business needs, convert the business information in the business needs into corresponding tables and columns; then, obtain the corresponding metamodel information according to the determined table, column attributes and business relationships, and build a query statement in combination with the business attribute screening conditions; finally, execute the query statement, parse the query results and feedback to the user. In this process, metadata association implements screening query, which requires first querying the associated metadata according to the object entity code, then querying the object entity data in combination with the metadata and the object entity code, and finally combining to obtain the required object entity data. For example, suppose the user's query requirement is "query the top three students with the highest accuracy in answering questions in Teacher Zhang's class on Tuesday." First, clarify the business information of the business needs, including teachers, courses, class schedules, students, grades, etc., and then build a metadata model. The metadata model includes coding, relationship coding, column attributes and descriptions, and put the business data information into the metadata model to establish an index code. Next, generate a query statement: obtain the stored metadata information (such as the index ID corresponding to the business column information such as teachers and courses), filter the information under the corresponding index ID in combination with different entity storage data tables (such as the teacher name ID and student name ID in the name entity data table), and generate an entity query statement. Finally, add a filter condition (such as teacher name equals "Mr. Zhang") to the entity data table to generate a query SQL statement. Execute the query SQL statement and return the query result according to the business requirement of "querying the top three students with the highest accuracy in answering questions in Mr. Zhang's class on Tuesday".
从上述示例可知,在需要构建关联多张实体存储数据表以实现复杂业务场景时,元数据模型构建的实现过程较为复杂,在基于元数据模型进行数据查询时,需要从不同的数据层中获取数据,还需要进行数据组合,导致数据的查询过程复杂且效率较低。鉴于此,本申请实施例提供了一种元数据模型优化方法,可以创建元数据模型对应的对象视图,通过该对象视图向用户展示元数据模型的至少一个对象的对象信息,以使用户无需调用多个不同的数据层进行数据组合处理便可快速获取待查询的数据,简化了数据查询步骤,提高了数据查询效率。并且,该方法还可以响应于对对象视图的更新操作,获取对象视图的更新信息,并基于对象视图的更新信息,对元数据模型对应的数据表进行自适应更新,无需运维人员在每次对对象视图更新后,对元数据模型对应的数据表进行更新维护,减少了维护成本。As can be seen from the above examples, when it is necessary to build multiple entity storage data tables to implement complex business scenarios, the implementation process of metadata model construction is relatively complicated. When performing data query based on the metadata model, it is necessary to obtain data from different data layers and to combine data, resulting in a complex data query process and low efficiency. In view of this, the embodiment of the present application provides a metadata model optimization method, which can create an object view corresponding to the metadata model, and display the object information of at least one object of the metadata model to the user through the object view, so that the user can quickly obtain the data to be queried without calling multiple different data layers for data combination processing, simplifying the data query steps and improving the data query efficiency. In addition, the method can also respond to the update operation of the object view, obtain the update information of the object view, and based on the update information of the object view, adaptively update the data table corresponding to the metadata model, without the need for operation and maintenance personnel to update and maintain the data table corresponding to the metadata model after each update of the object view, thereby reducing maintenance costs.
为了便于对本申请实施例提供的元数据模型优化方法的理解,首先,结合图1,对本申请实施例所涉及的数据处理系统的架构进行介绍。In order to facilitate the understanding of the metadata model optimization method provided in the embodiment of the present application, first, in conjunction with Figure 1, the architecture of the data processing system involved in the embodiment of the present application is introduced.
图1为本申请实施例提供的一种数据处理系统的架构示意图。请参见图1,数据处理系统中包括两个层级,分别为业务应用级和数据库级。其中,数据库级负责对元数据模型和元数据模型对象视图的构建以及对数据实体的存储,业务应用级负责根据业务逻辑向数据库中增删改数据。FIG1 is a schematic diagram of the architecture of a data processing system provided by an embodiment of the present application. Referring to FIG1 , the data processing system includes two levels, namely, the business application level and the database level. The database level is responsible for constructing the metadata model and the metadata model object view and storing the data entity, and the business application level is responsible for adding, deleting, and modifying data in the database according to the business logic.
业务应用级可以包括数据应用层,在数据应用层中,由于业务的多种多样性,对数据要求的操作也不相同,可以根据业务场景,将数据应用层划分为3个模块,分别为单对象增删改查模块、联表查询模块和元数据模型增删改查模块。The business application level can include the data application layer. In the data application layer, due to the diversity of businesses, the operations required for data are also different. According to the business scenarios, the data application layer can be divided into three modules, namely, the single object addition, deletion, modification and query module, the joint table query module and the metadata model addition, deletion, modification and query module.
其中,单数据增删改查模块可以用于单对象的增删改查场景。例如,在图书管理系统中,当用户登录图书管理系统时,可以根据用户登录id查询该用户的基本信息,以确定该用户是否为黑名单用户或该用户是否欠费等;当用户浏览可以借阅的书籍时,可以查询有哪些书籍可借用或者按类查询书籍等;当某个书籍需要下架时,系统管理员可以从图书管理系统的后台对书籍进行删除;当需要对书籍作者信息进行维护修改时,系统管理员可以登录图书管理系统修改作者数据。Among them, the single data addition, deletion, modification and query module can be used for single object addition, deletion, modification and query scenarios. For example, in a library management system, when a user logs in to the library management system, the user's basic information can be queried based on the user login id to determine whether the user is a blacklist user or whether the user is in arrears, etc.; when a user browses books that can be borrowed, he can query which books can be borrowed or query books by category, etc.; when a book needs to be removed from the shelf, the system administrator can delete the book from the background of the library management system; when the author information of a book needs to be maintained and modified, the system administrator can log in to the library management system to modify the author data.
联表查询模块可以用于联表查询场景,通常在对对象的宽表展示或关联搜索中会使用到联查查询。例如,在图书管理系统中,当用户登录系统后,可以根据用户与书籍之间的关系,联表查询用户借阅中的书籍;根据作者与书籍之间的关系,统计作者共写过哪些书;根据管理员与书籍之间的关系,统计管理员负责的书籍数量。在联表查询中,通常以需要查询的对象的某个属性与被关联的对象的某个属性相等为条件进行关联的,例如,作者与书籍之间可以通过作者信息中的作者索引与书籍中引用的作者索引来关联。The joint table query module can be used in joint table query scenarios, which are usually used in wide table display or associated search of objects. For example, in a library management system, after a user logs in to the system, he can query the books that the user is borrowing through a joint table based on the relationship between the user and the book; based on the relationship between the author and the book, count the books that the author has written; based on the relationship between the administrator and the book, count the number of books that the administrator is responsible for. In a joint table query, the association is usually based on the condition that a certain attribute of the object to be queried is equal to a certain attribute of the associated object. For example, the author and the book can be associated through the author index in the author information and the author index referenced in the book.
元数据模型增删改查模块可以用于元数据模型的增删改查场景。在元数据建模过程中,创建了对数据模型描述的相关表,使得元数据模型可以向外提供增删改查的功能。由于元数据模型特有的数据离散型,使得基于元数据模型对某个对象的属性进行修改时,对表的调用可以达到最少。在元数据建模过程中,还可以添加修改时间和修改人等信息,以通过这些信息来标记属性级的增删改日志。例如,在图书管理系统中,当系统管理员需要修改某位作者的出生年信息时,可以在对象实体数据表中修改该作者对应的对象实体数据;当系统管理员需要对书籍对象新增入库时间信息时,需要修改M2-模型属性表及M1-数据模型与属性关系表。在元数据建模过程中,可以基于业务需求对数据模型的描述进行及时修改。The metadata model addition, deletion, modification and query module can be used for the addition, deletion, modification and query scenarios of the metadata model. In the metadata modeling process, the relevant tables describing the data model are created so that the metadata model can provide the functions of addition, deletion, modification and query to the outside. Due to the unique data discreteness of the metadata model, when the attributes of an object are modified based on the metadata model, the calls to the table can be minimized. In the metadata modeling process, you can also add information such as modification time and modification person to mark the attribute-level addition, deletion and modification logs. For example, in a library management system, when the system administrator needs to modify the birth year information of an author, the object entity data corresponding to the author can be modified in the object entity data table; when the system administrator needs to add the storage time information to the book object, it is necessary to modify the M2-model attribute table and the M1-data model and attribute relationship table. In the metadata modeling process, the description of the data model can be modified in a timely manner based on business needs.
数据库级可以包括对象数据层和元数据模型层。对象数据层可以包括4个模块:数据对象视图模块、自维护结构化查询语言(Structured Query Language,SQL)转换模块、对象增删改转换模块和模型校验模块。当使用元数据建模创建元数据模型层时,在数据库级中将根据OMG定义的元模型规范创建元数据基础表,元数据基础表可以用于对模型数据的管理、对模型关系的管理、对模型的管理、以及对模型属性的管理。元数据模型层可以包括4个模块:模型数据管理模块、模型关系管理模块、模型管理模块和模型属性管理模块。The database level can include an object data layer and a metadata model layer. The object data layer can include four modules: a data object view module, a self-maintaining Structured Query Language (SQL) conversion module, an object addition, deletion, and modification conversion module, and a model verification module. When metadata modeling is used to create a metadata model layer, a metadata base table will be created at the database level according to the metamodel specification defined by OMG. The metadata base table can be used for the management of model data, the management of model relationships, the management of models, and the management of model attributes. The metadata model layer can include four modules: a model data management module, a model relationship management module, a model management module, and a model attribute management module.
本申请实施例在数据库级中的元数据模型层之上创建了对象数据层,该对象数据层可以作为数据应用层和元数据模型层之间的桥梁。数据应用层中的各个模块可以接收前端发送的业务处理请求,数据应用层还可以根据业务处理请求调用对象数据层中的各个模块,并通过对象数据层各模块对元数据模型层中的各模块进行对应的操作,以实现对元数据模型的视图创建和更新、以及对元数据模型中的数据的增删改查的目的。The embodiment of the present application creates an object data layer on top of the metadata model layer at the database level, and the object data layer can serve as a bridge between the data application layer and the metadata model layer. Each module in the data application layer can receive a business processing request sent by the front end, and the data application layer can also call each module in the object data layer according to the business processing request, and perform corresponding operations on each module in the metadata model layer through each module of the object data layer, so as to achieve the purpose of creating and updating views of the metadata model, and adding, deleting, modifying and checking data in the metadata model.
在本申请实施例中,使用对象视图实现数据层的数据展示具有如下优点:对开发人员而言,所见即所得,看到的均为可使用的实体模型(E-R数据模型);对于数据管理者而言,后台数据以元数据的形式存储,可以利用元数据建模的各类优点。In the embodiment of the present application, the use of object views to implement data display at the data layer has the following advantages: for developers, what you see is what you get, and what you see are usable entity models (E-R data models); for data managers, the background data is stored in the form of metadata, and the various advantages of metadata modeling can be utilized.
下面,通过具体实施例对本申请实施例所示的方法进行说明。需要说明的是,下面几个实施例可以单独存在,也可以互相结合,对于相同或相似的内容,在不同的实施例中不再重复说明。The following is a description of the method shown in the embodiments of the present application through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be repeatedly described in different embodiments.
图2为本申请实施例提供的一种元数据模型优化方法的流程示意图。请参见图2,该方法可以包括:FIG2 is a flow chart of a metadata model optimization method provided in an embodiment of the present application. Referring to FIG2 , the method may include:
本申请实施例中,该方法可以应用于计算设备中,计算设备可以为服务器,如存储服务器、通用服务器、GPU服务器或AI服务器等。例如,该方法可以由计算设备来实现,或者可以由计算设备中的芯片来实现,或者可以由计算设备中的元数据模型优化装置来实现。In the embodiment of the present application, the method can be applied to a computing device, which can be a server, such as a storage server, a general server, a GPU server, or an AI server. For example, the method can be implemented by a computing device, or can be implemented by a chip in a computing device, or can be implemented by a metadata model optimization device in a computing device.
S201、创建元数据模型对应的对象视图。S201. Create an object view corresponding to the metadata model.
该步骤可以通过图1中的对象数据层的数据对象视图模块实现。该数据对象视图模块可以对元数据模型层进行监听,当监听到元数据模型层有元数据模型创建成功之后,可以生成该元数据模型对应的对象视图。This step can be implemented by the data object view module of the object data layer in Figure 1. The data object view module can monitor the metadata model layer, and when it monitors that a metadata model is successfully created in the metadata model layer, it can generate an object view corresponding to the metadata model.
对象视图可以用于展示元数据模型的至少一个对象的对象信息。对象信息可以包括该对象的对象标识、以及该对象关联的至少一个属性的属性值。例如,对象标识可以为对象的名称或对象索引。The object view can be used to display the object information of at least one object of the metadata model. The object information can include the object identifier of the object and the attribute value of at least one attribute associated with the object. For example, the object identifier can be the name of the object or the object index.
该对象视图不仅可以用于对该对象视图对应的元数据模型的查询过程,还可以用于对与该对象视图对应的元数据模型相关联的其他元数据模型的联表查询。用户可以通过该对象视图直观便捷地对元数据模型中各个对象的至少一个属性的属性值进行查询,无需调用多个不同的数据层,简化了数据查询步骤,有利于提高数据查询效率。The object view can be used not only for querying the metadata model corresponding to the object view, but also for joint table querying of other metadata models associated with the metadata model corresponding to the object view. Users can use the object view to intuitively and conveniently query the attribute value of at least one attribute of each object in the metadata model without calling multiple different data layers, which simplifies the data query steps and helps improve data query efficiency.
在一种示例中,计算设备中可以包括预设的对象视图库,该对象视图库可以包括多个元数据模型对应的对象视图。In one example, a computing device may include a preset object view library, which may include object views corresponding to multiple metadata models.
对象视图的呈现方式可以为表格形式。例如,元数据模型为书籍元数据模型,该书籍元数据模型对应的对象视图可以如表18所示:The object view may be presented in a table format. For example, if the metadata model is a book metadata model, the object view corresponding to the book metadata model may be as shown in Table 18:
表18书籍元数据模型对应的对象视图Table 18 Object views corresponding to the book metadata model
在表18中,任意一行数据表示书籍元数据模型中任意一个对象的对象信息。其中,第1列(id列)的表头为元数据模型中每个对象的对象索引;第2列~第4列的表头为元数据模型的模型属性关系索引。例如,假设对象为西游记,则第一行数据为西游记对应的对象信息。其中,第1列的“1”为西游记的对象索引“1”;第2列中的“1”为书籍元数据模型中的“书籍与书籍名称关系”的模型属性关系索引,“西游记”表示书籍元数据模型关联的书籍名称属性的属性值;第3列中的“2”为书籍元数据模型中的“书籍与书籍业务编码关系”的模型属性关系索引,“书籍业务编码1”表示书籍元数据模型关联的书籍业务编码属性的属性值;第4列中的“3”为书籍元数据模型中的“书籍与作者编码关系”的模型属性关系索引,“作者编码1”表示书籍元数据模型关联的作者编码属性的属性值。In Table 18, any row of data represents the object information of any object in the book metadata model. Among them, the header of the first column (id column) is the object index of each object in the metadata model; the headers of the second to fourth columns are the model attribute relationship indexes of the metadata model. For example, assuming that the object is Journey to the West, the first row of data is the object information corresponding to Journey to the West. Among them, "1" in the first column is the object index "1" of Journey to the West; "1" in the second column is the model attribute relationship index of "book and book name relationship" in the book metadata model, "Journey to the West" represents the attribute value of the book name attribute associated with the book metadata model; "2" in the third column is the model attribute relationship index of "book and book business code relationship" in the book metadata model, "book business code 1" represents the attribute value of the book business code attribute associated with the book metadata model; "3" in the fourth column is the model attribute relationship index of "book and author code relationship" in the book metadata model, "author code 1" represents the attribute value of the author code attribute associated with the book metadata model.
S202、响应于对对象视图的更新操作,获取对象视图的更新信息。S202: In response to an update operation on the object view, obtain update information of the object view.
更新操作可以包括:新增操作、删除操作和修改操作。Update operations may include: adding operations, deleting operations, and modifying operations.
当更新操作为新增操作时,更新信息可以包括:元数据模型的模型索引、待新增对象、以及待新增对象的至少一个新增属性、以及每个新增属性的属性值。When the update operation is a new addition operation, the update information may include: a model index of the metadata model, an object to be added, at least one new attribute of the object to be added, and an attribute value of each new attribute.
当更新操作为删除操作时,更新信息可以包括待删除对象的第二对象索引。When the update operation is a delete operation, the update information may include a second object index of the object to be deleted.
当更新操作为修改操作时,更新信息可以包括:待修改对象的第三对象索引、待修改属性和待修改属性的修改属性值。When the update operation is a modification operation, the update information may include: a third object index of the object to be modified, a property to be modified, and a modified property value of the property to be modified.
S203、基于对象视图的更新信息,对元数据模型对应的数据表进行更新。S203: Based on the update information of the object view, update the data table corresponding to the metadata model.
该步骤可以由图1所示的对象数据层的对象增删改转换模块执行。该对象增删改转换模块可以获取对象视图的更新信息,并基于对象视图的更新信息,对元数据模型对应的数据表进行更新。This step can be performed by the object addition, deletion and modification conversion module of the object data layer shown in Fig. 1. The object addition, deletion and modification conversion module can obtain the update information of the object view, and based on the update information of the object view, update the data table corresponding to the metadata model.
在本申请实施例中,元数据模型可以包括如下所示的元数据表:数据模型表(如表8)、数据模型与属性关系表(如表10)、数据模型关系表(如表12)和模型属性表(如表6);元数据模型对应的数据表可以包括对象实体表(如表14)和对象实体数据表(如表16和表17)。In an embodiment of the present application, the metadata model may include metadata tables as shown below: a data model table (such as Table 8), a data model and attribute relationship table (such as Table 10), a data model relationship table (such as Table 12) and a model attribute table (such as Table 6); the data tables corresponding to the metadata model may include an object entity table (such as Table 14) and an object entity data table (such as Table 16 and Table 17).
可以基于预设的元数据模型创建模板(例如,表5、表7、表9和表11),来创建元数据模型中的各个元数据表。预设的元数据模型创建模板可以包括:多个字段、以及每个字段对应的预设条件,例如,预设条件可以包括:该字段的数据类型和字段长度等。Each metadata table in the metadata model can be created based on a preset metadata model creation template (e.g., Table 5, Table 7, Table 9, and Table 11). The preset metadata model creation template may include: multiple fields, and preset conditions corresponding to each field, for example, the preset conditions may include: the data type and field length of the field, etc.
当更新操作不同时,对象视图的更新信息不同,基于对象视图的更新信息对元数据模型对应的数据表进行更新的过程也不同。When the update operations are different, the update information of the object view is different, and the process of updating the data table corresponding to the metadata model based on the update information of the object view is also different.
需要说明的是,基于对象视图的更新信息,对元数据模型对应的数据表的更新过程将在图8~图13中进行详细说明。It should be noted that the updating process of the data table corresponding to the metadata model based on the updating information of the object view will be described in detail in FIGS. 8 to 13 .
本申请实施例提供的元数据模型优化方法,通过对象视图可以直观清晰地向用户展示元数据模型的至少一个对象的对象信息,便于用户对数据进行查询;可以对对象视图进行更新,并在对象视图更新后,还可以对元数据模型对应的数据表进行自适应更新,无需用户手动维护,降低了维护成本。The metadata model optimization method provided in the embodiment of the present application can intuitively and clearly display the object information of at least one object of the metadata model to the user through the object view, so as to facilitate the user to query the data; the object view can be updated, and after the object view is updated, the data table corresponding to the metadata model can also be adaptively updated, without the need for manual maintenance by the user, thereby reducing maintenance costs.
在本申请实施例中,可以根据元数据模型的变化情况,对元数据模型对应的对象视图进行创建和自维护,以降低后期对对象视图的维护成本。下面,结合图3和图4,对元数据模型对应的对象视图的创建过程进行详细说明;结合图5~图7对元数据模型对应的对象视图的自维护过程进行说明。In the embodiment of the present application, the object view corresponding to the metadata model can be created and self-maintained according to the changes in the metadata model to reduce the maintenance cost of the object view in the later stage. The creation process of the object view corresponding to the metadata model is described in detail below in conjunction with Figures 3 and 4; the self-maintenance process of the object view corresponding to the metadata model is described in conjunction with Figures 5 to 7.
图3为本申请实施例提供的一种元数据模型对应的对象视图的自适应创建过程示意图一。请参见图3,该方法具体包括:FIG3 is a schematic diagram of a first process of adaptively creating an object view corresponding to a metadata model provided by an embodiment of the present application. Referring to FIG3 , the method specifically includes:
S301、监控到元数据模型创建成功后,根据元数据模型的模型索引,在元数据模型对应的数据表中,确定元数据模型的至少一个对象、以及每个对象的对象信息。S301: After monitoring that a metadata model is successfully created, determine at least one object of the metadata model and object information of each object in a data table corresponding to the metadata model according to a model index of the metadata model.
可以采用切面或监听的方式确定元数据模型是否创建成功,若元数据模型创建失败,则无需执行创建对象视图的操作;若元数据模型创建成功,则创建该元数据模型对应的对象视图。You can use aspects or monitoring to determine whether the metadata model is created successfully. If the metadata model fails to be created, there is no need to perform the operation of creating an object view; if the metadata model is created successfully, create the object view corresponding to the metadata model.
S302、根据模型索引和每个对象的对象信息,生成对象视图的视图创建语句。S302: Generate a view creation statement for the object view according to the model index and the object information of each object.
对象信息可以包括对象的对象索引,以及对象关联的至少一个属性中、每个属性的模型属性关系索引和属性值存储表的标识。The object information may include an object index of the object, and a model attribute relationship index and an identifier of an attribute value storage table for each attribute in at least one attribute associated with the object.
在一种可能的实现方式中,可以通过执行如下所示的S3021~S3023步骤,来生成视图创建语句:In a possible implementation, a view creation statement may be generated by executing steps S3021 to S3023 as shown below:
S3021、根据每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成对象视图的属性查询语句。S3021. Generate an attribute query statement of the object view according to the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table.
在元数据建模中,通常将对象的至少一个属性的属性值存储于对象实体数据表中,本申请实施例中的属性值存储表可以为元数据建模中的对象实体数据表。可以在元数据模型中的对象实体数据表中,查询每个对象关联的各属性的模型属性关系索引。例如,在表10中,假设对象为西游记,属性为书籍名称,可以查询到西游记关联的书籍名称属性的模型属性关系索引为“1”。In metadata modeling, the attribute value of at least one attribute of an object is usually stored in an object entity data table. The attribute value storage table in the embodiment of the present application can be an object entity data table in metadata modeling. The model attribute relationship index of each attribute associated with each object can be queried in the object entity data table in the metadata model. For example, in Table 10, assuming that the object is Journey to the West and the attribute is the book name, the model attribute relationship index of the book name attribute associated with Journey to the West can be queried to be "1".
对象视图的属性查询语句可以包括该元数据模型中每个对象对应的第一属性查询语句。The property query statement of the object view may include a first property query statement corresponding to each object in the metadata model.
针对任意一个对象,当该对象关联有多个属性时,可以对这多个属性进行遍历,依次生成该对象各属性对应的初始属性查询语句,并对各属性对应的初始属性查询语句进行拼接处理,以得到该对象对应的第一属性查询语句。For any object, when the object is associated with multiple attributes, these multiple attributes can be traversed, initial attribute query statements corresponding to each attribute of the object can be generated in turn, and the initial attribute query statements corresponding to each attribute can be concatenated to obtain the first attribute query statement corresponding to the object.
属性查询语句可以为SQL,可以基于预设的属性查询语句生成模板来生成每个属性对应的初始属性查询语句。为提高对属性查询的准确性,预设的属性查询语句中可以包括每个属性的模型属性关系索引和属性值存储表的标识。The attribute query statement may be SQL, and the initial attribute query statement corresponding to each attribute may be generated based on a preset attribute query statement generation template. To improve the accuracy of the attribute query, the preset attribute query statement may include the model attribute relationship index of each attribute and the identifier of the attribute value storage table.
在本申请实施例中,预设的属性查询语句生成模板可以如下所示:In an embodiment of the present application, the preset attribute query statement generation template may be as follows:
S3022、根据模型索引、每个对象的对象索引、以及每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成对象视图的联表查询语句。S3022. Generate a joint table query statement for the object view according to the model index, the object index of each object, and the model attribute relationship index and the identifier of the attribute value storage table of each attribute in at least one attribute associated with each object.
对象视图的联表查询语句可以包括该元数据模型中每个对象对应的第一联表查询语句。The joint table query statement of the object view may include a first joint table query statement corresponding to each object in the metadata model.
针对任意一个对象,当该对象关联有多个属性时,可以对这多个属性进行遍历,依次生成该对象每个属性对应的初始联表查询语句,并对每个属性对应的初始联表查询语句进行拼接处理,以得到该对象对应的第一联表查询语句。For any object, when the object is associated with multiple attributes, these multiple attributes can be traversed to generate initial joint table query statements corresponding to each attribute of the object in turn, and the initial joint table query statements corresponding to each attribute can be concatenated to obtain the first joint table query statement corresponding to the object.
联表查询语句可以为SQL,可以基于预设的联表查询语句生成模板来生成每个属性对应的初始联表查询语句。在生成各属性对应的初始联表查询语句时,需要先确定各属性的属性值存储表的标识。在元数据建模过程中,可以根据属性的预设条件(例如,属性的属性值字符类型和字符长度)来确定属性值存储表的标识,可以将预设条件相同的多个属性的属性值存储于同一属性值存储表中。在这种情况下,可能存在多个属性的属性值存储表的标识相同。因此,为了在属性值存储表准确获取各属性的属性值,可以在预设的联查查询语句生成模板中增加对象实体索引、属性的属性值存储表标识和模型属性关系索引,以在属性值存储表中准确查找各属性的属性值。The joint table query statement can be SQL, and the initial joint table query statement corresponding to each attribute can be generated based on the preset joint table query statement generation template. When generating the initial joint table query statement corresponding to each attribute, it is necessary to first determine the identifier of the attribute value storage table of each attribute. In the metadata modeling process, the identifier of the attribute value storage table can be determined according to the preset conditions of the attribute (for example, the attribute value character type and character length of the attribute), and the attribute values of multiple attributes with the same preset conditions can be stored in the same attribute value storage table. In this case, there may be multiple attributes with the same identifier of the attribute value storage table. Therefore, in order to accurately obtain the attribute value of each attribute in the attribute value storage table, the object entity index, the attribute value storage table identifier of the attribute and the model attribute relationship index can be added to the preset joint query statement generation template to accurately find the attribute value of each attribute in the attribute value storage table.
预设的联表查询语句生成模板可以如下所示:The preset joint table query statement generation template can be as follows:
S3023、对属性查询语句和联表查询语句进行组合处理,得到视图创建语句。S3023. Combine the attribute query statement and the joint table query statement to obtain a view creation statement.
视图创建语句包括每个对象的第一视图创建语句。属性查询语句包括每个对象对应的第一属性查询语句,联表查询语句包括每个对象对应的第一联表查询语句,可以将每个对象的第一属性查询语句和第一联表查询语句进行组合处理,得到该对象的第一视图创建语句。The view creation statement includes the first view creation statement for each object. The attribute query statement includes the first attribute query statement corresponding to each object, and the joint table query statement includes the first joint table query statement corresponding to each object. The first attribute query statement and the first joint table query statement of each object can be combined and processed to obtain the first view creation statement of the object.
可以基于预设的视图创建语句生成模板,对至少一个第一属性查询语句和第一联表查询语句进行组合处理,得到视图创建语句。A view creation statement may be obtained by combining at least one first attribute query statement and a first joint table query statement based on a preset view creation statement generation template.
在相关技术中的视图创建语句中,通常需要填入对象视图的名称和选择(SELECT)语句。在本申请实施例中,为了实现对对象视图的自动更新,对相关技术中的视图创建语句进行了如下优化:将关键字“创建(CREATE)”修改为关键字“创建或替换(CREATE ORREPLACE)”;将元数据模型的名称自动确定为元数据模型对应的对象视图的名称,以便于关联管理元数据模型、以及元数据模型对应的对象视图;将选择语句设置为元数据模型对应的属性SQL及联表SQL的组合。视图创建语句生成模板可以如下所示:In the view creation statement in the related art, it is usually necessary to fill in the name of the object view and the select (SELECT) statement. In the embodiment of the present application, in order to realize the automatic update of the object view, the view creation statement in the related art is optimized as follows: the keyword "create (CREATE)" is modified to the keyword "create or replace (CREATE ORREPLACE)"; the name of the metadata model is automatically determined as the name of the object view corresponding to the metadata model, so as to facilitate the association management of the metadata model and the object view corresponding to the metadata model; the select statement is set to the combination of the attribute SQL and the joint table SQL corresponding to the metadata model. The view creation statement generation template can be as follows:
在一些示例中,在组装属性SQL或联表SQL时,可以使用对象映射框架中的映射器(Mapper)来组装,以便于对SQL的扩展。示例性的,对象映射框架可以为Mybatis-Plus。下面,以使用Mybatis-Plus的Mapper组装属性SQL为例对组装SQL的过程进行说明。可以通过如下方式组装属性SQL:遍历对象关联的多个属性,生成每个属性的属性SQL;可以使用Mapper中的回调函数(foreach)标签,对传入的属性SQL进行组合,以将多个属性生成的多个属性SQL组合为数组。如有新增属性,向属性SQL数组中添加该新增属性的属性SQL。在本申请实施例中,可以通过图1中的自维护SQL转换模块自动生成自维护SQL,以为对象视图的自动化维护提供保障。在实际应用中,开发人员可以通过引入包添加注解的方式完成自维护SQL的配置,有利于降低开发成本,提升开发效率。In some examples, when assembling attribute SQL or joint table SQL, the mapper in the object mapping framework can be used to assemble it, so as to facilitate the expansion of SQL. Exemplarily, the object mapping framework can be Mybatis-Plus. Below, the process of assembling SQL is explained by taking the use of Mybatis-Plus's Mapper to assemble attribute SQL as an example. Attribute SQL can be assembled in the following way: traverse multiple attributes associated with the object and generate attribute SQL for each attribute; the callback function (foreach) tag in the Mapper can be used to combine the incoming attribute SQL to combine multiple attribute SQLs generated by multiple attributes into an array. If there are new attributes, add the attribute SQL of the new attribute to the attribute SQL array. In an embodiment of the present application, self-maintenance SQL can be automatically generated by the self-maintenance SQL conversion module in Figure 1 to provide guarantee for the automated maintenance of object views. In actual applications, developers can complete the configuration of self-maintenance SQL by introducing packages to add annotations, which is conducive to reducing development costs and improving development efficiency.
S303、执行视图创建语句,创建对象视图。S303. Execute a view creation statement to create an object view.
可以在确定视图创建语句生成之后,可以通过预设的触发器和编译器来自动执行视图创建语句,以创建对象视图。After determining that a view creation statement is generated, the view creation statement can be automatically executed through a preset trigger and a compiler to create an object view.
图4为本申请实施例提供的一种元数据模型对应的对象视图的自适应创建过程示意图二。请参见图4,该方法具体包括:FIG4 is a second schematic diagram of a process of adaptively creating an object view corresponding to a metadata model provided by an embodiment of the present application. Referring to FIG4 , the method specifically includes:
S401、元数据模型创建。S401: Metadata model creation.
元数据模型创建包括数据模型表的创建、模型属性表的创建、数据模型与属性关系表的创建、以及数据模型关系表的创建。Metadata model creation includes the creation of data model tables, the creation of model attribute tables, the creation of data model and attribute relationship tables, and the creation of data model relationship tables.
S402、判断元数据模型是否创建成功。S402: Determine whether the metadata model is created successfully.
在确定元数据模型的数据模型数据、模型属性数据、数据模型与属性关系数据、以及数据模型关系数据创建成功之后,确定元数据模型创建成功。After determining that the data model data, the model attribute data, the data model and attribute relationship data, and the data model relationship data of the metadata model are successfully created, it is determined that the metadata model is successfully created.
若是,则执行S403~S406;若否,则结束对象视图创建过程。If yes, execute S403 to S406; if no, end the object view creation process.
S403、创建元数据模型的至少一个对象的对象数据。S403: Create object data of at least one object of the metadata model.
可以基于预设的对象数据生成模板来创建元数据模型的至少一个对象的对象数据。例如,预设的对象数据生成模板可以如表13所示。对象数据可以包括对象的对象索引、元数据模型的模型索引,对象数据还可以包括对象的实体编码。例如,对象数据可以为表14中的任意一行数据。The object data of at least one object of the metadata model can be created based on a preset object data generation template. For example, the preset object data generation template can be as shown in Table 13. The object data can include an object index of the object, a model index of the metadata model, and the object data can also include an entity code of the object. For example, the object data can be any row of data in Table 14.
S404、创建元数据模型的各对象的每个关联属性的属性数据。S404: Create attribute data for each associated attribute of each object of the metadata model.
可以基于预设的属性数据生成模板来创建各对象的每个关联属性的属性数据。例如,预设的属性数据生成模板可以如表15所示。属性数据可以包括对象索引、属性值索引、模型属性关系索引和属性值。例如,属性数据可以为表16或表17中的任意一行数据。The attribute data of each associated attribute of each object can be created based on a preset attribute data generation template. For example, the preset attribute data generation template can be as shown in Table 15. The attribute data can include an object index, an attribute value index, a model attribute relationship index, and an attribute value. For example, the attribute data can be any row of data in Table 16 or Table 17.
S405、生成视图创建语句。S405: Generate a view creation statement.
S406、执行视图创建语句,创建或更新元数据模型对应的对象视图。S406: Execute a view creation statement to create or update an object view corresponding to the metadata model.
需要说明的是,S405和S406的执行过程可以参照S302和S303的执行过程,此处不再进行重复赘述。It should be noted that the execution process of S405 and S406 can refer to the execution process of S302 and S303, and will not be repeated here.
本申请实施例提供的元数据模型优化方法,可以自动在每个元数据模型创建成功后,为该元数据模型创建对应的对象视图,无需运维人员为每个元数据模型单独编辑视图创建语句来创建对象视图,减少了对对象视图的维护成本。The metadata model optimization method provided in the embodiment of the present application can automatically create a corresponding object view for each metadata model after the metadata model is successfully created. There is no need for operation and maintenance personnel to edit the view creation statement for each metadata model separately to create the object view, thereby reducing the maintenance cost of the object view.
在实际应用过程中,可以对已创建的元数据模型进行更新,例如,可以对已创建的元数据模型的属性或者属性关系进行增删改等更新操作。在这种场景下,本申请实施例提供的元数据模型优化方法,还可以在元数据模型更新后,对元数据模型对应的对象视图进行自适应更新。下面,结合图5,对元数据模型更新后对象视图的自适应更新处理过程进行详细说明。In actual application, the created metadata model can be updated. For example, the attributes or attribute relationships of the created metadata model can be added, deleted, modified, and other update operations. In this scenario, the metadata model optimization method provided in the embodiment of the present application can also adaptively update the object view corresponding to the metadata model after the metadata model is updated. Below, in conjunction with Figure 5, the adaptive update processing process of the object view after the metadata model is updated is described in detail.
图5为本申请实施例提供的一种元数据模型对应的对象视图的自适应更新过程示意图。FIG5 is a schematic diagram of an adaptive update process of an object view corresponding to a metadata model provided in an embodiment of the present application.
请参见图5,该方法具体包括:Please refer to FIG5 , the method specifically includes:
S501、在监控到元数据模型发生更新时,根据元数据模型的模型索引,在元数据模型对应的数据表中,确定元数据模型的更新对象、以及更新对象的更新对象信息。S501. When it is monitored that a metadata model is updated, an update object of the metadata model and update object information of the update object are determined in a data table corresponding to the metadata model according to a model index of the metadata model.
在元数据建模过程中,经常涉及对元数据模型的属性的增删改操作。在这种更新场景下,更新对象可以包括元数据模型中每个对象,更新对象信息可以包括元数据模型中每个对象的第一更新对象信息。第一更新对象信息可以包括该对象的对象索引、更新后该对象关联的至少一个属性中、每个属性的模型属性关系索引和属性值存储表的标识。In the metadata modeling process, the addition, deletion and modification operations of the attributes of the metadata model are often involved. In this update scenario, the update object may include each object in the metadata model, and the update object information may include the first update object information of each object in the metadata model. The first update object information may include the object index of the object, at least one attribute associated with the object after the update, the model attribute relationship index of each attribute, and the identifier of the attribute value storage table.
例如,在图书管理系统中,假设已创建书籍数据模型,且书籍数据模型具备书籍名称、书籍业务编码及作者业务编码三个关联属性。在一种场景下,需要为书籍数据模型新增1个关联属性:书籍价格,并且书籍价格属性的属性值的数据需精确到小数点后两位。For example, in a library management system, assume that a book data model has been created, and the book data model has three associated attributes: book name, book business code, and author business code. In one scenario, you need to add a new associated attribute to the book data model: book price, and the attribute value of the book price attribute must be accurate to two decimal places.
在这种场景下,需要在元数据模型中的模型属性表中新增价格属性的属性信息。例如,可以在表6所示的模型属性表中新增价格属性的属性信息,新增价格属性的属性信息后的模型属性表可以如表19所示:In this scenario, it is necessary to add the attribute information of the price attribute to the model attribute table in the metadata model. For example, the attribute information of the price attribute can be added to the model attribute table shown in Table 6, and the model attribute table after adding the attribute information of the price attribute can be shown in Table 19:
表19新增价格属性的属性信息后的模型属性表Table 19 Model attribute table after adding attribute information of price attribute
在确定模型属性表中新增书籍价格属性的属性信息之后,可以在书籍元数据模型的数据模型与属性关系表中,新增“书籍与书籍价格关系”的属性关系数据。例如,可以在表10所示的数据模型与属性关系表中新增“书籍与书籍价格关系”的属性关系数据,在该属性关系数据增加完成后,书籍元数据模型中数据模型与数据关系表可以如表20所示:After determining the attribute information of the newly added book price attribute in the model attribute table, the attribute relationship data of "the relationship between books and book prices" can be added to the data model and attribute relationship table of the book metadata model. For example, the attribute relationship data of "the relationship between books and book prices" can be added to the data model and attribute relationship table shown in Table 10. After the attribute relationship data is added, the data model and data relationship table in the book metadata model can be shown in Table 20:
表20新增书籍数据模型与价格属性的属性关系Table 20 Attribute relationship between the newly added book data model and price attribute
在确定数据模型与属性关系表中新增“书籍与书籍价格关系”的属性关系数据之后,查看书籍元数据模型对应的数据表中是否包括标识为“t_entity_data_decimal_8_2”的属性值存储表;若包括,则在该属性值存储表中为元数据模型中每个对象新增书籍价格属性对应的属性值;若未包括,则基于预设的属性值存储表创建语句模板,生成该属性值存储表的创建语句,并执行该创建语句,以创建该属性值存储表。After determining the newly added attribute relationship data of "relationship between books and book prices" in the data model and the attribute relationship table, check whether the data table corresponding to the book metadata model includes the attribute value storage table identified as "t_entity_data_decimal_8_2"; if included, then add the attribute value corresponding to the book price attribute for each object in the metadata model in the attribute value storage table; if not included, generate a creation statement for the attribute value storage table based on a preset attribute value storage table creation statement template, and execute the creation statement to create the attribute value storage table.
例如,预设的属性值存储表创建语句模板可以包括多个预设字段,示例性的,预设字段可以包括待创建的属性值存储表的标识和数据存储类型(例如,浮点型字段存储表),预设字段还可以包括待创建的属性值存储表中的至少一个表格字段的预设条件。表格字段可以为属性值索引字段、对象索引字段、模型属性关系索引字段和属性值字段。预设条件可以包括该字段是否为主键、字段内容是否不为空、字段顺序是否自增、字段的数据类型、字段长度和字段说明等。For example, the preset attribute value storage table creation statement template may include multiple preset fields. Exemplarily, the preset fields may include the identifier of the attribute value storage table to be created and the data storage type (for example, a floating point field storage table). The preset fields may also include preset conditions for at least one table field in the attribute value storage table to be created. The table field may be an attribute value index field, an object index field, a model attribute relationship index field, and an attribute value field. The preset conditions may include whether the field is a primary key, whether the field content is not empty, whether the field order is auto-incremental, the data type of the field, the field length, and the field description.
需要说明的是,在创建“t_entity_data_decimal_8_2”属性值存储表的过程中,需要按照表19所示的模型属性表中书籍价格属性的数据类型(decimal)和长度(8.2),对属性值存储表中的书籍价格属性的属性值(value)进行存储。It should be noted that in the process of creating the "t_entity_data_decimal_8_2" attribute value storage table, the attribute value (value) of the book price attribute in the attribute value storage table needs to be stored according to the data type (decimal) and length (8.2) of the book price attribute in the model attribute table shown in Table 19.
对书籍元数据模型新增书籍价格属性后,可查询到书籍元数据模型有4个关联属性。其中,书籍元数据模型的书籍名称、书籍业务编码及作者编码这3个关联属性的属性值存储在t_entity_data_string_50属性值存储表,书籍价格属性的属性值存储在t_entity_data_decimal_8_2属性值存储表中。After adding the book price attribute to the book metadata model, you can query that the book metadata model has 4 associated attributes. Among them, the attribute values of the three associated attributes of the book metadata model, namely, book name, book business code and author code, are stored in the t_entity_data_string_50 attribute value storage table, and the attribute value of the book price attribute is stored in the t_entity_data_decimal_8_2 attribute value storage table.
S502、生成对象视图的视图创建语句。S502: Generate a view creation statement for the object view.
需要说明的是,S502的具体执行过程可以参照S302的具体执行过程,此处不再进行赘述。It should be noted that the specific execution process of S502 may refer to the specific execution process of S302, which will not be described in detail here.
S503、执行重新生成的视图创建语句,更新对象视图。S503: Execute the regenerated view creation statement to update the object view.
在本申请实施例中,预设的视图创建语句生成模板采用了“创建或替换(CREATEOR REPLACE)”关键字,在检测到元数据模型更新后,可以先判断是否存在该元数据模型对应的对象视图,若不存在,则将采用图3或图4实施例所示的方法,为该元数据模型创建对应的对象视图;若存在,则采用图5实施例所示的方法,重新生成对象视图的视图创建语句,并根据重新生成的视图创建语句,重新生成该元数据模型对应的对象视图。In an embodiment of the present application, the preset view creation statement generation template uses the "Create or Replace (CREATEOR REPLACE)" keyword. After detecting that the metadata model is updated, it can be determined whether there is an object view corresponding to the metadata model. If not, the method shown in the embodiment of Figure 3 or Figure 4 will be used to create a corresponding object view for the metadata model; if it exists, the method shown in the embodiment of Figure 5 will be used to regenerate the view creation statement of the object view, and regenerate the object view corresponding to the metadata model based on the regenerated view creation statement.
例如,更新后的书籍元数据模型的更新对象视图可以如表21所示:For example, the updated object view of the updated book metadata model may be as shown in Table 21:
表21更新后的书籍元数据模型对应的更新后的对象视图Table 21 Updated object views corresponding to the updated book metadata model
由于模型属性表设定的书籍价格属性的数据类型为小数,长度为8.2,示例性的,价格1可以为23.24。Since the data type of the book price attribute set in the model attribute table is decimal and the length is 8.2, for example, price 1 can be 23.24.
在本申请实施例中,当元数据模型中模型属性或者数据模型与属性关系发生更新且更新成功时,可以对元数据模型的对象视图进行自适应更新,以保证元数据模型与对象视图的一致性。可以理解的是,对象视图是基于元数据模型创建的。在图书管理系统的示例中,具备书籍数据模型(v_book)和作者数据模型(v_author),在使用对象视图中,可以使用联表的方式同时返回书籍及作者的相关信息。相比于相关技术中的联表查询过程,数据的获取效率得到提升,且数据模型和对象视图可以自维护,减少了开发维护成本。In an embodiment of the present application, when a model attribute in a metadata model or a relationship between a data model and an attribute is updated and the update is successful, the object view of the metadata model can be adaptively updated to ensure the consistency between the metadata model and the object view. It is understandable that the object view is created based on the metadata model. In the example of a library management system, there is a book data model (v_book) and an author data model (v_author). When using the object view, the relevant information of the book and the author can be returned simultaneously using a joint table. Compared with the joint table query process in the related art, the efficiency of data acquisition is improved, and the data model and object view can be self-maintained, reducing the development and maintenance costs.
对象视图是基于元数据模型和元数据模型对应的数据表的存在而存在的,当删除元数据模型时,元数据模型对应的对象视图也要删除。在实际操作过程中,对元数据模型的删除操作是从顶向下进行的:先删除元数据模型的对象视图,再删除元数据模型对应的数据表,最后删除元数据模型。下面,结合图6和图7,对元数据模型删除时对象视图的自适应删除过程进行详细说明。The object view exists based on the metadata model and the data table corresponding to the metadata model. When the metadata model is deleted, the object view corresponding to the metadata model must also be deleted. In the actual operation process, the deletion operation of the metadata model is performed from top to bottom: first delete the object view of the metadata model, then delete the data table corresponding to the metadata model, and finally delete the metadata model. Below, in conjunction with Figures 6 and 7, the adaptive deletion process of the object view when the metadata model is deleted is described in detail.
图6为本申请实施例提供的元数据模型对应的对象视图的自适应删除过程示意图一。请参见图6,该方法具体包括:FIG6 is a schematic diagram of a first process of adaptively deleting an object view corresponding to a metadata model provided by an embodiment of the present application. Referring to FIG6 , the method specifically includes:
S601、在监控到对元数据模型的删除操作时,删除对象视图。S601: When a deletion operation on a metadata model is monitored, delete the object view.
每个元数据模型对应的对象视图在代码开发过程中可能存在引用关系,在进行对象视图删除处理前,可以在代码中对该对象视图的引用关系进行判断,若不存在引用关系,则删除对象视图;若存在引用关系,则在代码中删除该对象视图的引用关系后,再删除该对象视图。The object views corresponding to each metadata model may have reference relationships during the code development process. Before deleting the object view, the reference relationship of the object view can be judged in the code. If no reference relationship exists, the object view is deleted; if a reference relationship exists, the reference relationship of the object view is deleted in the code before the object view is deleted.
在本申请实施例中,为了便于查找,可以以元数据模型中的数据模型表中的数据模型名称对对象视图进行命名。可以采用视图删除语句模板,生成对象视图对应的视图删除语句。例如,视图删除语句模板可以如下所示:In the embodiment of the present application, in order to facilitate searching, the object view can be named with the data model name in the data model table in the metadata model. A view deletion statement template can be used to generate a view deletion statement corresponding to the object view. For example, the view deletion statement template can be as follows:
S602、在元数据模型对应的数据表中,删除元数据模型的至少一个对象的对象信息。S602: Delete object information of at least one object of the metadata model in the data table corresponding to the metadata model.
在一种示例中:每个对象的对象信息可以包括该对象关联的各属性的属性数据、以及该对象的对象数据。针对任意一个对象,确定该对象的各属性的属性值存储表,在各属性的属性值存储表中,删除各属性的属性数据;在对至少一个对象的各属性的属性数据删除完成后,在元数据模型的数据表中删除各对象的对象数据。In one example, the object information of each object may include the attribute data of each attribute associated with the object and the object data of the object. For any object, the attribute value storage table of each attribute of the object is determined, and the attribute data of each attribute is deleted from the attribute value storage table of each attribute; after the attribute data of each attribute of at least one object is deleted, the object data of each object is deleted from the data table of the metadata model.
S603、删除元数据模型。S603: Delete the metadata model.
在一种示例中:可以通过如下方式对元数据模型进行删除:删除该元数据模型的数据模型关系数据;删除该元数据模型的元数据模型与属性关系数据;删除该元数据模型的数据模型数据。In one example, the metadata model may be deleted in the following manners: deleting the data model relationship data of the metadata model; deleting the metadata model and attribute relationship data of the metadata model; and deleting the data model data of the metadata model.
本申请实施例提供的元数据模型优化方法,可以在监控到对元数据模型的删除操作时,自动按照自顶而下的顺序依次删除该元数据模型对应的对象视图、元数据模型的数据表和元数据模型,无需运维人员手动对对象视图和元数据模型进行更新维护,减少了维护成本。The metadata model optimization method provided in the embodiment of the present application can automatically delete the object view, data table and metadata model corresponding to the metadata model in a top-down order when monitoring the deletion operation of the metadata model, eliminating the need for operation and maintenance personnel to manually update and maintain the object view and metadata model, thereby reducing maintenance costs.
图7为本申请实施例提供的元数据模型对应的对象视图的自适应删除过程示意图二。请参见图7,该方法具体包括:FIG7 is a second schematic diagram of the adaptive deletion process of the object view corresponding to the metadata model provided in the embodiment of the present application. Referring to FIG7 , the method specifically includes:
S701、监听到元数据模型删除指令。S701: A metadata model deletion instruction is monitored.
可以采用监听切面的方式对元数据模型的操作指令进行监听,当监听到操作指令为删除指令时,自动执行S702~S709步骤。The operation instructions of the metadata model can be monitored by using a monitoring aspect. When the monitored operation instruction is a deletion instruction, steps S702 to S709 are automatically executed.
S702、删除元数据模型的对象视图。S702: Delete the object view of the metadata model.
可以根据元数据模型的模型名称,在预设的视图库中确定该元数据模型的对象视图,并删除该对象视图You can determine the object view of the metadata model in the preset view library according to the model name of the metadata model, and delete the object view
S703、确定元数据模型的M个关联属性、以及各关联属性的模型属性关系索引和预设条件。S703: Determine M associated attributes of the metadata model, and the model attribute relationship index and preset conditions of each associated attribute.
其中,M为正整数。Wherein, M is a positive integer.
可以根据元数据模型对应的数据模型与属性关系表,确定元数据模型的M个关联属性、以及各关联属性的模型属性关系索引。针对任意一个关联属性,可以在模型属性表中,确定该关联属性的预设条件。According to the data model and attribute relationship table corresponding to the metadata model, the M associated attributes of the metadata model and the model attribute relationship index of each associated attribute can be determined. For any associated attribute, the preset condition of the associated attribute can be determined in the model attribute table.
S704、根据第i个关联属性的属性关系索引和预设条件,删除第i个关联属性的属性数据。S704: Delete the attribute data of the i-th associated attribute according to the attribute relationship index of the i-th associated attribute and the preset condition.
其中,i依次取1,2,3,……,M。Among them, i is 1, 2, 3, ..., M respectively.
在一种示例中,可以根据第i个关联属性的预设条件,在元数据模型对应的数据表中确定第i个关联属性的属性值存储表;根据第i个关联属性的模型属性关系索引,在该属性值存储表确定第i个关联属性的属性数据;在该属性值存储表中删除第i个关联属性的属性数据。In one example, based on the preset conditions of the i-th associated attribute, an attribute value storage table of the i-th associated attribute can be determined in the data table corresponding to the metadata model; based on the model attribute relationship index of the i-th associated attribute, attribute data of the i-th associated attribute can be determined in the attribute value storage table; and the attribute data of the i-th associated attribute can be deleted in the attribute value storage table.
S705、判断i是否大于M。S705: Determine whether i is greater than M.
若否,则执行S706;若是,则执行S707~S709。If not, execute S706; if so, execute S707 to S709.
S706、将i更新为i+1。S706: Update i to i+1.
在执行S706之后,执行S704。After executing S706 , execute S704 .
S707、在元数据模型对应的数据表中,删除元数据模型的至少一个对象的对象数据。S707: In the data table corresponding to the metadata model, delete the object data of at least one object of the metadata model.
可选的,多个元数据模型的至少一个对象的对象数据可以存储于同一个对象数据存储表中,当需要删除元数据模型1的至少一个对象的对象数据时,可以根据元数据模型1的模型索引,在对象数据存储表中查询元数据模型1的至少一个对象的对象数据,并删除该元数据模型1的至少一个对象的对象数据。Optionally, the object data of at least one object of multiple metadata models can be stored in the same object data storage table. When it is necessary to delete the object data of at least one object of metadata model 1, the object data of at least one object of metadata model 1 can be queried in the object data storage table based on the model index of metadata model 1, and the object data of at least one object of metadata model 1 can be deleted.
示例性的,该对象数据存储表可以如表14所示的对象实体表,待删除的元数据模型可以为书籍元数据模型,书籍元数据模型的模型索引为“1”,可以根据模型索引“1”在表14中查询到表14的前两行数据为书籍元数据模型的2个对象的对象数据,在表14中删除前两行数据。Exemplarily, the object data storage table can be an object entity table as shown in Table 14. The metadata model to be deleted can be a book metadata model. The model index of the book metadata model is "1". According to the model index "1", it can be queried in Table 14 that the first two rows of data in Table 14 are object data of two objects of the book metadata model, and the first two rows of data in Table 14 are deleted.
S708、删除元数据模型中的属性关系数据。S708. Delete the attribute relationship data in the metadata model.
在删除元数据模型时,可以先查询该元数据模型是否存在数据模型关系数据,若存在,则先删除该元数据模型的数据模型关系数据,再删除元数据模型的属性关系数据;若不存在,则删除该元数据模型的属性关系数据。When deleting a metadata model, you can first query whether the metadata model has data model relationship data. If so, delete the data model relationship data of the metadata model first, and then delete the attribute relationship data of the metadata model; if not, delete the attribute relationship data of the metadata model.
数据库中可以包括数据模型关系表和数据模型与属性关系表。数据模型关系表用于存储元数据模型的数据模型关系数据,可以在数据模型关系表删除该元数据模型的数据模型关系数据。数据模型与属性关系表可以用于存储每个元数据模型与至少一个关联属性之间的属性关系数据,可以在数据模型与属性关系表中删除该元数据模型关联的至少一个关联属性的属性关系数据。The database may include a data model relationship table and a data model and attribute relationship table. The data model relationship table is used to store the data model relationship data of the metadata model, and the data model relationship data of the metadata model can be deleted in the data model relationship table. The data model and attribute relationship table can be used to store the attribute relationship data between each metadata model and at least one associated attribute, and the attribute relationship data of at least one associated attribute associated with the metadata model can be deleted in the data model and attribute relationship table.
例如,当需要删除书籍元数据模型时,可以根据书籍元数据模型的各模型属性关系索引在表12所示的数据模型关系表中查询是否存在书籍元数据模型的数据模型关系数据。在表12中,可以查询到书籍元数据模型存在1条数据模型关系数据:书籍元数据模型的属性关系索引“3”与作者元数据模型的属性关系索引“5”关联,删除这1条数据模型关系数据。随后在表10所示的数据模型与属性关系表中,根据书籍元数据模型的标识,确定书籍元数据模型的属性关系数据为表10前三行数据,则在表10中删除该前三行数据。For example, when it is necessary to delete a book metadata model, you can query whether there is data model relationship data of the book metadata model in the data model relationship table shown in Table 12 according to the attribute relationship index of each model of the book metadata model. In Table 12, it can be queried that there is 1 data model relationship data of the book metadata model: the attribute relationship index "3" of the book metadata model is associated with the attribute relationship index "5" of the author metadata model, and this 1 data model relationship data is deleted. Then in the data model and attribute relationship table shown in Table 10, according to the identifier of the book metadata model, it is determined that the attribute relationship data of the book metadata model is the first three rows of data in Table 10, and then the first three rows of data in Table 10 are deleted.
S709、删除元数据模型中的数据模型数据。S709: Delete the data model data in the metadata model.
数据库中可以包括数据模型表。可以根据元数据模型的模型索引,在数据模型表中删除该元数据模型的数据模型数据。例如,假设待删除的元数据模型为书籍元数据模型,书籍元数据模型的模型索引为“1”,在表8中删除模型索引为“1”的第一行数据。The database may include a data model table. The data model data of the metadata model may be deleted from the data model table according to the model index of the metadata model. For example, assuming that the metadata model to be deleted is a book metadata model, the model index of the book metadata model is "1", and the first row of data with the model index of "1" is deleted from Table 8.
在一些示例中,基于元数据模型进行元数据查询时,通常将代码包装到业务逻辑中实现,这种方式将带来业务代码与数据库层代码混淆的问题。在本申请实施例中,可以采用切面或监听技术对元数据模型的创建操作、更新操作和删除操作进行实时监控,例如,监听技术可以为AOP技术。通过AOP技术,可以使开发人员在类的运行期生成代理对象,通过Java虚拟机(Java Virtual Machine,JVM)的动态代理功能或者第三方库实现运行期动态植入,以实现元数据模型创建(新增)、更新或删除时对象视图的自维护过程。通过这种方式,可以将各类操作封装到了切面中,以实现数据成各类操作代码与业务代码逻辑的分离,避免了业务代码与数据库层代码混淆的问题。在一些示例中,可以对本申请实施例提供的元数据模型创建(新增)、更新或删除时数据对象视图的自维护方法进行封装处理,并使用注解的方式,方便引入封装好的对象视图的自维护方法,以提高对象视图的自维护方法的易用性。In some examples, when performing metadata query based on metadata model, the code is usually packaged into business logic for implementation, which will bring about the problem of confusion between business code and database layer code. In the embodiment of the present application, the creation operation, update operation and deletion operation of the metadata model can be monitored in real time by using aspect or monitoring technology, for example, the monitoring technology can be AOP technology. Through AOP technology, developers can generate proxy objects during the runtime of the class, and dynamically implant during runtime through the dynamic proxy function of Java Virtual Machine (JVM) or third-party library to realize the self-maintenance process of the object view when the metadata model is created (added), updated or deleted. In this way, various operations can be encapsulated in aspect to realize the separation of data into various operation codes and business code logic, avoiding the problem of confusion between business code and database layer code. In some examples, the self-maintenance method of the data object view when the metadata model provided in the embodiment of the present application is created (added), updated or deleted can be encapsulated, and the self-maintenance method of the encapsulated object view can be conveniently introduced by using annotations to improve the ease of use of the self-maintenance method of the object view.
在一些示例中,可以通过索引字段动态匹配的方式来进行元数据检索和查询。例如,可以将用户文档中的字段映射为索引字段;对索引字段进行schema动态匹配,执行得到查询结果;通过元数据模型将查询结果映射到用户文档的字段中反馈给用户。在这种方式下,元数据查询存在如下问题:在开发过程中,需要为字段添加索引,增加了数据库的存储量且开发和运维成本较高。在本申请实施例中,无需为每个字段添加索引,可以基于元数据模型中的索引关系,为元数据模型创建对象视图,通过对象视图显示元数据模型中至少一个对象的对象信息。通过为每个元数据模型创建数据对象视图,不仅可以快速实现对该元数据模型中各个对象、以及各对象的对象信息进行查询,还可以用于对与该数据模型相关联的其他元数据模型的数据的联表查询,相比于相关技术中的联表查询过程,数据的获取效率得到提升,且元数据模型和对象视图可以自维护,减少了开发维护成本。In some examples, metadata retrieval and query can be performed by dynamically matching index fields. For example, fields in user documents can be mapped to index fields; schema dynamic matching is performed on index fields, and query results are obtained; query results are mapped to fields in user documents through metadata models and fed back to users. In this way, metadata query has the following problems: during the development process, it is necessary to add indexes to fields, which increases the storage capacity of the database and has high development and operation and maintenance costs. In an embodiment of the present application, it is not necessary to add indexes to each field. An object view can be created for the metadata model based on the index relationship in the metadata model, and the object information of at least one object in the metadata model can be displayed through the object view. By creating a data object view for each metadata model, not only can the query of each object in the metadata model and the object information of each object be quickly realized, but also the joint table query of the data of other metadata models associated with the data model can be used. Compared with the joint table query process in the related art, the efficiency of data acquisition is improved, and the metadata model and object view can be self-maintained, reducing the development and maintenance costs.
本申请实施例提供的元数据模型优化方法,还可以响应于对象视图的更新操作,获取对象视图的更新信息,并基于该更新信息对元数据模型对应的数据表进行自适应更新。下面,结合图8~图13,对对象视图更新后,元数据模型对应的数据表的更新过程进行说明。The metadata model optimization method provided in the embodiment of the present application can also obtain the update information of the object view in response to the update operation of the object view, and adaptively update the data table corresponding to the metadata model based on the update information. Below, in conjunction with Figures 8 to 13, the update process of the data table corresponding to the metadata model after the object view is updated is described.
对象视图的更新操作可以为新增操作,下面,结合图8和图9,对更新操作为新增操作时,基于对象视图的更新信息对元数据模型对应的数据表进行更新的过程进行说明。The update operation of the object view may be a new operation. The following describes the process of updating the data table corresponding to the metadata model based on the update information of the object view when the update operation is a new operation, in conjunction with FIG8 and FIG9 .
图8为本申请实施例提供的更新操作为新增操作时元数据模型优化方法的流程示意图一。请参见图8,该方法具体包括:FIG8 is a flow chart of a metadata model optimization method when the update operation provided by an embodiment of the present application is a new operation. Referring to FIG8 , the method specifically includes:
S801、获取对象视图的更新信息。S801. Obtain update information of the object view.
更新信息可以包括:元数据模型的模型索引、待新增对象、以及待新增对象的至少一个新增属性、以及每个新增属性的属性值。The update information may include: a model index of the metadata model, an object to be added, at least one new attribute of the object to be added, and an attribute value of each new attribute.
S802、根据模型索引,查询元数据模型的关联属性、以及关联属性的预设条件,并根据关联属性和预设条件,对至少一个新增属性、以及每个新增属性的属性值进行校验。S802: query the associated attributes of the metadata model and the preset conditions of the associated attributes according to the model index, and verify at least one newly added attribute and the attribute value of each newly added attribute according to the associated attributes and the preset conditions.
校验结果可以为校验通过或校验未通过。The verification result can be verification passed or verification failed.
可以确定该模型索引对应的元数据模型、以及该元数据模型的至少一个关联属性。针对任意一个关联属性,可以获取该关联属性的预设条件。示例性的,预设条件可以包括属性值字段的数据类型或字段长度等。The metadata model corresponding to the model index and at least one associated attribute of the metadata model may be determined. For any associated attribute, a preset condition of the associated attribute may be obtained. Exemplarily, the preset condition may include a data type or field length of an attribute value field.
在一种可能的实现方式中,可以通过如下方式对每个新增属性进行校验:判断目标元数据模型的至少一个关联属性是否包括该新增属性;若是,则校验通过;若否,则校验未通过。In a possible implementation, each newly added attribute may be verified in the following manner: determining whether at least one associated attribute of the target metadata model includes the newly added attribute; if so, the verification passes; if not, the verification fails.
针对任意一个新增属性,在对该新增属性校验通过后,可以通过如下方式对该新增属性的属性值进行校验:获取该新增属性的预设条件,并根据该预设条件对新增属性的属性值进行校验。例如,在新增属性的预设条件中要求属性值的字段长度为30,但更新信息中新增属性的属性值的字段长度为50,则确定该新增属性的属性值校验失败。For any newly added attribute, after the newly added attribute is verified, the attribute value of the newly added attribute can be verified in the following manner: obtain the preset conditions of the newly added attribute, and verify the attribute value of the newly added attribute according to the preset conditions. For example, if the field length of the attribute value is required to be 30 in the preset conditions of the newly added attribute, but the field length of the attribute value of the newly added attribute in the update information is 50, then it is determined that the attribute value verification of the newly added attribute has failed.
S803、若校验通过,则在元数据模型对应的数据表中,创建待新增对象的对象数据和至少一个新增属性的属性数据。S803: If the verification passes, then in the data table corresponding to the metadata model, create object data of the object to be added and attribute data of at least one newly added attribute.
对象数据可以包括模型索引和待新增对象的第一对象索引,对象数据还可以包括对象业务编码。属性数据可以包括:第一对象索引和至少一个新增属性的属性关系索引、属性值索引和属性值。The object data may include a model index and a first object index of the object to be added, and may also include an object service code. The attribute data may include: a first object index and an attribute relationship index, an attribute value index and an attribute value of at least one newly added attribute.
元数据模型对应的数据表中可以包括对象数据存储表和至少一个属性值存储表,该对象数据存储表可以用于存储该元数据模型的至少一个对象的对象数据,属性值存储表可以用于存储该元数据模型的至少一个对象的关联属性的属性数据。当关联属性的预设条件不同,该关联属性对应的属性值存储表可以不同。The data table corresponding to the metadata model may include an object data storage table and at least one attribute value storage table. The object data storage table may be used to store object data of at least one object of the metadata model, and the attribute value storage table may be used to store attribute data of associated attributes of at least one object of the metadata model. When the preset conditions of the associated attributes are different, the attribute value storage tables corresponding to the associated attributes may be different.
在校验通过后,可以在对象数据存储表中创建该待新增对象的对象数据。可以查询该待新增对象的各新增属性对应的属性值存储表,并在各新增属性对应的属性值存储表创建各新增属性的属性数据。After the verification is passed, the object data of the object to be added can be created in the object data storage table. The attribute value storage table corresponding to each newly added attribute of the object to be added can be queried, and the attribute data of each newly added attribute can be created in the attribute value storage table corresponding to each newly added attribute.
本申请实施例提供的元数据模型优化方法,可以在对象视图中新增待新增对象的至少一个新增属性、以及每个新增属性的属性值之后,自动在元数据模型对应的数据表中新增待新增对象对应的对象数据和至少一个属性数据,无需运维人员对每个对象视图单独进行更新维护,减少了维护成本。The metadata model optimization method provided in the embodiment of the present application can automatically add object data and at least one attribute data corresponding to the object to be added in the data table corresponding to the metadata model after adding at least one new attribute of the object to be added and the attribute value of each new attribute in the object view. There is no need for operation and maintenance personnel to update and maintain each object view separately, thereby reducing maintenance costs.
图9为本申请实施例提供的更新操作为新增操作时元数据模型优化方法的流程示意图二。请参见图9,该方法具体包括:FIG9 is a second flow diagram of a metadata model optimization method when the update operation provided by an embodiment of the present application is a new addition operation. Referring to FIG9 , the method specifically includes:
S901、业务应用级接收前端发送的更新请求。S901. The business application level receives an update request sent by the front end.
更新请求可以包括目标元数据模型的目标模型索引、待新增对象、待新增对象的至少一个新增属性、以及每个新增属性的属性值。更新请求还可以包括目标元数据模型的标识。The update request may include a target model index of the target metadata model, an object to be added, at least one new attribute of the object to be added, and an attribute value of each new attribute. The update request may also include an identifier of the target metadata model.
在一些示例中,可以在更新请求的调用链接或json参数中标记元数据模型的标识,例如,元数据模型为书籍(book)元数据模型,可以在调用链接后缀新增书籍元数据模型的名称。In some examples, the identifier of the metadata model may be marked in a call link or a json parameter of an update request. For example, if the metadata model is a book metadata model, the name of the book metadata model may be added to the suffix of the call link.
可以以键值对的方式对每个新增属性、以及该新增属性的属性值进行数据组合,以便于数据传输。例如,前端传入的参数可以如下所示:Each newly added attribute and its attribute value can be combined in a key-value pair to facilitate data transmission. For example, the parameters passed in by the front end can be as follows:
S902、业务应用级向对象数据层发送更新请求。S902: The business application layer sends an update request to the object data layer.
对象数据层可以调用对象增删改转换模块来接收该更新请求。在开发过程中,除对数据的查询外,数据的增删改需求也很多。在元数据建模方法中,由于数据的离散性,若需要对数据模型的多个属性的数据进行增删改时,需要调用多次接口,导致跨表调用频多,进而导致数据的增删改操作变的复杂。鉴于此,本申请实施例在对象数据层中新增对象增删改转换模块,该对象增删改转换模块可以通过数据应用层接收前端发送的对象操作指令(包括增加、删除或修改指令),并基于对象操作指令调用元数据模型层原有的增删改接口执行相应的对象操作,通过数据增删改转换模块可以简化对元数据模型层的调用操作。The object data layer can call the object addition, deletion and modification conversion module to receive the update request. During the development process, in addition to the query of data, there are also many needs for adding, deleting and modifying data. In the metadata modeling method, due to the discreteness of the data, if it is necessary to add, delete and modify the data of multiple attributes of the data model, it is necessary to call multiple interfaces, resulting in frequent cross-table calls, which in turn causes the data addition, deletion and modification operations to become complicated. In view of this, the embodiment of the present application adds an object addition, deletion and modification conversion module in the object data layer. The object addition, deletion and modification conversion module can receive the object operation instructions (including addition, deletion or modification instructions) sent by the front end through the data application layer, and call the original addition, deletion and modification interface of the metadata model layer based on the object operation instructions to perform the corresponding object operation. The call operation of the metadata model layer can be simplified through the data addition, deletion and modification conversion module.
S903、对象数据层向元数据模型层发送数据查询请求。S903: The object data layer sends a data query request to the metadata model layer.
数据查询请求包括目标模型索引。The data query request includes the target model index.
S904、元数据模型层根据数据查询请求,确定目标模型索引对应的目标元数据模型的至少一个关联属性、以及各关联属性的预设条件。S904: The metadata model layer determines, according to the data query request, at least one associated attribute of the target metadata model corresponding to the target model index and preset conditions of each associated attribute.
可选的,元数据模型层可以存储有数据模型与属性关系表和模型属性表。元数据模型层可以通过模型关系管理模块在数据模型与属性关系表查询到目标模型索引对应的至少一个关联属性的属性索引,以及通过模型属性管理模块根据各关联属性的属性索引在模型属性表中确定各关联属性的预设条件。Optionally, the metadata model layer may store a data model and attribute relationship table and a model attribute table. The metadata model layer may query the attribute index of at least one associated attribute corresponding to the target model index in the data model and attribute relationship table through the model relationship management module, and determine the preset conditions of each associated attribute in the model attribute table according to the attribute index of each associated attribute through the model attribute management module.
S905、元数据模型层向对象数据层发送目标元数据模型的至少一个关联属性、以及各关联属性的预设条件。S905: The metadata model layer sends at least one associated attribute of the target metadata model and preset conditions of each associated attribute to the object data layer.
S906、对象数据层根据至少一个关联属性、以及各关联属性的预设条件,对待新增对象的至少一个新增属性、以及每个新增属性的属性值进行校验,得到校验结果。S906: The object data layer verifies at least one newly added attribute of the newly added object and the attribute value of each newly added attribute according to at least one associated attribute and preset conditions of each associated attribute to obtain a verification result.
校验结果可以为校验通过或校验未通过。若校验通过,则执行S907,若校验未通过,则生成失败提示信息,该失败提示信息可以包括失败原因。The verification result may be a verification pass or a verification fail. If the verification passes, S907 is executed. If the verification fails, a failure prompt message is generated. The failure prompt message may include a failure reason.
需要说明的是,S906的具体执行过程可以参照S802的具体执行过程,此处不再进行赘述。It should be noted that the specific execution process of S906 can refer to the specific execution process of S802, which will not be repeated here.
S907、对象数据层在校验结果为校验通过时,向元数据模型层发送待新增对象的对象数据创建请求。S907: When the verification result is that the verification is passed, the object data layer sends an object data creation request for the object to be added to the metadata model layer.
对象数据创建请求可以包括目标模型索引和待新增对象。The object data creation request may include a target model index and an object to be added.
在元数据模型中,为体现不同数据模型之间的对比关联,创建了数据模型关系表。可以根据数据模型关系表中的元数据模型1与元数据模型2之间的对比关联,创建元数据模型1的各对象与元数据模型2的各对象之间的对比关联。In the metadata model, a data model relationship table is created to reflect the comparison and association between different data models. According to the comparison and association between metadata model 1 and metadata model 2 in the data model relationship table, a comparison and association between each object of metadata model 1 and each object of metadata model 2 can be created.
示例性的,可以参照表12所示的数据模型关系表,建立书籍元数据模型的各对象与作者元数据模型的各对象之间的对比关联关系,书籍元数据模型的各对象与作者元数据模型的各对象之间的对比关联关系可以如表22所示:Exemplarily, the data model relationship table shown in Table 12 may be referred to to establish a comparison association relationship between each object of the book metadata model and each object of the author metadata model. The comparison association relationship between each object of the book metadata model and each object of the author metadata model may be as shown in Table 22:
表22对象的对象关系数据存储表Table 22 Object relationship data storage table
数据模型关系表中设定了元数据模型1与元数据模型2之间的对比关联的关系类型(关系类型可以为表12中的枚举类型),因此,为保证元数据模型各对象的对象数据可创建,需要在创建各对象的对象数据前对该元数据模型的关系类型进行校验。The data model relationship table sets the relationship type of the comparative association between metadata model 1 and metadata model 2 (the relationship type can be an enumeration type in Table 12). Therefore, in order to ensure that the object data of each object in the metadata model can be created, it is necessary to verify the relationship type of the metadata model before creating the object data of each object.
对象数据层可以通过模型校验模块来实现对元数据模型的关系类型的校验过程。模型校验模块在监听到创建元数据模型1的目标对象的对象数据时,查询数据模型关系表,确定该元数据模型1中各模型属性关系索引是否与其他元数据模型中的各模型属性关系索引之间存在对比关联。示例性的,假设在表12中,元数据模型1的模型属性关系索引“3”与元数据模型2的模型属性关系索引“5”之间存在对比关联。则根据元数据模型1的对象视图,查到模型属性关系索引“3”对应的对象的数量记为X,以及根据元数据模型2的对象视图查到元模型属性关系索引“5”关联的对象的数量记为Y。判断X:Y的值是否满足数据模型关系表中的对比关联的关系类型,若满足,则确定校验通过;若不存在对比关联,或者,X:Y的值不满足数据模型关系表中的关系类型,则确定校验失败。The object data layer can implement the verification process of the relationship type of the metadata model through the model verification module. When the model verification module monitors the object data of the target object for creating metadata model 1, it queries the data model relationship table to determine whether there is a comparison association between each model attribute relationship index in the metadata model 1 and each model attribute relationship index in other metadata models. Exemplarily, assume that in Table 12, there is a comparison association between the model attribute relationship index "3" of metadata model 1 and the model attribute relationship index "5" of metadata model 2. Then, according to the object view of metadata model 1, the number of objects corresponding to the model attribute relationship index "3" is recorded as X, and the number of objects associated with the model attribute relationship index "5" is recorded as Y according to the object view of metadata model 2. Determine whether the value of X:Y satisfies the relationship type of the comparison association in the data model relationship table. If so, it is determined that the verification is passed; if there is no comparison association, or the value of X:Y does not meet the relationship type in the data model relationship table, it is determined that the verification failed.
S908、元数据模型层根据对象数据创建请求,在目标元数据模型对应的数据表中创建待新增对象的对象数据。S908. The metadata model layer creates object data of the object to be added in the data table corresponding to the target metadata model according to the object data creation request.
对象数据层可以通过模型数据管理模块来创建待新增对象的对象数据,模型数据管理模块可以根据预设的对象数据创建模板,来创建待新增对象的对象数据。The object data layer can create object data of the to-be-added object through the model data management module, and the model data management module can create object data of the to-be-added object according to a preset object data creation template.
可以在元数据模型的对象数据存储表中增加该待新增对象的对象数据。例如,可以在表14中增加如表23所示的待新增对象的对象数据。The object data of the object to be added can be added to the object data storage table of the metadata model. For example, the object data of the object to be added as shown in Table 23 can be added to Table 14.
表23待新增对象的对象数据Table 23 Object data of the object to be added
S909、元数据模型层向对象数据层发送待新增对象的对象数据。S909: The metadata model layer sends the object data of the object to be added to the object data layer.
S910、对象数据层向元数据模型层发送待新增对象的各新增属性的属性数据创建请求。S910: The object data layer sends an attribute data creation request for each newly added attribute of the object to be added to the metadata model layer.
S911、元数据模型层根据各新增属性的属性数据创建请求,在目标元数据模型对应的数据表中创建待新增对象的各新增属性的属性数据。S911. The metadata model layer creates attribute data of each newly added attribute of the object to be added in the data table corresponding to the target metadata model according to the attribute data creation request of each newly added attribute.
对象数据层可以通过模型数据管理模块来创建待新增对象的对象数据,模型数据管理模块可以根据预设的属性数据创建模板,来创建待新增对象的各新增属性的属性数据。The object data layer can create object data of the to-be-added object through the model data management module, and the model data management module can create a template according to preset attribute data to create attribute data of each newly added attribute of the to-be-added object.
可以确定待新增对象的各新增属性的属性值存储表,并在该属性值存储表中增加该新增属性的属性数据。例如,可以在表16中增加如表24所示的待新增对象的各新增属性的属性数据。The attribute value storage table of each newly added attribute of the object to be added can be determined, and the attribute data of the newly added attribute can be added to the attribute value storage table. For example, the attribute data of each newly added attribute of the object to be added as shown in Table 24 can be added to Table 16.
表24待新增对象的各属性的属性数据Table 24 Attribute data of each attribute of the object to be added
S912、元数据模型层向对象数据层发送待新增对象的各属性的属性数据。S912: The metadata model layer sends the attribute data of each attribute of the object to be added to the object data layer.
S913、对象数据层生成更新请求对应的更新结果。S913: The object data layer generates an update result corresponding to the update request.
更新结果可以包括待新增对象的对象数据和待新增对象的各新增属性的属性数据的更新结果。The update result may include the update result of the object data of the to-be-added object and the attribute data of each newly-added attribute of the to-be-added object.
S914、对象数据层向业务应用级发送更新结果。S914. The object data layer sends the update result to the business application layer.
更新操作可以为删除操作,下面,结合图10和图11,对更新操作为删除操作时,基于对象视图的更新信息对元数据模型对应的数据表进行更新的过程进行说明。The update operation may be a delete operation. The following describes the process of updating the data table corresponding to the metadata model based on the update information of the object view when the update operation is a delete operation in combination with FIG. 10 and FIG. 11 .
图10为本申请实施例提供的更新操作为删除操作时元数据模型优化方法的流程示意图一。请参见图10,该方法具体包括:FIG10 is a flow chart of a metadata model optimization method when the update operation provided by an embodiment of the present application is a deletion operation. Referring to FIG10 , the method specifically includes:
S1001、获取对象视图的更新信息。S1001. Obtain update information of the object view.
更新信息可以包括待删除对象的第二对象索引,更新信息还可以包括元数据模型的模型索引。The update information may include a second object index of the object to be deleted, and the update information may further include a model index of the metadata model.
S1002、根据第二对象索引,在元数据模型对应的数据表中确定是否存在待删除对象。S1002. Determine whether there is an object to be deleted in the data table corresponding to the metadata model according to the second object index.
可选的,元数据模型对应的数据表中可以包括对象数据存储表(例如,表14所示的对象实体表),对象数据存储表可以存储至少一个对象的对象数据,对象数据包括每个对象的对象索引、模型索引和对象的业务编码。可以根据第二对象索引,在元数据模型对应的对象数据存储表中查询是否存在第二对象索引对应的待删除对象。Optionally, the data table corresponding to the metadata model may include an object data storage table (for example, the object entity table shown in Table 14), and the object data storage table may store object data of at least one object, and the object data includes an object index, a model index, and a business code of each object. According to the second object index, it may be queried in the object data storage table corresponding to the metadata model whether there is an object to be deleted corresponding to the second object index.
S1003、若确定存在待删除对象后,则在元数据模型对应的数据表中,查询待删除对象的至少一个属性中、每个属性对应的属性值存储表。S1003: If it is determined that there is an object to be deleted, query the attribute value storage table corresponding to each attribute of at least one attribute of the object to be deleted in the data table corresponding to the metadata model.
可选的,元数据模型对应的数据表中可以包括元数据模型关联的各关联属性的属性值存储表,该属性值存储表可以存储元数据模型的至少一个关联属性的属性数据。Optionally, the data table corresponding to the metadata model may include an attribute value storage table of each associated attribute associated with the metadata model, and the attribute value storage table may store attribute data of at least one associated attribute of the metadata model.
S1004、针对任意一个属性,在属性的属性值存储表中,删除属性的属性数据。S1004. For any attribute, delete the attribute data of the attribute in the attribute value storage table of the attribute.
属性数据可以包括:第二对象索引和属性的属性索引、属性值索引和属性值。The attribute data may include: a second object index and an attribute index, an attribute value index, and an attribute value of the attribute.
S1005、在元数据模型对应的数据表中,删除待删除对象的对象数据。S1005. In the data table corresponding to the metadata model, delete the object data of the object to be deleted.
可以根据元数据模型的模型索引和第二对象索引,在元数据模型对应的对象数据存储表中,找到该模型索引和第二对象索引对应的待删除对象的对象数据并删除。According to the model index and the second object index of the metadata model, the object data of the object to be deleted corresponding to the model index and the second object index can be found in the object data storage table corresponding to the metadata model and deleted.
对象数据可以包括元数据模型的模型索引和第二对象索引,对象数据还可以包括对象业务编码。The object data may include a model index and a second object index of the metadata model, and the object data may also include an object service code.
本申请实施例提供的元数据模型优化方法,可以在对象视图中删除待删除对象的对象信息之后,自动在元数据模型对应的数据表中删除待删除对象对应的对象数据和至少一个属性数据,无需运维人员对每个对象视图单独进行更新维护,减少了维护成本。The metadata model optimization method provided in the embodiment of the present application can automatically delete the object data and at least one attribute data corresponding to the object to be deleted in the data table corresponding to the metadata model after deleting the object information of the object to be deleted in the object view. There is no need for operation and maintenance personnel to update and maintain each object view separately, thereby reducing maintenance costs.
图11为本申请实施例提供的更新操作为删除操作时元数据模型优化方法的流程示意图二。请参见图11,该方法具体包括:FIG11 is a second flow diagram of a metadata model optimization method when the update operation provided by an embodiment of the present application is a deletion operation. Referring to FIG11 , the method specifically includes:
S1101、业务应用级接收前端发送的更新请求。S1101. The business application level receives an update request sent by the front end.
更新请求包括目标元数据模型的目标模型索引和待删除对象的第二对象索引。The update request includes a target model index of the target metadata model and a second object index of the object to be deleted.
S1102、业务应用级向对象数据层发送更新请求。S1102: The business application layer sends an update request to the object data layer.
S1103、对象数据层向元数据模型层发送第一数据查询请求。S1103: The object data layer sends a first data query request to the metadata model layer.
第一数据查询请求用于请求获取目标元数据模型的对象数据存储表,第一数据查询请求包括目标模型索引。The first data query request is used to request to obtain the object data storage table of the target metadata model, and the first data query request includes the target model index.
S1104、元数据模型层根据第一数据查询请求,确定目标模型索引对应的目标元数据模型的对象数据存储表。S1104: The metadata model layer determines, according to the first data query request, an object data storage table of a target metadata model corresponding to the target model index.
元数据模型层可以通过模型数据管理模块,在元数据模型层的多个数据基础表中确定该目标模型索引对应的目标元数据模型的对象数据存储表。The metadata model layer can determine the object data storage table of the target metadata model corresponding to the target model index from multiple data foundation tables of the metadata model layer through the model data management module.
S1105、元数据模型层向对象数据层发送目标元数据模型的对象数据存储表。S1105. The metadata model layer sends the object data storage table of the target metadata model to the object data layer.
S1106、对象数据层根据对象数据存储表和第二对象索引,对待删除对象进行校验。S1106: The object data layer verifies the object to be deleted according to the object data storage table and the second object index.
若对象数据存储表中存在第二对象索引对应的待删除对象,则校验通过,并执行S1106;若对象数据存储表中不存在第二对象索引的待删除对象,则校验未通过,并生成失败提示信息。If the object to be deleted corresponding to the second object index exists in the object data storage table, the verification passes and S1106 is executed; if the object to be deleted corresponding to the second object index does not exist in the object data storage table, the verification fails and a failure prompt message is generated.
S1107、对象数据层向元数据模型层发送第二数据查询请求。S1107. The object data layer sends a second data query request to the metadata model layer.
第二数据查询请求用于请求获取目标元数据模型的数据模型与属性关系表,第二数据查询请求包括目标模型索引。The second data query request is used to request to obtain the data model and attribute relationship table of the target metadata model, and the second data query request includes the target model index.
S1108、元数据模型层根据第二数据查询请求,确定目标元数据模型的数据模型与属性关系表。S1108. The metadata model layer determines the data model and attribute relationship table of the target metadata model according to the second data query request.
元数据模型层可以通过模型关系管理模块,在元数据模型层的多个数据基础表中查询该目标模型索引对应的目标元数据模型的数据模型与属性关系表。The metadata model layer can query the data model and attribute relationship table of the target metadata model corresponding to the target model index in multiple data basic tables of the metadata model layer through the model relationship management module.
S1109、元数据模型层向对象数据层发送目标元数据模型的数据模型与属性关系表。S1109. The metadata model layer sends the data model and attribute relationship table of the target metadata model to the object data layer.
S1110、对象数据层根据数据模型与属性关系表,确定待删除对象的至少一个关联属性。S1110. The object data layer determines at least one associated attribute of the object to be deleted according to the data model and the attribute relationship table.
可以理解的是,可以通过数据模型与属性关系表确定目标元数据的至少一个关联属性,该目标元数据模型的至少一个关联属性也为目标元数据模型中该待删除对象的至少一个关联属性。It is understandable that at least one associated attribute of the target metadata can be determined through the data model and attribute relationship table, and the at least one associated attribute of the target metadata model is also at least one associated attribute of the object to be deleted in the target metadata model.
可以在数据模型与属性关系表中,确定每个关联属性的属性索引和模型属性关系索引。In the data model and attribute relationship table, the attribute index and the model attribute relationship index of each associated attribute may be determined.
S1111、对象数据层向元数据模型层发送待删除对象的各关联属性的属性数据删除请求。S1111. The object data layer sends an attribute data deletion request for each associated attribute of the object to be deleted to the metadata model layer.
属性数据删除请求可以包括第二对象索引和各关联属性的属性索引和模型属性关系索引。The attribute data deletion request may include the second object index and the attribute index of each associated attribute and the model attribute relationship index.
S1112、元数据模型层根据各关联属性的属性数据删除请求,在目标元数据模型对应的数据表中,删除待删除对象的各关联属性的属性数据。S1112. The metadata model layer deletes the attribute data of each associated attribute of the object to be deleted in the data table corresponding to the target metadata model according to the attribute data deletion request of each associated attribute.
元数据模型层可以根据每个关联属性的属性索引,在模型属性表中确定每个关联属性的预设条件,并根据预设条件确定待删除对象的各关联属性的属性值存储表,以及在各关联属性的属性值存储表中删除待删除对象的各关联属性的属性数据。The metadata model layer can determine the preset conditions of each associated attribute in the model attribute table according to the attribute index of each associated attribute, determine the attribute value storage table of each associated attribute of the object to be deleted according to the preset conditions, and delete the attribute data of each associated attribute of the object to be deleted in the attribute value storage table of each associated attribute.
S1113、元数据模型层向对象数据层发送各关联属性的属性数据删除结果。S1113. The metadata model layer sends the attribute data deletion result of each associated attribute to the object data layer.
S1114、对象数据层向元数据模型层发送待删除对象的对象数据删除请求。S1114. The object data layer sends an object data deletion request for the object to be deleted to the metadata model layer.
对象数据删除请求包括目标模型索引和第二对象索引。The object data deletion request includes a target model index and a second object index.
S1115、元数据模型层根据对象数据删除请求,在目标元数据模型对应的数据表中,删除待删除对象的对象数据。S1115. The metadata model layer deletes the object data of the object to be deleted in the data table corresponding to the target metadata model according to the object data deletion request.
元数据模型层可以通过模型数据管理模块根据目标模型索引和第二对象索引,在目标元数据模型的对象数据存储表确定待删除对象的对象数据,并删除待删除对象的对象数据。The metadata model layer can determine the object data of the object to be deleted in the object data storage table of the target metadata model according to the target model index and the second object index through the model data management module, and delete the object data of the object to be deleted.
S1116、元数据模型层向对象数据层发送对象数据删除结果。S1116. The metadata model layer sends the object data deletion result to the object data layer.
S1117、对象数据层生成更新请求对应的更新结果。S1117. The object data layer generates an update result corresponding to the update request.
更新结果可以包括待删除对象的各关联属性的属性数据删除结果和对象数据删除结果。The update result may include the attribute data deletion result of each associated attribute of the to-be-deleted object and the object data deletion result.
S1118、对象数据层向业务应用级发送更新结果。S1118. The object data layer sends the update result to the business application level.
当需要对对象实体的单个属性进行修改时,可以调用元数据模型中的对象实体数据表来实现对象实体的单个属性的更新(或修改)。若需要对数据模型的某个属性进行批量操作,如果调用元数据模型中的对象实体数据表进行逐个更新,在这个过程中将产生大量调用操作,影响元数据模型优化效率。鉴于此,本申请实施例提供的元数据模型优化方法,在元数据建模的基础上,利用数据对象视图将数据模型转化为范式建模所创建的表,使得数据库中数据模型即具备元数据建模带来的模型属性扩充特性,又具备范式建模带来的模型易用性。本申请实施例提供的元数据模型优化方法可以参考范式建模中对对象数据的修改方法,来实现对大量对象实体的属性的更新。When it is necessary to modify a single attribute of an object entity, the object entity data table in the metadata model can be called to implement the update (or modification) of a single attribute of the object entity. If it is necessary to perform batch operations on a certain attribute of the data model, if the object entity data table in the metadata model is called to update one by one, a large number of call operations will be generated in this process, affecting the optimization efficiency of the metadata model. In view of this, the metadata model optimization method provided in the embodiment of the present application, based on metadata modeling, uses data object views to convert the data model into a table created by paradigm modeling, so that the data model in the database has both the model attribute expansion characteristics brought by metadata modeling and the model ease of use brought by paradigm modeling. The metadata model optimization method provided in the embodiment of the present application can refer to the modification method of object data in paradigm modeling to implement the update of the attributes of a large number of object entities.
下面,结合图12和图13,对更新操作为修改操作时,基于对象视图的更新信息对元数据模型对应的数据表进行更新的过程进行说明。12 and 13 , the process of updating the data table corresponding to the metadata model based on the update information of the object view when the update operation is a modification operation is described below.
图12为本申请实施例提供的更新操作为修改操作时元数据模型优化方法的流程示意图一。请参见图12,该方法具体包括:FIG12 is a flow chart of a metadata model optimization method when the update operation provided by an embodiment of the present application is a modification operation. Referring to FIG12 , the method specifically includes:
S1201、获取对象视图的更新信息。S1201. Obtain update information of the object view.
更新信息可以包括待修改对象的第三对象索引、待修改属性和待修改属性的修改属性值,更新信息还可以包括元数据模型的模型索引。The update information may include a third object index of the object to be modified, a property to be modified, and a modified property value of the property to be modified. The update information may also include a model index of a metadata model.
S1202、根据第三对象索引,在元数据模型对应的数据表中确定是否存在待修改对象。S1202: Determine whether there is an object to be modified in the data table corresponding to the metadata model according to the third object index.
需要说明的是,S1202的具体执行过程可以参照S1002的具体执行过程,此处不再进行重复赘述。It should be noted that the specific execution process of S1202 can refer to the specific execution process of S1002, and will not be repeated here.
S1203、若存在待修改对象,则确定待修改对象的属性是否包括待修改属性。S1203: If there is an object to be modified, determine whether the attributes of the object to be modified include the attribute to be modified.
可以根据元数据模型中的数据模型与属性关系表,查询待修改对象关联的多个属性。判断这多个属性中是否包括该待修改属性,若包括,则继续执行S1204;若不包括,则进行报错提示。According to the data model and attribute relationship table in the metadata model, multiple attributes associated with the object to be modified can be queried. It is determined whether the attribute to be modified is included in the multiple attributes. If yes, S1204 is continued to be executed; if not, an error prompt is issued.
S1204、在确定待修改对象的属性包括待修改属性后,在待修改属性对应的属性值存储表中,将待修改属性的属性值更新为修改属性值。S1204: After determining that the attributes of the object to be modified include the attribute to be modified, in the attribute value storage table corresponding to the attribute to be modified, update the attribute value of the attribute to be modified to the modified attribute value.
可以获取待修改属性的属性关系索引和预设条件。可以根据预设条件,在元数据模型对应的数据表中确定待修改属性对应的属性值存储表;根据第二对象索引和待修改属性的属性关系索引,在待修改属性对应的属性值存储表中找到待修改属性对应的属性数据,并将属性数据中当前属性值更新为修改属性值。The attribute relationship index and preset conditions of the attribute to be modified can be obtained. According to the preset conditions, the attribute value storage table corresponding to the attribute to be modified can be determined in the data table corresponding to the metadata model; according to the second object index and the attribute relationship index of the attribute to be modified, the attribute data corresponding to the attribute to be modified can be found in the attribute value storage table corresponding to the attribute to be modified, and the current attribute value in the attribute data can be updated to the modified attribute value.
本申请实施例提供的元数据模型优化方法,可以在对象视图中对待修改对象的待修改属性的属性值进行修改之后,自动在元数据模型对应的数据表中将待新增对象的待修改属性的属性值修正为修改属性值,无需运维人员对每个对象视图单独进行更新维护,减少了维护成本。The metadata model optimization method provided in the embodiment of the present application can automatically correct the attribute value of the to-be-modified attribute of the to-be-modified object to the modified attribute value in the data table corresponding to the metadata model after the attribute value of the to-be-modified attribute of the to-be-modified object in the object view is modified, without the need for operation and maintenance personnel to update and maintain each object view separately, thereby reducing maintenance costs.
图13为本申请实施例提供的更新操作为修改操作时元数据模型优化方法的流程示意图二。请参见图13,该方法具体包括:FIG13 is a second flow chart of a metadata model optimization method when the update operation provided by an embodiment of the present application is a modification operation. Referring to FIG13 , the method specifically includes:
S1301、业务应用级接收前端发送的更新请求。S1301. The business application level receives an update request sent by the front end.
更新请求可以包括目标元数据模型的目标模型索引、修改对象的第三对象索引、待修改属性和待修改属性的修改属性值。更新请求还可以包括目标元数据模型的标识。The update request may include a target model index of the target metadata model, a third object index of the modified object, a property to be modified, and a modified property value of the property to be modified. The update request may also include an identifier of the target metadata model.
S1302、业务应用级向对象数据层发送更新请求。S1302: The business application layer sends an update request to the object data layer.
S1303、对象数据层向元数据模型层发送第三数据查询请求。S1303: The object data layer sends a third data query request to the metadata model layer.
第三数据查询请求用于请求获取目标元数据模型的对象数据存储表,第三数据查询请求包括目标模型索引。The third data query request is used to request to obtain the object data storage table of the target metadata model, and the third data query request includes the target model index.
S1304、元数据模型层根据第三数据查询请求,确定该目标模型索引对应的目标元数据模型的对象数据存储表。S1304: The metadata model layer determines, according to the third data query request, an object data storage table of the target metadata model corresponding to the target model index.
S1305、元数据模型层向对象数据层发送目标元数据模型的对象数据存储表。S1305. The metadata model layer sends the object data storage table of the target metadata model to the object data layer.
S1306、对象数据层根据对象数据存储表和第三对象索引,对待修改对象进行校验。S1306: The object data layer verifies the object to be modified according to the object data storage table and the third object index.
若对象数据存储表中存在第三对象索引对应的待修改对象,则校验通过,并执行S1307;若对象数据存储表中不存在第三对象索引对应的待修改对象,则校验未通过,并生成失败提示信息。If the object to be modified corresponding to the third object index exists in the object data storage table, the verification passes and S1307 is executed; if the object to be modified corresponding to the third object index does not exist in the object data storage table, the verification fails and a failure prompt message is generated.
对象数据层可以通过模型校验模块对待修改对象对应的元数据模型的数据模型关系的关系类型进行校验,以避免后续出现与配比关系不一致的场景导致数据问题。需要说明的是,对数据模型的关系类型的校验过程可以参照S907步骤中对关系类型的校验过程,此处不再进行赘述。The object data layer can verify the relationship type of the data model relationship of the metadata model corresponding to the object to be modified through the model verification module to avoid data problems caused by subsequent scenarios inconsistent with the matching relationship. It should be noted that the verification process of the relationship type of the data model can refer to the verification process of the relationship type in step S907, which will not be repeated here.
S1307、对象数据层向元数据模型层发送第四数据查询请求。S1307. The object data layer sends a fourth data query request to the metadata model layer.
第四数据查询请求用于请求获取目标元数据模型的至少一个关联属性、以及各关联属性的预设条件,第二数据查询请求包括目标模型索引。The fourth data query request is used to request to obtain at least one associated attribute of the target metadata model and preset conditions of each associated attribute, and the second data query request includes a target model index.
S1308、元数据模型层根据第四数据查询请求,确定目标元数据模型的至少一个关联属性、以及各关联属性的预设条件。S1308: The metadata model layer determines at least one associated attribute of the target metadata model and preset conditions of each associated attribute according to the fourth data query request.
S1309、元数据模型层向对象数据层发送目标元数据模型的至少一个关联属性、以及各关联属性的预设条件。S1309: The metadata model layer sends at least one associated attribute of the target metadata model and preset conditions of each associated attribute to the object data layer.
S1310、对象数据层根据至少一个关联属性、以及各关联属性的预设条件,对待修改对象的待修改属性、以及待修改属性的修改属性值进行校验,得到校验结果。S1310. The object data layer verifies the to-be-modified attribute of the to-be-modified object and the modified attribute value of the to-be-modified attribute according to at least one associated attribute and preset conditions of each associated attribute to obtain a verification result.
校验结果可以为校验通过或校验未通过。若校验通过,则执行S1311,若校验未通过,则生成失败提示信息,该失败提示信息可以包括失败原因。The verification result may be a verification pass or a verification fail. If the verification passes, S1311 is executed, and if the verification fails, a failure prompt message is generated, and the failure prompt message may include a failure reason.
S1311、对象数据层在校验结果为校验通过时,向元数据模型层发送待修改对象的待修改属性的属性数据更新请求。S1311. When the verification result is that the verification is passed, the object data layer sends an attribute data update request of the to-be-modified attribute of the to-be-modified object to the metadata model layer.
属性数据更新请求包括第三对象索引、待修改属性、待修改属性的修改属性值。The attribute data update request includes a third object index, an attribute to be modified, and a modified attribute value of the attribute to be modified.
S1312、元数据模型层根据属性数据更新请求,在目标元数据模型对应的数据表中,确定待修改属性的属性值存储表,并在待修改属性的属性值存储表中将待修改属性的属性值更新为修改属性值。S1312. The metadata model layer determines the attribute value storage table of the attribute to be modified in the data table corresponding to the target metadata model according to the attribute data update request, and updates the attribute value of the attribute to be modified to the modified attribute value in the attribute value storage table of the attribute to be modified.
元数据模型层可以通过模型数据管理模块执行S1312。The metadata model layer can be executed by the model data management module S1312.
S1313、元数据模型层向对象数据层发送的属性数据更新请求对应的属性数据更新结果。S1313. The attribute data update result corresponding to the attribute data update request sent by the metadata model layer to the object data layer.
S1314、对象数据层生成更新请求对应的更新结果。S1314. The object data layer generates an update result corresponding to the update request.
更新结果可以包括属性数据更新结果。The update result may include attribute data update result.
S1315、对象数据层向业务应用级发送更新结果。S1315. The object data layer sends the update result to the business application level.
为方便在对象增删改转换模块中的引用,可以将本申请实施例增删改的抽象为接口层。再通过泛型实现接口层的内容,作为实现层。在使用过程中,继承上述实现层中的内容以完成对对象增删改接口的引入。继承的方式便于抽象层代码向实际实现逻辑的转化。对于开发者来讲,通过继承实现层,可引入对对象的增删改接口。在本申请实施例中,通过泛型的引入可以在实现层中识别到本次处理的是哪个对象。继承的方式封装了增删改的具体实现过程,开发者仅需要引用对应的接口即可,有利于提升开发效率,降低开发成本。To facilitate the reference in the object addition, deletion and modification conversion module, the addition, deletion and modification of the embodiment of the present application can be abstracted as an interface layer. Then the content of the interface layer is implemented through generics as the implementation layer. During use, the content in the above implementation layer is inherited to complete the introduction of the object addition, deletion and modification interface. The inheritance method facilitates the transformation of the abstract layer code to the actual implementation logic. For developers, by inheriting the implementation layer, the addition, deletion and modification interface of the object can be introduced. In the embodiment of the present application, the introduction of generics can identify which object is being processed in the implementation layer. The inheritance method encapsulates the specific implementation process of addition, deletion and modification, and the developer only needs to reference the corresponding interface, which is conducive to improving development efficiency and reducing development costs.
本申请实施例通过设置对象增删改转换模块,来调用元数据模型层自动实现数据更新请求的处理,在对象增删改转换模块中对数据更新请求处理逻辑进行抽象化处理,可以实现一次开发重复利用,减少了开发成本,且避免了前端与元数据模型层的多次交互。The embodiment of the present application sets an object addition, deletion and modification conversion module to call the metadata model layer to automatically implement the processing of data update requests. The data update request processing logic is abstracted in the object addition, deletion and modification conversion module, which can achieve one-time development and reuse, reduce development costs, and avoid multiple interactions between the front end and the metadata model layer.
为方便在对象增删改转换模块中的引用,可以将增删改处理逻辑的抽象为接口层。再通过泛型实现接口层的内容,作为实现层。在使用过程中,继承上述实现层中的内容即可完成对对象增删改接口的引入。继承的方式,方便了抽象层代码向实际实现逻辑的转化。对于开发者来讲,通过继承实现层,可引入对对象的增删改接口。在本申请实施例中,通过泛型的引入可以在实现层中识别到本次处理的是哪个对象。继承的方式封装了增删改处理逻辑的具体实现过程,开发者仅需要引用对应的接口即可,有利于提升开发效率,降低开发成本。To facilitate the reference in the object addition, deletion and modification conversion module, the addition, deletion and modification processing logic can be abstracted into an interface layer. Then the content of the interface layer is implemented through generics as the implementation layer. During use, the introduction of the object addition, deletion and modification interface can be completed by inheriting the content in the above implementation layer. The inheritance method facilitates the transformation of the abstract layer code to the actual implementation logic. For developers, by inheriting the implementation layer, the addition, deletion and modification interface of the object can be introduced. In the embodiment of the present application, the introduction of generics can identify which object is being processed in the implementation layer. The inheritance method encapsulates the specific implementation process of the addition, deletion and modification processing logic, and the developer only needs to reference the corresponding interface, which is conducive to improving development efficiency and reducing development costs.
本申请实施例通过对相关技术中的元数据建模方法进行优化,使得优化后的元数据模型优化方法即具备元数据建模所带来的灵活性和扩展性,又具有范式建模中对数据增删改查的简便性,这使得本申请实施例提供的元数据模型优化方法可以应用于多种业务场景中。The embodiment of the present application optimizes the metadata modeling method in the related technology so that the optimized metadata model optimization method has both the flexibility and scalability brought by metadata modeling and the simplicity of adding, deleting, modifying and querying data in paradigm modeling. This makes the metadata model optimization method provided by the embodiment of the present application applicable to a variety of business scenarios.
业务场景1:元数据管理平台Business scenario 1: Metadata management platform
当企业数据量达到一定规模的情况下,需要引入数据治理流程对数据进行治理。在对数据进行治理时涉及元数据的管理,元数据包括了数据模型和结构、关键业务流程数据、系统依赖关系等信息。元数据管理平台搭建完成后,可以基于本申请实施例提供的元数据模型优化方法,利用对象视图的查询界面,实现从元数据管理平台层面的数据共享,方便各个系统对数据的集成要求。另外,利用对象的增删改接口,可实现元数据平台中的对象数据修改,降低元数据平台内数据变更的技术复杂度。When the amount of enterprise data reaches a certain scale, it is necessary to introduce a data governance process to govern the data. The management of metadata is involved in data governance. Metadata includes information such as data models and structures, key business process data, and system dependencies. After the metadata management platform is built, based on the metadata model optimization method provided in the embodiment of the present application, the query interface of the object view can be used to achieve data sharing from the metadata management platform level, facilitating the data integration requirements of various systems. In addition, the object add, delete, and modify interface can be used to implement object data modification in the metadata platform, reducing the technical complexity of data changes within the metadata platform.
业务场景2:搜索引擎Business Scenario 2: Search Engine
在对数据进行搜索时,可以基于本申请实施例提供的元数据模型优化方法,通过对象视图的查询界面进行数据查询。由于元数据模型的数据表可以以对象视图的形式对业务进行展示,从而可以对元数据模型各类字段进行过滤查询和排序。例如,用户需要对部门对象的名称或编码进行搜索时,可以基于对象视图中查询,简化了对象的查询过程。When searching for data, data can be queried through the query interface of the object view based on the metadata model optimization method provided in the embodiment of the present application. Since the data table of the metadata model can display the business in the form of an object view, it is possible to filter, query and sort various fields of the metadata model. For example, when a user needs to search for the name or code of a department object, he can query based on the object view, which simplifies the object query process.
业务场景3:湖仓一体建设Business scenario 3: Lake-warehouse integrated construction
数据湖存储了企业中多种业务应用程序、系统和设备所收集的海量非结构化数据和半结构化数据。数据仓库将不同来源的大型业务数据聚集到一个单一、一致的数据存储区,方便对大量结构化数据执行分析。湖仓一体能够兼顾拥有类似数据结构的数据湖所具备的灵活性和可扩展性,以及数据仓库的数据管理功能。采用本申请实施例提供的元数据模型优化方法在对湖仓一体的数据进行分析时,可以提供对联表数据的权限控制,联表数据的配比逻辑等进行校验;可以使用权限申请的方式,对某些用户开放一些对象的数据查看权限;还可以使用对象数据视图的查询功能,对不同对象以及不同对象的属性进行过滤查询。The data lake stores massive amounts of unstructured and semi-structured data collected by various business applications, systems, and devices in an enterprise. The data warehouse aggregates large business data from different sources into a single, consistent data storage area, making it easy to perform analysis on large amounts of structured data. The lake-warehouse integration can take into account the flexibility and scalability of a data lake with a similar data structure, as well as the data management functions of a data warehouse. When analyzing the lake-warehouse integration data using the metadata model optimization method provided in the embodiment of the present application, permission control of the joint table data, and verification of the matching logic of the joint table data can be provided; permission application can be used to open data viewing permissions of some objects to certain users; the query function of the object data view can also be used to filter queries on different objects and the attributes of different objects.
图14为本申请实施例提供的一种元数据模型优化装置的结构示意图。请参见图14,元数据模型优化装置10包括:FIG14 is a schematic diagram of the structure of a metadata model optimization device provided in an embodiment of the present application. Referring to FIG14 , the metadata model optimization device 10 includes:
创建模块11,用于创建元数据模型对应的对象视图,所述对象视图用于展示所述元数据模型的至少一个对象的对象信息;A creation module 11, used to create an object view corresponding to the metadata model, wherein the object view is used to display object information of at least one object of the metadata model;
获取模块12,用于响应于对所述对象视图的更新操作,获取所述对象视图的更新信息;An acquisition module 12, configured to acquire update information of the object view in response to an update operation on the object view;
更新模块13,用于基于所述对象视图的更新信息,对所述元数据模型对应的数据表进行更新。The updating module 13 is used to update the data table corresponding to the metadata model based on the update information of the object view.
本申请实施例提供的元数据模型优化装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The metadata model optimization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
在一种可能的实现方式中,所述创建模块11具体用于:在监控到所述元数据模型创建成功后,根据所述元数据模型的模型索引,在所述元数据模型对应的数据表中,确定所述元数据模型的至少一个对象、以及每个对象的对象信息;根据所述模型索引和所述每个对象的对象信息,生成所述对象视图的视图创建语句;执行所述视图创建语句,创建所述对象视图。In a possible implementation, the creation module 11 is specifically used to: after monitoring that the metadata model is successfully created, determine at least one object of the metadata model and the object information of each object in a data table corresponding to the metadata model according to the model index of the metadata model; generate a view creation statement for the object view according to the model index and the object information of each object; and execute the view creation statement to create the object view.
在一种可能的实现方式中,各对象的对象信息包括:所述对象的对象索引,以及所述对象关联的至少一个属性中、每个属性的模型属性关系索引和属性值存储表的标识;所述创建模块具体还用于:In a possible implementation, the object information of each object includes: an object index of the object, and a model attribute relationship index and an identifier of an attribute value storage table of each attribute in at least one attribute associated with the object; the creation module is further configured to:
根据所述每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成所述对象视图的属性查询语句;根据所述模型索引、所述每个对象的对象索引、以及所述每个对象关联的至少一个属性中每个属性的模型属性关系索引和属性值存储表的标识,生成所述对象视图的联表查询语句;对所述属性查询语句和所述联表查询语句进行组合处理,得到所述视图创建语句。Generate an attribute query statement for the object view according to the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table; generate a joint table query statement for the object view according to the model index, the object index of each object, and the model attribute relationship index of each attribute in at least one attribute associated with each object and the identifier of the attribute value storage table; combine the attribute query statement and the joint table query statement to obtain the view creation statement.
图15为本申请实施例提供的另一种元数据模型优化装置的结构示意图。请参见图15,在图14所示的元数据模型优化装置10的结构基础上,元数据模型优化装置10还包括删除模块14,在创建所述元数据模型对应的对象视图之后;所述删除模块14用于在监控到对所述元数据模型的删除操作时,删除所述对象视图。Fig. 15 is a schematic diagram of the structure of another metadata model optimization device provided in an embodiment of the present application. Referring to Fig. 15, based on the structure of the metadata model optimization device 10 shown in Fig. 14, the metadata model optimization device 10 further includes a deletion module 14, after creating the object view corresponding to the metadata model; the deletion module 14 is used to delete the object view when a deletion operation on the metadata model is monitored.
在一种可能的实现方式中,所述删除模块14具体还用于:在所述元数据模型对应的数据表中,删除所述元数据模型的至少一个对象的对象信息;删除所述元数据模型。In a possible implementation, the deletion module 14 is further specifically configured to: delete object information of at least one object of the metadata model in a data table corresponding to the metadata model; and delete the metadata model.
在一种可能的实现方式中,在创建所述元数据模型对应的对象视图之后,所述更新模块13具体还用于:在监控到所述元数据模型发生更新时,根据所述元数据模型的模型索引,在所述元数据模型对应的数据表中,确定所述元数据模型的更新对象、以及所述更新对象的更新对象信息;根据所述模型索引和所述更新对象信息,重新生成所述对象视图的视图创建语句;执行重新生成的视图创建语句,更新所述对象视图。In a possible implementation, after creating the object view corresponding to the metadata model, the update module 13 is specifically used to: when monitoring that the metadata model is updated, determine the update object of the metadata model and the update object information of the update object in the data table corresponding to the metadata model according to the model index of the metadata model; regenerate the view creation statement of the object view according to the model index and the update object information; and execute the regenerated view creation statement to update the object view.
在一种可能的实现方式中,所述更新信息包括模型索引、待新增对象、待新增对象的至少一个新增属性、以及每个新增属性的属性值;所述更新模块13具体还用于:根据所述模型索引,查询所述元数据模型的关联属性、以及所述关联属性的预设条件,并根据所述关联属性和所述预设条件,对所述至少一个新增属性、以及所述每个新增属性的属性值进行校验;若校验通过,则在所述元数据模型对应的数据表中,创建所述待新增对象的对象数据和所述至少一个新增属性的属性数据,所述对象数据包括所述模型索引和所述待新增对象的第一对象索引,所述属性数据包括:所述第一对象索引、以及所述至少一个新增属性的属性索引、属性值索引和属性值。In a possible implementation, the update information includes a model index, an object to be added, at least one new attribute of the object to be added, and the attribute value of each new attribute; the update module 13 is also specifically used to: query the associated attributes of the metadata model and the preset conditions of the associated attributes according to the model index, and verify the at least one new attribute and the attribute value of each new attribute according to the associated attributes and the preset conditions; if the verification passes, create object data of the object to be added and attribute data of the at least one new attribute in the data table corresponding to the metadata model, the object data includes the model index and the first object index of the object to be added, and the attribute data includes: the first object index, and the attribute index, attribute value index and attribute value of the at least one new attribute.
在一种可能的实现方式中,所述更新信息包括待删除对象的第二对象索引;所述更新模块13具体还用于:In a possible implementation, the update information includes a second object index of the object to be deleted; and the update module 13 is further configured to:
根据所述第二对象索引,在所述元数据模型对应的数据表中确定是否存在所述待删除对象;若确定存在所述待删除对象后,则在所述元数据模型对应的数据表中,查询所述待删除对象的至少一个属性中、每个属性对应的属性值存储表;针对任意一个属性,在所述属性的属性值存储表中,删除所述属性的属性数据,所述属性数据包括:所述第二对象索引和所述属性的属性索引、属性值索引和属性值;在所述元数据模型对应的数据表中,删除所述待删除对象的对象数据,所述对象数据包括所述元数据模型的模型索引和所述第二对象索引。According to the second object index, determine whether the object to be deleted exists in the data table corresponding to the metadata model; if it is determined that the object to be deleted exists, query the attribute value storage table corresponding to each attribute of at least one attribute of the object to be deleted in the data table corresponding to the metadata model; for any attribute, delete the attribute data of the attribute in the attribute value storage table of the attribute, and the attribute data includes: the second object index and the attribute index, attribute value index and attribute value of the attribute; in the data table corresponding to the metadata model, delete the object data of the object to be deleted, and the object data includes the model index of the metadata model and the second object index.
在一种可能的实现方式中,所述更新信息包括待修改对象的第三对象索引、待修改属性和所述待修改属性的修改属性值;所述更新模块13具体还用于:In a possible implementation, the update information includes a third object index of the object to be modified, a property to be modified, and a modified property value of the property to be modified; and the update module 13 is further configured to:
根据所述第三对象索引,在所述元数据模型对应的数据表中确定是否存在所述待修改对象;若存在所述待修改对象,则确定所述待修改对象的属性是否包括所述待修改属性;在确定所述待修改对象的属性包括所述待修改属性后,在所述待修改属性对应的属性值存储表中,将所述待修改属性的属性值更新为所述修改属性值。According to the third object index, determine whether the object to be modified exists in the data table corresponding to the metadata model; if the object to be modified exists, determine whether the attributes of the object to be modified include the attribute to be modified; after determining that the attributes of the object to be modified include the attribute to be modified, update the attribute value of the attribute to be modified to the modified attribute value in the attribute value storage table corresponding to the attribute to be modified.
本申请实施例提供的元数据模型优化装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The metadata model optimization device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
图16为本申请实施例提供的一种计算设备的硬件结构示意图。请参见图16,该计算设备20可以包括处理器21和存储器22。其中,处理器21和存储器22可以通信;示例性的,处理器21和存储器22通过通信总线23通信。FIG16 is a schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application. Referring to FIG16 , the computing device 20 may include a processor 21 and a memory 22. The processor 21 and the memory 22 may communicate; illustratively, the processor 21 and the memory 22 communicate via a communication bus 23.
所述存储器22用于存储计算机执行指令;The memory 22 is used to store computer-executable instructions;
所述处理器21用于执行所述存储器22存储的计算机执行指令,使得所述处理器21执行如上述方法实施例所示的技术方案。The processor 21 is used to execute the computer-executable instructions stored in the memory 22, so that the processor 21 executes the technical solution shown in the above method embodiment.
可选的,计算设备20还可以包括通信接口,通信接口可以包括发送器和/或接收器。Optionally, the computing device 20 may further include a communication interface, which may include a transmitter and/or a receiver.
可选的,上述处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。Optionally, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
本申请实施例还提供一种芯片,所述芯片用于执行如上述实施例所述的元数据模型优化方法,其实现原理和技术效果类似,此处不作赘述。An embodiment of the present application also provides a chip, which is used to execute the metadata model optimization method as described in the above embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机执行指令;所述计算机执行指令被处理器执行时用于实现如上述实施例所述的元数据模型优化方法。An embodiment of the present application provides a computer-readable storage medium, on which computer-executable instructions are stored; when the computer-executable instructions are executed by a processor, they are used to implement the metadata model optimization method as described in the above embodiment.
本申请实施例提供一种计算机程序产品,所述计算机程序产品包括计算机程序,当所述计算机程序被处理器执行时,使得计算机执行上述实施例所述的元数据模型优化方法。An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer executes the metadata model optimization method described in the above embodiment.
实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于可读取存储器中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储器(存储介质)包括:只读存储器(英文:read-only memory,缩写:ROM)、RAM、快闪存储器、硬盘、固态硬盘、磁带(英文:magnetic tape)、软盘(英文:floppy disk)、光盘(英文:optical disc)及其任意组合。All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程终端设备的处理单元以产生一个机器,使得通过计算机或其他可编程终端设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application embodiment is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the present application embodiment. It should be understood that each process and/or box in the flowchart and/or block diagram and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable terminal device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程终端设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in a flowchart and/or one or more boxes in a block diagram.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请实施例也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the embodiments of the present application are also intended to include these modifications and variations.
在本申请实施例中,术语“包括”及其变形可以指非限制性的包括;术语“或”及其变形可以指“和/或”。本申请实施例中术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。本申请实施例中,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the embodiments of the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and/or". In the embodiments of the present application, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the embodiments of the present application, "plurality" refers to two or more. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the previously associated objects are in an "or" relationship.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311633691.4ACN117851375A (en) | 2023-11-30 | 2023-11-30 | Metadata model optimization method and computing device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311633691.4ACN117851375A (en) | 2023-11-30 | 2023-11-30 | Metadata model optimization method and computing device |
| Publication Number | Publication Date |
|---|---|
| CN117851375Atrue CN117851375A (en) | 2024-04-09 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311633691.4APendingCN117851375A (en) | 2023-11-30 | 2023-11-30 | Metadata model optimization method and computing device |
| Country | Link |
|---|---|
| CN (1) | CN117851375A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118331980A (en)* | 2024-06-12 | 2024-07-12 | 湖南亚信安慧科技有限公司 | Data updating method, device, equipment and computer readable storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118331980A (en)* | 2024-06-12 | 2024-07-12 | 湖南亚信安慧科技有限公司 | Data updating method, device, equipment and computer readable storage medium |
| CN118331980B (en)* | 2024-06-12 | 2024-08-09 | 湖南亚信安慧科技有限公司 | Data updating method, device, equipment and computer readable storage medium |
| Publication | Publication Date | Title |
|---|---|---|
| US11907247B2 (en) | Metadata hub for metadata models of database objects | |
| US11755606B2 (en) | Dynamically updated data sheets using row links | |
| CN108038222B (en) | System of entity-attribute framework for information system modeling and data access | |
| US11615076B2 (en) | Monolith database to distributed database transformation | |
| US6374252B1 (en) | Modeling of object-oriented database structures, translation to relational database structures, and dynamic searches thereon | |
| CN1856783B (en) | Data management structures associated with generic data items using references | |
| US9495475B2 (en) | Method of representing an XML schema definition and data within a relational database management system using a reusable custom-defined nestable compound data type | |
| CN101901265B (en) | Objectification management system of virtual test data | |
| CN114218218A (en) | Data processing method, device and equipment based on data warehouse and storage medium | |
| CN109918394A (en) | Data query method, system, computer installation and computer readable storage medium | |
| CN112860777B (en) | Data processing method, device and equipment | |
| CN103914290A (en) | Operating command processing method and device | |
| US20230091845A1 (en) | Centralized metadata repository with relevancy identifiers | |
| CN113761040A (en) | Database and application program bidirectional mapping method, device, medium and program product | |
| WO2023151239A1 (en) | Micro-service creation method and related device | |
| CN103946794A (en) | Cross-reference and priority claim to related applications | |
| CN109885585A (en) | Support the distributed data base system and method for storing process, trigger and view | |
| CN114371845A (en) | Form generation method and device | |
| US11693652B2 (en) | Automated authoring of software solutions from a data model | |
| CN111368097A (en) | Knowledge graph extraction method and device | |
| Batra | SQL primer | |
| CN117851375A (en) | Metadata model optimization method and computing device | |
| Chellappan et al. | MongoDB Recipes: With Data Modeling and Query Building Strategies | |
| CN115952203B (en) | Data query method, device, system and storage medium | |
| CN117827880A (en) | Data model query method, device and storage medium based on low-code platform |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |