Multi-set inter-model ensemble mapping method and apparatus

By defining and parsing the mapping information between models, using a scripting language to describe the relationships between models, and generating a set mapping pool, the complexity of network devices adapting to multiple models is solved, improving adaptation efficiency and compatibility, and supporting the smooth evolution of future technologies.

CN116301882BActive Publication Date: 2026-03-27NANJING NO 3 COMM TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2026-03-27

Smart Images

  • Figure CN116301882B_ABST
    Figure CN116301882B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-set model inter-collection mapping methods: mapping information is defined, mapping first needs to use script definition collection mapping mapping condition, mapping source model, the query tree between source model and mapping relationship;Mapping information is parsed, after the device starts, the parsing work of script is carried out in initialization stage, and the collection mapping information parsed forms collection mapping pool, for subsequent collection mapping use;According to the parsing result of mapping information, collection mapping processing is carried out.The application extracts the public paradigm in complex collection mapping, uses the scheme of framework coding plus script mapping, and solves complex technical problems such as data set definition, data search, condition judgment, condition mapping, etc., once;Make private model can adapt to open model, impact on existing private model is smaller, compatible with existing architecture, smooth evolution, while making the device embrace openness.The application also provides a corresponding multi-set model inter-collection mapping device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of configuration management in network element management, and more particularly to a multi-set model inter-collection mapping method and device. BACKGROUND

[0002] A model is an abstraction of data characteristics, which describes the static characteristics, dynamic behavior and constraint conditions of a system from an abstraction level, and provides an abstract framework for information representation and operation. An external model is a model defined by a device side based on different northbound interfaces and their characteristics, and the data format actually stored and used by the device side is generally referred to as a private model.

[0003] There are many programmable operation forms and northbound interfaces of network devices, such as: traditional command line form of man-machine interaction operation, network relationship system of SNMP (Simple Network Management Protocol), NETCONF (Network Configuration Protocol) protocol using a hierarchical structure, Open Config model developed based on the standard NETCONF protocol framework and independent of device vendors, etc.

[0004] Almost every northbound interface has its special external model. In order to better realize the programmable capability of the network, improve the level of automation, and realize the demand for automatic distribution of services on demand and automatic operation and maintenance, more operation forms and their corresponding models may appear in the future. The device often needs to be compatible with the configuration models of these different operation forms. Because the external models are different and coupled with each other, the mapping of different external models to private models may be extremely complex, and the scenario of N external models corresponding to N private models may occur. We call this multi-to-multi mapping scenario as collection mapping. This scenario is complex to handle, involves many models, and if the collection mapping of each set of external models is manually adapted and coded, the development adaptation workload is large, the development cycle is long, and there is much repetitive work. SUMMARY

[0005] In order to solve the problems existing in the prior art, the present application provides a set of complex multi-set model to internal model adaptation collection mapping framework method for solving the technical problems that the collection mapping scenario is complex to handle, involves many models, and requires re-coding and adaptation for each set of models, the development adaptation workload is large, the development cycle is long, and there is much repetitive work when realizing the adaptation between network devices and multiple northbound interface models.

[0006] To achieve the above purpose, according to one aspect of the present application, a multi-set model inter-collection mapping method is provided, comprising the following steps:

[0007] (1) defining the mapping information, the mapping first needs to use the script to define the mapping condition of the set mapping, the mapping source model, the query tree between the source models and the mapping relationship;

[0008] (2) analyzing the mapping information, after the device starts, the script analysis work is carried out in the initialization stage, the analyzed set mapping information forms a set mapping pool, and the subsequent set mapping is used;

[0009] (3) set mapping processing is carried out according to the analysis result of the mapping information.

[0010] In an embodiment of the application, the mapping is defined using an XML script language, and the fields used in the mapping include:

[0011] <MAPPING_UIM> is the outermost node of the entire file, and all set mapping information is defined in the <MAPPING_UIM> node, which contains a plurality of <setmapping>node;

[0012] each <setmapping>The node corresponds to a set mapping, <setmapping>The id field and the name field in the node are used to describe the serial number and name of the current set mapping.

[0013] <setmapping>The <query_all> node under the node describes the search relationship between the collection mapping source model, and a <inputdataset>node, used to describe the source model mandatory field related to mapping operation, query tree, mapping condition, mapping relationship;

[0014] The <query_all> node contains several <querycond>node, each <querycond>A node represents a query relationship of one source model to another source model;

[0015] <querycond>The node contains several <queryelement>node, for describing elements related to the association between the input model and the output model;

[0016] <inputdataset>The node under contains one <inputdatadefine>node, a set of source model mandatory and optional elements in a set mapping, acting on the set mapping and several other set mappings <inputdatasubset>node, source model data subset;

[0017] <inputdatadefine>The node comprises several <class>node, each <class>The node describes whether a source model is mandatory or not;

[0018] <class>The node contains several <element>node, indicating an optional element in the present model;

[0019] <inputdatasubset>The node contains one <inputdatadefine>node, one <querytreedefine>node and one <conditionmapping>Node.

[0020] In one embodiment of the present application, the process of defining mapping information specifically includes:

[0021] Taking all source models and destination models, determine which source models can be mapped to which destination models, group them, and for each group, establish a set mapping relationship, i.e. a <setmapping>node;

[0022] In each set of collection mapping relationships, the query relationship between the source models two by two is described as a <query_all> node and its sub-nodes using scripts. <querycond>Node;

[0023] There can be multiple mapping cases between each group of source models and destination models, which are divided into several data subsets according to the cases;

[0024] Write the common mandatory information in all data subsets in the set mapping in <inputdataset>In the node <inputdatadefine>node, writes the mandatory information that the data subset is private to <inputdataset>In the node <inputdatadefine>node;

[0025] arranging the query order thereof into a query tree, using <querytreedefine>node represents;

[0026] The mapping condition in each data subset is represented by an <if_expressions> node;

[0027] The mapping relationship of each destination class in each data subset is represented by an <if_expressions> node <mapping>node representation, generate one <mappinginfo>Node.

[0028] In one embodiment of the present application, the mapping information is parsed, specifically including:

[0029] The query_all field is parsed to determine the search relationship between each source model and other source models in a collection mapping, to prepare for building a query tree later;

[0030] The inputDataDefine field in the inputDateSet field is parsed to determine the public required elements and optional elements of source models in a collection mapping;

[0031] The inputDataSubSet field in the inputDateSet field is parsed to determine the source model subset in a collection mapping;

[0032] The queryTreeDefine field in the inputDataSubSet field is parsed to determine the query relationship and query order of different source models in a source model subset, and finally generate a query tree;

[0033] The conditionMapping field in the inputDataSubSet field is parsed to determine the mapping conditions that a source model subset needs to meet, and the corresponding relationship of mapping elements.

[0034] In one embodiment of the present application, the collection mapping processing is performed according to the parsing result of the mapping information, specifically including:

[0035] The collection mapping to which the model belongs is searched;

[0036] The collection mapping to which the same source model belongs can be multiple, and each collection mapping needs to be processed in order;

[0037] In each collection mapping, it is necessary to first determine whether the required fields of the model object are complete for the collection mapping;

[0038] The data subset of the collection mapping is traversed, and the subset to which the model belongs is searched in turn;

[0039] A query result tree is generated;

[0040] The destination model object is generated according to the mapping conditions and mapping relationship;

[0041] The destination model object is inserted into the delivery chain table in order;

[0042] All source model object groups are traversed, and all destination model object groups are mapped to complete the mapping.

[0043] In one embodiment of the present application, the generating the query result tree specifically comprises:

[0044] Initializing the source model query result tree with the query result tree defined in the data subset, and hanging the current data object as a root node on the query result tree;

[0045] According to the query tree in the data subset, the query sequence between the source models in this time is parsed out;

[0046] According to the query sequence, all the source model objects defined in the query tree are found in sequence;

[0047] Taking the model data object processed in this time as a tree root node, and taking the source model data object found by the model data processed in this time as its child node, then other data objects are found in sequence and hung on the tree to form the query result tree.

[0048] In one embodiment of the present application, the generating the destination model object according to the mapping condition and the mapping relationship specifically comprises:

[0049] Judging whether each group of data in the query result tree meets the condition defined in the data subset, when taking the object in the query result object tree, the tree traversal is followed, each leaf node can only form a group of data with its root node, and cannot form a group of data with other adjacent leaf nodes or adjacent nodes of its root node;

[0050] If the condition defined in the data subset is not met, the next data subset is matched;

[0051] If the condition is met, according to the mapping relationship defined in the data subset, the mapping elements required by the destination model object group are found in the source model object group in the order from the key element to other elements, if the element types are inconsistent, type conversion is performed, and finally a group of destination model object groups are generated.

[0052] In one embodiment of the present application,

[0053] <querycond>The field meaning contained in the node is as follows: Id: query relationship serial number, used to distinguish different query relationships; inputClassId: input source model ID; outputClass: output source model ID;

[0054] <queryelement>The field meaning contained in the node is as follows: inputElementId: the associated element ID in the input model; outputElementId: the associated element ID in the output model; Value: the specified value of the input and output elements in this associated relationship, which can be left blank;

[0055] <class>The field meaning contained in the node is as follows: Id: source model serial number; Name: source model name; mustFlag: indicates whether the model is a mandatory model, TRUE for mandatory model, FALSE for optional model;

[0056] <element>The field meaning contained in the node is as follows: Id: source model serial number; Name: source model name; mustFlag: indicates whether the model is a mandatory element, TRUE is a mandatory element, and FALSE is an optional element.

[0057] In one embodiment of the present application,

[0058] <inputdatadefine>The node represents the subset of the source model, the mandatory and optional elements of the source model, and the scope of the action is limited to the subset of the model. The structure of the node is as follows: <inputdataset>under the node <inputdatadefine>node consistent;

[0059] <querytreedefine>The nodes describe a query tree, each <querytreedefine>The node contains a <querytree>node, <querytree>The node under it contains a description of the model corresponding to the tree root <rootclassid>nodes, sub-branches under several tree roots <querysubtree>node;

[0060] <conditionmapping>The <node> contains the mapping conditions that the source model subset needs to satisfy, expressed by the <if_expressions> node, and the mapping relationship, expressed by the <map> node. <mappinginfo>Node representation.

[0061] According to another aspect of the present application, there is also provided a multi-set inter-model collection mapping device, comprising at least one processor and a memory, which are connected through a data bus, the memory stores instructions executable by the at least one processor, and the instructions are used to complete the multi-set inter-model collection mapping method after being executed by the processor.

[0062] Overall, compared with the prior art, the above technical solutions conceived by the present application have the following beneficial effects:

[0063] (1) The present application solves the complex technical problems of data collection definition, data searching, condition judging and condition mapping at one time by refining the common paradigm in complex collection mapping and using the scheme of framework coding plus script mapping;

[0064] (2) The present application effectively reduces the development amount of service adaptation code, reduces the labor input, and significantly improves the model adaptation efficiency;

[0065] (3) The present application enables private models to adapt to open models, has less impact on existing private models, is compatible with the existing architecture, and evolves smoothly, while enabling devices to embrace openness and better adapt to the development of future technologies. BRIEF DESCRIPTION OF DRAWINGS

[0066] Figure 1 Fig. 1 is a flowchart of the multi-set inter-model collection mapping method in the implementation of the present application;

[0067] Figure 2 Fig. 2 is a resource file template described by the XML script language in the implementation of the present application;

[0068] Figure 3 Fig. 3 is a flowchart of the collection mapping processing part in the implementation of the present application;

[0069] Figure 4 XML file structure for public model to private model mapping described in example 1 of the present application, wherein the XML file is defined as follows: one setMapping node for one set mapping, including one query_all query relationship node, one inputDateSet data node. Each inputDateSet data node contains one inputDataDefine data node and multiple inputDataSubSet source model subset nodes. The source model subset node is the atomic unit of mapping, which is composed of one inputDataDefine data set, one queryTreeDefine query tree node, and one conditionMapping condition mapping node. The conditionMapping condition mapping node is defined by the if_expressions statement, which can describe the mapping conditions and the relationship between multiple mapping conditions with conditional expressions;

[0070] Figure 5 For the source class query tree structure diagram in example 1 of the present application, the query order is described using a tree structure: each tree node is a model, and different models are connected using the query_all field described search relationship;

[0071] Figure 6 For the source class query result tree in example 1 of the present application, the data in the query result tree should follow the tree traversal. Objects T1 and T2 in the figure are found according to object S1 and cannot form a group of source model objects with S2, but should form a group of source model objects with S1;

[0072] Figure 7 For the query result tree filtering process in example 1 of the present application. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical scheme and advantages of the present application clearer and more apparent, the present application will be further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0074] The steps of the present application are divided into three parts: the first part is the definition of mapping information; the second part is the analysis of mapping information; and the third part is the processing part of set mapping. As shown in Figure 1 The present application provides a set mapping method between multiple sets of models, including the following steps:

[0075] (1) defining mapping information, mapping first needs to use script to define mapping condition of collection mapping, mapping source model, query tree between source models and mapping relationship;

[0076] (2) analyzing mapping information, after device starts, script analysis work is carried out in initialization stage, and collection mapping information analyzed forms collection mapping pool, which is used for subsequent collection mapping;

[0077] (3) collection mapping processing is carried out according to analysis result of mapping information.

[0078] Specifically, before collection mapping is carried out, first, definition and analysis of mapping information from source model to destination model are carried out, as follows:

[0079] Mapping information definition and analysis part: 1 first needs to use script to define mapping condition of collection mapping, mapping source model, query tree between source models and mapping relationship, current implementation uses XML to define, and in actual operation, other script languages such as JSON can also be used to define. The following mainly introduces XML format definition method, overall structure and format. The overall structure using other script languages is consistent, only the script language changes. Figure 2 The overall structure and format of the resource file described using XML script language, wherein XXX represents a modifiable part, and the rest is a fixed format defined by the application. The following is a definition process and field detail:

[0080] 1.1 field detail:

[0081] 1.1.1 <MAPPING_UIM> is the outermost node of the entire file, and all collection mapping information is defined in the <MAPPING_UIM> node, which contains a plurality of

[0082] <setmapping>node. Here MAPPING_UIM this outermost node is to wrap multiple setMapping nodes, so that it forms a parent-child relationship, let the whole file structure more distinct, in the description of the mapping information has no actual role.

[0083] 1.1.2 each <setmapping>The node corresponds to a set mapping, <setmapping>In the node, there are id field and name field, which are used to describe the serial number and name of the current set mapping.

[0084] 1.1.3 <setmapping>The <query_all> node under the node describes the search relationship between the collection mapping source model, and a <inputdataset><query_all> node, which is used to describe the source model mandatory fields related to the mapping operation, query tree, mapping condition, mapping relationship, etc.

[0085] 1.1.4 The <query_all> node contains several <querycond>node, each

[0086] <querycond>The node represents a query relationship between one source model and another source model.

[0087] The field meanings are as follows:

[0088] ·Id: Query relationship serial number, used to distinguish different query relationships.

[0089] ·inputClassId: Input source model ID.

[0090] ·outputClass: Output source model ID.

[0091] 1.1.5 <querycond>The node contains several <queryelement>Node, used to describe the associated elements between the input model and the output model. Its field meanings are as follows:

[0092] • inputElementId: the associated element ID in the input model.

[0093] • outputElementId: the associated element ID in the output model.

[0094] • Value: the specified value of the input and output elements in this association, which can be left blank. 1.1.6 <inputdataset>The node under contains one <inputdatadefine>node, a set

[0095] Common mandatory and optional elements of source models in the mapping, scope of the mapping and several <inputdatasubset>node, source model data subset.

[0096] 1.1.7 <inputdatadefine>The node comprises several <class>node, each <class>Section

[0097] The point describes whether a source model is mandatory or not, and its field meanings are as follows:

[0098] • Id: Source model serial number.

[0099] • Name: Source model name.

[0100] • mustFlag: Indicates whether the model is a mandatory model or not, TRUE for a mandatory model,

[0101] FALSE for an optional model.

[0102] 1.1.8 <class>The node contains several <element>node, indicates a mandatory element in this model

[0103] element, its field meaning is as follows:

[0104] • Id: source model serial number.

[0105] • Name: source model name.

[0106] • mustFlag: indicates whether the model is a mandatory element, TRUE for a mandatory element,

[0107] FALSE for an optional element.

[0108] 1.1.9 <inputdatasubset>The node contains one <inputdatadefine>node, one

[0109] <querytreedefine>node and one <conditionmapping>Node.

[0110] 1.1.9.1 <inputdatadefine>Node represents the subset of the source model, mandatory and optional elements of the source model. Scope is limited to this model subset. Its structure is similar to

[0111] <inputdataset>under the node <inputdatadefine>The nodes are consistent, and no further elaboration is made.

[0112] 1.1.9.2 <querytreedefine>A node describes a query tree. Each

[0113] <querytreedefine>The node contains a <querytree>Node.

[0114] <querytree>The node contains one <rootclassid>nodes (describing models corresponding to tree roots), several <querysubtree>Node (sub-branch under tree root).

[0115] 1.1.9.2.1 Each <querysubtree>The node contains several

[0116] <querysegment>nodes (sub-branches under sub-branches) and several

[0117] <querycond>Node (minimal branch).

[0118] 1.1.9.2.2 <querysegment>Node its fields have the following meanings:

[0119] • Id: used to distinguish different querySegments under querySubTree, is an auto-incrementing number.

[0120] • leftSegId: indicates the id of the querySegment on the left of this branch under the same querySubTree.

[0121] 1.1.9.2.3 <querycond>Node its fields have the following meanings:

[0122] • Id: This id refers to the queryCond defined in query_all.

[0123] • queryType: This indicates the direction of the query using the queryCond defined in query_all. If it is 1, it is a forward reference, and if it is 0, it is a reverse reference. When the queryCond is forward referenced, it indicates that the outputClass is searched using the inputClassId, and the input is a number of inputElementId fields in the inputClassId object when searching. The output is the outputClass object. 1.1.9.3 <conditionmapping>The node contains the mapping conditions that the source model subset needs to satisfy, expressed by the <if_expressions> node, and the mapping relationship, expressed by the <map> node.

[0124] The node contains the mapping conditions that the source model subset needs to satisfy, expressed by the <if_expressions> node, and the mapping relationship, expressed by the <map> node.

[0125] <mappinginfo>Node representation.

[0126] 1.1.9.3.1 The <if_expressions> node is used to store the condition expressions that need to be satisfied for the mapping. The condition expressions are recorded in the script, and are decomposed into multiple conditional statements when parsed.

[0127] 1.1.9.3.2 <mappinginfo>The node contains several <mapping>node, each <mapping>The node describes the mapping relationship of a destination model, and its field meanings are as follows:

[0128] • destClassid: destination model ID.

[0129] • AfterFobj: whether the destination model is issued after the source model, TRUE for issued after the source model, and FALSE for issued before the source model.

[0130] 1.1.9.3.3 <mapping>The node contains several <element>node, each

[0131] <element>The node indicates which object of which source model the element value in a destination model is taken from. Its fields have the following meanings:

[0132] • srcEleld: source model element ID.

[0133] • SrcClassld: source model ID.

[0134] • destEleld: destination model element ID.

[0135] • flag: reserved field, indicating whether other processing is needed.

[0136] 1.2 Definition process:

[0137] 1.2.1 Take all source models and destination models, determine which source models can be mapped to which destination models, and group them. For each group, establish a set mapping relationship, i.e. a <setmapping>node.

[0138] 1.2.2 In each set of mapping relationships, the query relationships between the source models two by two are described using scripts as <query_all> nodes and their sub-nodes <querycond>Node.

[0139] 1.2.3 There can be multiple mapping cases between each group of source models and destination models, such as source model A, source model B is a source model in a set mapping. When the value of element 1 in source model A is 1, and source model B maps to destination model C and destination model D;

[0140] When the value of element 1 in source model A is 2, and source model B maps to destination model C and destination model E. According to the case, it is divided into several data subsets.

[0141] 1.2.4 Write the common mandatory information in all data subsets in the set mapping in

[0142] <inputdataset>In the node <inputdatadefine>node, writes the mandatory information that the data subset is private to <inputdataset>In the node <inputdatadefine>node.

[0143] 1.2.5 Arrange the query order into a query tree, using... <querytreedefine>Node representation.

[0144] 1.2.6 Represent the mapping condition in each data subset with an <if_expressions> node.

[0145] 1.2.7 Represent the mapping relationship of each destination class in each data subset with an <if_expressions> node. <mapping>node representation, generate one <mappinginfo>Node.

[0146] 2 After the device is started, the initialization phase performs parsing of the script, and the parsed collection mapping information forms a collection mapping pool for subsequent collection mapping. The parsing steps are as follows:

[0147] 2.1 Parse the query_all field to explicitly define the search relationship between multiple source models in a collection mapping and between each source model and other source models, to prepare for subsequent construction of a query tree. The query_all field contains several queryCond fields, each of which defines an id field (used to distinguish different queryCond), an inputClassId field (used to define the input source model ID of the search relationship), an outputClass (used to define the output source model ID of the search relationship), and several queryElement fields. The queryElement field contains an inputElementId field (input source model search element), an outputElementId field (output source model corresponding element), and a value field (search element value).

[0148] 2.2 Parse the inputDataDefine field in the inputDateSet field to explicitly define the public required elements and optional elements of the source models in a collection mapping. The inputDataDefine field defines several class fields (representing a model). Each class field contains an id field (model ID), a name field (model name), a mustFlag field (indicating whether the model is a required model, TRUE for a required model and FALSE for an optional model), and several element fields. Each element field contains an id field (model element ID), a name field (element name), and a mustFlag field (indicating whether the element is a required element, TRUE for a required element and FALSE for an optional element).

[0149]

[0150] 2.3 Parse the inputDataSubSet field in the inputDateSet field to explicitly define the source model subset in a collection mapping, where the inputDataDefine field explicitly defines the required elements and optional elements of the source models in the source model subset.

[0151] ​2.4 Analyze the queryTreeDefine field in the inputDataSubSet field to determine the query relationship and query order of different source models in a source model subset, and finally generate a query tree. See Figure 2 Each queryTreeDefine field contains a rootClassId field (describing the model corresponding to the tree root), several querySubTree fields (sub-branches under the tree root), and each querySubTree field contains several querySegment fields (sub-branches under the sub-branches), a querySegment field contains an id field (used to distinguish different querySegments under the querySubTree, which is an incremental number), a leftSegId field (indicating the id of the querySegment on the left of the branch under the same querySubTree), and several queryCond fields (the smallest branch). A queryCond field contains an id field (the id of the queryCond defined in query_all is referenced), a queryType field (indicating the query direction of the queryCond defined in query_all, if it is 1, it is a forward reference, if it is 0, it is a reverse reference. When the queryCond is a forward reference, it means that the inputClassId is used to find the outputClass, and the input is several inputElementId fields in the inputClassId object when searching. The output is the outputClass object).

[0152] 2.5 Analyze the conditionMapping field in the inputDataSubSet field to determine the mapping conditions that need to be met by a source model subset and the corresponding relationship of the mapping elements. The if_expressions field describes the mapping conditions that need to be met, and the condition expressions are recorded in the script and are stored by decomposing the condition expressions into multiple condition judgment statements when parsed. The corresponding relationship of the mapping elements corresponds to the mapping conditions one by one, and each mapping condition can have different mapping element corresponding relationships.

[0153] The flow of the set mapping processing part is shown in Figure 3 , and is as follows: 1. Find the set mapping to which the model belongs.

[0154] 1.1 After receiving a model data object, first determine whether it is a private model according to the model ID.

[0155] 1.2 is a private model, then directly to the original configuration distribution process flow.

[0156] 1.3 is a non-private model, then according to the model ID in the collection mapping pool to find the model belongs to the collection mapping.

[0157] 1.4 can not find the collection mapping, then the mapping ends.

[0158] 2 find the collection mapping, the same source model belongs to the collection mapping may have more than one, need to be processed in order each collection mapping.

[0159] 3 each collection mapping, need to first determine whether the model object in the optional field set mapping required complete.

[0160] 3.1 to determine whether the collection mapping defined by the public optional field belongs to the model.

[0161] 3.2 no, continue processing.

[0162] 3.3, if yes, then determine whether the model data in the field contains all the optional fields of the model.

[0163] 3.4 does not contain all the optional fields, then the mapping ends.

[0164] 3.5 contains all the optional fields, then continue to process the next step.

[0165] 4 traversal of the data subset of the collection mapping, in turn to find the model belongs to the subset.

[0166] 4.1 for each subset check its all source model, if the model is not included in the source model, then does not belong to the data subset, then continue to match the next data subset.

[0167] 4.2 belongs to the data subset, then continue to process the next step.

[0168] 5 generate query result tree.

[0169] 5.1 take the query result tree defined in the data subset, initialize the source model query result tree, and this data object as the root node hanging on the query result tree.

[0170] 5.2 according to the query tree in the data subset, parse the query order between the source model this time.

[0171] 5.3 according to the query order in turn to find all the source model object defined in the query tree.

[0172] 5.4 Take the model data object of this processing as the root node of the tree, take the source model data object found according to the model data of this processing as its child node, and then find other data objects in sequence and hang them on the tree to form the query result tree.

[0173] 6. Generate the destination model object according to the mapping condition and the mapping relationship.

[0174] 6.1 Determine whether each group of data in the query result tree meets the condition defined by the data subset. When taking the object in the query result object tree, follow the traversal of the tree, each leaf node can only form a group of data with its root node, and cannot form a group of data with other adjacent leaf nodes or adjacent nodes of its root node.

[0175] 6.2 If the condition defined by the data subset is not met, continue to match the next data subset.

[0176] 6.3 If the condition is met, find the mapping elements required by the destination model object group in the group of source model objects according to the order from the key element to other elements according to the mapping relationship defined by the data subset. If the element types are inconsistent, perform type conversion. Finally, generate a group of destination model object groups.

[0177] 7. Insert the destination model object into the delivery chain table in sequence.

[0178] 8. Traverse all source model object groups to map all destination model object groups to complete the mapping.

[0179] Example 1, assuming there are five external models R, S, T, U, and W, which are to be mapped as a whole into private models A and B. The mapping relationship can be described as an XML file according to the definition in the invention, as shown in the following: Figure 4 Example (For easy parsing, each external model is provided with a serial number to uniquely identify a model, referred to as class id. In the example, the serial number of the model is identified in the form of model name + "_ID" for easy reading.)

[0180] The mapping relationship definition and parsing process are as follows:

[0181] 1. First, analyze the differences and connections between the external models and the private models, and express them in the XML organization form described in the patent. The specific organization rules are explained in detail in the following analysis, and the generation process is not described.

[0182] 2. After the device is started, read the query_all field in Figure 4 to read the search relationship between the external models:

[0183] a) Element 1 of external model R is associated with element 1 of external model S, through which the objects associated with external model R in external model S can be found;

[0184] b) Element 1 of external model S is associated with element 3 of external model T, and element 2 of external model S is associated with element 2 of external model T, through which the objects associated with external model S in external model T can be found;

[0185] c) Element 1 of external model S is associated with element 1 of external model U, through which the objects associated with external model S in external model U can be found;

[0186] d) Element 1 of external model S is associated with element 1 of external model W, through which the objects associated with external model S in external model W can be found;

[0187] 3. Analyze the inputDataDefine field in the public input data set information inputDateSet to determine the necessary elements of the source model in a common set mapping:

[0188] a) Element 1 and element 2 in external model S;

[0189] b) Element 1 in external model R;

[0190] c) Element 2 and element 3 in external model T.

[0191] 4. Analyze the inputDataDefine field in the first input data information subset inputDataSubSet to determine the necessary elements of the source model in a set mapping subset: element 1 in external model U is the necessary element.

[0192]

[0193]

[0194] 5. Analyze the queryTreeDefine part in the first input data information subset inputDataSubSet, first analyze the rootClassId field of the query tree root to determine that the query tree root is external model R, then analyze the querySubTree field to determine the association relationship using query relationship queryCond sequence number 1, i.e. external model R is associated with external model S, and external model S is hung as a child node of external model R on the tree, and then other query sub-tree nodes are analyzed in turn, and finally a query tree is formed as shown in

[0195] Figure 5 ​​​​

[0196] 6. Analyze the mapping condition and the field of mapping relationship conditionMapping in the first input data information subset inputDataSubSet.

[0197] a) Analyze the field of mapping condition if_expressions, and make sure that the mapping condition of this data subset is that the element 1 in the external model U is 1 and the element 1 in the external model T is less than 5.

[0198] b) Analyze the field of mapping relationship MappingInfo, and make sure that the element 1 and element 2 in the external model R are mapped to the element 1 and element 2 in the private model A; the element 3 in the external model S is mapped to the element 3 in the private model A; the element 1 in the external model U is mapped to the element 4 in the private model A; the private model A is delivered after the external model; the element 1 in the external model S is mapped to the element 1 in the private model B; the element 1 in the external model T is mapped to the element 2 in the private model B.

[0199] The private model A is delivered before the external model.

[0200] 7. Repeat steps 4 to 5 to complete the analysis of the second input data information subset.

[0201] 8. After the analysis is completed, store the above information in the collection mapping pool.

[0202] The collection mapping processing flow is as follows:

[0203] 1. After receiving a data object R1 of the external model R, first determine whether it is a private model according to the model ID.

[0204] 2. Obviously, the ID of the external model R is not a private model, and the model needs to be found in the collection mapping pool.

[0205] 3. After finding the collection mapping, determine whether the public mandatory field defined by the collection mapping belongs to the model, and the element 1 is a mandatory field.

[0206] 4. Determine whether the data object R1 received this time contains the element 1.

[0207] 5. If all mandatory fields are not contained, the mapping is completed.

[0208] 6. If the element 1 field is contained, continue to traverse the data subset of the collection mapping, and there are two data subsets in the collection mapping, and the external model R exists in each data subset.

[0209] 7、Firstly, the data subset 1 is processed, the source model query result tree is initialized firstly, and the data object R1 is hung as the root node on the query result tree.

[0210] 8、According to the query tree in the data subset, the query order between the source models is parsed as:

[0211] a) looking up the external model S according to the external model R;

[0212] b) looking up the external model T according to the external model S;

[0213] c) looking up the external model U according to the external model S;

[0214] 9、According to the query order, the objects S1 and S2 in the external model S are found firstly by using the external model R1, then the objects T1 and T2 in the external model T and the objects U1 and U2 in the external model U are found according to the external model S1, the objects T3 and T4 in the external model T and the objects U3 and U4 in the external model U are found according to the external model S2.

[0215] 10、The model data object R1 of the present processing is taken as the root node of the tree, the source model data objects found according to the model data of the present processing are taken as the child nodes, then other data objects are found in turn and are hung on the tree, and the query result tree is formed, as shown in the following figure. Figure 6

[0216] 11、The data is taken from the query result tree, when the objects in the query result object tree are taken, the tree is traversed, each leaf node can only form a group of data with its root node, and cannot form a group of data with other adjacent leaf nodes or adjacent nodes of its root node, four groups of data are obtained, which are R1, S1, T1, U1; R1, S1, T2, U2; R1, S2, T3, U3; R1, S2, T4, U4.

[0217] 12、It is judged whether each group of data in the query result tree satisfies the condition defined by the data subset (specifically, the value range of the specific element in the model is described in the data subset condition, and it is checked whether the value of the specific element in the data model in each group of data in the query result tree is in the range described in the condition, if in the range, the group of data is the data satisfying the condition, and the next step processing can be continued). According to the condition, two groups of data R1, S1, T1, U1 and R1, S2, T4, U4 are screened out, as shown in the following figure. Figure 7

[0218] ​​13. Based on the mapping relationship defined in the data subset definition, for the two sets of data that meet the conditions, in a source model object group, search for the mapping elements required by the target model object group in order from the key element to other elements. If the element types are inconsistent, perform type conversion. Finally, generate two target model object groups A1, B1 and A2, B2.

[0219] 14. Insert the target model objects into the distributed linked list in sequence.

[0220] 15. Repeat steps 7-14 to complete the mapping of the data subset of the second set.

[0221] Furthermore, the present invention also provides a multi-set model set mapping apparatus, including at least one processor and a memory, wherein the at least one processor and the memory are connected via a data bus, and the memory stores instructions that can be executed by the at least one processor, wherein the instructions, after being executed by the processor, are used to complete the multi-set model set mapping method.< / mappinginfo> < / mapping> < / querytreedefine> < / inputdatadefine> < / inputdataset> < / inputdatadefine> < / inputdataset> < / querycond> < / setmapping> < / element> < / element> < / mapping> < / mapping> < / mapping> < / mappinginfo> < / mappinginfo> < / conditionmapping> < / querycond> < / querysegment> < / querycond> < / querysegment> < / querysubtree> < / querysubtree> < / rootclassid> < / querytree> < / querytree> < / querytreedefine> < / querytreedefine> < / inputdatadefine> < / inputdataset> < / inputdatadefine> < / conditionmapping> < / querytreedefine> < / inputdatadefine> < / inputdatasubset> < / element> < / class> < / class> < / class> < / inputdatadefine> < / inputdatasubset> < / inputdatadefine> < / inputdataset> < / queryelement> < / querycond> < / querycond> < / querycond> < / inputdataset> < / setmapping> < / setmapping> < / setmapping> < / setmapping> < / mappinginfo> < / conditionmapping> < / querysubtree> < / rootclassid> < / querytree> < / querytree> < / querytreedefine> < / querytreedefine> < / inputdatadefine> < / inputdataset> < / inputdatadefine> < / element> < / class> < / queryelement> < / querycond> < / mappinginfo> < / mapping> < / querytreedefine> < / inputdatadefine> < / inputdataset> < / inputdatadefine> < / inputdataset> < / querycond> < / setmapping> < / conditionmapping> < / querytreedefine> < / inputdatadefine> < / inputdatasubset> < / element> < / class> < / class> < / class> < / inputdatadefine> < / inputdatasubset> < / inputdatadefine> < / inputdataset> < / queryelement> < / querycond> < / querycond> < / querycond> < / inputdataset> < / setmapping> < / setmapping> < / setmapping> < / setmapping>

Claims

1. A multi-set inter-model ensemble mapping method, characterized in that, Includes the following steps: (1) Define the mapping information, and use scripts to define the mapping conditions, mapping source models, query trees between source models, and mapping relationships of the set mapping; The mapping is defined using an XML scripting language, and the fields used in the mapping include: <MAPPING_UIM> is the outermost node of the whole file, and all the set mapping information is defined in the <MAPPING_UIM> node, which contains several <setmapping> node;< / setmapping> Each <setmapping>The node corresponds to a set mapping, <setmapping> The node has an id field and a name field, which are used to describe the sequence number and name of the mapping in this collection;< / setmapping> < / setmapping> <setmapping>The <query_all> node under the node describes the search relationship between the collection mapping source model, and a <inputdataset> Nodes are used to describe the required fields of the source model, query tree, mapping conditions, and mapping relationships related to the mapping operation;< / inputdataset> < / setmapping> <query_all>A node contains several <querycond>node, each <querycond> A node represents a query relationship between one source model and another source model;< / querycond> < / querycond> <querycond>A node contains several <queryelement> Nodes are used to describe elements that are related to the input and output models;< / queryelement> < / querycond> <inputdataset>The node contains one <inputdatadefine>Nodes and several <inputdatasubset>Node, the <inputdatadefine>Nodes are used to describe the common required and optional elements of the source model in a set mapping, and their scope is as described above. <inputdatadefine>The node is located <setmapping>Nodes and several <inputdatasubset>Node, the <inputdatasubset> Nodes are used to describe subsets of the source model data;< / inputdatasubset> < / inputdatasubset> < / setmapping> < / inputdatadefine> < / inputdatadefine> < / inputdatasubset> < / inputdatadefine> < / inputdataset> <inputdatadefine>The node contains several <class>Node, each <class>The node describes whether a source model is required; <class>A node contains several <element> A node represents a required element in this model;< / element> < / class> < / class> < / class> < / inputdatadefine> <inputdatasubset>The node contains one <inputdatadefine>Node, one <querytreedefine>Node and a <conditionmapping> node;< / conditionmapping> < / querytreedefine> < / inputdatadefine> < / inputdatasubset> The process of defining mapping information specifically includes: Take all source models and target models, determine which source models can map to which target models, group them, and establish a set mapping relationship for each group, i.e., a set mapping relationship. <setmapping> node;< / setmapping> In each set mapping relationship, the pairwise query relationships between the source models are described using scripts.<query_all> Nodes and their subordinates <querycond> Nodes; each source model and destination model is divided into several data subsets according to different mapping conditions;< / querycond> Write the required information common to all data subsets in the set mapping. <inputdataset>In the node <inputdatadefine>The node writes the required private information of the data subset in... <inputdataset>under the node <inputdatasubset>In the node <inputdatadefine> node;< / inputdatadefine> < / inputdatasubset> < / inputdataset> < / inputdatadefine> < / inputdataset> The above <inputdataset>In the node <inputdatadefine>Nodes and <inputdatasubset>In the node <inputdatadefine>The query order of the nodes is arranged into a query tree, using... <querytreedefine>Node representation; mapping conditions for each data subset are used<if_expressions> Node representation; mapping the relationship between each target class in each data subset using... <mapping>Node representation, generating a <mappinginfo> node;< / mappinginfo> < / mapping> < / querytreedefine> < / inputdatadefine> < / inputdatasubset> < / inputdatadefine> < / inputdataset> (2) Parse the mapping information. After the device starts up, the script is parsed during the initialization phase. The parsed set mapping information forms a set mapping pool for subsequent set mapping. (3) Perform set mapping processing based on the parsing results of the mapping information.

2. The method for mapping sets between multiple models as described in claim 1, characterized in that, The parsing of the mapping information specifically includes: Parse the query_all field to clarify the lookup relationships between multiple source models in a collection mapping, and between each source model and other source models, in preparation for building the query tree later; Parse the inputDataDefine field in the inputDateSet field to identify the common required and optional elements of the source model in a collection mapping; Parse the inputDataSubSet field within the inputDateSet field to identify a subset of the source model in a collection mapping. The queryTreeDefine field in the inputDataSubSet field is parsed to clarify the query relationship and query order of different source models in a source model subset, and finally generate a query tree; Parse the conditionMapping field in the inputDataSubSet field to clarify the mapping conditions that a subset of the source model must satisfy, as well as the correspondence between the mapping elements.

3. The method for mapping sets between multiple models as described in claim 1, characterized in that, The set mapping process based on the parsing results of the mapping information specifically includes: Find the set mapping to which the model belongs; Find the corresponding set mapping and process each set mapping in order; In each set mapping, it is necessary to first determine whether the required fields in the model object set mapping are complete; Iterate through the data subsets mapped by this set, and find the subset to which this model belongs in turn; Generate a query result tree; Generate the target model object based on the mapping conditions and mapping relationships; Insert the target model objects into the distribution list in sequence; Iterate through all source model object groups and map them to all destination model object groups to complete the mapping.

4. The method for mapping sets between multiple models as described in claim 3, characterized in that, The generation of the query result tree specifically includes: Retrieve the query result tree defined in the data subset, initialize the source model query result tree, and attach the current data object as the root node to the query result tree; Based on the query tree in the data subset, the query order among the source models is parsed out. Search for all source model objects defined in the query tree in the order of the query; The model data object processed in this operation is taken as the root node of the tree, and the source model data object found based on the model data processed in this operation is taken as its child node. Then, other data objects are searched in turn and attached to the tree to form the query result tree.

5. The method for mapping sets between multiple models as described in claim 3, characterized in that, The process of generating the target model object based on the mapping conditions and mapping relationships specifically includes: Determine whether each set of data in the query result tree satisfies the conditions defined for the data subset. When retrieving objects from the query result object tree, follow the tree traversal. Each leaf node can only form a set of data with its root node and cannot form a set of data with other adjacent leaf nodes or adjacent nodes of its root node. If the conditions defined for the data subset are not met, continue matching the next data subset; If the conditions are met, the mapping relationship defined in the data subset is used to search for the mapping element required by the target model object group in a set of source model object groups, in the order from the key element to other elements. If the element types are inconsistent, type conversion is performed, and finally a set of target model object groups is generated.

6. The method for mapping sets between multiple models as described in claim 1, characterized in that, <querycond> The fields contained in the node have the following meanings: Id: Query relationship sequence number, used to distinguish different query relationships; inputClassId: Input source model ID; outputClass: Output source model ID;< / querycond> <queryelement>The fields contained in the node have the following meanings: inputElementId: ID of the associated element in the input model; outputElementId: ID of the associated element in the output model; Value: This... <queryelement> The specified values ​​for the input and output elements in a node;< / queryelement> < / queryelement> <class> The fields contained in the node have the following meanings: Id: source model number; Name: source model name; mustFlag: indicates whether the model is a required model, TRUE is a required model, and FALSE is an optional model;< / class> <element> The fields contained in the node have the following meanings: Id: source model number; Name: source model name; mustFlag: indicates whether the model is a required element, TRUE is a required element, and FALSE is an optional element.< / element> 7. The method for mapping sets between multiple models as described in claim 1, characterized in that: <querytreedefine>Each node describes a query tree. <querytreedefine>The node contains a <querytree>node, <querytree>Each node contains a description of the model corresponding to the tree root. <rootclassid>Nodes, and several sub-branches under the root of the tree. <querysubtree> node;< / querysubtree> < / rootclassid> < / querytree> < / querytree> < / querytreedefine> < / querytreedefine> <conditionmapping>The nodes contain the mapping conditions that the subset of the source model needs to satisfy, using<if_expressions> Node representation and mapping relationships, using <mappinginfo> Node representation.< / mappinginfo> < / conditionmapping> 8. A set mapping device between multiple models, characterized in that: It includes at least one processor and a memory, which are connected via a data bus. The memory stores instructions that can be executed by the at least one processor. After being executed by the processor, the instructions are used to complete the set mapping method between multiple models as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Mapping architecture for arbitrary data models

    CN1604082A