Data mapping method and device, computer equipment and storage medium
By obtaining the target type of the target form and determining the target mapping rules, the problem of insufficient flexibility in data mapping in traditional technology is solved, and a flexible data mapping process is realized, reducing development costs.
Patent Information
- Application Number
- CN202411773446.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-14
AI Technical Summary
In traditional technology, data mapping between different business forms is less flexible, and it needs to be implemented through a fixed rule data conversion platform, resulting in insufficient flexibility.
By obtaining the target form and its corresponding target type, determining the target mapping rules of the target form, determining the source form based on these rules, and performing data mapping, improving the flexibility of data mapping.
It realizes that when the target form requires data mapping, quickly determine the source form and complete the data mapping, thereby improving the flexibility of data mapping and reducing development costs.
Smart Images

Figure CN119621727A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data mapping method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of computer technology, enterprises manage their resources through multiple business systems. Different business systems contain different business forms, and data interactions often exist between different business forms.
[0003] In traditional technology, in order to solve the data interaction between different business forms, it is necessary to implement data mapping between different business forms through a data conversion platform. The data mapping rules in the data conversion platform are fixed rules, resulting in low flexibility in data mapping. Summary of the invention
[0004] Based on this, it is necessary to provide a data mapping method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the flexibility of data mapping in order to address the above technical problems.
[0005] In a first aspect, the present application provides a data mapping method. The method comprises:
[0006] Obtain a target form and a target type corresponding to the target form;
[0007] Based on the target type, determining a target mapping rule corresponding to the target form;
[0008] Determine a source form corresponding to the target form based on the form matching relationship in the target mapping rule;
[0009] Based on the mapping scenarios and mapping relationships in the target mapping rules, data mapping is performed on the target form and the source form.
[0010] In one embodiment, determining the target mapping rule corresponding to the target form based on the target type includes:
[0011] Based on the target type, determining a plurality of candidate mapping rule identifiers; the candidate mapping rule identifiers include the target type and the candidate type;
[0012] In the case that the multiple candidate types are all different, determining the candidate mapping rules corresponding to the multiple candidate mapping rule identifiers as the target mapping rules;
[0013] In the case that the same candidate type exists, the target mapping rule corresponding to the target form is determined based on the mapping rule filtering condition in the candidate mapping rule.
[0014] In one embodiment, the form matching relationship includes a form matching type, a source entity matching attribute, and a target entity matching attribute; and determining the source form corresponding to the target form based on the form matching relationship in the target mapping rule includes:
[0015] Based on the source type in the target mapping rule, obtaining a candidate form corresponding to the source type;
[0016] Based on the form matching type, determining a form to be matched from the candidate forms and the target form;
[0017] In a case where the form to be matched is the target form, determining a source form corresponding to the target form based on the target entity matching attribute and the target form;
[0018] In the case that the form to be matched is the candidate form, a source form corresponding to the target form is determined based on the source entity matching attribute and the candidate form.
[0019] In one embodiment, when the form to be matched is the candidate form, determining the source form corresponding to the target form based on the source entity matching attribute and the candidate form includes:
[0020] Obtaining a target matching attribute value corresponding to the target entity matching attribute from the target form;
[0021] For each of the candidate forms, determining a source matching attribute value corresponding to the source entity matching attribute from the candidate form;
[0022] The source matching attribute value is compared with the target matching attribute value, and if the source matching attribute value is the same as the target matching attribute, the candidate form is determined as the source form.
[0023] In one embodiment, the performing data mapping on the target form and the source form based on the mapping scenario and the mapping relationship in the target mapping rule includes:
[0024] In the case where the mapping scenario is writing, mapping the source mapping attribute value corresponding to the source mapping attribute in the mapping relationship in the source form to the target mapping attribute value corresponding to the target mapping attribute in the mapping relationship in the target form;
[0025] In the case where the mapping scenario is reverse writing, the target mapping attribute value corresponding to the target mapping attribute in the target form is mapped to the source mapping attribute value corresponding to the source mapping attribute in the source form.
[0026] In one embodiment, when the mapping relationship is an entry mapping relationship, the source mapping attribute includes a source mapping entry row and a source mapping field, and the target mapping attribute includes a target entry row and a target mapping field; mapping the source mapping attribute value corresponding to the source mapping attribute in the mapping relationship in the source form to the target mapping attribute value corresponding to the target mapping attribute in the mapping relationship in the target form includes:
[0027] Mapping the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row to the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row;
[0028] The mapping of the target mapping attribute value corresponding to the target mapping attribute in the target form to the source mapping attribute value corresponding to the source mapping attribute in the source form includes:
[0029] The target mapping attribute value corresponding to the target mapping field in the target form in the target entry row is mapped to the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row.
[0030] In a second aspect, the present application also provides a data mapping device. The device comprises:
[0031] An acquisition module, used to acquire a target form and a target type corresponding to the target form;
[0032] A mapping rule determination module, used to determine a target mapping rule corresponding to the target form based on the target type;
[0033] A source form determination module, used to determine a source form corresponding to the target form based on the form matching relationship in the target mapping rule;
[0034] A mapping module is used to perform data mapping between the target form and the source form based on the mapping scenario and mapping relationship in the target mapping rule.
[0035] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0037] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0038] The above-mentioned data mapping method, apparatus, computer equipment, storage medium and computer program product obtain a target form and a target type corresponding to the target form, determine a target mapping rule corresponding to the target form based on the target type, determine a source form corresponding to the target form based on the form matching relationship in the target mapping rule, and perform data mapping between the target form and the source form based on the mapping scenario and mapping relationship in the target mapping rule, that is, when the target form needs to be data mapped, it is only necessary to determine the target mapping rule corresponding to the target form to determine the source form corresponding to the target form, and complete the data mapping between the target form and the source form, thereby improving the flexibility of data mapping. Moreover, when adding a new target form or source form, or adding a data mapping relationship between a new target form and a source form, it is only necessary to add a new data mapping rule, which reduces the development cost compared to modifying the program. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 An application environment diagram of a data mapping method in an embodiment;
[0040] Figure 2 is a flow chart of a data mapping method in one embodiment;
[0041] Figure 3A A schematic diagram of a network relationship table in one embodiment;
[0042] Figure 3B A schematic diagram of a network relationship table in another embodiment;
[0043] Figure 4 A schematic diagram of a data mapping rule setting interface in an embodiment;
[0044] Figure 5 A schematic diagram of target types, candidate types and candidate mapping rules in one embodiment;
[0045] Figure 6 A schematic diagram of a flow chart of a data mapping method in an embodiment;
[0046] Figure 7 A schematic diagram of a flow chart of a source form determination step in one embodiment;
[0047] Figure 8 A schematic diagram of a form matching relationship setting interface in an embodiment;
[0048] Fig. 9 A schematic diagram of the mapping relationship between entries in one embodiment;
[0049] Fig.10 A schematic diagram of an interface for setting entry mapping relationships in an embodiment;
[0050] Fig.11 A data mapping system framework diagram in one embodiment;
[0051] Fig.12 is a flow chart of a data mapping method in a data mapping system in one embodiment;
[0052] Fig.13 is a structural block diagram of a data mapping device in one embodiment;
[0053] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] The data mapping method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Both the terminal and the server can be used alone to execute the data mapping method provided in the embodiment of the present application. The terminal and the server can also be used in collaboration to execute the data mapping method provided in the embodiment of the present application. For example, the terminal 102 obtains the target form and the target type corresponding to the target form; based on the target type, the target mapping rule corresponding to the target form is determined; based on the form matching relationship in the target mapping rule, the source form corresponding to the target form is determined; based on the mapping scenario and mapping relationship in the target mapping rule, the target form and the source form are data mapped. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0056] In one embodiment, Figure 2As shown, a data mapping method is provided, which can be applied to a computer device, which can be a terminal or a server, and can be executed by the terminal or the server itself, or can be implemented through interaction between the terminal and the server. This embodiment takes the method applied to a computer device as an example for description, and includes steps 202 to 208.
[0057] Step 202: Acquire the target form and the target type corresponding to the target form.
[0058] The target form refers to the form that triggers data mapping. The target type refers to the entity type of the target form. The entity type refers to the business object type with specific meaning and attributes in the enterprise system. It can be understood that the target type refers to the form type of the target form.
[0059] Exemplarily, the computer device obtains a target form and a target type corresponding to the target form.
[0060] In one embodiment, the computer device responds to a preset trigger operation for the target form and obtains the target type corresponding to the target form. The preset trigger operation refers to a preset trigger operation, and the preset trigger operation includes but is not limited to a save operation, a submit operation, and a review operation. That is, when the computer device responds to the preset trigger operation for the target form, it determines the target form as a form that needs to be mapped with data, and obtains the target type of the target form.
[0061] In one embodiment, the computer device obtains the target type corresponding to the target form based on a preset time interval. The preset time interval refers to a pre-set time interval. That is, every preset time interval, the target form is determined as a form that needs to be data mapped, and the target type of the target form is obtained.
[0062] Step 204: Determine the target mapping rule corresponding to the target form based on the target type.
[0063] The target mapping rule refers to the data mapping rule used to map data to the target form. The target mapping rule can be one or more, that is, the target mapping rule corresponding to the target form is a one-to-one or one-to-many relationship. In the case of multiple target mapping rules, the number of source forms corresponding to the target form is multiple, and the multiple source forms and the target form are meshed forms. For example, Figure 3A As shown in the schematic diagram of the network relationship form, the single entry form A and the single entry form B are source forms, the single entry form C is the target form, and the single entry form A, the single entry form B and the single entry form C are network relationship forms, or, as Figure 3BIn the schematic diagram of the network relationship form shown, the multi-entry form A and the multi-entry form B are source forms, the multi-entry form C is the target form, and the multi-entry form A, the multi-entry form B and the multi-entry form C are network relationship forms.
[0064] The target mapping rules include but are not limited to basic information, mapping rule filtering conditions, form matching relationships, and mapping relationships. For example, the target mapping rules are as follows: Figure 4 The data mapping rule setting interface shown is set up, and the target mapping rule includes basic information, mapping rule filtering conditions, form matching relationship, mapping relationship and target entity allowed configuration attributes. The basic information includes mapping rule code, data mapping rule identifier, mapping scenario, source entity, target entity, target entity application, target entity business operation, target form repeatable execution identifier in temporary storage state, threshold identifier and remarks, etc.; mapping rule filtering conditions include filtering fields and filtering conditions, etc.; form matching relationship includes form matching type, source entity matching attributes and target entity matching attributes; mapping relationship includes the correspondence between source mapping fields and target mapping fields, as well as mapping method, etc.
[0065] Exemplarily, the computer device determines the mapping rule identifier containing the target type as the target mapping rule identifier, and determines the data mapping rule corresponding to the target mapping rule identifier as the target mapping rule. Figure 4 In the data mapping rule setting interface shown, the target type is withdrawal processing, the data mapping rule identifier is loan withdrawal application-withdrawal processing, and the data mapping rule identifier includes the target type.
[0066] In one embodiment, a computer device determines multiple mapping rule identifiers corresponding to a target type as multiple candidate mapping rule identifiers; for each candidate mapping rule identifier, obtains a mapping rule filtering condition in the candidate mapping rule corresponding to the candidate mapping rule identifier; if the target form satisfies the mapping rule filtering condition, the candidate mapping rule is determined as the target mapping rule.
[0067] Step 206: Determine the source form corresponding to the target form based on the form matching relationship in the target mapping rule.
[0068] The form matching relationship refers to the rules for determining the source form corresponding to the target form, and the form matching relationship includes but is not limited to the form matching type, source entity matching attributes, and target entity matching attributes. The source form refers to the form that performs data mapping with the target form, and the source form can be one or more.
[0069] Exemplarily, when there is only one target mapping rule, the computer device determines the source form corresponding to the target form according to the form matching relationship in the target mapping rule.
[0070] In one embodiment, when there are at least two target mapping rules, for each target mapping rule, the computer device determines the source form corresponding to the target form according to the form matching relationship in the target mapping rule.
[0071] Step 208: Based on the mapping scenarios and mapping relationships in the target mapping rules, data mapping is performed on the target form and the source form.
[0072] Among them, mapping scenarios refer to scenarios of data mapping, including but not limited to writing and reverse writing. Writing can be divided into field writing and attachment writing, etc., and reverse writing can be divided into field reverse writing and attachment reverse writing, etc. Writing and reverse writing can be subdivided according to actual conditions. Writing refers to mapping data or attachments in the source form to the target form, and reverse writing refers to mapping data or attachments in the target form to the source form. Mapping relationship refers to the mapping relationship between data or attachments, etc. between the source form and the target form. Mapping relationship can be divided into field mapping relationship and entry mapping relationship. Field mapping relationship describes the mapping relationship between the fields of the source form and the fields of the target form. Entry mapping relationship describes the mapping relationship between the fields in the entry line of the source document and the fields in the entry line of the target form.
[0073] Exemplarily, the computer device performs data mapping on the target form and the source form according to the mapping scenario and the mapping relationship in the target mapping rule.
[0074] In the above data mapping method, a target form and a target type corresponding to the target form are obtained, a target mapping rule corresponding to the target form is determined based on the target type, a source form corresponding to the target form is determined based on the form matching relationship in the target mapping rule, and data mapping is performed on the target form and the source form based on the mapping scenario and mapping relationship in the target mapping rule. That is, when the target form needs to be mapped, only the target mapping rule corresponding to the target form needs to be determined to determine the source form corresponding to the target form, and the data mapping between the target form and the source form can be completed, thereby improving the flexibility of data mapping. Moreover, when a new target form or source form is added, or a new data mapping relationship between a target form and a source form is added, only a new data mapping rule needs to be added, which reduces the development cost compared to modifying the program.
[0075] In one embodiment, based on the target type, determining the target mapping rule corresponding to the target form includes:
[0076] Based on the target type, multiple candidate mapping rule identifiers are determined; the candidate mapping rule identifiers include the target type and the candidate type; when multiple candidate types are different, the candidate mapping rules corresponding to the multiple candidate mapping rule identifiers are determined as the target mapping rules; when there are identical candidate types, the target mapping rules corresponding to the target form are determined based on the mapping rule filtering conditions in the candidate mapping rules.
[0077] Among them, the candidate mapping rule identifier refers to a mapping rule identifier including a target type, and the candidate mapping rule identifier includes a target type and a candidate type. For example, if the target type is withdrawal processing, and the candidate mapping rule identifier is loan withdrawal application-withdrawal processing, then the candidate type is loan withdrawal application.
[0078] Exemplarily, the computer device determines multiple mapping rule identifiers including a target type as multiple candidate mapping rule identifiers, obtains a candidate type from each candidate mapping rule identifier respectively, compares the multiple candidate types, and if the multiple candidate types are not the same, determines the candidate mapping rules corresponding to the multiple candidate mapping rule identifiers as the target mapping rule; if there are identical candidate types, for a group of candidate mapping rule identifiers including the same candidate type, obtains mapping rule filtering conditions from the candidate mapping rules corresponding to the candidate mapping rule identifiers, determines whether the target form satisfies the mapping rule filtering conditions, if the target form only satisfies one of the mapping rule filtering conditions, determines the candidate mapping rule corresponding to the mapping rule filtering conditions satisfied by the target form as the reference mapping rule, and if each group of candidate mapping rule identifiers including the same candidate type has only one reference mapping rule, determines the reference mapping rule as the target mapping rule. For example, a schematic diagram of the target type, candidate type, and candidate mapping rule is shown in FIG. Figure 5 As shown, the candidate type corresponding to candidate mapping rule 1 is the repayment initialization form, and the target type is the repayment processing. The candidate type corresponding to candidate mapping rule 2 is the repayment application, and the target type is the repayment processing. Since the repayment initialization form and the repayment application are different, candidate mapping rule 1 and candidate mapping rule 2 are both target mapping rules.
[0079] In one embodiment, a flowchart diagram of a data mapping method is shown in FIG. Figure 6As shown, the computer device determines multiple candidate mapping rule identifiers corresponding to the target type, and determines whether the candidate type among the multiple candidate mapping rule identifiers is unique. If it is unique, the candidate mapping rule corresponding to the candidate mapping rule identifier is determined as the target mapping rule, and the data mapping of the target form is completed based on the target mapping rule; if it is not unique, for a group of candidate mapping rule identifiers including the same candidate type, based on the mapping rule filtering condition in the candidate mapping rule corresponding to the candidate mapping rule identifier, a group of candidate mapping rule identifiers including the same candidate type are screened. If only one candidate mapping rule identifier remains after screening each group of candidate mapping rule identifiers including the same candidate type, the candidate mapping rule corresponding to the screened candidate mapping rule identifier is determined as the target mapping rule, and the data mapping of the target form is completed based on the target mapping rule; otherwise, the data mapping of the target form is stopped.
[0080] In this embodiment, when a target type corresponds to multiple candidate mapping rule identifiers, if the multiple candidate types are all different, it means that the target form corresponds to only one source form in one candidate type, and there is no need to screen the candidate mapping rules corresponding to the candidate mapping rule identifier, and the candidate mapping rules corresponding to the candidate mapping rule identifier are directly determined as the target mapping rules; if there are identical candidate types, it means that the target form corresponds to multiple source forms in one candidate type, and data mapping errors will occur, and it is necessary to screen the candidate mapping rules corresponding to the candidate mapping rule identifier so that the target form corresponds to only one source form in one candidate type, and the candidate mapping rules corresponding to the screened candidate mapping rule identifiers are determined as the target mapping rules, thereby avoiding data mapping errors and improving the accuracy of data mapping.
[0081] In one embodiment, Figure 7 As shown, the form matching relationship includes the form matching type, the source entity matching attribute and the target entity matching attribute; based on the form matching relationship in the target mapping rule, the source form corresponding to the target form is determined, including:
[0082] Step 702: Based on the source type in the target mapping rule, a candidate form corresponding to the source type is obtained.
[0083] Among them, the form matching type refers to the way of representing the matching source form. The form matching type includes but is not limited to the target entity containing the source entity attribute and the source entity containing the target entity attribute. The target entity containing the source entity attribute means that the target form contains the identifier representing the source form, and the source entity containing the target entity attribute means that the source form contains the identifier representing the target form. The target entity contains the source entity attribute and the source entity contains the target entity attribute can be further divided according to actual needs, for example, Figure 8In the form matching relationship setting interface shown, the form matching types include target entity contains source entity attributes (document header-document header), target entity contains source entity attributes (document header-entry), source entity contains target entity attributes (document header-document header) and source entity contains target entity attributes (entry-document header). Source entity matching attributes refer to the fields used for matching in the source form, and target entity matching attributes refer to the fields used for matching in the target form. Source type refers to the entity type of the source form. Candidate form refers to the form whose entity type is the source type.
[0084] Exemplarily, the computer device obtains the source type from the basic information of the target mapping rule, obtains a form whose entity type is the source type, and determines the form whose entity type is the source type as a candidate form.
[0085] Step 704: Based on the form matching type, determine the form to be matched from the candidate forms and the target form.
[0086] The form to be matched refers to a form storing matching information, and the form to be matched is one of the candidate forms or the target form.
[0087] Exemplarily, the computer device obtains the form matching type in the form matching relationship. If the form matching type is that the target entity contains the source entity attributes, the target form is used as the form to be matched; if the form matching type is that the source entity contains the target entity attributes, the candidate form is used as the form to be matched.
[0088] Step 706: When the form to be matched is a target form, a source form corresponding to the target form is determined based on the target entity matching attribute and the target form.
[0089] Exemplarily, when the form to be matched is the target form, the computer device obtains the target matching attribute value corresponding to the target entity matching attribute from the target form, and determines the candidate form corresponding to the target matching attribute value as the source form corresponding to the target form.
[0090] Step 708: When the form to be matched is a candidate form, the source form corresponding to the target form is determined based on the source entity matching attributes and the candidate form.
[0091] Exemplarily, when the form to be matched is a candidate form, the computer device obtains source matching attribute values corresponding to source entity matching attributes from the candidate form, and determines the source form corresponding to the target form based on multiple source matching attribute values.
[0092] In this embodiment, candidate forms are obtained based on the source type in the target mapping rule, and the form to be matched is determined from the candidate forms and the target form based on the form matching type in the form matching relationship of the target mapping rule. For different forms to be matched, different methods are used to determine the source form corresponding to the target form, thereby improving the flexibility of source form determination.
[0093] In one embodiment, when the form to be matched is a candidate form, determining the source form corresponding to the target form based on the source entity matching attribute and the candidate form includes:
[0094] Obtain a target matching attribute value corresponding to the target entity matching attribute from the target form; for each candidate form, determine a source matching attribute value corresponding to the source entity matching attribute from the candidate form; compare the source matching attribute value with the target matching attribute value, and if the source matching attribute value is the same as the target matching attribute, determine the candidate form as the source form.
[0095] The target matching attribute value refers to the attribute value corresponding to the target entity matching attribute in the target form, and the source matching attribute value refers to the attribute value corresponding to the source entity matching attribute in the candidate form.
[0096] Exemplarily, when the form to be matched is a candidate form, the computer device obtains the target matching attribute value corresponding to the target entity matching attribute from the target form, obtains the source matching attribute value corresponding to the source entity matching attribute from each candidate form, compares the source matching attribute value with the target matching attribute value, and if the source matching attribute value is the same as the target matching attribute, the candidate form is determined to be the source form.
[0097] In this embodiment, the form to be matched is a candidate form, which means that the candidate form includes an identifier representing the target form. Then, a source matching attribute value corresponding to the source entity matching attribute is determined from the candidate form, and the source matching attribute value is compared with the target matching attribute value. If the source matching attribute value is the same as the target matching attribute, the candidate form is determined as the source form.
[0098] In one embodiment, based on the mapping scenario and the mapping relationship in the target mapping rule, data mapping is performed on the target form and the source form, including:
[0099] When the mapping scenario is write, the source mapping attribute value corresponding to the source mapping attribute in the mapping relationship in the source form is mapped to the target mapping attribute value corresponding to the target mapping attribute in the mapping relationship in the target form; when the mapping scenario is write-back, the target mapping attribute value corresponding to the target mapping attribute in the target form is mapped to the source mapping attribute value corresponding to the source mapping attribute in the source form.
[0100] Among them, writing refers to mapping the data in the source form to the target form. Writing back refers to mapping the data in the target form to the source form. The source mapping attribute refers to the attribute of the mapped data in the source form. The source mapping attribute value may include the source mapping field, or the source entry line and the source mapping field, that is, in the case of a single entry, the source mapping attribute value includes the source mapping field; in the case of multiple entries, the source mapping attribute value includes the source entry line and the source mapping field. The source mapping attribute value refers to the value corresponding to the source mapping attribute in the source form. The target mapping attribute refers to the attribute of the mapped data in the target form. The target mapping attribute value may include the target mapping field, or the target entry line and the target mapping field, that is, in the case of a single entry, the target mapping attribute value includes the target mapping field; in the case of multiple entries, the target mapping attribute value includes the target entry line and the target mapping field. The target mapping attribute value refers to the value corresponding to the target mapping attribute in the target form.
[0101] Exemplarily, for each group of mapping relationships including source mapping attributes, target mapping attributes, and mapping functions, when the mapping scenario is writing, the computer device obtains the source mapping attribute value corresponding to the source mapping attribute in the source form, determines the target mapping data based on the mapping function and the source mapping attribute value, and maps the target mapping data to the target mapping attribute value corresponding to the target mapping attribute in the target document. For each group of mapping relationships including source mapping attributes, target mapping attributes, and mapping functions, when the mapping scenario is reverse writing, the computer device obtains the target mapping attribute value corresponding to the target mapping attribute in the target form, determines the target mapping data based on the mapping function and the target mapping attribute value, and maps the target mapping data to the source mapping attribute value corresponding to the source mapping attribute in the source form.
[0102] In this embodiment, the direction of data mapping is determined by the mapping scenario, and the relationship of data mapping is determined by the mapping relationship. The data mapping between the target form and the source form is completed according to the mapping scenario and the mapping relationship. That is, different mapping scenarios lead to different data mapping directions, and different mapping relationships lead to different data mapping fields, thereby improving the flexibility of data mapping.
[0103] In one embodiment, when the mapping relationship is an entry mapping relationship, the source mapping attributes include a source mapping entry line and a source mapping field, and the target mapping attributes include a target entry line and a target mapping field; based on the mapping scenario and the mapping relationship in the target mapping rule, data mapping is performed on the target form and the source form, including:
[0104] When the mapping scenario is write, the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row is mapped to the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row; when the mapping scenario is write-back, the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row is mapped to the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row.
[0105] The entry mapping relationship refers to the mapping relationship between the multi-entry target form and the multi-entry source form. It can be understood that there are multiple entries in the target form and multiple entries in the source form. The entry mapping relationship describes the mapping relationship between the fields in the entry items of the target form and the fields in the entry items of the source form. For example, the mapping relationship diagram between the entry items is as follows: Fig. 9 As shown, the initial loan form includes entries A1, A2 and A3, and the loan contract processing form includes entries B1, B2 and B3. Entry A1 in the initial loan form corresponds to entry B1 in the loan contract processing form, entry A2 in the initial loan form corresponds to entry B2 in the loan contract processing form, and entry A3 in the initial loan form corresponds to entry B3 in the loan contract processing form. The source mapping entry line refers to the identifier that represents the entry in the source form, and the source mapping field refers to the field corresponding to the mapped data in the source mapping entry line; the target entry line refers to the identifier that represents the entry in the target form, and the target mapping field refers to the field corresponding to the mapped data in the target entry line. For example, the schematic diagram of the entry mapping relationship setting interface is shown as follows Fig.10 As shown, the source mapping attribute is guarantee information (gmsubentry).Guarantee document number (gcontract), the source mapping entry line is guarantee information (gmsubentry), and the source mapping field is guarantee document number (gcontract); the target mapping attribute is guarantee information entry (entry_gcontract).Guarantee document number (gcontract), the target entry line is guarantee information entry (entry_gcontract), and the target mapping field is guarantee document number (gcontract).
[0106] Exemplarily, for each set of entry mapping relationships including source mapping attributes, target mapping attributes, and mapping functions, the source mapping attributes include source mapping entry rows and source mapping fields, and the target mapping attributes include target entry rows and target mapping fields. When the mapping scenario is write, the computer device obtains the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row, determines the target mapping data based on the mapping function and the source mapping attribute value, and maps the target mapping data to the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row. For each set of entry mapping relationships including source mapping attributes, target mapping attributes, and mapping functions, the source mapping attributes include source mapping entry rows and source mapping fields, and the target mapping attributes include target entry rows and target mapping fields. When the mapping scenario is write-back, the computer device obtains the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row, determines the target mapping data based on the mapping function and the target mapping attribute value, and maps the target mapping data to the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row.
[0107] In this embodiment, when the target form and the source form are multi-entry forms, the direction of data mapping is determined by the mapping scenario, the relationship of data mapping is determined by the entry mapping relationship, and based on the source mapping entry rows and source mapping fields included in the source mapping attributes in the entry mapping relationship, and the target mapping attributes in the entry mapping relationship including the target entry rows and target mapping fields, the data mapping between the multi-entry target form and the source form is completed.
[0108] In an exemplary embodiment, the data mapping system framework is shown in FIG. Fig.11 As shown in the figure, a layered architecture design is adopted, including a data source layer, a mapping rule layer, and a target document layer. The data source layer can connect to different business systems and databases to extract various types of document data. The mapping rule layer is used to define the field mapping relationship and conversion rules between different documents, which can be configured through a visual interface without writing a lot of code. The data mapping system includes the following core logic: automatic registration of document services, saving after configuration, and implementing the logic of business scenarios. It supports the configuration of mapping methods such as direct mapping, expression mapping, and function mapping, as well as the configuration of the relationship between multiple entry lines, the configuration of serial and parallel execution of multiple source documents, the configuration of filtering conditions for multiple source documents, and the data validation rules of the target document after executing the business logic. The target document layer is a new document generated according to the mapping rules or a document that is being operated, which can be used for data interaction and sharing between different business documents.
[0109] Interface configuration layer logic: By providing an intuitive graphical interface, users can easily select data source documents and target documents, and define the word relationship between their segment mappings. It supports multiple mapping methods, such as direct mapping, expression mapping, function mapping, etc., to meet the data conversion needs in different scenarios. At the same time, you can configure multiple source documents to execute business in parallel or serially, and support the configuration of the relationship between document entry lines. You can also set data validation rules to ensure that the mapped data meets the requirements of the target document.
[0110] Automated execution: The mapping model can automatically execute document mapping and conversion operations according to preset trigger conditions. For example, you can set a scheduled task to regularly extract data from the data source and perform mapping conversion; or automatically trigger the mapping operation when a specific event occurs, such as the creation, update, or deletion of a data source document. This can greatly improve the efficiency and real-time performance of data integration.
[0111] Transaction compensation: When executing business, messages will be sent to MQ (Message Queue). MQ consumption maintains the idempotence of transactions. Using MQ compensation transactions improves system reliability and data consistency.
[0112] Scalability and compatibility: This model has good scalability and compatibility, and can be easily integrated into existing low-code development platforms or enterprise-level applications. It supports a variety of data sources and target document formats, including database tables, Excel files, XML (eXtensible Markup Language) files, JSON (Java Script Object Notation) files, etc., which can meet the diverse needs of different enterprises.
[0113] Security: Currently, the standard version supports the configuration of dual-open attributes. If you need to add fields to standard documents, you need to confirm and add them in the field attributes that are allowed to be configured. All business executions will record execution logs and record historical versions before and after the execution; all business executions support idempotence to prevent repeated execution.
[0114] The flow chart of the data mapping method in the data mapping system is as follows: Fig.12 As shown, including:
[0115] The data mapping system obtains the target type corresponding to the target form in response to a preset trigger operation for the target form.
[0116] Determine the target mapping rule. The data mapping system determines multiple mapping rule identifiers including the target type as multiple candidate mapping rule identifiers, obtains the candidate type from each candidate mapping rule identifier respectively, and compares the multiple candidate types. If the multiple candidate types are not the same, the candidate mapping rules corresponding to the multiple candidate mapping rule identifiers are determined as the target mapping rules; if there are identical candidate types, for a group of candidate mapping rule identifiers including the same candidate type, the mapping rule filtering conditions are obtained from the candidate mapping rules corresponding to the candidate mapping rule identifiers, and it is determined whether the target form satisfies the mapping rule filtering conditions. If the target form only satisfies one of the mapping rule filtering conditions, the candidate mapping rule corresponding to the mapping rule filtering conditions satisfied by the target form is determined as the reference mapping rule. If there is only one reference mapping rule in each group of candidate mapping rule identifiers including the same candidate type, the reference mapping rule is determined as the target mapping rule.
[0117] Determine the source form. For each target mapping rule, the data mapping system obtains the source type from the basic information of the target mapping rule, obtains the form whose entity type is the source type, and determines the form whose entity type is the source type as the candidate form; obtains the form matching type in the form matching relationship, and if the form matching type is that the target entity contains the source entity attribute, the target form is used as the form to be matched; if the form matching type is that the source entity contains the target entity attribute, the candidate form is used as the form to be matched. In the case where the form to be matched is the target form, the data mapping system obtains the target matching attribute value corresponding to the target entity matching attribute from the target form, and determines the candidate form corresponding to the target matching attribute value as the source form corresponding to the target form. In the case where the form to be matched is the candidate form, the data mapping system obtains the target matching attribute value corresponding to the target entity matching attribute from the target form, obtains the source matching attribute value corresponding to the source entity matching attribute from each candidate form, compares the source matching attribute value with the target matching attribute value, and if the source matching attribute value is the same as the target matching attribute, the candidate form is determined as the source form.
[0118] In the case where the source form and the target form are single entries, for each source form, for each group of mapping relationships including source mapping attributes, target mapping attributes and mapping functions in the target mapping rules, when the mapping scenario is write, the data mapping system obtains the source mapping attribute value corresponding to the source mapping attribute in the source form, determines the target mapping data based on the mapping function and the source mapping attribute value, and maps the target mapping data to the target mapping attribute value corresponding to the target mapping attribute in the target document. For each group of mapping relationships including source mapping attributes, target mapping attributes and mapping functions in the target mapping rules, when the mapping scenario is write-back, the data mapping system obtains the target mapping attribute value corresponding to the target mapping attribute in the target form, determines the target mapping data based on the mapping function and the target mapping attribute value, and maps the target mapping data to the source mapping attribute value corresponding to the source mapping attribute in the source form.
[0119] In the case where the source form and the target form are multiple entries, for each source form, for each group of mapping relationships including source mapping attributes, target mapping attributes and mapping functions in the target mapping rule, the source mapping attributes include source mapping entry rows and source mapping fields, and the target mapping attributes include target entry rows and target mapping fields. In the case where the mapping scenario is write, the data mapping system obtains the source mapping attribute values corresponding to the source mapping fields in the source form in the source mapping entry rows, determines the target mapping data based on the mapping function and the source mapping attribute values, and maps the target mapping data to the target mapping attribute values corresponding to the target mapping fields in the target form in the target entry rows. For each set of entry mapping relationships including source mapping attributes, target mapping attributes and mapping functions in the target mapping rules, the source mapping attributes include source mapping entry rows and source mapping fields, and the target mapping attributes include target entry rows and target mapping fields. When the mapping scenario is reverse writing, the data mapping system obtains the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row, determines the target mapping data based on the mapping function and the target mapping attribute value, and maps the target mapping data to the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row.
[0120] After the data mapping is completed, the data mapping results are written into the operation log and the historical version is recorded.
[0121] In this embodiment, the target form and the target type corresponding to the target form are obtained, the target mapping rule corresponding to the target form is determined based on the target type, the source form corresponding to the target form is determined based on the form matching relationship in the target mapping rule, and the target form and the source form are data mapped based on the mapping scenario and mapping relationship in the target mapping rule. That is, when the target form needs to be mapped, it is only necessary to determine the target mapping rule corresponding to the target form to determine the source form corresponding to the target form, and complete the data mapping between the target form and the source form, thereby improving the flexibility of data mapping. Moreover, when adding a new target form or source form, or adding a data mapping relationship between a new target form and a source form, it is only necessary to add a new data mapping rule, which reduces the development cost compared to modifying the program.
[0122] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0123] Based on the same inventive concept, the embodiment of the present application also provides a data mapping device for implementing the data mapping method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data mapping device embodiments provided below can refer to the limitations on the data mapping method above, and will not be repeated here.
[0124] In one embodiment, Fig.13 As shown, a data mapping device is provided, comprising: an acquisition module, a mapping rule determination module, a source form determination module and a mapping module, wherein:
[0125] An acquisition module 1302 is used to acquire a target form and a target type corresponding to the target form;
[0126] A mapping rule determination module 1304 is used to determine a target mapping rule corresponding to a target form based on a target type;
[0127] A source form determination module 1306 is used to determine a source form corresponding to a target form based on a form matching relationship in a target mapping rule;
[0128] The mapping module 1308 is used to perform data mapping between the target form and the source form based on the mapping scenario and mapping relationship in the target mapping rule.
[0129] In one embodiment, the mapping rule determination module 1304 is also used to: determine multiple candidate mapping rule identifiers based on the target type; the candidate mapping rule identifiers include the target type and the candidate type; when multiple candidate types are different, determine the candidate mapping rules corresponding to the multiple candidate mapping rule identifiers as the target mapping rules; when there are the same candidate types, determine the target mapping rules corresponding to the target form based on the mapping rule filtering conditions in the candidate mapping rules.
[0130] In one embodiment, the source form determination module 1306 is also used to: obtain candidate forms corresponding to the source type based on the source type in the target mapping rule; determine the form to be matched from the candidate forms and the target form based on the form matching type; when the form to be matched is the target form, determine the source form corresponding to the target form based on the target entity matching attributes and the target form; when the form to be matched is the candidate form, determine the source form corresponding to the target form based on the source entity matching attributes and the candidate form.
[0131] In one embodiment, the source form determination module 1306 is also used to: obtain the target matching attribute value corresponding to the target entity matching attribute from the target form; for each candidate form, determine the source matching attribute value corresponding to the source entity matching attribute from the candidate form; compare the source matching attribute value with the target matching attribute value, and if the source matching attribute value is the same as the target matching attribute, determine the candidate form as the source form.
[0132] In one embodiment, the mapping module 1308 is also used for: when the mapping scenario is writing, mapping the source mapping attribute value corresponding to the source mapping attribute in the mapping relationship in the source form to the target mapping attribute value corresponding to the target mapping attribute in the mapping relationship in the target form; when the mapping scenario is writing back, mapping the target mapping attribute value corresponding to the target mapping attribute in the target form to the source mapping attribute value corresponding to the source mapping attribute in the source form.
[0133] In one embodiment, the mapping module 1308 is further used to: map the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row to the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row; map the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row to the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row.
[0134] Each module in the above data mapping device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0135] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data mapping method is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0136] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0137] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0138] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0139] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0141] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0142] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data mapping method, characterized in that: The method comprises: Obtain a target form and a target type corresponding to the target form; Based on the target type, determining a target mapping rule corresponding to the target form; Determine a source form corresponding to the target form based on the form matching relationship in the target mapping rule; Based on the mapping scenarios and mapping relationships in the target mapping rules, data mapping is performed on the target form and the source form.
2. The method according to claim 1, characterized in that The determining, based on the target type, a target mapping rule corresponding to the target form includes: Based on the target type, determining a plurality of candidate mapping rule identifiers; the candidate mapping rule identifiers include the target type and the candidate type; In the case that the multiple candidate types are all different, determining the candidate mapping rules corresponding to the multiple candidate mapping rule identifiers as the target mapping rules; In the case that the same candidate type exists, the target mapping rule corresponding to the target form is determined based on the mapping rule filtering condition in the candidate mapping rule.
3. The method according to claim 1, characterized in that The form matching relationship includes a form matching type, a source entity matching attribute, and a target entity matching attribute; and determining the source form corresponding to the target form based on the form matching relationship in the target mapping rule includes: Based on the source type in the target mapping rule, obtaining a candidate form corresponding to the source type; Based on the form matching type, determining a form to be matched from the candidate forms and the target form; In a case where the form to be matched is the target form, determining a source form corresponding to the target form based on the target entity matching attribute and the target form; In the case that the form to be matched is the candidate form, a source form corresponding to the target form is determined based on the source entity matching attribute and the candidate form.
4. The method according to claim 3, characterized in that In the case where the form to be matched is the candidate form, determining the source form corresponding to the target form based on the source entity matching attribute and the candidate form includes: Obtaining a target matching attribute value corresponding to the target entity matching attribute from the target form; For each of the candidate forms, determining a source matching attribute value corresponding to the source entity matching attribute from the candidate form; The source matching attribute value is compared with the target matching attribute value, and if the source matching attribute value is the same as the target matching attribute, the candidate form is determined as the source form.
5. The method according to claim 1, characterized in that The performing data mapping on the target form and the source form based on the mapping scenario and the mapping relationship in the target mapping rule includes: In the case where the mapping scenario is writing, mapping the source mapping attribute value corresponding to the source mapping attribute in the mapping relationship in the source form to the target mapping attribute value corresponding to the target mapping attribute in the mapping relationship in the target form; In the case where the mapping scenario is reverse writing, the target mapping attribute value corresponding to the target mapping attribute in the target form is mapped to the source mapping attribute value corresponding to the source mapping attribute in the source form.
6. The method according to claim 5, characterized in that In the case where the mapping relationship is an entry mapping relationship, the source mapping attribute includes a source mapping entry row and a source mapping field, and the target mapping attribute includes a target entry row and a target mapping field; mapping the source mapping attribute value corresponding to the source mapping attribute in the mapping relationship in the source form to the target mapping attribute value corresponding to the target mapping attribute in the mapping relationship in the target form includes: Mapping the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row to the target mapping attribute value corresponding to the target mapping field in the target form in the target entry row; The mapping of the target mapping attribute value corresponding to the target mapping attribute in the target form to the source mapping attribute value corresponding to the source mapping attribute in the source form includes: The target mapping attribute value corresponding to the target mapping field in the target form in the target entry row is mapped to the source mapping attribute value corresponding to the source mapping field in the source form in the source mapping entry row.
7. A data mapping device, characterized in that: The device comprises: An acquisition module, used to acquire a target form and a target type corresponding to the target form; A mapping rule determination module, used to determine a target mapping rule corresponding to the target form based on the target type; A source form determination module, used to determine a source form corresponding to the target form based on the form matching relationship in the target mapping rule; A mapping module is used to perform data mapping between the target form and the source form based on the mapping scenario and mapping relationship in the target mapping rule.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.