CN106951404A - A kind of conversion method of data format and device - Google Patents
A kind of conversion method of data format and device Download PDFInfo
- Publication number
- CN106951404A CN106951404A CN201710174825.9A CN201710174825A CN106951404A CN 106951404 A CN106951404 A CN 106951404A CN 201710174825 A CN201710174825 A CN 201710174825A CN 106951404 A CN106951404 A CN 106951404A
- Authority
- CN
- China
- Prior art keywords
- information
- code table
- transformation rule
- data element
- product information
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/178—Techniques for file synchronisation in file systems
- G06F16/1794—Details of file format conversion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Artificial Intelligence (AREA)
- Document Processing Apparatus (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present application provides a kind of conversion method of data format and device, is asked by receiving Data Format Transform;Based on the identified XML file transformation rule with ONIX Standard Editions information and CNONIX Standard Edition information matches, and the code table collection transformation rule of identified and ONIX code tables version information and CNONIX code table matches version informations, data form to the publication product information based on CNONIX Standard Edition information is changed, obtain the mode of the publication product information based on ONIX Standard Edition information, realize the purpose that the publication product information based on CNONIX Standard Edition information is converted into the publication product information based on ONIX Standard Edition information, it is easy to the export trade of publication product.
Description
Technical field
The present invention relates to digital publishing technical field, more particularly to a kind of conversion method of data format and device.
Background technology
At present, ONIX (Online Information Exchange, online information is exchanged) standard is widely used to entirely
Ball publishes trade, and ONIX standards are a set of international publication product information interchange format standards, and the standard is intended to figure
All participants provide unified publication product information lattice in the industrial chains such as book publisher, whole seller, retailer, network bookman
Formula, to solve each inter-agency a variety of data forms and deposit to exchange the puzzlement brought to publication produce product information.
CNONIX (CN Online Information Exchange, China On Line information is exchanged) is a set of according to the world
Publication product information interchange format standards that general ONIX standards are developed, suitable for China's actual conditions, the standard is just in state
Interior Publishing Industry is progressively promoted and used.
In view of this there is provided a kind of conversion method of data format and device, it will be believed with realizing based on CNONIX Standard Editions
The publication product information of breath is converted into the publication product information based on ONIX Standard Edition information, and then is easy to publish produce
The export trade of product, is urgent problem to be solved.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of conversion method of data format and device, by that will be based on CNONIX
The publication product information of Standard Edition information is converted into the publication product information based on ONIX Standard Edition information, in order to
The export trade of publication product.
To achieve these goals, technical scheme provided in an embodiment of the present invention is as follows:
A kind of conversion method of data format, including:
Data Format Transform request is received, the Data Format Transform request instruction has ONIX Standard Edition information, is based on
The publication product information of CNONIX Standard Edition information, the ONIX code tables version letter of the correspondence ONIX Standard Editions information
Breath, and correspond to the CNONIX code table version informations of the CNONIX Standard Editions information;
From at least one default XML file transformation rule, it is determined that with the ONIX Standard Editions information and CNONIX
The XML file transformation rule of Standard Edition information matches;
From at least one default code table collection transformation rule, it is determined that with the ONIX code tables version information and
The code table collection transformation rule of CNONIX code table matches version informations;
Based on identified XML file transformation rule and code table collection transformation rule, to the publication product information
Data form is changed, and obtains the publication product information based on the ONIX Standard Editions information.
It is preferred that, XML file transformation rule and the code table collection transformation rule based on determined by, to the publication
The data form of product information is changed, and obtains the publication product information based on the ONIX Standard Editions information, including:
Based on identified XML file transformation rule, the data form to the publication product information is changed, obtained
To the first publication product information based on the ONIX Standard Editions information;
Based on identified code table collection transformation rule, the data form to the first publication product information is turned
Change, obtain the publication product information based on the ONIX Standard Editions information.
It is preferred that, the publication product information includes data element, and the corresponding data item of the data element indicates have
Data item attribute, the data item attribute is optional attribute or must fill out attribute;Identified XML file transformation rule indicates there is mesh
Mark data element,
The XML file transformation rule based on determined by, the data form to the publication product information is turned
Change, obtain the first publication product information based on the ONIX Standard Editions information, including:
S1, determine in the publication product information whether there is the target data element;If it does, performing step
S2;
S2, determine whether the corresponding data item attribute of the target data element is that must fill out attribute;If the number of targets
According to the corresponding data item attribute of element for attribute must be filled out, step S3 is performed;If the corresponding data item of the target data element
Attribute is optional attribute, performs step S4;
S3, the data element for being combined the target data element higher level are re-executed as new target data element
Step S2;
S4, the target data element and its all subdata elements are deleted from the publication product information.
It is preferred that, identified code table collection transformation rule indicates there is shielding code table and shielding code value,
The code table collection transformation rule based on determined by, the data form to the first publication product information is entered
Row conversion, obtains the publication product information based on the ONIX Standard Editions information, including:
The code table used in S1, acquisition the first publication product information is the data element for shielding code table
The code value used in element, and the first publication product information is the data element for shielding code value;
Whether the acquired corresponding data item attribute of data element of S2, determination is that must fill out attribute;If acquired number
According to the corresponding data item attribute of element for attribute must be filled out, step S3 is performed;If the corresponding data item of acquired data element
Attribute is optional attribute, performs step S4;
S3, the data element for being combined acquired data element higher level are as the data element acquired in new, again
Perform step S2;
S4, delete from the first publication product information acquired data element and its all subdata elements.
It is preferred that, the generating mode of identified XML file transformation rule, including:
Obtain corresponding first schema of the ONIX Standard Editions information, and the CNONIX Standard Editions information pair
The 2nd schema answered;
First schema is converted into the first XML normative documents, and the 2nd schema is converted into second
XML normative documents;
According to the architectural difference between the first XML normative documents and the 2nd XML normative documents, generation is identified
XML file transformation rule.
It is preferred that, the generating mode of identified code table collection transformation rule, including:
The corresponding first generation code table collection including at least one code table of the ONIX code tables version information is obtained, and
The corresponding second generation code table collection including at least one code table of the CNONIX code tables version information;
The first generation code table collection is converted into the 3rd XML normative documents, and the second generation code table collection is converted into
4th XML normative documents;
According to the architectural difference between the 3rd XML normative documents and the 4th XML normative documents, generation determined by generation
Code table collection transformation rule.
A kind of data format converting device, including:
Data Format Transform request reception unit, for receiving Data Format Transform request, the Data Format Transform please
Asking instruction has ONIX Standard Edition information, based on the publication product information of CNONIX Standard Edition information, the correspondence ONIX
The ONIX code table version informations of Standard Edition information, and correspond to the CNONIX code tables of the CNONIX Standard Editions information
Version information;
XML file transformation rule determining unit, for from least one default XML file transformation rule, it is determined that with
The XML file transformation rule of the ONIX Standard Editions information and CNONIX Standard Edition information matches;
Code table collection transformation rule determining unit, for from least one default code table collection transformation rule, it is determined that
With the ONIX code tables version information and the code table collection transformation rule of CNONIX code table matches version informations;
Data Format Transform unit, it is right for based on identified XML file transformation rule and code table collection transformation rule
The data form of the publication product information is changed, and obtains the publication product based on the ONIX Standard Editions information
Information.
It is preferred that, the Data Format Transform unit, including:
First Data Format Transform unit, for based on identified XML file transformation rule, to the publication product
The data form of information is changed, and obtains the first publication product information based on the ONIX Standard Editions information;
Second Data Format Transform unit, for based on identified code table collection transformation rule, being published to described first
The data form of thing product information is changed, and obtains the publication product information based on the ONIX Standard Editions information.
It is preferred that, the publication product information includes data element, and the corresponding data item of the data element indicates have
Data item attribute, the data item attribute is optional attribute or must fill out attribute;Identified XML file transformation rule indicates there is mesh
Mark data element,
The first Data Format Transform unit, including:
Target data element, for performing step S1, determining to whether there is the target in the publication product information
Data element;If it does, performing step S2;
First must fill out attribute determining unit, for performing step S2, determining the corresponding data item of the target data element
Whether attribute is that must fill out attribute;If the corresponding data item attribute of the target data element performs step S3 for that must fill out attribute;
If the corresponding data item attribute of the target data element is optional attribute, step S4 is performed;
First determining unit, for the data element that performs step S3, be combined the target data element higher level as
New target data element, re-executes step S2;
First deletes unit, for performing step S4, the target data member being deleted from the publication product information
Plain and its all subdata elements.
It is preferred that, identified code table collection transformation rule indicates there is shielding code table and shielding code value,
The second Data Format Transform unit, including:
Data element acquiring unit, for performing step S1, obtaining the generation used in the first publication product information
Code table is the data element for shielding code table, and the code value used in the first publication product information is described
Shield the data element of code value;
Second must fill out attribute determining unit, for performing step S2, determining the acquired corresponding data item of data element
Whether attribute is that must fill out attribute;If the corresponding data item attribute of acquired data element performs step S3 for that must fill out attribute;
If the corresponding data item attribute of acquired data element is optional attribute, step S4 is performed;
Second determining unit, for the data element that performs step S3, be combined acquired data element higher level as
New acquired data element, re-executes step S2;
Second deletes unit, for performing step S4, acquired number being deleted from the first publication product information
According to element and its all subdata elements.
The embodiment of the present application provides a kind of conversion method of data format and device, is asked by receiving Data Format Transform;
Based on the identified XML file transformation rule with ONIX Standard Editions information and CNONIX Standard Edition information matches, and
The code table collection transformation rule of identified and ONIX code tables version information and CNONIX code table matches version informations, to base
Changed, obtained based on ONIX Standard Editions letter in the data form of the publication product information of CNONIX Standard Edition information
The mode of the publication product information of breath, realizes and is converted into the publication product information based on CNONIX Standard Edition information
The purpose of publication product information based on ONIX Standard Edition information, is easy to the export trade of publication product.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments described in invention, for those of ordinary skill in the art, on the premise of not paying creative work,
Other accompanying drawings can also be obtained according to these accompanying drawings.
A kind of conversion method of data format flow chart that Fig. 1 provides for the embodiment of the present application;
One kind XML file transformation rule and conversion of code table collection based on determined by that Fig. 2 provides for the embodiment of the present application
Rule, the data form to the publication product information is changed, and obtains going out based on the ONIX Standard Editions information
The method flow diagram of version thing product information;
One kind that Fig. 3 is provided for the embodiment of the present application XML file transformation rule based on determined by, to the publication produce
The data form of product information is changed, and obtains the side of the first publication product information based on the ONIX Standard Editions information
Method flow chart;
One kind that Fig. 4 is provided for the embodiment of the present application code table collection transformation rule based on determined by, goes out to described first
The data form of version thing product information is changed, and obtains the publication product information based on the ONIX Standard Editions information
Method flow diagram;
A kind of generation method flow chart for identified XML file transformation rule that Fig. 5 provides for the embodiment of the present application;
A kind of generation method flow chart for identified code table collection transformation rule that Fig. 6 provides for the embodiment of the present application;
A kind of structural representation for data format converting device that Fig. 7 provides for the embodiment of the present application.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in the present invention, below in conjunction with of the invention real
The accompanying drawing in example is applied, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described implementation
Example only a part of embodiment of the invention, rather than whole embodiments.Based on the embodiment in the present invention, this area is common
The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to protection of the present invention
Scope.
Embodiment:
A kind of conversion method of data format flow chart that Fig. 1 provides for the embodiment of the present application.
As shown in figure 1, this method includes:
S101, reception Data Format Transform request, the Data Format Transform request instruction have ONIX Standard Edition information,
Based on the publication product information of CNONIX Standard Edition information, the ONIX code tables version of the correspondence ONIX Standard Editions information
This information, and correspond to the CNONIX code table version informations of the CNONIX Standard Editions information;
Optionally, ONIX Standard Editions information indicates the version (e.g., ONIX standards 3.0.2 versions) of ONIX standards.
Optionally, CNONIX Standard Editions information indicates the version (e.g., the version of CNONIX standards 1.0) of CNONIX standards.
Optionally, the ONIX code table version informations of the correspondence ONIX Standard Editions information, are indicated:Marked with the ONIX
The version (e.g., the phase code tables of ONIX the 32nd) of the corresponding ONIX code tables of quasi- version information.
Optionally, the CNONIX code table version informations of the correspondence CNONIX Standard Editions information, are indicated:With it is described
The version (e.g., the phase code tables of CNONIX the 1st) of the corresponding CNONIX code tables of CNONIX Standard Edition information.
Optionally, the publication product information based on CNONIX Standard Edition information is:Based on CNONIX Standard Editions letter
Cease the publication product information of the version generation of the CNONIX standards indicated.
S102, from least one default XML file transformation rule, it is determined that with the ONIX Standard Editions information and
The XML file transformation rule of CNONIX Standard Edition information matches;
Optionally, it is preset with least one XML file transformation rule;Each default XML file transformation rule is to that should have
One ONIX Standard Editions information and a CNONIX Standard Edition information;And each default XML file transformation rule is corresponding
Different between the first information, the first information is ONIX Standard Editions information and CNONIX Standard Edition information.
Optionally, from least one default XML file transformation rule, it is determined that with the ONIX Standard Editions information and
The XML file transformation rule of CNONIX Standard Edition information matches, including:From at least one default XML file transformation rule
In, search the ONIX Standard Editions letter that corresponding ONIX Standard Edition information asks to indicate for the Data Format Transform
Breath, corresponding CNONIX Standard Edition information is the CNONIX Standard Edition information that the Data Format Transform asks to indicate
XML file transformation rule, wherein, the XML file transformation rule found be determination with the ONIX Standard Editions
The XML file transformation rule of information and CNONIX Standard Edition information matches.
S103, from least one default code table collection transformation rule, it is determined that with the ONIX code tables version information
With the code table collection transformation rule of CNONIX code table matches version informations;
Optionally, it is preset with least one code table collection transformation rule;Each default code table collection transformation rule correspondence
There are an ONIX code tables version information and a CNONIX code table version information;And each default code table collection transformation rule
Different between corresponding second information, second information is ONIX code tables version information and CNONIX code table versions
Information.
Optionally, from least one default code table collection transformation rule, it is determined that believing with the ONIX code tables version
The code table collection transformation rule of breath and CNONIX code table matches version informations, including:From at least one default code table collection
In transformation rule, the ONIX generations that corresponding ONIX code table version information asks to indicate for the Data Format Transform are searched
Code table version information, corresponding CNONIX code table version information is the CNONIX that the Data Format Transform asks to indicate
The code table collection transformation rule of code table version information, wherein, the code table collection transformation rule found be determination with
The code table collection transformation rule of ONIX code tables version information and CNONIX the code table matches version information.
S104, based on identified XML file transformation rule and code table collection transformation rule, the publication product is believed
The data form of breath is changed, and obtains the publication product information based on the ONIX Standard Editions information.
Optionally, based on identified XML file transformation rule and code table collection transformation rule, to the publication product
The data form of information is changed, and can obtain the ONIX Standard Edition information based on Data Format Transform request instruction
Publication product information.
The embodiment of the present application provides a kind of conversion method of data format, is asked by receiving Data Format Transform;Based on institute
The XML file transformation rule with ONIX Standard Editions information and CNONIX Standard Edition information matches determined, and determined
With ONIX code tables version information and the code table collection transformation rule of CNONIX code table matches version informations, to based on
The data form of the publication product information of CNONIX Standard Edition information is changed, and obtains being based on ONIX Standard Edition information
Publication product information mode, realize and the publication product information based on CNONIX Standard Edition information be converted into base
In the purpose of the publication product information of ONIX Standard Edition information, it is easy to the export trade of publication product.
In order to be more comprehensively illustrated to a kind of conversion method of data format that the embodiment of the present application is provided, now to this
Apply for that one kind of embodiment offer, based on identified XML file transformation rule and code table collection transformation rule, is published to described
The data form of thing product information is changed, and obtains the side of the publication product information based on the ONIX Standard Editions information
Method describes in detail, refers to Fig. 2.
As shown in Fig. 2 this method includes:
S201, based on identified XML file transformation rule, the data form to the publication product information is turned
Change, obtain the first publication product information based on the ONIX Standard Editions information;
Optionally, based on identified XML file transformation rule, the data form to the publication product information is carried out
Conversion, can obtain asking the first publication product of the ONIX Standard Edition information indicated to be believed based on the Data Format Transform
Breath.
S202, based on identified code table collection transformation rule, to the data form of the first publication product information
Changed, obtain the publication product information based on the ONIX Standard Editions information.
Optionally, after step S201 execution completions obtain the first publication product information, also need to resulting first
Publication product information is further processed, and the concrete mode of the processing refers to step S202.Step S202 is specifically wrapped
Include:Based on identified code table collection transformation rule, the data form to the first publication product information is changed, obtained
To the publication product information for the ONIX Standard Edition information for asking to indicate based on the Data Format Transform.
The embodiment of the present application offer is changed based on identified XML file transformation rule and code table collection by above-mentioned
Rule, the data form to the publication product information is changed, and obtains going out based on the ONIX Standard Editions information
Version produce product information approach is further described so that the conversion method of data format that the embodiment of the present application is provided becomes apparent from,
Completely, be easy to skilled artisan understands that.
Optionally, the publication product information includes the data element (data element that the publication product information includes
The number of element is at least one), the corresponding data item of the data element indicates there is data item attribute, and the data item attribute is
Optional attribute must fill out attribute;Identified XML file transformation rule indicates there is target data element.
Accordingly, a kind of conversion method of data format that the embodiment of the present application is provided is explained in order to more comprehensive
State, the one kind now provided the embodiment of the present application XML file transformation rule based on determined by, to the publication product information
Data form changed, obtain the first publication product information based on the ONIX Standard Editions information method carry out
It is discussed in detail, refers to Fig. 3.
As shown in figure 3, this method includes:
S301, determine in the publication product information whether there is the target data element;If it does, performing step
Rapid S302;
Optionally, determine what is indicated in the publication product information with the presence or absence of identified XML file transformation rule
Target data element;If there is the number of targets that identified XML file transformation rule is indicated in the publication product information
According to element, step S302 is performed;If identified XML file transformation rule is not present in the publication product information to indicate
Target data element, then perform terminate flow.
S302, determine whether the corresponding data item attribute of the target data element is that must fill out attribute;If the target
The corresponding data item attribute of data element performs step S303 for that must fill out attribute;If the corresponding number of the target data element
It is optional attribute according to item attribute, performs step S304;
S303, the data element for being combined the target data element higher level are as new target data element, and return is held
Row step S302;
Optionally, if there is the target that identified XML file transformation rule is indicated in the publication product information
Data element, it is determined that the data item that the corresponding data item of the target data element in the publication product information is indicated
Whether attribute is that must fill out attribute, if the corresponding data item of the target data element in the publication product information refers to
The data item attribute shown is must fill out attribute, and the data element that the target data element higher level is combined is used as new target data
Element, and re-execute step S302;If the corresponding number of the target data element in the publication product information
The data item attribute indicated according to item is optional attribute (if the target data member i.e., in the publication product information
The data item attribute that the corresponding data item of element is indicated is not that must fill out attribute), perform step S304.
S304, the target data element and its all subdata elements are deleted from the publication product information.
Optionally, the number for the target data element that identified XML file transformation rule is indicated is at least one, works as institute
When the number for the target data element that the XML file transformation rule of determination is indicated is multiple, respectively for each target data member
Element, performs the step S301-S304 that a embodiment of the present application is provided.
It should be noted that when last in the target data element indicated for identified XML file transformation rule
One target data data element, which is performed, to be completed after the step S301-S304 that the embodiment of the present application is provided, current publication produce
Product information (last time is deleted the publication product information of the target data element and its all subdata elements) is
Obtained the first publication product information based on the ONIX Standard Editions information.
By it is above-mentioned to the embodiment of the present application provide based on identified XML file transformation rule, to the publication
The data form of product information is changed, and obtains the first publication product information side based on the ONIX Standard Editions information
Method is further described so that the conversion method of data format that the embodiment of the present application is provided becomes apparent from, completely, is easy to this area
Technical staff understands.
Optionally, identified code table collection transformation rule indicates there is shielding code table and shielding code value.
Accordingly, a kind of conversion method of data format that the embodiment of the present application is provided is explained in order to more comprehensive
State, the one kind now provided the embodiment of the present application code table collection transformation rule based on determined by publishes produce to described first
The data form of product information is changed, and the method for obtaining the publication product information based on the ONIX Standard Editions information is entered
Row is discussed in detail, and refers to Fig. 4.
As shown in figure 4, this method includes:
The code table used in S401, acquisition the first publication product information is the data element for shielding code table
The code value used in element, and the first publication product information is the data element for shielding code value;
Optionally, for accessed each data element, a step S402-S403 is performed respectively.
Whether the acquired corresponding data item attribute of data element of S402, determination is that must fill out attribute;If acquired
The corresponding data item attribute of data element performs step S403 for that must fill out attribute;If the corresponding number of acquired data element
It is optional attribute according to item attribute, performs step S404;
S403, the data element for being combined acquired data element higher level are returned as the data element acquired in new
Receipt row step S402;
Optionally, it is determined that the corresponding data item of data element acquired in the first publication product information is indicated
Data item attribute whether be that must fill out attribute;If the acquired data element correspondence in the first publication product information
The data item attribute that indicates of data item for attribute must be filled out, the data element that acquired data element higher level is combined is as new
Acquired data element, re-execute step S402;The acquired data element in the first publication product information
The data item attribute that the corresponding data item of element is indicated is optional attribute (that is, acquired in the first publication product information
The data item attribute that indicates of the corresponding data item of data element for attribute must be filled out), perform step S404.
S404, delete from the first publication product information acquired data element and its all subdatas member
Element.
Optionally, for accessed each data element, a step S402-S404 is performed respectively;When for most
Latter accessed data element, which is performed, to be completed after step S402-S404, and the first current publication product information is (last
First publication product information of data element and its all subdata elements acquired in being once deleted) it is obtained base
In the publication product information of the ONIX Standard Editions information.
By it is above-mentioned to the embodiment of the present application provide based on identified code table collection transformation rule, go out to described first
The data form of version thing product information is changed, and obtains the publication product information side based on the ONIX Standard Editions information
Method is further described so that the conversion method of data format that the embodiment of the present application is provided becomes apparent from, completely, is easy to this area
Technical staff understands.
In order to be more comprehensively illustrated to a kind of conversion method of data format that the embodiment of the present application is provided, now to this
A kind of generation method for identified XML file transformation rule that application embodiment is provided describes in detail, refers to Fig. 5.
As shown in figure 5, this method includes:
S501, corresponding first schema of the acquisition ONIX Standard Editions information, and the CNONIX Standard Editions
Corresponding 2nd schema of information;
Optionally, the corresponding schema of the ONIX Standard Editions information got is referred to as the first schema;Obtain
To the corresponding schema of the CNONIX Standard Editions information be referred to as the 2nd schema.
S502, the first schema is converted into the first XML normative documents, and the 2nd schema is converted into
2nd XML normative documents;
Optionally, by default document format crossover tool, the first schema can be converted into the first XML standards
File, and the 2nd schema is converted into the 2nd XML normative documents.
It is only the preferred embodiment of the embodiment of the present application above, inventor can be arbitrarily set according to the demand of oneself " by institute
State the first schema and be converted into the first XML normative documents, and the 2nd schema is converted into the 2nd XML normative documents "
Specific implementation, then this does not limit.
S503, according to the architectural difference between the first XML normative documents and the 2nd XML normative documents, generation institute is really
Fixed XML file transformation rule.
Optionally, according to the architectural difference between the first XML normative documents and the 2nd XML normative documents, institute is generated
The XML file transformation rule of determination, including:Determine the structure between the first XML normative documents and the 2nd XML normative documents
Difference, the XML file transformation rule according to determined by the generation of identified architectural difference.
Optionally, if in step S102 implementation procedures, when determining at least one default XML file transformation rule
In, when the XML file not existed with the ONIX Standard Editions information and CNONIX Standard Edition information matches changes rule, holding
Before row step S104, the step S501-S503 provided using the embodiment of the present application is directly generated and the ONIX Standard Editions
The XML file transformation rule of information and CNONIX Standard Edition information matches, and using the XML file transformation rule generated as
XML file transformation rule determined by step S102 is to perform step S104.
By it is above-mentioned to the embodiment of the present application provide identified XML file transformation rule generation method it is further
Introduce so that the conversion method of data format that the embodiment of the present application is provided becomes apparent from, completely, is easy to those skilled in the art to manage
Solution.
In order to be more comprehensively illustrated to a kind of conversion method of data format that the embodiment of the present application is provided, now to this
A kind of generation method for identified code table collection transformation rule that application embodiment is provided describes in detail, refers to Fig. 6.
As shown in fig. 6, this method includes:
S601, the corresponding first generation code table including at least one code table of the acquisition ONIX code tables version information
Collection, and the corresponding second generation code table collection including at least one code table of the CNONIX code tables version information;
S602, the first generation code table collection is converted into the 3rd XML normative documents, and the second generation code table collection is turned
Change the 4th XML normative documents into;
Optionally, the 3rd XML normative documents include at least one the 3rd sub- XML normative document, the 3rd son
XML normative documents are converted into by utilizing the document format crossover tool to the code table that the first generation code table is concentrated
Obtain.The 3rd XML normative documents include each code table the corresponding 3rd concentrated respectively with the first generation code table
Sub- XML normative documents.
Accordingly, the 4th XML normative documents include at least one the 4th sub- XML normative document, the 4th son
XML normative documents are converted into by utilizing the document format crossover tool to the code table that the second generation code table is concentrated
Obtain.The 4th XML normative documents include each code table the corresponding 4th concentrated respectively with the second generation code table
Sub- XML normative documents.
Or, the 3rd XML normative documents are a files, by by the properties collection in each 3rd sub- XML normative documents
Place in one file, obtaining a 3rd XML normative document, (the 3rd XML normative documents are to be placed with content set
The file after conjunction).
Or, the 4th XML normative documents are a files, by by the properties collection in each 4th sub- XML normative documents
Place in one file, obtaining a 4th XML normative document, (the 4th XML normative documents are to be placed with content set
The file after conjunction).
It is only the preferred embodiment of the embodiment of the present application above, inventor can be arbitrarily set according to the demand of oneself " by institute
State first generation code table collection and be converted into the 3rd XML normative documents, and the second generation code table collection is converted into the 4th XML standards text
The specific implementation of part ", then this does not limit.
S603, according to the architectural difference between the 3rd XML normative documents and the 4th XML normative documents, generation institute is really
Fixed code table collection transformation rule.
Optionally, according to the architectural difference between the 3rd XML normative documents and the 4th XML normative documents, institute is generated
The XML file transformation rule of determination, including:Determine the structure between the 3rd XML normative documents and the 4th XML normative documents
Difference;The code table collection transformation rule according to determined by the generation of identified architectural difference.
Optionally, if in step S103 implementation procedures, advised when determining that at least one default code table collection is changed
In then, the code table collection not existed with the ONIX code tables version information and CNONIX code table matches version informations, which is changed, advises
When then, before step S104 is performed, the step S601-S603 provided using the embodiment of the present application is directly generated and the ONIX
The code table collection transformation rule of code table version information and CNONIX code table matches version informations, and by the code table generated
Collect transformation rule as code table collection transformation rule determined by step S103 to perform step S104.
Enter one by the generation method of the above-mentioned identified code table collection transformation rule provided the embodiment of the present application
Step is introduced so that the conversion method of data format that the embodiment of the present application is provided becomes apparent from, completely, is easy to those skilled in the art
Understand.
Method is described in detail in the invention described above disclosed embodiment, can be taken various forms for the method for the present invention
Device realize, therefore the invention also discloses a kind of device, specific embodiment is given below and is described in detail.
A kind of structural representation for data format converting device that Fig. 7 provides for the embodiment of the present application.
As shown in fig. 7, the device includes:
Data Format Transform request reception unit 71, for receiving Data Format Transform request, the Data Format Transform
Request instruction has ONIX Standard Edition information, and based on the publication product information of CNONIX Standard Edition information, correspondence is described
The ONIX code table version informations of ONIX Standard Edition information, and correspond to the CNONIX generations of the CNONIX Standard Editions information
Code table version information;
XML file transformation rule determining unit 72, for from least one default XML file transformation rule, it is determined that
With the XML file transformation rule of the ONIX Standard Editions information and CNONIX Standard Edition information matches;
Code table collection transformation rule determining unit 73, for from least one default code table collection transformation rule, really
The code table collection transformation rule of the fixed and ONIX code tables version information and CNONIX code table matches version informations;
Data Format Transform unit 74, for based on identified XML file transformation rule and code table collection transformation rule,
Data form to the publication product information is changed, and obtains the publication produce based on the ONIX Standard Editions information
Product information.
Optionally, the Data Format Transform unit, including:
First Data Format Transform unit, for based on identified XML file transformation rule, to the publication product
The data form of information is changed, and obtains the first publication product information based on the ONIX Standard Editions information;
Second Data Format Transform unit, for based on identified code table collection transformation rule, being published to described first
The data form of thing product information is changed, and obtains the publication product information based on the ONIX Standard Editions information.
Optionally, the publication product information includes data element, and the corresponding data item of the data element indicates have
Data item attribute, the data item attribute is optional attribute or must fill out attribute;Identified XML file transformation rule indicates there is mesh
Mark data element,
The first Data Format Transform unit, including:
Target data element, for performing step S1, determining to whether there is the target in the publication product information
Data element;If it does, performing step S2;
First must fill out attribute determining unit, for performing step S2, determining the corresponding data item of the target data element
Whether attribute is that must fill out attribute;If the corresponding data item attribute of the target data element performs step S3 for that must fill out attribute;
If the corresponding data item attribute of the target data element is optional attribute, step S4 is performed;
First determining unit, for the data element that performs step S3, be combined the target data element higher level as
New target data element, re-executes step S2;
First deletes unit, for performing step S4, the target data member being deleted from the publication product information
Plain and its all subdata elements.
Optionally, identified code table collection transformation rule indicates there is shielding code table and shielding code value,
The second Data Format Transform unit, including:
Data element acquiring unit, for performing step S1, obtaining the generation used in the first publication product information
Code table is the data element for shielding code table, and the code value used in the first publication product information is described
Shield the data element of code value;
Second must fill out attribute determining unit, for performing step S2, determining the acquired corresponding data item of data element
Whether attribute is that must fill out attribute;If the corresponding data item attribute of acquired data element performs step S3 for that must fill out attribute;
If the corresponding data item attribute of acquired data element is optional attribute, step S4 is performed;
Second determining unit, for the data element that performs step S3, be combined acquired data element higher level as
New acquired data element, re-executes step S2;
Second deletes unit, for performing step S4, acquired number being deleted from the first publication product information
According to element and its all subdata elements.
The embodiment of the present application provides a kind of data format converting device, is asked by receiving Data Format Transform;Based on institute
The XML file transformation rule with ONIX Standard Editions information and CNONIX Standard Edition information matches determined, and determined
With ONIX code tables version information and the code table collection transformation rule of CNONIX code table matches version informations, to based on
The data form of the publication product information of CNONIX Standard Edition information is changed, and obtains being based on ONIX Standard Edition information
Publication product information mode, realize and the publication product information based on CNONIX Standard Edition information be converted into base
In the purpose of the publication product information of ONIX Standard Edition information, it is easy to the export trade of publication product.
The embodiment of each in the present invention is described by the way of progressive, and what each embodiment was stressed is and other realities
Apply the difference of example, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
Speech, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part illustration
.
It the above is only the preferred embodiment of the present invention, make skilled artisans appreciate that or realizing of the invention.It is right
A variety of modifications of these embodiments will be apparent to one skilled in the art, general original as defined herein
Reason can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, the present invention will not
Be intended to be limited to the embodiments shown herein, and be to fit to it is consistent with principles disclosed herein and features of novelty most
Wide scope.
Claims (10)
1. a kind of conversion method of data format, it is characterised in that including:
Data Format Transform request is received, the Data Format Transform request instruction has ONIX Standard Edition information, is based on
The publication product information of CNONIX Standard Edition information, the ONIX code tables version letter of the correspondence ONIX Standard Editions information
Breath, and correspond to the CNONIX code table version informations of the CNONIX Standard Editions information;
From at least one default XML file transformation rule, it is determined that with the ONIX Standard Editions information and CNONIX standards
The XML file transformation rule of matches version information;
From at least one default code table collection transformation rule, it is determined that with the ONIX code tables version information and CNONIX generations
The code table collection transformation rule of code table matches version information;
Based on identified XML file transformation rule and code table collection transformation rule, to the data of the publication product information
Form is changed, and obtains the publication product information based on the ONIX Standard Editions information.
2. according to the method described in claim 1, it is characterised in that XML file transformation rule and the generation based on determined by
Code table collection transformation rule, the data form to the publication product information is changed, and obtains being based on the ONIX standard editions
The publication product information of this information, including:
Based on identified XML file transformation rule, the data form to the publication product information is changed, and obtains base
In the first publication product information of the ONIX Standard Editions information;
Based on identified code table collection transformation rule, the data form to the first publication product information is changed,
Obtain the publication product information based on the ONIX Standard Editions information.
3. method according to claim 2, it is characterised in that the publication product information includes data element, described
The corresponding data item of data element indicates there is data item attribute, and the data item attribute is optional attribute or must fill out attribute;Institute is really
Fixed XML file transformation rule indicates there is target data element,
The XML file transformation rule based on determined by, the data form to the publication product information is changed, obtained
To the first publication product information based on the ONIX Standard Editions information, including:
S1, determine in the publication product information whether there is the target data element;If it does, performing step S2;
S2, determine whether the corresponding data item attribute of the target data element is that must fill out attribute;If the target data member
The corresponding data item attribute of element performs step S3 for that must fill out attribute;If the corresponding data item attribute of the target data element
For optional attribute, step S4 is performed;
S3, the data element for being combined the target data element higher level re-execute step as new target data element
S2;
S4, the target data element and its all subdata elements are deleted from the publication product information.
4. method according to claim 3, it is characterised in that identified code table collection transformation rule indicates there is shielding generation
Code table and shielding code value,
The code table collection transformation rule based on determined by, the data form to the first publication product information is turned
Change, obtain the publication product information based on the ONIX Standard Editions information, including:
S1, the code table used in the first publication product information is obtained for the data element for shielding code table, with
And the code value used in the first publication product information is the data element of the shielding code value;
Whether the acquired corresponding data item attribute of data element of S2, determination is that must fill out attribute;If acquired data element
The corresponding data item attribute of element performs step S3 for that must fill out attribute;If the corresponding data item attribute of acquired data element
For optional attribute, step S4 is performed;
S3, the data element for being combined acquired data element higher level are re-executed as the data element acquired in new
Step S2;
S4, delete from the first publication product information acquired data element and its all subdata elements.
5. the method according to claim 1-4 any one, it is characterised in that identified XML file transformation rule
Generating mode, including:
Obtain corresponding first schema of the ONIX Standard Editions information, and the CNONIX Standard Editions information is corresponding
2nd schema;
First schema is converted into the first XML normative documents, and the 2nd schema is converted into the 2nd XML marks
Quasi- file;
According to the architectural difference between the first XML normative documents and the 2nd XML normative documents, XML texts determined by generation
Part transformation rule.
6. the method according to claim 1-4 any one, it is characterised in that identified code table collection transformation rule
Generating mode, including:
The corresponding first generation code table collection including at least one code table of the ONIX code tables version information is obtained, and it is described
The corresponding second generation code table collection including at least one code table of CNONIX code table version informations;
The first generation code table collection is converted into the 3rd XML normative documents, and the second generation code table collection is converted into the 4th
XML normative documents;
According to the architectural difference between the 3rd XML normative documents and the 4th XML normative documents, code table determined by generation
Collect transformation rule.
7. a kind of data format converting device, it is characterised in that including:
Data Format Transform request reception unit, for receiving Data Format Transform request, the Data Format Transform request refers to
ONIX Standard Edition information is shown with, based on the publication product information of CNONIX Standard Edition information, the correspondence ONIX standards
The ONIX code table version informations of version information, and correspond to the CNONIX code table versions of the CNONIX Standard Editions information
Information;
XML file transformation rule determining unit, for from least one default XML file transformation rule, it is determined that with it is described
The XML file transformation rule of ONIX Standard Editions information and CNONIX Standard Edition information matches;
Code table collection transformation rule determining unit, for from least one default code table collection transformation rule, it is determined that and institute
State the code table collection transformation rule of ONIX code tables version information and CNONIX code table matches version informations;
Data Format Transform unit, for based on identified XML file transformation rule and code table collection transformation rule, to described
The data form of publication product information is changed, and obtains the publication product letter based on the ONIX Standard Editions information
Breath.
8. device according to claim 7, it is characterised in that the Data Format Transform unit, including:
First Data Format Transform unit, for based on identified XML file transformation rule, to the publication product information
Data form changed, obtain the first publication product information based on the ONIX Standard Editions information;
Second Data Format Transform unit, for based on identified code table collection transformation rule, produce to be published to described first
The data form of product information is changed, and obtains the publication product information based on the ONIX Standard Editions information.
9. device according to claim 8, it is characterised in that the publication product information includes data element, described
The corresponding data item of data element indicates there is data item attribute, and the data item attribute is optional attribute or must fill out attribute;Institute is really
Fixed XML file transformation rule indicates there is target data element,
The first Data Format Transform unit, including:
Target data element, for performing step S1, determining to whether there is the target data in the publication product information
Element;If it does, performing step S2;
First must fill out attribute determining unit, for performing step S2, determining the corresponding data item attribute of the target data element
Whether it is that must fill out attribute;If the corresponding data item attribute of the target data element performs step S3 for that must fill out attribute;If
The corresponding data item attribute of the target data element is optional attribute, performs step S4;
First determining unit, for the data element that performs step S3, be combined the target data element higher level as new
Target data element, re-executes step S2;
First deletes unit, for performing step S4, delete from the publication product information target data element and
Its all subdata element.
10. device according to claim 9, it is characterised in that identified code table collection transformation rule indicates there is shielding
Code table and shielding code value,
The second Data Format Transform unit, including:
Data element acquiring unit, for performing step S1, obtaining the code table used in the first publication product information
For the data element of the shielding code table, and the code value used in the first publication product information is the shielding
The data element of code value;
Second must fill out attribute determining unit, for performing step S2, determining the acquired corresponding data item attribute of data element
Whether it is that must fill out attribute;If the corresponding data item attribute of acquired data element performs step S3 for that must fill out attribute;If
The corresponding data item attribute of acquired data element is optional attribute, performs step S4;
Second determining unit, for the data element that performs step S3, be combined acquired data element higher level as new
Acquired data element, re-executes step S2;
Second deletes unit, for performing step S4, acquired data element being deleted from the first publication product information
Plain and its all subdata elements.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710174825.9A CN106951404B (en) | 2017-03-22 | 2017-03-22 | Data format conversion method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710174825.9A CN106951404B (en) | 2017-03-22 | 2017-03-22 | Data format conversion method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106951404A true CN106951404A (en) | 2017-07-14 |
CN106951404B CN106951404B (en) | 2020-05-19 |
Family
ID=59473016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710174825.9A Active CN106951404B (en) | 2017-03-22 | 2017-03-22 | Data format conversion method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106951404B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110109681A (en) * | 2019-05-08 | 2019-08-09 | 上海携程商务有限公司 | The conversion method and system of code between different platform |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005001708A1 (en) * | 2003-06-27 | 2005-01-06 | Common Ground Publishing Pty Ltd | Method and apparatus for the creation, location and formatting of digital content |
CN104765717A (en) * | 2014-01-08 | 2015-07-08 | 北大方正集团有限公司 | Method and device for mass document format conversion |
-
2017
- 2017-03-22 CN CN201710174825.9A patent/CN106951404B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2005001708A1 (en) * | 2003-06-27 | 2005-01-06 | Common Ground Publishing Pty Ltd | Method and apparatus for the creation, location and formatting of digital content |
CN104765717A (en) * | 2014-01-08 | 2015-07-08 | 北大方正集团有限公司 | Method and device for mass document format conversion |
Non-Patent Citations (2)
Title |
---|
张秀兰、党梦娇、马科: "ONIX与我国编目标准的统一", 《高校图书馆工作》 * |
张秀兰、薄丽辉、张文亮: "CNONIX对ONIX的继承与创新", 《图书馆建设》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110109681A (en) * | 2019-05-08 | 2019-08-09 | 上海携程商务有限公司 | The conversion method and system of code between different platform |
Also Published As
Publication number | Publication date |
---|---|
CN106951404B (en) | 2020-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103577456B (en) | For the method and apparatus processing time series data | |
CN102779063A (en) | Method for providing application invocation and server | |
AU2014315494B2 (en) | Automatically generating certification documents | |
CN103186991B (en) | Electronic book reading system capable of achieving multi-equipment seamless reading and equipment switching method | |
CN108710679A (en) | E-book reading processing method, device and equipment | |
US20030097288A1 (en) | Inspection schedule management support system and inspection schedule management support method | |
AU2014201213A1 (en) | Information Processing System, Information Processing Apparatus, Method Of Controlling An Information Processing Appataus, And Program | |
CN110532559B (en) | Rule processing method and device | |
CN103580991A (en) | Mail attachment uploading method and device | |
CN106951404A (en) | A kind of conversion method of data format and device | |
CN102903064A (en) | Renting deciding method and system | |
KR101485108B1 (en) | Batch automatic method for coordinate transfer and apparatus for the same | |
CN104881336A (en) | Data backup method and device | |
JP4843512B2 (en) | Information presentation server | |
US20210117614A1 (en) | One click listing | |
CN116185628A (en) | Geological space data processing method and device and electronic equipment | |
CN102841890A (en) | Data processing method and device for document creation | |
CN102768627B (en) | Analog watch hand implementation method and device and electronic equipment with analog clock | |
CN103618791A (en) | WEB reverse proxy method, device and system supporting XSLT file | |
CN103294788A (en) | Universal background processing method and system for websites | |
CN103902573A (en) | Method and device for displaying traffic line mark maps | |
TWI524197B (en) | Method for generating web program and corresponding form interface form annotation of table filed | |
Tajima et al. | WePatch: a system enabling users to improve bad user interfaces on the web | |
JP2005352774A (en) | Information processor, control method for information processor, computer program, and recording medium | |
EP1990747B1 (en) | Communication system and reply method thereof |
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 | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A data format conversion method and device Effective date of registration: 20220811 Granted publication date: 20200519 Pledgee: Beijing Beitou Financing Guarantee Co.,Ltd. Pledgor: BEIJING JETSEN TECHNOLOGY Co.,Ltd. Registration number: Y2022110000176 |