CN115543485A - Data conversion configuration generation method and device, computer equipment and medium - Google Patents

Data conversion configuration generation method and device, computer equipment and medium Download PDF

Info

Publication number
CN115543485A
CN115543485A CN202211302604.2A CN202211302604A CN115543485A CN 115543485 A CN115543485 A CN 115543485A CN 202211302604 A CN202211302604 A CN 202211302604A CN 115543485 A CN115543485 A CN 115543485A
Authority
CN
China
Prior art keywords
mapping
target
data
source
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211302604.2A
Other languages
Chinese (zh)
Other versions
CN115543485B (en
Inventor
刘寒
高歌
顾明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN202211302604.2A priority Critical patent/CN115543485B/en
Publication of CN115543485A publication Critical patent/CN115543485A/en
Application granted granted Critical
Publication of CN115543485B publication Critical patent/CN115543485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition

Abstract

The invention provides a data conversion configuration generation method, a data conversion configuration generation device, computer equipment and a medium, wherein the data conversion configuration generation method comprises the following steps: acquiring a requirement list and a preset knowledge base of user data exchange; determining a source mapping of each demand item to a source format and a target mapping thereof to a target format based on a knowledge base; generating a transfer mapping set from the data type in the source format to the data type in the target format based on the source mapping and the target mapping corresponding to each demand item; and generating a data conversion configuration which accords with the requirement list based on the transfer mapping set. By the method and the device, the user requirement item is taken as a center, multiple data modes can be simultaneously expanded and associated, the data provider and the data user do not need to modify the software of the data provider and the data user, and multiple different configuration file formats can be output by using consistent transfer mapping content, so that the development workload required by adapting to different software is reduced, and the user experience is improved.

Description

Data conversion configuration generation method and device, computer equipment and medium
Technical Field
The invention relates to the technical field of data exchange in the engineering field, in particular to a data conversion configuration generation method, a data conversion configuration generation device, computer equipment and a medium.
Background
Data conversion is typically performed by a format conversion program. The format conversion program typically needs to provide the correct configuration file to function properly. The two data formats have different respective data types (object type, geometry type, attribute type, etc.), and there is a mapping in the configuration file from the source data format to the target data format (object-object mapping, geometry-geometry mapping, attribute-attribute mapping, etc.). The format conversion program can automatically perform data conversion between data file instances according to the configuration file, and rewrite the information in the source format data into a specified form or a specified position in the target format data.
In the related art, an IDS (Information Delivery Specification) method is intended to be a unified data exchange interoperability definition format, using a unified rule set in terms of software capability validation, data creation and supplementation, data conversion configuration, data content verification. However, this method requires that both the upstream and downstream software modify their own software programs, using the same configuration file in multiple kinds of software; all requirements and configurations are defined centered around a unified object format (IFC), without compromising on the respective properties of the upstream and downstream software.
Disclosure of Invention
Therefore, the technical problem to be solved by the present invention is to overcome the defect that the data conversion configuration is not formulated and the software capability is verified for the user-defined information manual in the prior art, thereby providing a data conversion configuration generation method, apparatus, computer device and medium.
With reference to the first aspect, the present invention provides a data conversion configuration generation method, where the method includes:
acquiring a requirement list and a preset knowledge base of user data exchange, wherein the requirement list comprises a plurality of requirement items, and the knowledge base stores source format definition of source data, target format definition of target data and definition of conversion capacity between the source format and the target format;
determining a source mapping of each requirement item to a source format and a target mapping thereof to a target format based on the knowledge base;
generating a transfer mapping set from the data type of the source format to the data type of the target format based on the source mapping and the target mapping corresponding to each requirement item;
and generating a data conversion configuration which accords with the requirement list based on the transmission mapping set.
In the mode, the user requirement item is taken as a center, multiple data modes can be simultaneously expanded and associated, the data provider and the data user do not need to modify the software of the data provider and the data user, and multiple different configuration file formats can be output by using consistent transfer mapping content, so that the development workload required by adapting to different software is reduced. The data format is clearly defined by using the knowledge base, the capacity range of format conversion software is determined, data conversion configuration meeting the data exchange requirement is conveniently screened, and the use experience of a user is improved.
With reference to the first aspect, in a first embodiment of the first aspect, the determining, based on the knowledge base, a source mapping of each requirement item to a source format and a target mapping thereof to a target format includes:
determining a source mapping of the requirement item to a source format based on the requirement item and the source format definition, wherein the source mapping is used for representing the mapping relation between the requirement item and one or more data type entries in the source format definition;
and determining a target mapping of the requirement item to the target format definition based on the requirement item and the target format definition, wherein the target mapping is used for representing the mapping relation between the requirement item and one or more data type entries in the target format definition.
With reference to the first embodiment of the first aspect, in a second embodiment of the first aspect, the generating a set of transfer mappings from data types in a source format to data types in a target format based on a source mapping and a target mapping corresponding to each requirement item includes:
sequentially extracting the current source data type from the source mapping corresponding to the current demand item;
extracting all target data types in the target mapping corresponding to the current demand item to form a current target type set;
judging whether the current source data type appears for the first time;
and when the current source data type appears for the first time, adding the mapping relation between the current source data type and each target data type in the current target type set into the transfer mapping set, and returning to the step of sequentially extracting the current source data type from the mapping corresponding to the current demand item until each demand item is traversed and completed.
With reference to the second embodiment of the first aspect, in a third embodiment of the first aspect, the generating a set of transfer mappings from data types in a source format to data types in a target format based on a source mapping and a target mapping corresponding to each requirement item further includes:
and when the current source data type does not appear for the first time, eliminating the mapping relation of the target data type without intersection with the current target type set in the transfer mapping set so as to update the transfer mapping set, and returning to the step of sequentially extracting the current source data type from the mapping corresponding to the current demand item until each demand item is traversed and completed.
With reference to the first aspect, in a fourth embodiment of the first aspect, before generating, based on the transfer mapping set, a data conversion configuration that conforms to the requirement list, the method further includes:
based on the knowledge base, checking the transfer mapping set;
and when the transmission mapping set passes the verification, generating data conversion configuration which accords with the requirement list based on the transmission mapping set.
With reference to the fourth embodiment of the first aspect, in a fifth embodiment of the first aspect, the verifying the transfer mapping set includes:
determining whether the transfer mapping satisfies constraints of the knowledge base based on the knowledge base;
determining that the verification fails when at least one transfer mapping does not satisfy the constraints of the knowledge base on the transfer mapping;
determining that the transfer mapping currently passes verification when the transfer mapping satisfies the constraints of the knowledge base on the transfer mapping;
judging whether a conflict exists in the transmission mapping set;
when a conflict exists in the transfer mapping set, determining that the verification fails;
and when no conflict exists in the transfer mapping set, determining that the transfer mapping set passes the check.
With reference to the first aspect, in a sixth embodiment of the first aspect, the generating a data conversion configuration conforming to the requirement list based on the transfer mapping set includes:
and determining a configuration file format corresponding to the requirement list based on the knowledge base, and writing the transfer mapping into the configuration file format to obtain data conversion configuration conforming to the requirement list.
In a second aspect of the present invention, the present invention also provides a data conversion configuration generation apparatus, comprising:
the system comprises a demand acquisition unit, a processing unit and a processing unit, wherein the demand acquisition unit is used for acquiring a demand list and a preset knowledge base of user data exchange, the demand list comprises a plurality of demand items, and the knowledge base stores a source format definition of source data, a target format definition of target data and a definition of conversion capacity between a source format and a target format;
the mapping determining unit is used for determining a source mapping from each demand item to a source format and a target mapping from each demand item to a target format based on the knowledge base;
the mapping transmission unit is used for generating a transmission mapping set from the data type in the source format to the data type in the target format based on the source mapping and the target mapping corresponding to each demand item;
and the configuration generating unit is used for generating data conversion configuration which accords with the requirement list based on the transmission mapping set.
With reference to the second aspect, in a first embodiment of the second aspect, the mapping determining unit includes:
a source mapping determining unit, configured to determine, based on the requirement item and a source format definition, a source mapping of the requirement item to a source format, where the source mapping is used to represent a mapping relationship between the requirement item and one or more data type entries in the source format definition;
and the target mapping determining unit is used for determining a target mapping from the requirement item to the target format definition based on the requirement item and the target format definition, and the target mapping is used for representing the mapping relation between the requirement item and one or more data type entries in the target format definition.
With reference to the first embodiment of the second aspect, in a second embodiment of the second aspect, the mapping passing unit includes:
the source mapping extraction unit is used for sequentially extracting the current source data type from the source mapping corresponding to the current demand item;
the target mapping extraction unit is used for extracting all target data types in the target mapping corresponding to the current demand item to form a current target type set;
the first unit is used for judging whether the current source data type appears for the first time;
and the first traversal unit is used for adding the mapping relation between the current source data type and each target data type in the current target type set into the transfer mapping set when the current source data type appears for the first time, and returning to the step of sequentially extracting the current source data type from the mapping corresponding to the current demand item until each demand item is traversed.
With reference to the second embodiment of the second aspect, in a third embodiment of the second aspect, the mapping passing unit further includes:
and the second traversal unit is used for eliminating the mapping relation of the target data type which does not have intersection with the current target type set in the transfer mapping set when the current source data type does not appear for the first time so as to update the transfer mapping set, and returning to the step of sequentially extracting the current source data type from the mapping corresponding to the current demand item until the traversal of each demand item is completed.
With reference to the second aspect, in a fourth embodiment of the second aspect, the apparatus further comprises:
the checking unit is used for checking the transmission mapping set; and when the transmission mapping set passes the verification, generating data conversion configuration which accords with the requirement list based on the transmission mapping set.
With reference to the fourth embodiment of the second aspect, in a fifth embodiment of the second aspect, the verification unit includes:
a second judging unit, configured to judge whether the transfer mapping satisfies a constraint of the knowledge base based on the knowledge base;
a first check failure unit which determines that the check fails when at least one transfer mapping does not satisfy the constraint of the knowledge base on the transfer mapping;
a first check passing unit, which determines that the transfer mapping passes the check currently when the transfer mapping satisfies the constraint of the knowledge base on the transfer mapping;
a third judging unit, configured to judge whether a conflict exists in the transfer mapping set;
the second check failure unit is used for determining that the check fails when a conflict exists in the transmission mapping set;
and the second check passing unit is used for determining that the transfer mapping set passes the check when no conflict exists in the transfer mapping set.
The verification passing unit is used for determining that the transmission mapping set passes the verification when all the source formats have corresponding target formats;
and the verification failure unit is used for determining verification failure when at least one source format does not have a corresponding target format.
With reference to the second aspect, in a sixth embodiment of the second aspect, the configuration generating unit includes:
and the configuration generation subunit is used for determining a configuration file format corresponding to the requirement list based on the knowledge base, and writing the transfer mapping into the configuration file format to obtain data conversion configuration conforming to the requirement list.
According to a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the data conversion configuration generation method in any one of the first aspect and the optional embodiments thereof.
According to a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, which stores computer instructions for causing the computer to execute the data conversion configuration generation method of any one of the first aspect and the optional embodiments thereof.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a proposed data conversion configuration generation method according to an exemplary embodiment.
Fig. 2 is a flow diagram of generation and verification of a transfer map, according to an example embodiment.
Fig. 3 is a block diagram of a data conversion configuration generation apparatus according to an exemplary embodiment.
Fig. 4 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the related art, a unified rule set is used in software capability confirmation, data creation and supplement, data conversion configuration, and data content verification. However, this method requires that both the upstream and downstream software modify their own software programs, using the same configuration file in multiple kinds of software; all requirements and configurations are defined centered around a unified object format (IFC), without compromising on the respective characteristics of the upstream and downstream software.
In order to solve the foregoing problems, an embodiment of the present invention provides a data conversion configuration generating method, which is used in a computer device, where an execution main body of the data conversion configuration generating method may be a data conversion configuration generating apparatus, and the apparatus may be implemented as part or all of the computer device in a software, hardware, or a combination of software and hardware, where the computer device may be a terminal, a client, or a server, and the server may be one server or a server cluster composed of multiple servers, and the terminal in this embodiment of the present invention may be another intelligent hardware device such as a smart phone, a personal computer, a tablet computer, a wearable device, and an intelligent robot. In the following method embodiments, the execution subject is a computer device as an example.
The computer device in the embodiment is suitable for a use scenario of data exchange in the engineering field. The data conversion configuration generation method provided by the invention can simultaneously expand and associate multiple data modes by taking the user requirement item as the center, does not need the data provider and the data user to modify the software per se, and can output multiple different configuration file formats by utilizing consistent transfer mapping content, thereby reducing the development workload required by adapting to different software. By clearly defining the data format, whether the capability range of format conversion software can meet the data exchange requirement is further judged, and the use experience of a user is improved.
Fig. 1 is a flowchart of a proposed data conversion configuration generation method according to an exemplary embodiment. As shown in fig. 1, the data conversion arrangement generating method includes the following steps S101 to S104.
In step S101, a requirement list and a predetermined knowledge base for user data exchange are obtained.
In the embodiment of the invention, a plurality of requirement items are included in the requirement list. The knowledge base stores the source format definition of the source data, the target format definition of the target data and the definition of the conversion capability between the source format and the target format.
In one example, the list of requirements for user data exchange may be a list of requirements items entered by the end user (or loaded from a file). Each requirement item is a description of an object from the natural language document, or some property it has, to the physical world. The user enumerates all the physical objects involved in the requirements document, as well as the physical properties each physical object has, and enters them into the facility.
In another example, the source format definition includes: a list of all data types (object type, geometric type, attribute type, value type, etc.) in the source data format, and a list of classification relationships (parent-child classes) and dependencies (e.g., geometric types used by objects, attribute items possessed by objects, value types and value ranges of attribute items) between them, etc.
The object format definition includes: a list of all data types (object type, geometric type, attribute type, value type, etc.) in the target data format, and a list of classification relationships (parent-child classes) and dependencies (e.g., geometric types used by objects, attribute items possessed by objects, value types and value ranges of attribute items) between them, etc.
The definition of the conversion capability from the source format to the target format comprises the following steps: the definition of the capability range of the format conversion program to perform conversion between the two formats is specifically represented as the corresponding relation between the data type in the source format definition and the data type in the target format definition. The method is divided into a fixed capability definition and a configurable capability definition. Wherein the fixed capability definition comprises: a certain data type (and subclasses thereof) in the source data format can be converted to a data type in the target data format and is fixed and not configurable. Configurable capability definitions include: a data type in the source data format (and subclasses thereof) can be converted to multiple data types in the target data format, one of which can be specified by a configuration item in the data conversion configuration.
In step S102, a source mapping of each demand item to a source format and a target mapping thereof to a target format are determined based on the knowledge base.
In the embodiment of the invention, by utilizing the knowledge base, the knowledge only needs one-time preparation work for each format conversion program for converting between two formats, and all subsequent configuration generation and verification work for the format conversion program can be carried out based on the same piece of knowledge.
In an example, the mapping of requirements items to source format definitions, target format definitions may be loaded by a user using an interactive interface (or from a file).
The mapping of the requirement items to the source format definition is typically determined by the data provider (creator, editor, or collector) and represents the expression(s) of each of the requirement items in the source data format in the currently acquired data. Each requirement item corresponds to one or more data type entries in the source format definition
The mapping of the requirement items to the target format definitions is typically determined by the data consumer, representing the verification rules for the target format data output for the data conversion result, or the data read constraint rules for other applications that subsequently use this data. Each requirement item corresponds to one or more data type entries in the target format definition.
In step S103, a set of transfer mappings from data types in the source format to data types in the target format is generated based on the source mapping and the target mapping corresponding to each requirement item.
In the embodiment of the invention, each requirement item is used as a transfer to automatically generate a mapping from a data type in a source format to a data type in a target format, and each requirement item may be connected to one or more data types in the source format and one or more data types in the target format. By taking the user requirement item as a center, the mapping content is transferred consistently, and multiple data modes are related in an expanded mode, so that the use experience of the user is improved.
In step S104, a data conversion configuration conforming to the requirement list is generated based on the transfer mapping set.
In the embodiment of the invention, a plurality of different configuration file formats are output by utilizing consistent transfer mapping content, thereby reducing the development workload required by adapting to different software.
By the embodiment, the user requirement items are taken as centers, multiple data modes can be simultaneously expanded and associated, the data provider and the data user do not need to modify the software of the data provider and the data user, and multiple different configuration file formats can be output by using consistent transfer mapping content, so that the development workload required by adapting to different software is reduced. The data format is clearly defined by using the knowledge base, the capacity range of format conversion software is determined, data conversion configuration meeting the data exchange requirement is conveniently screened, and the use experience of a user is improved.
In one embodiment, determining a source mapping of each requirement item to a source format and a target mapping thereof to a target format based on a knowledge base comprises: determining a source mapping from the requirement item to a source format based on the requirement item and the source format definition, wherein the source mapping is used for representing the mapping relation between the requirement item and one or more data type entries in the source format definition; and determining a target mapping of the requirement item to the target format definition based on the requirement item and the target format definition, wherein the target mapping is used for expressing the mapping relation of the requirement item and one or more data type entries in the target format definition.
In one example, determining a source mapping of each demand item to a source format and a target mapping thereof to a target format may include: the user utilizes the interactive interface (or loads from a file) to require the mapping of items to the source format definition, the target format definition. The mapping of the requirement items to the source format definition is generally determined by a data provider (creator, editor, or collector), and represents the expression manner(s) of each of the requirement items in the source data format in the currently acquired data, where each requirement item corresponds to one or more data type entries in the source format definition. The mapping of requirement items to target format definitions is generally determined by the data consumer, representing either a verification rule for the target format data output for the data conversion result, or a data read constraint rule for other applications that subsequently use this data, each requirement item corresponding to one or more data type entries in the target format definition.
The following embodiments will specifically describe the generation process of the transfer mapping from the data type of the source format to the data type of the target format.
In step S201, the current source data type is sequentially extracted from the source map corresponding to the current demand item.
In step S202, all target data types in the target map corresponding to the current demand item are extracted to form a current target type set.
In step S203, it is determined whether the current source data type is present for the first time.
When the current source data type appears for the first time, in step S204, the mapping relationship between the current source data type and each target data type in the current target type set is added to the transfer mapping set, and the step S201 is returned to extract the current source data type from the mapping corresponding to the current requirement item in sequence until each requirement item is traversed.
In another scenario, when the current source data type does not appear for the first time, in step S205, the mapping relationship of the target data type that does not have an intersection with the current target type set in the transfer mapping set is removed to update the transfer mapping set, and step S201 is returned to extract the current source data type from the mapping corresponding to the current requirement item in sequence until each requirement item is traversed completely.
In one example, FIG. 3 is a data structure diagram of a proposed transfer map according to an example.
Based on the data structure diagram of the transfer map shown in fig. 3, the transfer map generation may include:
1) And establishing an empty transfer mapping, wherein each position on the left side of the data structure is a data type in the source format, and each position on the right side of the data structure is a set of data types in the target format.
2) For each demand item, steps 3) to 8) are performed.
3) And executing the steps 4) to 7) for each source data type in the source mapping of the current demand item.
4) All target data types in the target map of the current demand item are taken to form a current target type set.
5) If the left side of the transfer mapping does not have the current source data type, adding a mapping of 'current source data type-current target type set' into the transfer mapping, and jumping to 7); otherwise execute 6)
6) And if the current source data type exists on the left side of the transfer mapping, solving the intersection of the target type set existing on the right side of the transfer mapping and the current target type set, and writing the intersection into the mapping as a new right target type set.
7) The loop continues for the next source data type.
8) The loop for the next demand item continues to be executed.
In another example, referring to FIG. 2, FIG. 2 illustrates a generation check process of a transfer map. The setting requirement items comprise 1, 2 and 3 …, the source types comprise a, b and c …, and the target types comprise alpha, beta and gamma …. If the source type a is converted into alpha in the transfer mapping generated based on the requirement item 1, the source type a is converted into beta in the transfer mapping generated based on the requirement item 2, and the alpha and the beta have no parent-child relationship, the requirement item 1 and the requirement item 2 are contradictory, and an error is reported. If the source type a is converted into alpha and beta in the transfer mapping generated based on the requirement item 1, and the source type a is converted into beta and gamma in the transfer mapping generated based on the requirement item 2, then taking the intersection to obtain the conversion of the source type a into alpha.
By the embodiment, the user requirement item is taken as the center, the transfer mapping from the source data type to different target data types is realized by using the consistent transfer mapping content, multiple data modes can be simultaneously expanded and associated, the same rule set format is not required, the development and use share of format conversion software is reduced, and the data format conversion efficiency is improved.
In an embodiment, before generating the data conversion configuration conforming to the requirement list based on the transfer mapping set, the method further comprises: checking the transfer mapping set; and when the transfer mapping set passes the verification, generating data conversion configuration according with the requirement list based on the transfer mapping set. Wherein, the checking the transfer mapping set comprises: based on the knowledge base, judging whether the transfer mapping meets the constraint of the knowledge base; determining that the verification fails when at least one transfer mapping does not satisfy the constraints of the knowledge base on the transfer mapping; when the transfer mapping meets the constraint of the knowledge base on the transfer mapping, determining that the current transfer mapping passes verification; judging whether conflicts exist in the transmission mapping set or not; when a conflict exists in the transmission mapping set, determining that the verification fails; and when no conflict exists in the transfer mapping set, determining that the transfer mapping set passes the check.
In the embodiment of the invention, the generated transfer mapping set is verified, and the source format corresponds to the target format to form the correct transfer mapping, so that the accuracy of the transfer mapping is further ensured, and the accuracy of the data conversion configuration written in the transfer mapping is further ensured.
In one example, automatic verification of the generated transfer mapping may construct constraints that include:
1) Non-null property: for each source data type to the left of the transfer map, its corresponding set of target types to the right should be non-empty.
2) The parent-child classes are consistent: for each source data type to the left of the transfer map, if it is a child, and there is a transfer map also for the parent in the source data format, the target data type for the child should be the same as, or a child of, the target data type for the parent.
3) Capacity constraint: for a pair of source data type-target data type in the transfer map, there should be an entry in the translation capability definition that makes the source data type of the transfer map the same as or a subclass of the source data type defined for the capability, and the target data type of the transfer map the same as or a subclass of the target data type defined for the capability.
And when the constraint is not satisfied, reporting an error and prompting a mapping conflict.
In one embodiment, generating a data transformation configuration that conforms to a requirement list based on a set of transfer mappings includes: and determining a configuration file format corresponding to the requirement list based on the knowledge base, and writing the transfer mapping into the configuration file format to obtain data conversion configuration conforming to the requirement list.
In the embodiment of the invention, the content of the transfer mapping is written into a specific configuration file format and is output as a result, and a plurality of different configuration file formats are output by using the consistent transfer mapping content, thereby reducing the development workload required for adapting to different software.
Based on the same inventive concept, the invention also provides a data conversion configuration generation device.
Fig. 3 is a block diagram of a data conversion configuration generation apparatus according to an exemplary embodiment. As shown in fig. 3, the data conversion configuration generating apparatus includes a requirement acquiring unit 301, a mapping determining unit 302, a mapping passing unit 303, and a configuration generating unit 304.
The requirement obtaining unit 301 is configured to obtain a requirement list for user data exchange and a preset knowledge base, where the requirement list includes a plurality of requirement items, and the knowledge base stores a source format definition of source data, a target format definition of target data, and a definition of conversion capability between the source format and the target format.
A mapping determining unit 302, configured to determine a source mapping of each requirement item to a source format and a target mapping thereof to a target format based on the knowledge base.
A mapping transferring unit 303, configured to generate a set of transferring mappings from a data type in a source format to a data type in a target format based on the source mapping and the target mapping corresponding to each requirement item.
And a configuration generating unit 304, configured to generate a data conversion configuration that meets the requirement list based on the transfer mapping set.
In an embodiment, the mapping determining unit 302 includes: the source mapping determining unit is used for determining a source mapping from the requirement item to the source format based on the requirement item and the source format definition, and the source mapping is used for expressing the mapping relation between the requirement item and one or more data type entries in the source format definition; and the target mapping determining unit is used for determining a target mapping from the requirement item to the target format definition based on the requirement item and the target format definition, and the target mapping is used for expressing the mapping relation between the requirement item and one or more data type entries in the target format definition.
In another embodiment, the mapping passing unit 303 includes: the source mapping extraction unit is used for sequentially extracting the current source data type from the source mapping corresponding to the current demand item; the target mapping extraction unit is used for extracting all target data types in the target mapping corresponding to the current demand item to form a current target type set; the first unit is used for judging whether the current source data type appears for the first time; and the first traversal unit is used for adding the mapping relation between the current source data type and each target data type in the current target type set into the transfer mapping set when the current source data type appears for the first time, and returning to the step of extracting the current source data type from the mapping corresponding to the current demand item in sequence until each demand item is traversed.
In another embodiment, the mapping passing unit 303 further includes: and the second traversal unit is used for eliminating the mapping relation of the target data type which does not have intersection with the current target type set in the transfer mapping set when the current source data type does not appear for the first time so as to update the transfer mapping set, and returning to the step of sequentially extracting the current source data type from the mapping corresponding to the current demand item until the traversal of each demand item is completed.
In yet another embodiment, the apparatus further comprises: the checking unit is used for checking the transmission mapping set; and when the transmission mapping set passes the verification, generating the data conversion configuration which accords with the requirement list based on the transmission mapping set.
In yet another embodiment, a verification unit includes: a second judging unit, configured to judge whether the transfer mapping satisfies a constraint of the knowledge base based on the knowledge base; a first check failure unit which determines that the check fails when at least one transfer mapping does not satisfy the constraint of the knowledge base on the transfer mapping; a first check passing unit, which determines that the transfer mapping passes the check currently when the transfer mapping satisfies the constraint of the knowledge base on the transfer mapping; a third judging unit, configured to judge whether a conflict exists in the transfer mapping set; the second check failure unit is used for determining that the check fails when a conflict exists in the transmission mapping set; and the second check passing unit is used for determining that the transfer mapping set passes the check when no conflict exists in the transfer mapping set.
In a further embodiment, the configuration generation unit 304 includes: and the configuration generation subunit is used for determining a configuration file format corresponding to the demand list based on the knowledge base, and writing the transfer mapping into the configuration file format to obtain the data conversion configuration conforming to the demand list.
For specific limitations and beneficial effects of the data conversion configuration generation apparatus, reference may be made to the above limitations on the data conversion configuration generation method, which is not described herein again. The various modules described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 4 is a schematic diagram of a hardware structure of a computer device according to an exemplary embodiment. As shown in fig. 4, the apparatus includes one or more processors 410 and a storage 420, where the storage 420 includes a persistent memory, a volatile memory, and a hard disk, and one processor 410 is taken as an example in fig. 4. The apparatus may further include: an input device 430 and an output device 440.
The processor 410, the memory 420, the input device 430, and the output device 440 may be connected by a bus or other means, such as the bus connection in fig. 4.
Processor 410 may be a Central Processing Unit (CPU). The Processor 410 may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 420, which is a non-transitory computer-readable storage medium including a persistent memory, a volatile memory, and a hard disk, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the service management method in the embodiment of the present application. The processor 410 executes various functional applications of the server and data processing by executing non-transitory software programs, instructions, and modules stored in the memory 420, that is, implements any of the above-described data conversion configuration generation methods.
The memory 420 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data used as needed or desired, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 420 may optionally include memory located remotely from processor 410, which may be connected to a data processing device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 430 may receive input numeric or character information and generate key signal inputs related to user settings and function control. The output device 440 may include a display device such as a display screen.
One or more modules are stored in the memory 420, which when executed by the one or more processors 410 perform the methods shown in fig. 1-2.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Details of the technique that are not described in detail in the present embodiment may be specifically referred to the related description in the embodiments shown in fig. 1 to fig. 2.
Embodiments of the present invention further provide a non-transitory computer storage medium, where computer-executable instructions are stored, and the computer-executable instructions may execute the authentication method in any of the method embodiments. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.

Claims (10)

1. A method for generating a data conversion configuration, the method comprising:
acquiring a requirement list and a preset knowledge base of user data exchange, wherein the requirement list comprises a plurality of requirement items, and the knowledge base stores source format definition of source data, target format definition of target data and definition of conversion capacity between the source format and the target format;
determining a source mapping of each demand item to a source format and a target mapping thereof to a target format based on the knowledge base;
generating a transfer mapping set from the data type in the source format to the data type in the target format based on the source mapping and the target mapping corresponding to each demand item;
and generating a data conversion configuration which accords with the requirement list based on the transfer mapping set.
2. The method of claim 1, wherein determining a source mapping of each demand item to a source format and a target mapping thereof to a target format based on the knowledge base comprises:
determining a source mapping of the requirement item to a source format based on the requirement item and the source format definition, wherein the source mapping is used for representing the mapping relation between the requirement item and one or more data type entries in the source format definition;
and determining a target mapping of the requirement item to the target format definition based on the requirement item and the target format definition, wherein the target mapping is used for representing the mapping relation between the requirement item and one or more data type entries in the target format definition.
3. The method of claim 2, wherein generating a set of transfer mappings from data types in a source format to data types in a target format based on the source mapping and the target mapping corresponding to each requirement item comprises:
sequentially extracting the current source data type from the source mapping corresponding to the current demand item;
extracting all target data types in the target mapping corresponding to the current demand item to form a current target type set;
judging whether the current source data type appears for the first time;
when the current source data type appears for the first time, adding the mapping relation between the current source data type and each target data type in the current target type set into the transfer mapping set, and returning to the step of extracting the current source data type from the mapping corresponding to the current demand item in sequence until each demand item is traversed and completed.
4. The method of claim 3, wherein generating a set of transfer mappings from data types in a source format to data types in a target format based on the source mapping and the target mapping corresponding to each requirement item further comprises:
and when the current source data type does not appear for the first time, eliminating the mapping relation of the target data type without intersection with the current target type set in the transfer mapping set so as to update the transfer mapping set, and returning to the step of sequentially extracting the current source data type from the mapping corresponding to the current demand item until each demand item is traversed and completed.
5. The method of claim 1, wherein prior to generating a data transformation configuration that conforms to the requirement list based on the set of transfer mappings, the method further comprises:
based on the knowledge base, checking the transfer mapping set;
and when the transmission mapping set passes the verification, generating data conversion configuration which accords with the requirement list based on the transmission mapping set.
6. The method of claim 5, wherein the checking the set of transfer mappings comprises:
determining whether the transfer mapping satisfies constraints of the knowledge base based on the knowledge base;
determining that the verification fails when at least one transfer mapping does not satisfy the constraints of the knowledge base on the transfer mapping;
determining that the transfer mapping currently passes verification when the transfer mapping satisfies the constraints of the knowledge base on the transfer mapping;
judging whether a conflict exists in the transmission mapping set;
when a conflict exists in the transfer mapping set, determining that the verification fails;
and when no conflict exists in the transfer mapping set, determining that the transfer mapping set passes the check.
7. The method of claim 1, wherein generating a data transformation configuration that conforms to the requirement list based on the set of transfer mappings comprises:
and determining a configuration file format corresponding to the requirement list based on the knowledge base, and writing the transfer mapping into the configuration file format to obtain data conversion configuration conforming to the requirement list.
8. An apparatus for generating a data conversion configuration, the apparatus comprising:
the system comprises a demand acquisition unit, a processing unit and a processing unit, wherein the demand acquisition unit is used for acquiring a demand list and a preset knowledge base for user data exchange, the demand list comprises a plurality of demand items, and the knowledge base stores a source format definition of source data, a target format definition of target data and a definition of conversion capacity between a source format and a target format;
the mapping determining unit is used for determining a source mapping from each demand item to a source format and a target mapping from each demand item to a target format based on the knowledge base;
the mapping transmission unit is used for generating a transmission mapping set from the data type in the source format to the data type in the target format based on the source mapping and the target mapping corresponding to each demand item;
and the configuration generating unit is used for generating data conversion configuration which accords with the requirement list based on the transmission mapping set.
9. A computer device comprising a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the data conversion configuration generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions for causing a computer to perform the data conversion configuration generation method of any one of claims 1-7.
CN202211302604.2A 2022-10-24 2022-10-24 Data conversion configuration generation method, device, computer equipment and medium Active CN115543485B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211302604.2A CN115543485B (en) 2022-10-24 2022-10-24 Data conversion configuration generation method, device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211302604.2A CN115543485B (en) 2022-10-24 2022-10-24 Data conversion configuration generation method, device, computer equipment and medium

Publications (2)

Publication Number Publication Date
CN115543485A true CN115543485A (en) 2022-12-30
CN115543485B CN115543485B (en) 2023-06-30

Family

ID=84719323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211302604.2A Active CN115543485B (en) 2022-10-24 2022-10-24 Data conversion configuration generation method, device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN115543485B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050080755A1 (en) * 2000-01-27 2005-04-14 Kazuyuki Aoyama System for getting conversion rules
US20090228678A1 (en) * 2008-03-06 2009-09-10 Hideki Takano Mapping definition creation system and mapping definition creation program
CN111143446A (en) * 2019-11-26 2020-05-12 贝壳技术有限公司 Data structure conversion processing method and device of data object and electronic equipment
CN111628956A (en) * 2019-02-28 2020-09-04 阿里巴巴集团控股有限公司 Format conversion method, device and system for network request transmission data
CN113656377A (en) * 2021-08-23 2021-11-16 深圳市万睿智能科技有限公司 Automatic matching method and device for data migration, computer equipment and storage medium
CN115221113A (en) * 2021-04-20 2022-10-21 华为技术有限公司 Data format conversion method, device, equipment and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050080755A1 (en) * 2000-01-27 2005-04-14 Kazuyuki Aoyama System for getting conversion rules
US20090228678A1 (en) * 2008-03-06 2009-09-10 Hideki Takano Mapping definition creation system and mapping definition creation program
CN111628956A (en) * 2019-02-28 2020-09-04 阿里巴巴集团控股有限公司 Format conversion method, device and system for network request transmission data
CN111143446A (en) * 2019-11-26 2020-05-12 贝壳技术有限公司 Data structure conversion processing method and device of data object and electronic equipment
CN115221113A (en) * 2021-04-20 2022-10-21 华为技术有限公司 Data format conversion method, device, equipment and computer readable storage medium
CN113656377A (en) * 2021-08-23 2021-11-16 深圳市万睿智能科技有限公司 Automatic matching method and device for data migration, computer equipment and storage medium

Also Published As

Publication number Publication date
CN115543485B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN106874247B (en) Report generation method and device
WO2021189829A1 (en) Data query method and apparatus, electronic device, and storage medium
CN112650533B (en) Interface document generation method and device and terminal equipment
US20150331923A1 (en) Crm-based data migration system and method
CN111581920A (en) Document conversion method, device, equipment and computer storage medium
US7464099B2 (en) Method and system for transferring content from a database to a file
CN107515866B (en) Data operation method, device and system
CN113626223A (en) Interface calling method and device
CN105005543A (en) Interface generation apparatus and method
US20140095550A1 (en) Converting source objects to target objects
CN115599359A (en) Code generation method, device, equipment and medium
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN115543485B (en) Data conversion configuration generation method, device, computer equipment and medium
CN109150694A (en) Sending method, display methods and the server and mobile terminal of dynamic scene information
CN113722321A (en) Data export method and device and electronic equipment
CN114036180A (en) Report generation method, device, equipment and storage medium
CN116107971A (en) Model data processing method and device, electronic equipment and storage medium
CN104298490A (en) Service publication method and device based on service oriented architecture
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
CN113254455A (en) Dynamic configuration method and device of database, computer equipment and storage medium
CN112199529A (en) Picture processing method and device, electronic equipment and storage medium
CN113448960A (en) Method and device for importing form file
CN116755684B (en) OAS Schema generation method, device, equipment and medium
CN113609145B (en) Database processing method, device, electronic equipment, storage medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant