CN110929485B - File generation method, device, equipment and medium - Google Patents

File generation method, device, equipment and medium Download PDF

Info

Publication number
CN110929485B
CN110929485B CN201911245176.2A CN201911245176A CN110929485B CN 110929485 B CN110929485 B CN 110929485B CN 201911245176 A CN201911245176 A CN 201911245176A CN 110929485 B CN110929485 B CN 110929485B
Authority
CN
China
Prior art keywords
field
paragraph
file
parameters
generated
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.)
Active
Application number
CN201911245176.2A
Other languages
Chinese (zh)
Other versions
CN110929485A (en
Inventor
黄唯
冯哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Unionpay Co Ltd
Original Assignee
China Unionpay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201911245176.2A priority Critical patent/CN110929485B/en
Publication of CN110929485A publication Critical patent/CN110929485A/en
Application granted granted Critical
Publication of CN110929485B publication Critical patent/CN110929485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the invention discloses a file generation method, a device, equipment and a medium. The method comprises the following steps: according to the file format of the file to be generated, acquiring paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph; acquiring the field content of each field included in each paragraph according to the field parameters; and generating a file according to the paragraph parameters, the field parameters and the field content of each field. The file generation method, device, equipment and medium provided by the embodiment of the invention can generate the file and improve the file generation efficiency.

Description

File generation method, device, equipment and medium
Technical Field
The present invention relates to the field of file processing technologies, and in particular, to a method, an apparatus, a device, and a medium for generating a file.
Background
The report forms dynamically display data in the form of tables, charts and the like. At present, a report is mainly generated in a code mode. For creating a new report, the code corresponding to the report needs to be redeveloped and edited. The report is generated in a code mode, the user needs to have professional knowledge, and the editing code is easy to make mistakes, so that the report generation efficiency is lower.
Disclosure of Invention
The embodiment of the invention provides a file generation method, device, equipment and medium, which can generate a file and improve file generation efficiency.
In one aspect, an embodiment of the present invention provides a file generating method, including:
according to the file format of the file to be generated, acquiring paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph;
acquiring the field content of each field included in each paragraph according to the field parameters;
and generating a file according to the paragraph parameters, the field parameters and the field content of each field.
On the other hand, the embodiment of the invention provides a file generating device, which comprises:
the first acquisition module is used for acquiring paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph according to the file format of the file to be generated;
the second acquisition module is used for acquiring the field content of each field included in each paragraph according to the field parameters;
and the generation module is used for generating a file according to the paragraph parameters, the field parameters and the field content of each field.
In still another aspect, an embodiment of the present invention provides a file generating apparatus, including: a processor, a memory, and a computer program stored on the memory and executable on the processor;
the processor implements the file generation method provided by the embodiment of the invention when executing the computer program.
In still another aspect, an embodiment of the present invention provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements a file generating method provided by the embodiment of the present invention.
The file generation method, device, equipment and medium provided by the embodiment of the invention can generate the file and improve the file generation efficiency.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings that are needed to be used in the embodiments of the present invention will be briefly described, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flow chart of a file generation method according to an embodiment of the present invention;
FIGS. 2 a-2 g are schematic diagrams illustrating paragraph parameter and field parameter entry systems provided by embodiments of the present invention;
fig. 3 is a schematic structural diagram of a file generating apparatus according to an embodiment of the present invention;
fig. 4 illustrates a block diagram of an exemplary hardware architecture of a computing device capable of implementing the file generation method and apparatus according to an embodiment of the invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely configured to illustrate the invention and are not configured to limit the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the invention by showing examples of the invention.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
In order to solve the problems in the prior art, the embodiment of the invention provides a file generation method, a device, equipment and a medium. The file generating method provided by the embodiment of the invention is first described below.
Fig. 1 shows a flow chart of a file generation method according to an embodiment of the present invention. The file generation method may include:
s101: and acquiring the paragraph parameters of each paragraph of the file to be generated and the field parameters of each field included in each paragraph according to the file format of the file to be generated.
S102: and acquiring the field content of each field included in each paragraph according to the field parameters.
S103: and generating a file according to the paragraph parameters, the field parameters and the field content of each field.
In one embodiment of the invention, paragraph parameters may include paragraph position and paragraph type.
Paragraph location, i.e., the order of paragraphs in the file. Paragraph types may include: fixed format paragraphs, data detail paragraphs, and data statistics paragraphs. Where a fixed format paragraph refers to a paragraph in which the file line content is a database-independent value, and is obtained without additional data queries. The data detail paragraph refers to: the fields contained in the file lines in the paragraphs need to be obtained by querying the data in the database, and each line in the paragraphs corresponds to a data source record. The data statistics paragraph refers to that fields contained in file lines in the paragraph can not be obtained until the statistics of the related data in the data source is performed.
The field parameters may include: the field original value (the value of the field itself), the field location, the field type, and the field format. Where the field location is the order of the fields in a row of files. The field types include a fixed format field, a preset variable field, a database field, and a statistics field. A fixed format field refers to a field that is displayed in a file as the value of the field itself without any conversion process; the preset variable field refers to a variable irrelevant to a data source, and a field of a predefined variable which needs to be converted when writing a file; the database field refers to a field which is a field of a database related table, and the value of the field is related to records in the database; the statistics field is a field in which a value is available for a data statistics party. The field format includes the value of the field, the length of the field, and the like. The format parameters of a field are an entry to a function that handles the format of the field. Each field corresponds to a format handling function that functions to normalize the format of the field contents to the format in the file. The partial format processing functions are shown in table 1.
TABLE 1
In table 1, str in each function is a function input parameter, and the value is a field itself. The format handling function is not limited to the functions given in table 1, and may be customized according to actual needs.
In one embodiment of the present invention, a file to be generated may be decomposed into a plurality of paragraphs according to a file format, and paragraph parameters of each paragraph may be generated; each paragraph is decomposed into a plurality of fields and field parameters for each field are generated.
In one embodiment of the present invention, for each paragraph, the position of the paragraph in the file to be generated and the paragraph type to which the paragraph belongs may be determined; and generating paragraph parameters of the paragraphs according to the positions of the paragraphs in the file to be generated and the types of the paragraphs to which the paragraphs belong.
In one embodiment of the present invention, for each field, the position of the field in the paragraph, the field type to which the field belongs, and the field format of the field may be determined; generating field parameters of the fields according to the positions of the fields in the paragraphs, the field types of the fields and the field formats of the fields.
In one embodiment of the present invention, the user may specify the location of the paragraph in the file to be generated, the paragraph type to which the paragraph belongs, the location of the field in the paragraph, the field type to which the field belongs, and the field format of the field, i.e., the user may specify the paragraph parameters and the field parameters. Based on this, the position of the paragraph in the file to be generated, the paragraph type to which the paragraph belongs, the position of the field in the paragraph, the field type to which the field belongs, and the field format of the field can be determined according to the input of the user.
In one embodiment of the present invention, if the field type is a database field, searching the database for data meeting the preset condition as the field content of the field.
Suppose that the file format of the file to be generated is as follows:
running water report form of certain mechanism
Transaction time 1|transaction amount 1|acquirer 1|merchant number 1
Transaction time 2 transaction amount 2 acquirer 2 merchant number 2
Transaction time 3 transaction amount 3 order receipts 3 merchant number 3
……
Total number of bars: x— sum total: y is Y
YYYY-MM-DD
The file to be generated is decomposed into 4 paragraphs, the first paragraph is a fixed format paragraph, the second paragraph is a data detail paragraph, the third paragraph is a data statistics paragraph, and the fourth paragraph is a fixed format paragraph.
The first paragraph is decomposed into 1 field, the ORIGINAL value of the field is 'a mechanism running report', the field type is a fixed format field, the field position is 1, and the function corresponding to the field format is ORIGINAL (str).
The second paragraph is broken down into 7 fields, respectively "transaction time", "|", "transaction amount", "|", "order taking entity", "|", and "merchant number". The field ORIGINAL value of the 1 st field is required to be obtained by inquiring from a database, the field type is a database field, the field position is 1, and the function corresponding to the field format is ORIGINAL (str); the ORIGINAL value of the 2 nd field is "|", the field type is a fixed format field, the field position is 2, and the function corresponding to the field format is ORIGINAL (str); … …; the ORIGINAL value of the 7 th field needs to be obtained from the database, the field type is the database field, the field position is 7, and the function corresponding to the field format is ORIGINAL (str).
The third paragraph breaks down into 5 fields, respectively "total number of bars: "," X "," - - ", and" in total: "and" Y ". The field original value of the 1 st field is "total number of pieces: the field type is a fixed format field, the field position is 1, and the function corresponding to the field format is ORIGINAL (str); … …; the ORIGINAL value of the 2 nd field is obtained by counting the data, the field type is a statistic field, the field position is 2, and the function corresponding to the field format is ORIGINAL (str); … …; the field ORIGINAL value of the 5 th field needs to be obtained by statistics, the field type is a statistical field, the field position is 2, and the function corresponding to the field format is ORIGINAL (str).
The fourth paragraph is decomposed into 1 field, the field original value of the field is 'file generation year, month and day', the field type is a preset variable field, the field position is 1, and the function corresponding to the field format is TEXT (str) 'yyyyy-mm-dd'.
For the first paragraph, the obtained field content is a 'mechanism running report'.
For the second paragraph, the second paragraph is a data detail paragraph, the fields included in the file line in the paragraph need to be obtained by querying data from the database, and each line in the paragraph corresponds to a data source record. Assume that there are 4 records in the data source. The contents of the 4 records in the data source are shown in table 2.
TABLE 2
Transaction time Transaction amount Collecting mechanism Merchant number
2017, 10, 8, 21:59 100 Some treasures B1
2017, 11, 5/13 200 Certain association B1
2017, 5, 8, 10:52 140 Some pair of B2
2017, 9, 5, 16:40 200 Certain association B3
The field contents of the first line of the obtained second paragraph are "2017, 10, 8, 21:59", "|", "100", "|", "certain treasures", "|", and "B1", respectively.
The field contents of the second line of the second paragraph obtained are "2017, 11, 5, 13", "|", "200", "|", "certain link", "|", and "B1", respectively.
The field contents of the third line of the obtained second paragraph are "2017, 5, 8, 10:52", "|", "140", "|", "certain pair", "|", and "B2", respectively.
The field contents of the fourth line of the obtained second paragraph are "2017, 9, 5, 16:40", "|", "200", "|", "certain link", "|", and "B3", respectively.
For the third paragraph, the obtained field contents are "total number of pieces: "," 4"," - - "," amount total: "and" 640".
For the fourth paragraph, the obtained field content is: 2018-1-5.
After the field content of each field of each paragraph is obtained, the paragraph content of each paragraph can be generated according to the field parameters and the field content; and generating a file according to the paragraph content and the paragraph parameters.
In one embodiment of the invention, for each paragraph, the field contents of the paragraph are arranged according to the positions of the fields included in the field parameters in the paragraph; and merging the arranged field contents to obtain paragraph contents of the paragraphs.
For the first paragraph, the obtained paragraph content of the first paragraph is:
running water report form of certain mechanism
For the second paragraph, the obtained paragraph contents of the second paragraph are:
10.2017.8.21:59.sub.100.sub.certain B1
11.2017.5.5:13.sub.200.certain Union.sub.B1
5.8.2017.10:52.sub.140.certain payment.sub.B2
5.2017.9.16:40.sub.200.certain Union.sub.B3
For the third paragraph, the obtained paragraph contents of the third paragraph are:
total number of bars: 4- -sum of money: 640
For the fourth paragraph, the obtained paragraph contents of the fourth paragraph are:
2018-1-5
in one embodiment of the present invention, after obtaining the paragraph content of each paragraph, the paragraph content may be arranged according to the positions of the paragraphs included in the paragraph parameters in the file to be generated; and merging the arranged paragraph contents to generate a file.
The content of the generated file is as follows:
running water report form of certain mechanism
10.2017.8.21:59.sub.100.sub.certain B1
11.2017.5.5:13.sub.200.certain Union.sub.B1
5.8.2017.10:52.sub.140.certain payment.sub.B2
5.2017.9.16:40.sub.200.certain Union.sub.B3
Total number of bars: 4- -sum of money: 640
2018-1-5
The file generation method provided by the embodiment of the invention can generate the file without redevelopment of codes of the new report file, and can improve the file generation efficiency.
In one embodiment of the present invention, a file name, a file storage path, a file generation condition, and the like of a file to be generated may also be set. File names such as "organization's running water report", file storage paths such as: "D \some organization\running water report\file generation conditions such as: daily 0:00 generation.
In one embodiment of the present invention, a target file may be obtained, where the target file includes a paragraph parameter of each paragraph of the file to be generated corresponding to a file format of the file to be generated and a field parameter of each field included in each paragraph; analyzing the target file to obtain paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph.
The object files of the embodiment of the invention include, but are not limited to: extensible markup language (Extensible Markup Language, XML) files, javaScript object notation (JavaScript Object Notation, JSON) files, and the like.
By way of example, assume that the file format of the file to be generated is as follows:
running water report form of certain mechanism
Transaction time 1|transaction amount 1|acquirer 1|merchant number 1
Transaction time 2 transaction amount 2 acquirer 2 merchant number 2
Transaction time 3 transaction amount 3 order receipts 3 merchant number 3
……
Total number of bars: x— sum total: y is Y
YYYY-MM-DD
The user breaks the file to be generated into 4 paragraphs, wherein the first paragraph is a fixed format paragraph, the second paragraph is a data detail paragraph, the third paragraph is a data statistics paragraph, and the fourth paragraph is a fixed format paragraph.
The first paragraph is decomposed into 1 field, the ORIGINAL value of the field is 'a mechanism running report', the field type is a fixed format field, the field position is 1, and the function corresponding to the field format is ORIGINAL (str).
The second paragraph is broken down into 7 fields, respectively "transaction time", "|", "transaction amount", "|", "order taking entity", "|", and "merchant number". The field ORIGINAL value of the 1 st field is required to be obtained by inquiring from a database, the field type is a database field, the field position is 1, and the function corresponding to the field format is ORIGINAL (str); the ORIGINAL value of the 2 nd field is "|", the field type is a fixed format field, the field position is 2, and the function corresponding to the field format is ORIGINAL (str); … …; the ORIGINAL value of the 7 th field needs to be obtained from the database, the field type is the database field, the field position is 7, and the function corresponding to the field format is ORIGINAL (str).
The third paragraph breaks down into 5 fields, respectively "total number of bars: "," X "," - - ", and" in total: "and" Y ". The field original value of the 1 st field is "total number of pieces: the field type is a fixed format field, the field position is 1, and the function corresponding to the field format is ORIGINAL (str); … …; the ORIGINAL value of the 2 nd field is obtained by counting the data, the field type is a statistic field, the field position is 2, and the function corresponding to the field format is ORIGINAL (str); … …; the field ORIGINAL value of the 5 th field needs to be obtained by statistics, the field type is a statistical field, the field position is 2, and the function corresponding to the field format is ORIGINAL (str).
The fourth paragraph is decomposed into 1 field, the field original value of the field is 'file generation year, month and day', the field type is a preset variable field, the field position is 1, and the function corresponding to the field format is TEXT (str) 'yyyyy-mm-dd'.
The user enters paragraph parameters and field parameters into the system. When the paragraph parameters and the field parameters are input into the system, the whole file format is sequentially input according to the sequence of paragraphs. The format of the file lines in the paragraphs is sequentially recorded according to the sequence of the fields.
Fig. 2 a-2 g are schematic diagrams illustrating paragraph parameter and field parameter entry systems provided by embodiments of the present invention.
Take the paragraph parameters and field parameters of the first paragraph as an example.
In the interface shown in fig. 2a, click "add file paragraph". In the interface shown in fig. 2b, the "paragraph type" of the paragraph of the file to be added is selected, at which time the fixed format paragraph is selected. In the interface shown in fig. 2c, click "add field". In the interface shown in fig. 2d, the "field type" of the field to be added is selected, at which time the "fixed format field" is selected. In the interface shown in fig. 2e, a field format handling function is selected. In the interface shown in FIG. 2f, the field original value "some organization running report" is edited. The result of entering the paragraph parameters and field parameters of the first paragraph into the system is shown in fig. 2 g.
When the field editing of all the paragraphs is completed, an XML file containing the paragraph parameters of each paragraph of the file to be generated corresponding to the file format of the file to be generated and the field parameters of each field included in each paragraph is generated.
In one embodiment of the present invention, before generating the XML file including the paragraph parameter of each paragraph of the file to be generated corresponding to the file format of the file to be generated and the field parameter of each field included in each paragraph, the validity check may also be performed on each parameter entered by the user. If the validity check is passed, an XML file containing paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph corresponding to the file format of the file to be generated is generated. If the validity check is not passed, prompting the user to modify.
In one embodiment of the present invention, the parent node of the XML File of the embodiment of the present invention, which includes the paragraph parameter of each paragraph of the File to be generated corresponding to the File format of the File to be generated and the field parameter of each field included in each paragraph, may be < File >; the < File > node includes, but is not limited to, a < FileInfo > child node, a < FileTask > child node, and a < FileBody > child node. The < FileInfo > child node stores basic information of the file including, but not limited to, file name, file description, file generation time, etc.; the < FileTask > child node stores a file generation task; the < FileBody > child node stores the file format.
The < FileBody > child nodes include a < FilePara > child node and a < linesources > child node. < FilePara > represents a paragraph, which has both location and type properties. The < LinePoes > child node represents a field that has two attributes of location and function type, the < LinePoes > child node stores the value of the field and the parameters of the format handling function.
It will be appreciated that when the paragraph type of the file paragraph to be added is selected as the statistics field, the subsequently selected field format processing function is the statistics function. When the paragraph type of the paragraph to be added with the file is selected as the data detail paragraph, the query statement for querying the data from the database is required to be edited subsequently so as to acquire the field content from the database.
After an XML file containing the paragraph parameters of each paragraph and the field parameters of each field included in each paragraph of the file to be generated corresponding to the file format of the file to be generated is generated, the XML file is parsed, and the obtained paragraph parameters of each paragraph and the field parameters of each field included in each paragraph of the file to be generated are obtained.
In one embodiment of the invention, the fields that need to query the database are spliced into executable structured query language (Structured Query Language, SQL) statements, and the field content can be queried from the database by executing the SQL statements.
Corresponding to the method embodiment, the embodiment of the invention also provides a file generation device. As shown in fig. 3, fig. 3 shows a schematic structural diagram of a file generating apparatus according to an embodiment of the present invention.
The file generating apparatus may include:
the first obtaining module 301 is configured to obtain, according to a file format of a file to be generated, a paragraph parameter of each paragraph of the file to be generated and a field parameter of each field included in each paragraph.
A second obtaining module 302, configured to obtain, according to the field parameter, a field content of each field included in each paragraph.
The generating module 303 is configured to generate a file according to the paragraph parameter, the field parameter, and the field content of each field.
In one embodiment of the present invention, the first obtaining module 301 may include:
the first generation unit is used for decomposing the file to be generated into a plurality of paragraphs according to the file format and generating paragraph parameters of each paragraph;
and the second generation unit is used for decomposing each paragraph into a plurality of fields and generating the field parameters of each field.
In one embodiment of the present invention, the first generating unit may specifically be configured to:
for each paragraph, determining the position of the paragraph in the file to be generated and the paragraph type to which the paragraph belongs;
and generating paragraph parameters of the paragraphs according to the positions of the paragraphs in the file to be generated and the types of the paragraphs to which the paragraphs belong.
In one embodiment of the present invention, the second generating unit may specifically be configured to:
for each field, determining the position of the field in the paragraph, the field type of the field and the field format of the field;
generating field parameters of the fields according to the positions of the fields in the paragraphs, the field types of the fields and the field formats of the fields.
In one embodiment of the present invention, the second obtaining module 302 may specifically be configured to:
searching data meeting preset conditions from a database, and taking the data as field contents of the fields.
In one embodiment of the present invention, the first obtaining module 301 may specifically be configured to:
obtaining a target file, wherein the target file comprises paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph, wherein the paragraph parameters of each paragraph of the file to be generated correspond to the file format of the file to be generated;
analyzing the target file to obtain paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph.
In one embodiment of the invention, the target file is:
extensible markup language XML files.
In one embodiment of the present invention, the generating module 303 may include:
a third generating unit, configured to generate paragraph contents of each paragraph according to the field parameters and the field contents;
and the fourth generation unit is used for generating a file according to the paragraph content and the paragraph parameters.
In one embodiment of the present invention, the third generating unit may specifically be configured to:
for each paragraph, arranging the field contents of the paragraphs according to the positions of the fields included by the field parameters in the paragraphs;
and merging the arranged field contents to obtain paragraph contents of the paragraphs.
In one embodiment of the present invention, the fourth generating unit may specifically be configured to:
arranging paragraph contents according to positions of paragraphs included in paragraph parameters in a file to be generated;
and merging the arranged paragraph contents to generate a file.
Fig. 4 illustrates a block diagram of an exemplary hardware architecture of a computing device capable of implementing the file generation method and apparatus according to an embodiment of the invention. As shown in fig. 4, computing device 400 includes an input device 401, an input interface 402, a central processor 403, a memory 404, an output interface 405, and an output device 406. The input interface 402, the central processor 403, the memory 404, and the output interface 405 are connected to each other through the bus 410, and the input device 401 and the output device 406 are connected to the bus 410 through the input interface 402 and the output interface 405, respectively, and further connected to other components of the computing device 400.
Specifically, the input device 401 receives input information from the outside, and transmits the input information to the central processor 403 through the input interface 402; the central processor 403 processes the input information based on computer executable instructions stored in the memory 404 to generate output information, temporarily or permanently stores the output information in the memory 404, and then transmits the output information to the output device 406 through the output interface 405; output device 406 outputs the output information to the outside of computing device 400 for use by a user.
That is, the computing device shown in fig. 4 may also be implemented as a file generation device, which may include: a memory storing a computer program; and a processor, which can implement the file generation method provided by the embodiment of the invention when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium is stored with a computer program; the computer program, when executed by a processor, implements the file generation method provided by the embodiment of the present invention.
It should be understood that the invention is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
In the foregoing, only the specific embodiments of the present invention are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present invention is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present invention, and they should be included in the scope of the present invention.

Claims (12)

1. A method of generating a file, the method comprising:
acquiring a paragraph parameter of each paragraph of the file to be generated and a field parameter of each field included in each paragraph according to a file format of the file to be generated;
acquiring the field content of each field included in each paragraph according to the field parameters;
generating a file according to the paragraph parameters, the field parameters and the field content of each field;
the obtaining the paragraph parameter of each paragraph of the file to be generated and the field parameter of each field included in each paragraph according to the file format of the file to be generated includes:
obtaining a target file, wherein the target file comprises paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph, which correspond to the file format of the file to be generated, and the target file is a file generated by decomposing the file to be generated in advance to obtain paragraph parameters and field parameters, and sequentially inputting the paragraph parameters and the field parameters into a system according to the sequence and performing validity check;
and analyzing the target file to obtain paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph.
2. The method according to claim 1, wherein the obtaining the paragraph parameter of each paragraph of the file to be generated and the field parameter of each field included in each paragraph according to the file format of the file to be generated includes:
according to the file format, decomposing the file to be generated into a plurality of paragraphs, and generating paragraph parameters of each paragraph;
each paragraph is decomposed into a plurality of fields and field parameters for each field are generated.
3. The method of claim 2, wherein generating paragraph parameters for each paragraph comprises:
for each paragraph, determining the position of the paragraph in the file to be generated and the paragraph type to which the paragraph belongs;
and generating paragraph parameters of the paragraphs according to the positions of the paragraphs in the file to be generated and the paragraph types to which the paragraphs belong.
4. The method of claim 2, wherein generating the field parameters for each field comprises:
for each field, determining the position of the field in the paragraph, the field type of the field and the field format of the field;
generating field parameters of the field according to the position of the field in the paragraph, the field type of the field and the field format of the field.
5. The method of claim 4, wherein the obtaining the field content of each field in each paragraph according to the field parameters comprises:
searching data meeting preset conditions from a database, and taking the data as field contents of the fields.
6. The method of claim 1, wherein the object file is an extensible markup language XML file.
7. The method of claim 1, wherein generating the file based on the paragraph parameters, the field parameters, and the field content of each field comprises:
generating paragraph contents of each paragraph according to the field parameters and the field contents;
and generating a file according to the paragraph content and the paragraph parameters.
8. The method of claim 7, wherein generating paragraph content for each paragraph based on the field parameters and the field content comprises:
for each paragraph, arranging the field content of the paragraph according to the positions of the fields included by the field parameters in the paragraph;
and merging the arranged field contents to obtain paragraph contents of the paragraphs.
9. The method of claim 7, wherein generating a file from the paragraph content and the paragraph parameters comprises:
arranging the paragraph contents according to the positions of the paragraphs included in the paragraph parameters in the file to be generated;
and merging the arranged paragraph contents to generate a file.
10. A document generating apparatus, the apparatus comprising:
the first acquisition module is used for acquiring paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph according to the file format of the file to be generated;
the second acquisition module is used for acquiring the field content of each field included in each paragraph according to the field parameters;
the generation module is used for generating a file according to the paragraph parameters, the field parameters and the field content of each field;
the first obtaining module is specifically configured to obtain a target file, where the target file includes a paragraph parameter of each paragraph of the file to be generated and a field parameter of each field included in each paragraph, where the paragraph parameter corresponds to a file format of the file to be generated, and the target file is a file generated by decomposing the file to be generated in advance to obtain a paragraph parameter and a field parameter, and sequentially entering the paragraph parameter and the field parameter into a system in sequence and performing validity verification;
and analyzing the target file to obtain paragraph parameters of each paragraph of the file to be generated and field parameters of each field included in each paragraph.
11. A file generating apparatus, the apparatus comprising: a processor, a memory, and a computer program stored on the memory and executable on the processor;
the processor, when executing the computer program, implements the file generation method according to any one of claims 1 to 9.
12. A computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the file generation method according to any one of claims 1 to 9.
CN201911245176.2A 2019-12-06 2019-12-06 File generation method, device, equipment and medium Active CN110929485B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911245176.2A CN110929485B (en) 2019-12-06 2019-12-06 File generation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911245176.2A CN110929485B (en) 2019-12-06 2019-12-06 File generation method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110929485A CN110929485A (en) 2020-03-27
CN110929485B true CN110929485B (en) 2023-09-19

Family

ID=69858223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911245176.2A Active CN110929485B (en) 2019-12-06 2019-12-06 File generation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110929485B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751413A (en) * 2008-12-18 2010-06-23 中国银联股份有限公司 Trading chronological file of field marking method and information recording method thereof
CN107609131A (en) * 2017-09-18 2018-01-19 中国银行股份有限公司 A kind of report file generation method and device
CN108694214A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 Generation method, generating means, readable medium and the electronic equipment of data sheet
CN109471890A (en) * 2018-10-16 2019-03-15 深圳壹账通智能科技有限公司 Generation method, terminal device and the medium of report file
CN110263316A (en) * 2019-06-27 2019-09-20 深圳前海微众银行股份有限公司 A kind of document handling method, device and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040117731A1 (en) * 2002-09-27 2004-06-17 Sergey Blyashov Automated report building system
US10185757B2 (en) * 2015-10-26 2019-01-22 Dataiq, Llc Non-uniform multi-row text file loading

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751413A (en) * 2008-12-18 2010-06-23 中国银联股份有限公司 Trading chronological file of field marking method and information recording method thereof
CN108694214A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 Generation method, generating means, readable medium and the electronic equipment of data sheet
CN107609131A (en) * 2017-09-18 2018-01-19 中国银行股份有限公司 A kind of report file generation method and device
CN109471890A (en) * 2018-10-16 2019-03-15 深圳壹账通智能科技有限公司 Generation method, terminal device and the medium of report file
CN110263316A (en) * 2019-06-27 2019-09-20 深圳前海微众银行股份有限公司 A kind of document handling method, device and computer equipment

Also Published As

Publication number Publication date
CN110929485A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
US20200218737A1 (en) Method, system and program product for matching of transaction records
US7305614B2 (en) Interoperable retrieval and deposit using annotated schema to interface between industrial document specification languages
CN109344170B (en) Stream data processing method, system, electronic device and readable storage medium
CN103699637A (en) Code productivity statistic method and system
WO2003069521A2 (en) Method, software application and system for incorporating benchmark data into a business software application
US20170193375A1 (en) Rule guided fabrication of structured data and messages
CN111523072A (en) Page access data statistical method and device, electronic equipment and storage medium
CN110765750B (en) Report data input method and terminal equipment
CN108960672B (en) Quota and time-limited wind control method and device and computer readable storage medium
CN103678396B (en) A kind of data back up method and device based on data model
CN110929485B (en) File generation method, device, equipment and medium
CN112434115B (en) Data processing method and device, electronic equipment and readable storage medium
CN104378362B (en) For carrying out the method and device of message interface conversion
CN109614535B (en) Method and device for acquiring network data based on Scapy framework
CN110781235A (en) Big data based purchase data processing method and device, terminal and storage medium
CN114358596A (en) Index calculation method and device
Pugliese et al. A natural language processing tool to support the electronic invoicing process in Italy
CN110782238B (en) Abnormal resource transfer combination identification method, device, equipment and medium
CN114238024A (en) Timing diagram generation method and system
CN114663176A (en) Business operation execution method, device, equipment and computer readable storage medium
Madhan et al. Tool development for formalizing the requirement for the safety critical software engineering process
Basci et al. Entropy metric for xml dtd documents
CN111709250B (en) Method, apparatus, electronic device, and storage medium for information processing
CN110765100B (en) Label generation method and device, computer readable storage medium and server
CN112258607B (en) Slide rendering method and device and electronic equipment

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