Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a medium for making a layout template of a publication, so as to solve the problems of high technical threshold, low work efficiency, high training cost, and the like in the prior art for manually making a layout template.
In a first aspect, an embodiment of the present invention provides a method for making a layout template of a publication, including:
determining a data standard type adopted by XML content description of a publication to be typeset;
acquiring a format XML description file corresponding to the data standard type;
constructing format template source material data according to the format XML description file;
searching and matching a basic template corresponding to the data standard type according to the layout template source material data, and constructing layout template application data;
and constructing a layout template of the publication to be typeset according to the layout template application data.
In a possible implementation manner, in the foregoing method provided in an embodiment of the present invention, the source material data includes at least one layout block, and entry tag data;
wherein the layout tiles in each set contain block or entry tag data and the blocks in each set contain entry tag data.
In a possible implementation manner, in the method provided in an embodiment of the present invention, the basic template includes a first layout unit corresponding to the layout block, a second layout unit corresponding to the block, and a third layout unit corresponding to the entry tag data;
searching and matching a basic template corresponding to the data standard type according to the layout template source material data, and constructing layout template application data, wherein the method specifically comprises the following steps:
searching a first layout unit corresponding to the layout block according to the layout block in the layout template source material data;
searching and matching a second typesetting unit corresponding to the block according to the block in the layout template source material data;
searching a third typesetting unit corresponding to the item label data according to the item label data in the layout template source material data;
and constructing layout template application data according to the first layout unit, the second layout unit and the third layout unit.
In a possible implementation manner, in the method provided in an embodiment of the present invention, the constructing a layout template of the publication to be typeset according to the layout template application data specifically includes:
copying each first layout unit in the layout template application data to an initial layout template of the publication to be typeset;
copying each second typesetting unit in the layout template application data to a corresponding first typesetting unit;
and copying each third typesetting unit in the layout template application data to the corresponding first typesetting unit or second typesetting unit.
In a possible implementation manner, in the foregoing method provided in an embodiment of the present invention, after copying each second layout unit in the layout template application data to a corresponding first layout unit, the method further includes:
and clearing the item tag data typesetting units contained in the second typesetting units.
In a second aspect, an embodiment of the present invention provides an apparatus for making a layout template of a publication, including:
the determining module is used for determining the data standard type adopted by the XML content description of the publication to be typeset;
the acquisition module is used for acquiring a format XML description file corresponding to the data standard type;
the source material data construction module is used for constructing layout template source material data according to the layout XML description file;
the application data construction module is used for searching and matching a basic template corresponding to the data standard type according to the layout template source material data and constructing layout template application data;
and the layout template building module is used for building a layout template of the publication to be typeset according to the layout template application data.
In a possible implementation manner, in the apparatus provided in an embodiment of the present invention, the source material data includes at least one layout block, and entry tag data;
wherein the layout tiles in each set contain block or entry tag data and the blocks in each set contain entry tag data.
In a possible implementation manner, in the apparatus provided in an embodiment of the present invention, the basic template includes a first layout unit corresponding to the layout block, a second layout unit corresponding to the block, and a third layout unit corresponding to the entry tag data;
the application data construction module comprises:
the layout block matching unit is used for searching and matching a first layout unit corresponding to the layout block according to the layout block in the layout template source material data;
the block matching unit is used for searching and matching a second typesetting unit corresponding to the block according to the block in the layout template source material data;
the item tag data matching unit is used for searching a third typesetting unit corresponding to the item tag data according to the item tag data in the source material data of the layout template;
and the construction unit is used for constructing the layout template application data according to the first layout unit, the second layout unit and the third layout unit.
In a possible implementation manner, in the apparatus provided in an embodiment of the present invention, the layout template building module is specifically configured to:
copying each first layout unit in the layout template application data to an initial layout template of the publication to be typeset; copying each second typesetting unit in the layout template application data to a corresponding first typesetting unit; and copying each third typesetting unit in the layout template application data to the corresponding first typesetting unit or second typesetting unit.
In a possible implementation manner, in the apparatus provided in an embodiment of the present invention, the layout template building module is further specifically configured to:
and after copying each second typesetting unit in the layout template application data to the corresponding first typesetting unit, removing the item tag data typesetting unit contained in each second typesetting unit.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first aspect above.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, the program being executed by a processor to implement the method according to the first aspect.
Based on the above aspects, the embodiment of the invention obtains the format XML description file corresponding to the data standard type by determining the data standard type adopted by the XML content description of the publication to be typeset, constructs the format template source material data according to the format XML description file, searches and matches the basic template corresponding to the data standard type according to the format template source material data, constructs the format template application data, and finally constructs the format template of the publication to be typeset according to the format template application data.
It should be understood that what is described in the summary above is not intended to limit key or critical features of embodiments of the invention, nor is it intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Detailed Description
Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present invention are shown in the drawings, it should be understood that the present invention may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and the embodiments of the invention are for illustration purposes only and are not intended to limit the scope of the invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, and in the above-described drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 2 is a schematic flowchart of a method for making a layout template of a publication according to an embodiment of the present invention, as shown in fig. 2, the method may include the following steps:
s101, determining a data standard type adopted by XML content description of the publication to be typeset.
In practical applications, the execution subject of the embodiment may be a layout template making device of a publication. In practical applications, the layout template creation apparatus of the publication may be implemented by a virtual apparatus, such as software code, or may be implemented by an entity apparatus written with related execution code, such as a usb disk, or may be implemented by an entity apparatus integrated with related execution code, such as a chip, an intelligent terminal, or the like.
In practical application, referring to fig. 1, the layout template and the XML content are used as two necessary input sources of the XML layout system, the two are interdependent, an error of any one of the input sources will make the synthesis result of the XML layout system incorrect, and the XML content description of the publication to be laid can adopt different data standards, the data standard types can include JATS, DocBOOK, ToolBook and the like, so the XML content of different data standards needs the layout template corresponding to the data standard, therefore, the layout template making apparatus of the publication first determines the data standard type adopted by the XML content description of the publication to be laid, for example, the determination result is the JATS data standard.
S102, obtaining a format XML description file corresponding to the data standard type.
Specifically, after a data standard type adopted by XML content description is determined, a layout XML description file corresponding to the data standard type is obtained. According to an embodiment of the present invention, the layout XML description file may be generated by a corresponding generating machine, and the layout template generating apparatus of the publication may read the layout XML description file from the generating machine, and preferably, may cache the read data in a memory of a corresponding entity apparatus.
S103, constructing layout template source material data according to the layout XML description file.
In practice, layout block, block and item tag data are provided when identifying the layout characteristics of a publication, and are sequentially included relationships. For example, for the top layout content of a single page publication, it is first defined as a header block, and then the left position is defined as a header left block, the middle position is defined as a header middle block, and the right position is defined as a header right block according to the position of the layout content. The specific laid out content items contained in the block are item tag data.
Specifically, the layout template source material data includes layout blocks, blocks and entry tag data, that is, the required layout blocks, blocks and entry tag data are constructed according to the layout XML description file.
S104, searching and matching a basic template corresponding to the data standard type according to the layout template source material data, and constructing layout template application data.
Specifically, the basic template is also constructed by adopting the data standard type determined in the above steps, wherein the basic template comprises a comprehensive format block typesetting unit, a block typesetting unit and an item label data typesetting unit. In this step, the layout unit in the corresponding basic template can be searched and matched according to the layout block, block and item tag data in the layout template source material data, and layout template application data is constructed.
And S105, constructing a layout template of the publication to be typeset according to the layout template application data.
Specifically, according to an embodiment of the present invention, after the layout block layout unit, the block layout unit, and the item tag data layout unit required for constructing the layout template are determined, each layout unit may be copied to construct the layout template of the publication to be laid out.
According to the method for manufacturing the layout template of the publication, the data standard type adopted by the XML content description of the publication to be typeset is determined, the layout XML description file corresponding to the data standard type is obtained, the layout template source material data is built according to the layout XML description file, the basic template corresponding to the data standard type is searched and matched according to the layout template source material data, the layout template application data is built, and finally the layout template of the publication to be typeset is built according to the layout template application data.
Example two
Fig. 3 is a schematic flow chart of a method for making a layout template of a publication according to a second embodiment of the present invention, and as shown in fig. 3, the method for making a layout template of a publication according to the present embodiment is further detailed in steps S101 to S105 on the basis of the first method embodiment of the present application, and then the method according to the present embodiment includes the following steps:
s201, determining the data standard type adopted by the XML content description of the publication to be typeset.
S202, obtaining a format XML description file corresponding to the data standard type.
S203, establishing format template source material data according to the format XML description file.
Specifically, the source material data includes at least one set of layout block, and entry tag data.
Wherein the layout tiles in each set contain block or entry tag data and the blocks in each set contain entry tag data.
The above steps S201 to S203 correspond to steps S101 to S103 in the first embodiment, and detailed contents are not described herein again.
S204, searching and matching a first layout unit corresponding to the layout block according to the layout block in the layout template source material data. And searching a second typesetting unit corresponding to the block according to the block in the layout template source material data. And searching a third typesetting unit corresponding to the item label data according to the item label data in the layout template source material data.
S205, constructing layout template application data according to the first layout unit, the second layout unit and the third layout unit.
Specifically, the basic template includes a layout unit corresponding to the layout block, a layout unit corresponding to the block, and a layout unit corresponding to the item tag data. And searching and matching the typesetting units in the corresponding basic template according to the layout blocks, the blocks and the item label data in the layout template source material data to construct layout template application data.
S206, copying each first layout unit in the layout template application data to an initial layout template of the publication to be laid.
S207, copying each second typesetting unit in the layout template application data to the corresponding first typesetting unit. And clearing the item tag data typesetting units contained in the second typesetting units.
Specifically, since the copied block layout unit may include other entry tag data layout units, it is preferable to remove the entry tag data layout units included in each block layout unit to avoid the problem of layout error.
And S208, copying each third typesetting unit in the layout template application data to the corresponding first typesetting unit or second typesetting unit.
Specifically, after the layout block typesetting unit, the block typesetting unit and the item tag data typesetting unit required for constructing the layout template are determined, each typesetting unit can be copied to construct the layout template of the publication to be typeset.
The method for manufacturing the layout template of the publication can automatically manufacture the required layout template, reduces the corresponding technical threshold and is not easy to generate errors compared with the existing manual manufacturing mode, so that the training cost is reduced, and the working efficiency is improved.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a layout template manufacturing apparatus for a publication according to a third embodiment of the present invention, as shown in fig. 4, the apparatus includes:
the determining module 310 is configured to determine a data standard type adopted by the XML content description of the publication to be typeset.
An obtaining module 320, configured to obtain a layout XML description file corresponding to the data standard type.
And the source material data construction module 330 is configured to construct layout template source material data according to the layout XML description file.
And the application data construction module 340 is configured to search and match a basic template corresponding to the data standard type according to the layout template source material data, and construct layout template application data.
And a layout template constructing module 350, configured to construct a layout template of the publication to be typeset according to the layout template application data.
The apparatus provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 2, and the implementation principle and the technical effect are similar, which are not described herein again.
Example four
Fig. 5 is a schematic structural diagram of an apparatus for making a layout template of a publication according to a fourth embodiment of the present invention, and as shown in fig. 5, the apparatus according to this embodiment is based on the apparatus according to a third embodiment of the present application, and further, the source material data includes at least one set of layout block, and entry tag data.
Wherein the layout tiles in each set contain block or entry tag data and the blocks in each set contain entry tag data.
According to an embodiment of the present invention, the basic template includes a first layout unit corresponding to the layout block, a second layout unit corresponding to the block, and a third layout unit corresponding to the entry tag data.
The application data construction module 340 includes:
and a layout block matching unit 341, configured to search, according to a layout block in the layout template source material data, a first layout unit corresponding to the layout block in a matching manner.
And the block matching unit 342 is configured to search and match a second typesetting unit corresponding to the block according to the block in the layout template source material data.
And the item tag data matching unit 343 is configured to search, according to the item tag data in the layout template source material data, a third layout unit corresponding to the item tag data in a matching manner.
A constructing unit 344, configured to construct layout template application data according to the first layout unit, the second layout unit, and the third layout unit.
According to an embodiment of the present invention, the layout template building module 350 is specifically configured to:
and copying each first layout unit in the layout template application data to an initial layout template of the publication to be typeset. And copying each second typesetting unit in the layout template application data to the corresponding first typesetting unit. And copying each third typesetting unit in the layout template application data to the corresponding first typesetting unit or second typesetting unit.
According to an embodiment of the present invention, the layout template building module 350 is further specifically configured to:
and after copying each second typesetting unit in the layout template application data to the corresponding first typesetting unit, removing the item tag data typesetting unit contained in each second typesetting unit.
The apparatus provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 3, and the implementation principle and the technical effect are similar, which are not described herein again.
EXAMPLE five
Fig. 6 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention, and as shown in fig. 6, the electronic device includes: memory 610, processor 620, and computer programs.
Wherein the computer program is stored in the memory and configured to be executed by the processor to implement a layout template making method of a publication as in embodiment one of the present application or a layout template making method of a publication as in embodiment two of the present application.
The related description may be understood by referring to the related description and effect corresponding to the steps in fig. 2 to fig. 3, and redundant description is not repeated here.
EXAMPLE six
Sixth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement a method for making a layout template of a publication as in first embodiment of the present application or a method for making a layout template of a publication as in second embodiment of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.