CN113419996A - Method, system, equipment and medium for converting metadata file - Google Patents

Method, system, equipment and medium for converting metadata file Download PDF

Info

Publication number
CN113419996A
CN113419996A CN202110594302.6A CN202110594302A CN113419996A CN 113419996 A CN113419996 A CN 113419996A CN 202110594302 A CN202110594302 A CN 202110594302A CN 113419996 A CN113419996 A CN 113419996A
Authority
CN
China
Prior art keywords
attribute
elements
input file
file
data
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.)
Pending
Application number
CN202110594302.6A
Other languages
Chinese (zh)
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.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
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 Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202110594302.6A priority Critical patent/CN113419996A/en
Publication of CN113419996A publication Critical patent/CN113419996A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a system, equipment and a storage medium for converting a metadata file, wherein the method comprises the following steps: in response to receiving an input file, judging whether an outermost label of the input file belongs to a label corresponding to a metadata file; responding to the fact that the outermost layer label of the input file belongs to a label corresponding to the metadata file, reading keywords in the input file, and judging whether the reference of each keyword is legal or not; responding to the fact that the quote of each keyword is legal, extracting data service elements and attribute elements of the input file, and carrying out classified assembly on the data service elements and the attribute elements to obtain intermediate data; and generating a target template according to the intermediate data, and filling corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data. The invention can automatically convert the metadata files in different specifications into the template with the preset format, thereby improving the efficiency of developers.

Description

Method, system, equipment and medium for converting metadata file
Technical Field
The present invention relates to the field of data conversion, and more particularly, to a method, system, computer device and readable medium for metadata file conversion.
Background
In the field of software development, RESTful style interface mode has been widely accepted by the public, and the accompanying JSON format response data is adopted by more and more developers. From the birth of RESTful, in order to unify the specific implementation of RESTful style, three standards with wide influence are generated together, namely, the OData (Open Data Protocol) standard introduced by microsoft, the OpenAPI specification and the Redfish specification referring to the two previous achievements.
The three specifications define a language and a model capable of describing JSON expression of the object, which can be simply called metadata, namely data for describing data. Metadata is published with the publishing of specifications in order to constrain the format of the data. A common format for metadata files is the CSDL of ODdata (containing xml and json formats, the yaml format data description model of OpenAPI.
Although some specifications, such as Redfish, provide a verification tool for returning results to data. But surprisingly, there is currently no tool that is capable of generating corresponding JSON instances based on a metadata model. This does bring great inconvenience to the developer, because this conversion process requires the developer to know the grammar rules of the metadata model very well, and manually add fields one by one according to the grammar rules to finally generate the template, and then perform data filling on the basis of the template. And grammar rules of different specifications are different, so that higher learning cost is required, and unnecessary troubles are brought to developers.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, a system, a computer device, and a computer-readable storage medium for metadata file conversion, which can automatically convert data model description files (i.e., metadata files) in different specifications into templates in example formats by parsing and assembling the metadata files, and then fill data according to the templates, so that developers do not need to know corresponding syntax rules of the metadata models, thereby improving the efficiency of the developers.
In view of the foregoing, an aspect of the embodiments of the present invention provides a method for converting a metadata file, including the following steps: in response to receiving an input file, judging whether an outermost label of the input file belongs to a label corresponding to a metadata file; responding to the fact that the outermost layer label of the input file belongs to a label corresponding to the metadata file, reading keywords in the input file, and judging whether the reference of each keyword is legal or not; responding to the fact that the quote of each keyword is legal, extracting data service elements and attribute elements of the input file, and carrying out classified assembly on the data service elements and the attribute elements to obtain intermediate data; and generating a target template according to the intermediate data, and filling corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
In some embodiments, the determining whether the reference to each keyword is legitimate comprises: and forming a set by all the keywords, and judging whether all the references in the set have definitions in the input file.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: selecting a preset number of attribute elements to construct an attribute group, and sequentially assembling other attribute elements to the attribute group.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: in response to assembling the attribute elements into the attribute group, determining whether all references in the current attribute group have definitions in the input file; and stopping the assembling in response to the presence reference in the current property group not having a definition in the input file.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: in response to all references in the current property group having definitions in the input file, assembly continues until all property elements are assembled into an attribute volume.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: setting definitions of all attribute elements and attribute constraints in the attribute body, and assembling the data service elements on the attribute body.
In some embodiments, the method further comprises: and checking whether the input file is matched with the target template.
In another aspect of the embodiments of the present invention, a metadata file conversion system is provided, including: the first judgment module is configured to respond to the received input file and judge whether the outermost label of the input file belongs to a label corresponding to the metadata file; the second judgment module is configured to respond to that the outermost label of the input file belongs to a label corresponding to the metadata file, read the keywords in the input file, and judge whether the reference of each keyword is legal; the assembly module is configured to respond that the quote of each keyword is legal, extract the data service elements and the attribute elements of the input file, and perform classified assembly on the data service elements and the attribute elements to obtain intermediate data; and the template module is configured to generate a target template according to the intermediate data and fill corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: by analyzing and assembling the metadata file, the data model description files (namely the metadata file) in different specifications can be automatically converted into templates with example formats, and then data is filled according to the templates, so that developers do not need to know corresponding grammar rules of the metadata model any more, and the efficiency of the developers is improved.
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 only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a diagram illustrating an embodiment of a method for metadata file conversion provided by the present invention;
FIG. 2 is a block diagram illustrating an embodiment of a method for converting a metadata file according to the present invention;
FIG. 3 is a diagram illustrating a hardware configuration of an embodiment of a computer device for metadata file conversion according to the present invention;
FIG. 4 is a schematic diagram of an embodiment of a computer storage medium for metadata file conversion provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In a first aspect of the embodiments of the present invention, an embodiment of a method for converting a metadata file is provided. Fig. 1 is a schematic diagram illustrating an embodiment of a method for converting a metadata file provided by the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, responding to the received input file, and judging whether the outmost label of the input file belongs to the label corresponding to the metadata file;
s2, responding to the fact that the outermost label of the input file belongs to the label corresponding to the metadata file, reading the keywords in the input file, and judging whether the reference of each keyword is legal or not;
s3, responding to the fact that the quote of each keyword is legal, extracting data service elements and attribute elements of the input file, and classifying and assembling the data service elements and the attribute elements to obtain intermediate data; and
and S4, generating a target template according to the intermediate data, and filling corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
OData is an OASIS (Organization for Structured Information Standards) standard that describes how Restful services are created and accessed. The standard conforms to the Microsoft Open Specification promisse (Microsoft Open Specification promisse), and currently the fourth version 4.0 is being used.
The OpenAPI defines a standard, language-independent RESTful API (Application Programming Interface) Interface specification that allows developers and operating systems to view and understand the functionality of a service without accessing source code, documents, or network traffic checks (both for human learning and reading, and for machine reading). In addition, the document generation tool may use the OpenAPI specification to generate API documents, and the code generation tool may generate server and client code, test code, and other use cases in various programming languages.
JSON (JavaScript Object Notation) is a lightweight data exchange format. It stores and represents data in a text format that is completely independent of the programming language, based on a subset of ECMAScript (js specification set by the european computer association). The simple and clear hierarchical structure enables JSON to become an ideal data exchange language, is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
The embodiment of the invention can quickly convert the data model description file defined in the standard specification into the JSON format, and comprises the following specific steps:
and responding to the received input file, and judging whether the outmost label of the input file belongs to the label corresponding to the metadata file. A user may need multiple input files with reference relationships between the files. Taking OData as an example, the OData metadata file is a file in an XML format, the content conforms to the CSDL syntax (universal Schema definition Language) specified in the OData specification, the outermost layer must be an Edma element, and similarly, other metadata files have corresponding tags, and therefore, it is determined whether the tag of the outermost layer of the input file belongs to the tag corresponding to the metadata file.
And responding to the fact that the outmost label of the input file belongs to the label corresponding to the metadata file, reading the keywords in the input file, and judging whether the reference of each keyword is legal or not. If the outmost label of the input file belongs to the label corresponding to the metadata file, for example, the outmost label is Edma, which indicates that the OData metadata file is caused to be used, the keyword in the input file can be read, the keyword in the OData metadata file is Reference, and the keywords are all placed in the Edma element. In addition, it is necessary to determine whether or not the references between the plurality of files are legal and whether or not there is a null reference.
In some embodiments, the determining whether the reference to each keyword is legitimate comprises: and forming a set by all the keywords, and judging whether all the references in the set have definitions in the input file. Reading the Reference tags in each file to form a set, judging whether all references in the set are defined in the input file, if the undefined Reference tags exist, namely empty references exist, then the analysis fails, and returning errors to the user.
And responding to the fact that the reference of each keyword is legal, extracting the data service elements and the attribute elements of the input file, and classifying and assembling the data service elements and the attribute elements to obtain intermediate data. If all references in the set are defined in the input file, data service elements and attribute elements in all the input files need to be extracted, the data service elements are used for defining the syntax and format of the data service, such as Schema tags, the attribute elements are used for defining resource types, local structure attributes and Action (active) elements, and the Action elements are used for expressing operations which can be performed on the resources.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: selecting a preset number of attribute elements to construct an attribute group, and sequentially assembling other attribute elements to the attribute group. And sequentially assembling attribute elements, and mainly solving the reference among the attributes of the structure.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: in response to assembling the attribute elements into the attribute group, determining whether all references in the current attribute group have definitions in the input file; and stopping the assembling in response to the presence reference in the current property group not having a definition in the input file. During the assembly process, the attribute elements with completed assembly can be detected, and if the attribute elements are detected to have undefined references, an error is reported and the assembly is stopped.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: in response to all references in the current property group having definitions in the input file, assembly continues until all property elements are assembled into an attribute volume. And assembling all attribute elements into an attribute body for assembling with the data service elements, wherein all attribute definitions and attribute constraints are contained in the attribute body.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: setting definitions of all attribute elements and attribute constraints in the attribute body, and assembling the data service elements on the attribute body. The assembly process is similar to the process of assembling property elements described above, and it can also be detected during assembly whether there is an undefined reference.
And generating a target template according to the intermediate data, and filling corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data. The target JSON template may be generated according to the intermediate Data, and for the filling of the attribute, a default manner may be adopted, for example, the character type defaults to "and" the Data and "the filling of the Data and" the "and" the "and" the "Data" and "Data and" the "and" Data "the filling of the Data and" Data "the" Data "the filling of the" Data and "Data" the "Data" and "the filling of the Data and" Data and "the Data and" the filling of the Data "the Data and" the "Data" the Data and "the Data" the filling of the Data and "the Data" the filling of the Data "the Data and" the filling of the Data and "the Data and" the Data and "the filling of the Data" the filling of the Data "the Data and" the Data "the filling of the Data" the Data of.
In some embodiments, the method further comprises: and checking whether the input file is matched with the target template. After obtaining the target JSON template, the user can manually edit the JSON template, modify and cut attributes, and then perform reverse verification on the JSON template, namely input the JSON template and a corresponding metadata file, judge whether the JSON template is matched with the corresponding metadata file, and if the JSON template is not matched with the metadata file, adjust the JSON template again.
Fig. 2 is a schematic structural diagram illustrating an embodiment of a method for converting a metadata file provided by the present invention. As shown in fig. 2, an embodiment of the present invention includes an analyzer, a generator, and a checker. The analyzer can analyze the corresponding specification type according to the data model description file (namely the metadata file) input by the user, and then the specification type is delivered to different generators at the lower layer. The generator can translate the input file into a corresponding target JSON model file (i.e., a JSON instance template). The checker executes the final check, or can receive the JSON model file and the data model description file specified by the user and verify whether the two files are consistent.
The user inputs the metadata files into the analyzer in batch, and the analyzer automatically analyzes the structure, grammar and relationship of the metadata files, completes verification, generates a tree structure and sends the tree structure to the generator. And the generator generates a target JSON template according to the intermediate data, and adopts a corresponding default mode for filling the attributes. After the JSON template is cut, a checker can be used for checking whether the JSON template is matched with the metadata file in a reverse mode.
It should be noted that: in the process of analyzing and judging the input file by the analyzer, the input metadata document may contain references to resources on the network, and the references may be references to standard files in the specification or references to third-party self-defined files. At this time, the online and offline processing methods are also different, and when the offline method is adopted, the downloaded resources need to be manually placed in the local peer directory of the analyzer, so that the analyzer can query and analyze the corresponding files.
The embodiment of the invention can convert the data model description files (namely metadata files) of OData and OpenAPI into JSON format example templates, can be compatible with the syntax of data model definition languages in OData and OpenAPI specifications, can convert corresponding metadata files in various formats into JSON templates, and is convenient for developers to develop. Developers do not need to pay attention to the syntax of metadata files with different formats in different specifications, only need to pay attention to the finally generated JSON template, and meanwhile, the reverse verification function provided by the tool can provide compliance verification with the metadata files after the user edits the JSON template.
It should be particularly noted that, the steps in the embodiments of the method for converting a metadata file can be mutually intersected, replaced, added, or deleted, so that these methods for converting a metadata file that are reasonably arranged and combined to transform also belong to the scope of the present invention, and the scope of the present invention should not be limited to the embodiments.
In view of the above object, according to a second aspect of the embodiments of the present invention, there is provided a metadata file conversion system, including: the first judgment module is configured to respond to the received input file and judge whether the outermost label of the input file belongs to a label corresponding to the metadata file; the second judgment module is configured to respond to that the outermost label of the input file belongs to a label corresponding to the metadata file, read the keywords in the input file, and judge whether the reference of each keyword is legal; the assembly module is configured to respond that the quote of each keyword is legal, extract the data service elements and the attribute elements of the input file, and perform classified assembly on the data service elements and the attribute elements to obtain intermediate data; and the template module is configured to generate a target template according to the intermediate data and fill corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
In some embodiments, the second determining module is configured to: and forming a set by all the keywords, and judging whether all the references in the set have definitions in the input file.
In some embodiments, the assembly module is configured to: selecting a preset number of attribute elements to construct an attribute group, and sequentially assembling other attribute elements to the attribute group.
In some embodiments, the assembly module is configured to: in response to assembling the attribute elements into the attribute group, determining whether all references in the current attribute group have definitions in the input file; and stopping the assembling in response to the presence reference in the current property group not having a definition in the input file.
In some embodiments, the assembly module is configured to: in response to all references in the current property group having definitions in the input file, assembly continues until all property elements are assembled into an attribute volume.
In some embodiments, the assembly module is configured to: setting definitions of all attribute elements and attribute constraints in the attribute body, and assembling the data service elements on the attribute body.
In some embodiments, the system further comprises a verification module configured to: and checking whether the input file is matched with the target template.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, responding to the received input file, and judging whether the outmost label of the input file belongs to the label corresponding to the metadata file; s2, responding to the fact that the outermost label of the input file belongs to the label corresponding to the metadata file, reading the keywords in the input file, and judging whether the reference of each keyword is legal or not; s3, responding to the fact that the quote of each keyword is legal, extracting data service elements and attribute elements of the input file, and classifying and assembling the data service elements and the attribute elements to obtain intermediate data; and S4, generating a target template according to the intermediate data, and filling corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
In some embodiments, the determining whether the reference to each keyword is legitimate comprises: and forming a set by all the keywords, and judging whether all the references in the set have definitions in the input file.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: selecting a preset number of attribute elements to construct an attribute group, and sequentially assembling other attribute elements to the attribute group.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: in response to assembling the attribute elements into the attribute group, determining whether all references in the current attribute group have definitions in the input file; and stopping the assembling in response to the presence reference in the current property group not having a definition in the input file.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: in response to all references in the current property group having definitions in the input file, assembly continues until all property elements are assembled into an attribute volume.
In some embodiments, the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises: setting definitions of all attribute elements and attribute constraints in the attribute body, and assembling the data service elements on the attribute body.
In some embodiments, the steps further comprise: and checking whether the input file is matched with the target template.
Fig. 3 is a schematic hardware structural diagram of an embodiment of the computer device for converting the metadata file provided by the present invention.
Taking the apparatus shown in fig. 3 as an example, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, the memory 202, the input device 203 and the output device 204 may be connected by a bus or other means, and fig. 3 illustrates the connection by a bus as an example.
The memory 202, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for converting a metadata file in the embodiments of the present application. The processor 201 executes various functional applications of the server and data processing, i.e., a method of converting a metadata file of the above-described method embodiment, by executing nonvolatile software programs, instructions, and modules stored in the memory 202.
The memory 202 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 created according to the use of the method of metadata file conversion, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to local modules 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 203 may receive information such as a user name and a password that are input. The output device 204 may include a display device such as a display screen.
Program instructions/modules corresponding to one or more methods of metadata file conversion are stored in the memory 202 and, when executed by the processor 201, perform the methods of metadata file conversion in any of the method embodiments described above.
Any embodiment of a computer device for performing the above method for converting a metadata file may achieve the same or similar effects as any of the above method embodiments corresponding thereto.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
Fig. 4 is a schematic diagram of an embodiment of a computer storage medium for converting a metadata file according to the present invention. Taking the computer storage medium as shown in fig. 4 as an example, the computer readable storage medium 3 stores a computer program 31 which, when executed by a processor, performs the above method.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by a computer program to instruct related hardware, and the program of the method for converting a metadata file can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods as described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method of metadata file conversion, comprising the steps of:
in response to receiving an input file, judging whether an outermost label of the input file belongs to a label corresponding to a metadata file;
responding to the fact that the outermost layer label of the input file belongs to a label corresponding to the metadata file, reading keywords in the input file, and judging whether the reference of each keyword is legal or not;
responding to the fact that the quote of each keyword is legal, extracting data service elements and attribute elements of the input file, and carrying out classified assembly on the data service elements and the attribute elements to obtain intermediate data; and
and generating a target template according to the intermediate data, and filling corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
2. The method of claim 1, wherein determining whether the reference to each keyword is legitimate comprises:
and forming a set by all the keywords, and judging whether all the references in the set have definitions in the input file.
3. The method of claim 1, wherein the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises:
selecting a preset number of attribute elements to construct an attribute group, and sequentially assembling other attribute elements to the attribute group.
4. The method of claim 3, wherein the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises:
in response to assembling the attribute elements into the attribute group, determining whether all references in the current attribute group have definitions in the input file; and
in response to the presence reference in the current property group not having a definition in the input file, stopping the assembling.
5. The method of claim 4, wherein the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises:
in response to all references in the current property group having definitions in the input file, assembly continues until all property elements are assembled into an attribute volume.
6. The method of claim 5, wherein the categorically assembling the data service elements and the attribute elements to obtain intermediate data comprises:
setting definitions of all attribute elements and attribute constraints in the attribute body, and assembling the data service elements on the attribute body.
7. The method of claim 1, further comprising:
and checking whether the input file is matched with the target template.
8. A system for metadata file conversion, comprising:
the first judgment module is configured to respond to the received input file and judge whether the outermost label of the input file belongs to a label corresponding to the metadata file;
the second judgment module is configured to respond to that the outermost label of the input file belongs to a label corresponding to the metadata file, read the keywords in the input file, and judge whether the reference of each keyword is legal;
the assembly module is configured to respond that the quote of each keyword is legal, extract the data service elements and the attribute elements of the input file, and perform classified assembly on the data service elements and the attribute elements to obtain intermediate data; and
and the template module is configured to generate a target template according to the intermediate data and fill corresponding attributes in the target template according to the attribute constraint conditions of the intermediate data.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110594302.6A 2021-05-28 2021-05-28 Method, system, equipment and medium for converting metadata file Pending CN113419996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110594302.6A CN113419996A (en) 2021-05-28 2021-05-28 Method, system, equipment and medium for converting metadata file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110594302.6A CN113419996A (en) 2021-05-28 2021-05-28 Method, system, equipment and medium for converting metadata file

Publications (1)

Publication Number Publication Date
CN113419996A true CN113419996A (en) 2021-09-21

Family

ID=77713226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110594302.6A Pending CN113419996A (en) 2021-05-28 2021-05-28 Method, system, equipment and medium for converting metadata file

Country Status (1)

Country Link
CN (1) CN113419996A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886406A (en) * 2017-01-19 2017-06-23 阿里巴巴集团控股有限公司 The generation method and device of exploitation code or document
CN107832443A (en) * 2017-11-20 2018-03-23 郑州云海信息技术有限公司 A kind of processing method, device and the medium of JSON document data
CN109446496A (en) * 2018-11-05 2019-03-08 北京锐安科技有限公司 A kind of conversion method, device, equipment and the storage medium of test language file
CN111241801A (en) * 2018-11-29 2020-06-05 北京京东尚科信息技术有限公司 File generation method, device, equipment and computer readable storage medium
CN111258564A (en) * 2020-01-17 2020-06-09 通号万全信号设备有限公司 Method and device for automatically generating codes based on QT
CN112199556A (en) * 2020-10-14 2021-01-08 深圳市元征科技股份有限公司 Automatic XML Schema file format conversion method, system and related equipment
CN112363757A (en) * 2020-11-11 2021-02-12 深圳前海微众银行股份有限公司 Method, device and equipment for automatically generating data file and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886406A (en) * 2017-01-19 2017-06-23 阿里巴巴集团控股有限公司 The generation method and device of exploitation code or document
CN107832443A (en) * 2017-11-20 2018-03-23 郑州云海信息技术有限公司 A kind of processing method, device and the medium of JSON document data
CN109446496A (en) * 2018-11-05 2019-03-08 北京锐安科技有限公司 A kind of conversion method, device, equipment and the storage medium of test language file
CN111241801A (en) * 2018-11-29 2020-06-05 北京京东尚科信息技术有限公司 File generation method, device, equipment and computer readable storage medium
CN111258564A (en) * 2020-01-17 2020-06-09 通号万全信号设备有限公司 Method and device for automatically generating codes based on QT
CN112199556A (en) * 2020-10-14 2021-01-08 深圳市元征科技股份有限公司 Automatic XML Schema file format conversion method, system and related equipment
CN112363757A (en) * 2020-11-11 2021-02-12 深圳前海微众银行股份有限公司 Method, device and equipment for automatically generating data file and readable storage medium

Similar Documents

Publication Publication Date Title
JP7371141B2 (en) Tools and methods for real-time dataflow programming languages
CN108415832B (en) Interface automation test method, device, equipment and storage medium
EP3433732B1 (en) Converting visual diagrams into code
US10108535B2 (en) Web application test script generation to test software functionality
CN107608889B (en) Method and system for automatically generating test script
US8745641B1 (en) Automatic verification and anomaly detection in a representational state transfer (REST) application programming interface
US9483260B1 (en) Documentation generation for web APIs based on byte code analysis
CN108628748B (en) Automatic test management method and automatic test management system
CN103077185A (en) Object-based user-defined information-expanding method
CN114625353A (en) Model framework code generation system and method
CN104156313A (en) Method for automatically generating Web service testing case
CN111581920A (en) Document conversion method, device, equipment and computer storage medium
CN113900958A (en) Test case script generation method, system, medium and electronic device
CN113238740B (en) Code generation method, code generation device, storage medium and electronic device
CN110333863A (en) A kind of method and device for generating, showing the small routine page
CN111782117B (en) Interface display method and device, storage medium and electronic device
CN112541002A (en) Program language conversion method, device, electronic equipment and storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
CN115061851A (en) Data verification method and device, storage medium and electronic equipment
CN117472372B (en) Responsive form construction method and system
CN114168149A (en) Data conversion method and device
CN113672233B (en) Server out-of-band management method, device and equipment based on Redfish
CN113419996A (en) Method, system, equipment and medium for converting metadata file
CN112433752A (en) Page parsing method, device, medium and electronic equipment
CN113886216A (en) Interface test and tool configuration method, device, electronic equipment and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210921