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

File generation method, device, equipment and medium Download PDF

Info

Publication number
CN110929485A
CN110929485A CN201911245176.2A CN201911245176A CN110929485A CN 110929485 A CN110929485 A CN 110929485A CN 201911245176 A CN201911245176 A CN 201911245176A CN 110929485 A CN110929485 A CN 110929485A
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.)
Granted
Application number
CN201911245176.2A
Other languages
Chinese (zh)
Other versions
CN110929485B (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

Images

Abstract

The embodiment of the invention discloses a file generation method, a file generation 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 by each paragraph; according to the field parameters, acquiring the field content of each field included in each paragraph; and generating a file according to the paragraph parameters, the field parameters and the field contents of each field. The file generation method, the file generation device, the file generation equipment and the file generation medium can generate files and improve 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 file generation method, apparatus, device, and medium.
Background
The report forms are used for dynamically displaying data in forms, charts and other formats. At present, reports are generated mainly by means of codes. For a new report to be created, the code corresponding to the report needs to be redeveloped and edited. The report is generated in a code mode, a user needs professional knowledge, and errors are easily generated when the code is edited, so that the report generation efficiency is low.
Disclosure of Invention
Embodiments of the present invention provide a file generation method, apparatus, device, and medium, which can generate a file and improve file generation efficiency.
In one aspect, an embodiment of the present invention provides a file generation 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 by each paragraph;
according to the field parameters, acquiring the field content of each field included in each paragraph;
and generating a file according to the paragraph parameters, the field parameters and the field contents of each field.
In another aspect, an embodiment of the present invention provides a file generating apparatus, including:
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 by 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 contents of each field.
In another aspect, an embodiment of the present invention provides a file generating device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor;
the processor executes the computer program to realize the file generation method provided by the embodiment of the invention.
In another aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the file generation method provided in the embodiment of the present invention.
The file generation method, the file generation device, the file generation equipment and the file generation medium can generate files and improve file generation efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a file generation method according to an embodiment of the present invention;
2 a-2 g are schematic diagrams of a paragraph parameter and field parameter entry system provided by an embodiment of the invention;
FIG. 3 is a schematic structural diagram of a file generation apparatus according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating an exemplary hardware architecture of a computing device capable of implementing the file generation method and apparatus according to embodiments of the present 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 objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting 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 present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
In order to solve the problem of the prior art, embodiments of the present invention provide a file generation method, apparatus, device, and medium. First, a file generation method according to an embodiment of the present invention will be described.
Fig. 1 shows a flowchart of a file generation method according to an embodiment of the present invention. The file generation method may include:
s101: and acquiring paragraph parameters of each paragraph of the file to be generated and field parameters of each field included by each paragraph according to the file format of the file to be generated.
S102: according to the field parameters, the field content of each field included in each paragraph is obtained.
S103: and generating a file according to the paragraph parameters, the field parameters and the field contents of each field.
In one embodiment of the invention, the paragraph parameters may include a paragraph position and a paragraph type.
Paragraph position is the order of paragraphs in the document. Paragraph types may include: a fixed format paragraph, a data detail paragraph, and a data statistics paragraph. The fixed format paragraph refers to that the contents of the file line in the paragraph are all values unrelated to the database, and can be obtained without additional data query. The data detail paragraphs refer to: the fields contained in the file lines in the paragraph need to be obtained by querying data from a database, and each line in the paragraph corresponds to one data source record. The data statistics paragraph means that the fields contained in the file line in the paragraph need to be obtained after statistics on the related data in the data source.
The field parameters may include: the field origin value (the value of the field itself), the field location, the field type, and the field format. Where the field position is the order of the fields in a row of the file. The field types include fixed format fields, preset variable fields, database fields, and statistical fields. The fixed format field refers to a field that does not require any conversion processing and is displayed in the file as the value of the field itself; the preset variable field refers to a variable irrelevant to a data source, and is a field of a predefined variable which needs to be converted when a file is written; the field of the database is a field of a database correlation table, and the value of the field is related to the record in the database; the statistic field is a field which needs to be subjected to statistics and can obtain values. The field format includes the value of the field, the length of the field, and the like. The format parameter of a field is an argument for a function that handles the format of the field. Each field corresponds to a format handling function, which functions to normalize the format of the field contents to the format in the file. The partial format handling function is shown in table 1.
TABLE 1
Figure BDA0002307319930000041
In table 1, str in each function is a function entry, and a value is a field itself. The format processing function is not limited to the functions given in table 1, and the format processing function can be customized according to actual needs.
In an embodiment of the present invention, a file to be generated may be decomposed into a plurality of paragraphs according to a file format, and a paragraph parameter of each paragraph is generated; each paragraph is decomposed into a plurality of fields and field parameters for each field are generated.
In an embodiment of the present invention, for each paragraph, a position of the paragraph in the file to be generated and a 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 paragraph types 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; and 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.
In an embodiment of the present invention, a user may specify a position of a paragraph in a file to be generated, a paragraph type to which the paragraph belongs, a position of a field in the paragraph, a field type to which the field belongs, and a field format of the field, that is, the user may specify a paragraph parameter and a field parameter. Based on the above, the position of the paragraph in the file to be generated, the type of the paragraph to which the paragraph belongs, the position of the field in the paragraph, the type of the field to which the field belongs, and the field format of the field can be determined according to the input of the user.
In an embodiment of the present invention, if the field type is a database field, data meeting a preset condition is searched from the database as 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 organization
Transaction time 1 transaction amount 1 acquirer transaction number 1 merchant number 1
Transaction time 2 transaction amount 2 acquirer transaction number 2 merchant number 2
Transaction time 3 transaction amount 3 acquirer transaction number 3 merchant number 3
……
Total number of strips: x- -amount totaled: y is
YYYY-MM-DD
The file to be generated is decomposed into 4 paragraphs, the paragraph type of the first paragraph is a fixed format paragraph, the paragraph type of the second paragraph is a data detail paragraph, the paragraph type of the third paragraph is a data statistics paragraph, and the paragraph type of the fourth paragraph is a fixed format paragraph.
The first paragraph is decomposed into 1 field, the original value of the field is 'some organization running water report', the field type is fixed format field, the field position is 1, the function corresponding to the field format is ORIGINAL (str).
The second paragraph is broken down into 7 fields, which are "transaction time", "|", "transaction amount", "|", "acquirer", "|" and "merchant number", respectively. The original value of the field of the 1 st field needs to be obtained by querying 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 field with a fixed format, the position of the field is 2, and the function corresponding to the field format is ORIGINAL (str); … …, respectively; the original value of the field of the 7 th field needs to be obtained by querying from a database, the field type is the database field, the field position is 7, and the function corresponding to the field format is origin (str).
The third paragraph is broken down into 5 fields, respectively "total number of bars: "," X "," - - - "," total amount: "and" Y ". The original value of the 1 st field is "total number of pieces: ", the field type is fixed format field, the field position is 1, the function corresponding to the field format is origin (str); … …, respectively; the original value of the field of the 2 nd field needs to be obtained by counting data, the field type is a counting field, the field position is 2, and the function corresponding to the field format is origin (str); … …, respectively; the original value of the field of the 5 th field needs to be obtained by counting data, the field type is a counting field, the field position is 2, and the function corresponding to the field format is origin (str).
The fourth paragraph is decomposed into 1 field, the original value of the field is "year, month and day of file generation", the field type is a preset variable field, the field position is 1, and the function corresponding to the field format is TEXT (str, "yyyy-mm-dd").
For the first paragraph, the obtained field content is "a certain organization running water report".
For the second paragraph, the second paragraph is a data detail paragraph, the fields included in the file lines in the paragraph need to be obtained by querying data from the database, and each line in the paragraph corresponds to one data source record. Assume that there are 4 records in the data source. The contents of 4 records in the data source are shown in table 2.
TABLE 2
Transaction time Amount of transaction Sheet collecting mechanism Merchant number
21:59 days 8, 10 months in 2017 100 A treasure B1
11/2017, 5/13 200 A couplet B1
5/8/10/52 in 2017 140 A payment B2
9/2017, 5/16: 40 200 A couplet B3
The field contents of the first line of the second paragraph acquired are "21: 59", "i", "100", "i", "a certain treasure", "i", and "B1", respectively, in 10/8/2017.
The field contents of the second line of the second paragraph are acquired as "5: 13 on month 11 of 2017,", "200", "|", "some connection", "|" and "B1", respectively.
The field contents of the third line of the second paragraph are acquired as "10: 52 on 5/8/2017", "|", "140", "|", "some payment", "|" and "B2", respectively.
The field contents of the fourth line of the second paragraph are acquired as "16: 40 on 9/5/2017", "|", "200", "|", "some connection", "|" and "B3", respectively.
For the third paragraph, the obtained field contents are "total number: "," 4 "," - - - "," amounts total: "and" 640 ".
For the fourth paragraph, the obtained field contents are: 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 contents and the paragraph parameters.
In one embodiment of the invention, for each paragraph, the field contents of the paragraph are arranged according to the position of the field included by the field parameter in the paragraph; and combining the arranged field contents to obtain the paragraph contents of the paragraphs.
For the above first paragraph, the obtained paragraph contents of the first paragraph are:
running water report form of certain organization
For the second paragraph, the paragraph contents of the second paragraph are obtained as follows:
8/10/2017/21: 59|100| certain Bao | B1
11/2017/5/13 |200| A certain Union | B1
10:52|140| certain payment | B2 in 8.5.7.2017
Year 2017, month 9, day 5, 16:40|200| Union | B3
For the third paragraph, the obtained paragraph contents of the third paragraph are:
total number of strips: 4- -amount totaled: 640
For the above fourth paragraph, the paragraph contents of the obtained fourth paragraph are:
2018-1-5
in an embodiment of the present invention, after obtaining the paragraph contents of each paragraph, the paragraph contents may be arranged according to the position of the paragraph included in the paragraph parameter in the file to be generated; and combining the arranged paragraph contents to generate a file.
The contents of the generated file are as follows:
running water report form of certain organization
8/10/2017/21: 59|100| certain Bao | B1
11/2017/5/13 |200| A certain Union | B1
10:52|140| certain payment | B2 in 8.5.7.2017
Year 2017, month 9, day 5, 16:40|200| Union | B3
Total number of strips: 4- -amount totaled: 640
2018-1-5
The file generation method provided by the embodiment of the invention can generate the file without redeveloping the code of a 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 "some organization running water report", file storage paths such as: d, a certain mechanism/running report and file generation conditions are as follows: generated at 0:00 times daily.
In an embodiment of the present invention, a target file may be obtained, where the target file includes a paragraph parameter of each paragraph of a to-be-generated file corresponding to a file format of the to-be-generated file and a field parameter of each field included in each paragraph; 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 by each paragraph.
The target files of the embodiment of the invention include but are not limited to: extensible markup language (XML) files, JavaScript Object Notation (JSON) files, and the like.
For example, assume that the file format of the file to be generated is as follows:
running water report form of certain organization
Transaction time 1 transaction amount 1 acquirer transaction number 1 merchant number 1
Transaction time 2 transaction amount 2 acquirer transaction number 2 merchant number 2
Transaction time 3 transaction amount 3 acquirer transaction number 3 merchant number 3
……
Total number of strips: x- -amount totaled: y is
YYYY-MM-DD
The user decomposes the file to be generated into 4 paragraphs, the paragraph type of the first paragraph is a fixed format paragraph, the paragraph type of the second paragraph is a data detail paragraph, the paragraph type of the third paragraph is a data statistics paragraph, and the paragraph type of the fourth paragraph is a fixed format paragraph.
The first paragraph is decomposed into 1 field, the original value of the field is 'some organization running water report', the field type is fixed format field, the field position is 1, the function corresponding to the field format is ORIGINAL (str).
The second paragraph is broken down into 7 fields, which are "transaction time", "|", "transaction amount", "|", "acquirer", "|" and "merchant number", respectively. The original value of the field of the 1 st field needs to be obtained by querying 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 field with a fixed format, the position of the field is 2, and the function corresponding to the field format is ORIGINAL (str); … …, respectively; the original value of the field of the 7 th field needs to be obtained by querying from a database, the field type is the database field, the field position is 7, and the function corresponding to the field format is origin (str).
The third paragraph is broken down into 5 fields, respectively "total number of bars: "," X "," - - - "," total amount: "and" Y ". The original value of the 1 st field is "total number of pieces: ", the field type is fixed format field, the field position is 1, the function corresponding to the field format is origin (str); … …, respectively; the original value of the field of the 2 nd field needs to be obtained by counting data, the field type is a counting field, the field position is 2, and the function corresponding to the field format is origin (str); … …, respectively; the original value of the field of the 5 th field needs to be obtained by counting data, the field type is a counting field, the field position is 2, and the function corresponding to the field format is origin (str).
The fourth paragraph is decomposed into 1 field, the original value of the field is "year, month and day of file generation", the field type is a preset variable field, the field position is 1, and the function corresponding to the field format is TEXT (str, "yyyy-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 the paragraphs. The format of the file lines in the paragraphs is sequentially entered according to the sequence of the fields.
Fig. 2 a-2 g are schematic diagrams illustrating a paragraph parameter and field parameter entry system provided by an embodiment of the present invention.
Take the paragraph parameter and the field parameter 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 document paragraph 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 raw value "some organization's running water report" is edited. The result of the entry of the paragraph parameters and field parameters of the first paragraph into the system is shown in FIG. 2 g.
And after the fields of all the paragraphs are edited, generating an XML file which contains paragraph parameters of each paragraph of the file to be generated corresponding to the file format of the file to be generated and field parameters of each field included by each paragraph.
In an embodiment of the present invention, before generating an XML file that includes a paragraph parameter of each paragraph of the to-be-generated file corresponding to the file format of the to-be-generated file and a field parameter of each field included in each paragraph, validity check may be performed on each parameter entered by the user. And if the validity check is passed, generating the XML file which comprises 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 by each paragraph. And if the validity check is not passed, prompting the user to modify.
In an embodiment of the present invention, a parent node of an XML File that includes a paragraph parameter of each paragraph of a to-be-generated File corresponding to a File format of the to-be-generated File and a field parameter of each field included in each paragraph in the to-be-generated File in the embodiment of the present invention may be < File >; < File > nodes include, but are not limited to, < FileInfo > child node, < FileTask > child node, and < FileBody > child node. The < FileInfo > child node stores basic information of the file including but not limited to a file name, a file description, a file generation time, and the like; a < FileTask > child node stores a file generation task; < FileBody > child node stores the file format.
The < FileBody > child nodes include a < FilePara > child node and a < LinePares > child node. < FilePara > represents a paragraph that has both location and type attributes. The < LineProces > child node represents a field that has both location and function type attributes, and the < LineProces > child node stores the value of the field and the parameters of the format handling function.
It is to be understood that when the paragraph type of the file paragraph to be added is selected as the statistical field, the field format processing function selected subsequently is a statistical function. When the paragraph type of the file paragraph to be added is selected as the data detail paragraph, the query statement for querying data from the database needs to be edited subsequently, so as to obtain the field content from the database.
After generating an XML file containing paragraph parameters of each paragraph of the file to be generated corresponding to the file format of the file to be generated and field parameters of each field included in each paragraph, analyzing the XML file to obtain the paragraph parameters of each paragraph of the file to be generated and the field parameters of each field included in each paragraph.
In an embodiment of the present invention, fields that need to Query a database are spliced into an executable Structured Query Language (SQL) statement, and the field content can be queried from the database by executing the SQL statement.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a file generating apparatus. As shown in fig. 3, fig. 3 is a schematic structural diagram of a file generation apparatus according to an embodiment of the present invention.
The file generating apparatus may include:
the first obtaining module 301 is configured to obtain 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 the file format of the file to be generated.
The second obtaining module 302 is configured to obtain field contents of each field included in each paragraph according to the field parameter.
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 an embodiment of the present invention, the first obtaining module 301 may include:
the first generation unit is used for decomposing a file to be generated into a plurality of paragraphs according to a 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 an embodiment of the present invention, the first generating unit may specifically be configured to:
for each paragraph, determining the position of the paragraph in a 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.
In an 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;
and 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.
In an embodiment of the present invention, the second obtaining module 302 may specifically be configured to:
and searching data meeting preset conditions from the database to serve as field content of the field.
In an embodiment of the present invention, the first obtaining module 301 may be specifically configured to:
acquiring a target file, wherein the target file comprises paragraph parameters of each paragraph of the file to be generated corresponding to the file format of the file to be generated and field parameters of each field included by each paragraph;
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 by each paragraph.
In one embodiment of the present invention, the target file is:
an extensible markup language (XML) file.
In an 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 the file according to the paragraph contents and the paragraph parameters.
In an embodiment of the present invention, the third generating unit may specifically be configured to:
for each paragraph, arranging the field contents of the paragraph according to the position of the field included by the field parameters in the paragraph;
and combining the arranged field contents to obtain the paragraph contents of the paragraphs.
In an embodiment of the present invention, the fourth generating unit may specifically be configured to:
arranging the paragraph contents according to the positions of the paragraphs included by the paragraph parameters in the file to be generated;
and combining the arranged paragraph contents to generate a file.
FIG. 4 is a block diagram illustrating an exemplary hardware architecture of a computing device capable of implementing the file generation method and apparatus according to embodiments of the present 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 processing unit 403, the memory 404, and the output interface 405 are connected to each other through a 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, stores the output information temporarily or permanently 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 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 that may include: a memory storing a computer program; and a processor which, when executing the computer program, can implement the file generation method provided by the embodiment of the present invention.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium; the computer program realizes the file generation method provided by the embodiment of the invention when being executed by a processor.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. 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 illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as 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, plug-in, 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 by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, 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 so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent 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, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (13)

1. A method of file generation, the method comprising:
according to the file format of a file to be generated, acquiring paragraph parameters of each paragraph of the file to be generated and field parameters of each field included by each paragraph;
according to the field parameters, acquiring the field content of each field included in each paragraph;
and generating a file according to the paragraph parameters, the field parameters and the field contents of each field.
2. The method according to claim 1, wherein the obtaining, 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 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 a paragraph, the field type to which the field belongs and the field format of the field;
and generating the 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 according to claim 4, wherein the obtaining the field content of each field in each paragraph according to the field parameter comprises:
and searching data meeting preset conditions from the database to serve as field content of the field.
6. The method according to claim 1, wherein the obtaining, 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 includes:
acquiring a target file, wherein the target file comprises paragraph parameters of each paragraph of the file to be generated corresponding to the file format of the file to be generated and field parameters of each field included in each paragraph;
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 by each paragraph.
7. The method of claim 6, wherein the target file is an extensible markup language (XML) file.
8. The method of claim 1, wherein generating a file according to the paragraph parameter, the field parameter, 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 contents and the paragraph parameters.
9. The method of claim 8, wherein generating the paragraph content for each paragraph based on the field parameter and the field content comprises:
for each paragraph, arranging the field contents of the paragraph according to the position of the field included by the field parameters in the paragraph;
and combining the arranged field contents to obtain the paragraph contents of the paragraphs.
10. The method of claim 8, wherein generating a file based on the paragraph contents 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 combining the arranged paragraph contents to generate a file.
11. A file generation apparatus, characterized in that the apparatus 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 by each paragraph according to the file format of the file to be generated;
the second obtaining module is used for obtaining 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 contents of each field.
12. A file generating apparatus, characterized in that the apparatus comprises: 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 a file generation method as claimed in any one of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the file generation method of any one of claims 1 to 10.
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 true CN110929485A (en) 2020-03-27
CN110929485B 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 (7)

* 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
CN101751413A (en) * 2008-12-18 2010-06-23 中国银联股份有限公司 Trading chronological file of field marking method and information recording method thereof
US20170116208A1 (en) * 2015-10-26 2017-04-27 DatalQ,LLC Non-uniform multi-row text file loading
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

Patent Citations (7)

* 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
CN101751413A (en) * 2008-12-18 2010-06-23 中国银联股份有限公司 Trading chronological file of field marking method and information recording method thereof
US20170116208A1 (en) * 2015-10-26 2017-04-27 DatalQ,LLC Non-uniform multi-row text file loading
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
CN110929485B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
US10635435B2 (en) Collection of API documentations
US8615526B2 (en) Markup language based query and file generation
CN109344170B (en) Stream data processing method, system, electronic device and readable storage medium
US20030018666A1 (en) Interoperable retrieval and deposit using annotated schema to interface between industrial document specification languages
CN103699637A (en) Code productivity statistic method and system
CN106096644A (en) Method for measuring similarity based on probability workflow and device
US20080172651A1 (en) Applying Function Level Ownership to Test Metrics
CN116069300A (en) Workflow control code generation method and device, electronic equipment and storage medium
CN109819019B (en) Monitoring and statistical analysis method and system for large-scale network data acquisition
CN112434115B (en) Data processing method and device, electronic equipment and readable storage medium
CN110929485B (en) File generation method, device, equipment and medium
CN114238024A (en) Timing diagram generation method and system
CN110782238B (en) Abnormal resource transfer combination identification method, device, equipment and medium
Kulkarni et al. Novel Approach to Abstract the Data Flow Diagram from Java Application Program
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
CN112258607B (en) Slide rendering method and device and electronic equipment
CN112540913B (en) Method, system, equipment and readable storage medium for determining code coverage rate
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
CN112836063B (en) Method for realizing feature tracing
CN114817267A (en) Method, apparatus and medium for generating data report
CN111125147B (en) Extra-large set analysis method and device based on extended pre-calculation model and SQL function
CN112559366B (en) Method, device, system, equipment and storage medium for updating test object
CN110188332B (en) Seat information table generation method, apparatus, computer device and storage medium

Legal Events

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