CN112347745B - Method and device for acquiring file generation progress, electronic device and storage medium - Google Patents

Method and device for acquiring file generation progress, electronic device and storage medium Download PDF

Info

Publication number
CN112347745B
CN112347745B CN202011137208.XA CN202011137208A CN112347745B CN 112347745 B CN112347745 B CN 112347745B CN 202011137208 A CN202011137208 A CN 202011137208A CN 112347745 B CN112347745 B CN 112347745B
Authority
CN
China
Prior art keywords
line number
current
target data
generation progress
progress
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
CN202011137208.XA
Other languages
Chinese (zh)
Other versions
CN112347745A (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.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity 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 DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN202011137208.XA priority Critical patent/CN112347745B/en
Publication of CN112347745A publication Critical patent/CN112347745A/en
Application granted granted Critical
Publication of CN112347745B publication Critical patent/CN112347745B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a method, a device, an electronic device and a storage medium for acquiring file generation progress, wherein the method for acquiring the file generation progress comprises the following steps: acquiring target data and the total number of rows of the target data; the target data represents data required for generating a target file; monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for carrying out write processing on the target data; and acquiring and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number. By the method and the device, the problem that in the related technology, accurate file generation progress cannot be obtained is solved.

Description

Method and device for acquiring file generation progress, electronic device and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring a file generation progress, an electronic device, and a storage medium.
Background
In the data analysis and research and judgment system, a plurality of functions of generating and downloading an Excel report are provided, but when the Excel report to be generated contains a large amount of data, the time required for generating the Excel report is long, so that a user is in a waiting state for a long time, the generation progress of the Excel report cannot be perceived in real time, and the experience of the user is greatly influenced.
In the related art, a simulation method is adopted to calculate the generation progress of an Excel report. However, the scheme of simulating the generation progress does not truly reflect the generation progress of the Excel report. The generation progress calculated by the method is not accurate, so that when the displayed generation progress is 99%, the waiting time of the user is still long, and bad experience is brought to the user.
At present, aiming at the problem that the accurate file generation progress cannot be obtained in the related technology, no effective solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a method, a device, an electronic device and a storage medium for acquiring file generation progress, which are used for at least solving the problem that in the related technology, accurate file generation progress cannot be acquired.
In a first aspect, an embodiment of the present application provides a method for acquiring a file generation progress, where the method includes:
acquiring target data and the total number of rows of the target data; the target data represents data required for generating a target file;
monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for carrying out write processing on the target data;
and acquiring and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number.
In some embodiments, the obtaining and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number includes:
obtaining a single line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number represents the line number corresponding to each data;
obtaining the current generation progress of the target file according to the total number of lines of the target data and the current writing line number;
judging whether the current generation progress meets a preset recording condition or not according to the current writing line number and the single line number; and if the preset recording conditions are met, recording the current generation progress of the target file.
In some embodiments, the determining, according to the current number of writing lines and the single number of lines, whether the current generation progress meets a preset recording condition includes:
performing remainder processing on the current writing line number according to the single line number to obtain a remainder;
judging whether the current generation progress meets a preset recording condition according to the remainder, and if the remainder is zero, determining that the current generation progress meets the preset recording condition;
and if the remainder is not zero, determining that the current generation progress does not meet the preset recording condition.
In some of these embodiments, the method further comprises:
judging whether the generation flow of the target file is finished according to the current generation progress;
if the generation flow of the target file is not completed, continuing to record the current generation progress of the target file;
and if the generation flow of the target file is completed, ending the recording flow of the current generation progress of the target file.
In some embodiments, the listening to the write function to obtain the current write line number of the target data includes: and after the data rendering is completed, the function monitors the write-in function to acquire the current write-in line number of the target data.
In a second aspect, an embodiment of the present application provides an apparatus for acquiring a file generation progress, where the apparatus includes:
the data acquisition module is used for acquiring target data and the total line number of the target data; the target data represents data required for generating a target file;
the write monitoring module is used for monitoring the write function to obtain the current write line number of the target data;
and the progress recording module is used for acquiring and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number.
In some embodiments, the progress recording module includes a single line number acquisition unit, a generation progress acquisition unit, and a generation progress recording unit, wherein:
the single-part line number acquisition unit is used for acquiring the single-part line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number represents the line number corresponding to each data;
the generation progress acquisition unit is used for acquiring the current generation progress of the target file according to the total line number and the current writing line number of the target data;
the generation progress recording unit is used for judging whether the current generation progress meets a preset recording condition according to the current writing line number and the single line number; and if the preset recording conditions are met, recording the current generation progress of the target file.
In some embodiments, the generating progress record unit includes a remainder subunit, a first determination subunit, and a second determination subunit, wherein:
a remainder taking subunit, configured to perform remainder taking processing on the current writing line number according to the single line number, so as to obtain a remainder;
the first determining subunit is configured to determine whether the current generation progress meets a preset recording condition according to the remainder, and if the remainder is zero, determine that the current generation progress meets the preset recording condition;
and the second determining subunit is used for determining that the current generation progress does not meet the preset recording condition if the remainder is not zero.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements a method for calculating a file generation progress according to the first aspect when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program which, when executed by a processor, implements a method for calculating a file generation progress as described in the first aspect above.
Compared with the related art, the method, the device, the electronic device and the storage medium for acquiring the file generation progress provided by the embodiment of the application acquire the target data and the total line number of the target data; the target data represents data required for generating a target file; monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for carrying out write processing on the target data; according to the total line number of the target data and the current writing line number, the current generation progress of the target file is obtained and recorded, and the problem that in the related art, the accurate file generation progress cannot be obtained is solved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 is a flowchart of a method for acquiring a file generation progress in an embodiment of the present application;
FIG. 2 is a flowchart of acquiring and recording a current generation progress of a target file according to an embodiment of the present application;
FIG. 3 is a flowchart for determining whether the current generation progress satisfies a preset recording condition in the embodiment of the present application;
FIG. 4 is a flowchart of a process for determining whether generation of a target file is completed in an embodiment of the present application;
FIG. 5 is a flowchart of a method for acquiring file generation progress in a preferred embodiment of the present application;
FIG. 6 is a flowchart of a method for obtaining a file generation progress according to an embodiment of the present application;
fig. 7 is a hardware structure block diagram of a terminal of a method for acquiring a file generation progress in the embodiment of the present application;
fig. 8 is a block diagram of a file generation progress acquisition device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described and illustrated below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden on the person of ordinary skill in the art based on the embodiments provided herein, are intended to be within the scope of the present application. Moreover, it should be appreciated that while such a development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as having the benefit of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by those of ordinary skill in the art that the embodiments described herein can be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar terms herein do not denote a limitation of quantity, but rather denote the singular or plural. The terms "comprising," "including," "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means greater than or equal to two. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. The terms "first," "second," "third," and the like, as used herein, are merely distinguishing between similar objects and not representing a particular ordering of objects.
The various techniques described herein may be applied, but are not limited to, to various file generation systems and various file loading systems, so as to display the generation progress or the loading progress of the target file in real time.
Fig. 1 is a flowchart of a method for obtaining a file generation progress according to an embodiment of the present application, as shown in fig. 1, where the flowchart includes the following steps:
step S110, obtaining target data and total line number of the target data; the target data represents data required for generating the target file.
Step S120, monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for performing write processing on the target data.
The current write line number indicates the line number of the data that has been written currently.
Step S130, according to the total number of lines of the target data and the current writing line number, the current generation progress of the target file is obtained and recorded.
According to the total number of lines of the target data and the current writing line number, the ratio of the line number of the current written data to the total line number of the target data, namely the current generation progress of the target file, can be calculated in real time.
Obtaining target data and a total line number of the target data through the steps S110 to S130; the target data represents data required for generating the target file; monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for carrying out write processing on the target data; and acquiring and recording the current generation progress of the target file according to the total line number and the current writing line number of the target data. According to the method, the write-in function is monitored, so that the current write-in line number of the target data can be obtained in real time, the current generation progress of the accurate target file is obtained according to the total line number of the target data and the current write-in line number, the generation progress of the file can be truly reflected by adopting the method, the problem that the waiting time of a user is too long due to inaccurate generation progress can be avoided, the user experience is improved, and the problem that the accurate file generation progress cannot be obtained in the related technology is solved.
In some of these embodiments, step S120 includes: and monitoring the write-in function by the function after the data rendering is completed, and obtaining the current write-in line number of the target data.
The function is arranged in a row writing processing interface (RowWriteHandler interface) after the data rendering is completed, so that the channel monitoring of the writing function is realized.
Specifically, the write-in function is monitored by calling a function after the data rendering is completed (afterRowDispose function), namely, the function after the data rendering is completed once is called every time one line of target data is written, so that the current write-in line number of the target data can be obtained in an accumulated mode.
According to the embodiment, the function arranged in the line writing processing interface after the line data rendering is completed is called, so that the line monitoring of the writing function is realized, the current writing line number of the target data is obtained, and the current generation progress of the target file can be accurately calculated according to the total line number and the current writing line number of the target data. Meanwhile, the implementation monitors the write-in function in a disk way, and the write-in processing of target data is not affected.
In some embodiments, fig. 2 is a flowchart of acquiring and recording a current generation progress of a target file according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S210, obtaining a single line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number indicates the line number corresponding to each data.
Further, the preset number of parts is set to 100 parts.
For example, the total number of lines of the target data is a, and the preset number of copies is 100. The number of lines corresponding to each data can be calculated to be B according to the total number of lines of the target data and the preset number of lines. If the total line number of the target data is greater than or equal to 100, the line number corresponding to each data is B=A/100; if the total number of lines of the target data is less than 100, the number of lines corresponding to each data is b=a. For another example, if the total number of lines of the target data is a=1, the number of lines corresponding to each data is b=a=1. In other embodiments, the preset number of copies may be set according to actual situations, and is not limited specifically.
Step S220, according to the total number of lines of the target data and the current writing line number, the current generation progress of the target file is obtained.
Step S230, judging whether the current generation progress meets the preset recording condition according to the current writing line number and the single line number; and if the preset recording conditions are met, recording the current generation progress of the target file.
It should be noted that, when the data size of the target data is large, if one line of data is written, the current generation progress of the target file is recorded once, and the current generation progress of two adjacent records is very small in phase difference, so that a preset recording condition needs to be set, and when the preset recording condition is met, the current generation progress of the target file is recorded, so that unnecessary memory occupation and computing resource occupation can be avoided.
In the steps S210 to S230, by setting the preset recording condition and determining whether the current generation progress meets the preset recording condition according to the current writing line number and the single line number, when the current generation progress of the target file is recorded while meeting the preset recording condition, the problem that the system processing efficiency is affected due to the fact that the interval time between two adjacent recording current generation progress is too short and the numerical value change is small when the data volume of the target data is too large can be avoided, and the system processing efficiency is not affected while the file generation progress calculation precision is improved.
In some embodiments, fig. 3 is a flowchart of determining whether the current generating progress meets the preset recording condition in the embodiments of the present application, and as shown in fig. 3, the flowchart includes the following steps:
step S310, performing remainder processing on the current writing line number according to the single line number to obtain a remainder.
Step S320, judging whether the current generation progress meets the preset recording condition according to the remainder, and if the remainder is zero, determining that the current generation progress meets the preset recording condition.
In step S330, if the remainder is not zero, it is determined that the current generation progress does not satisfy the preset recording condition.
Through the steps S310 to S330, performing remainder processing on the current writing line number according to the single line number to obtain a remainder; judging whether the current generation progress meets the preset recording condition according to the remainder, and if the remainder is zero, determining that the current generation progress meets the preset recording condition; and if the remainder is not zero, determining that the current generation progress does not meet the preset recording condition. According to the method, the remainder is obtained by performing remainder processing on the current writing line number according to the single line number, and whether the current generation progress meets the preset recording condition or not can be rapidly and accurately judged according to the remainder, so that preparation is made for the current generation progress of the follow-up recording target file.
In some embodiments, fig. 4 is a flowchart of a process for determining whether generation of a target file is completed in the embodiments of the present application, as shown in fig. 4, where the process includes the following steps:
step S410, judging whether the generation flow of the target file is completed according to the current generation progress.
Step S420, if the generation flow of the target file is not completed, continuing to record the current generation progress of the target file.
For example, if the current generation progress is 50%, determining that the generation flow of the target file is not completed, and continuing to record the current generation progress of the target file.
Step S430, if the generation flow of the target file is completed, the recording flow of the current generation progress of the target file is ended.
For example, if the current generation progress is 100%, it is determined that the generation flow of the target file is completed, and the recording flow of the current generation progress of the target file is ended.
The embodiments of the present application are described and illustrated below by means of preferred embodiments.
Fig. 5 is a flowchart of a method for obtaining a file generation progress according to a preferred embodiment of the present application, as shown in fig. 5, where the flowchart includes the following steps:
step S510, obtaining target data and total line number of the target data; the target data represents data required for generating the target file.
Step S520, monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for performing write processing on the target data.
Step S530, obtaining a single line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number indicates the line number corresponding to each data.
Step S540, according to the total number of lines of the target data and the current writing line number, the current generation progress of the target file is obtained.
Step S550, judging whether the current generation progress meets the preset recording condition according to the current writing line number and the single line number; and if the preset recording conditions are met, recording the current generation progress of the target file.
The embodiments of the present application are further described and illustrated below by way of one specific embodiment.
Fig. 6 is a flow chart of a method for obtaining a file generation progress according to an embodiment of the present application, as shown in fig. 6, where the flow chart includes the following steps:
(1) Acquiring target data and total line number of the target data; the target data represents data required for generating the target file; and after the line data rendering is completed, the function monitors a write-in function to acquire the current write-in line number of the target data, and the write-in function is used for carrying out write-in processing on the target data.
(2) Obtaining a single line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number represents the line number corresponding to each data; and obtaining the current generation progress of the target file according to the total number of lines of the target data and the current writing line number.
(3) Performing remainder processing on the current writing line number according to the single line number to obtain a remainder; and judging whether the current generation progress meets the preset recording condition according to the remainder, if the remainder is zero, determining that the current generation progress meets the preset recording condition, and recording the current generation progress of the target file.
(4) Judging whether the generation flow of the target file is completed or not according to the current generation progress; if the generation flow of the target file is not completed, continuing to record the current generation progress of the target file; and if the generation flow of the target file is completed, ending the recording flow of the current generation progress of the target file.
It should be noted that, the obtained current generation progress may also be stored in the memory in real time and displayed on the interface of the user side.
It should be noted that the steps illustrated in the above-described flow or flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein. For example, with reference to fig. 3, the execution sequence of step S320 and step S330 may be interchanged, i.e., step S320 may be executed first, and then step S330 may be executed; step S330 may be performed first, and then step S320 may be performed. For another example, in connection with fig. 4, the order of step S420 and step S430 may also be interchanged.
The method embodiment provided in this embodiment may be executed in a terminal, a computer or a similar computing device. Taking the operation on the terminal as an example, fig. 7 is a block diagram of a hardware structure of the terminal of the method for acquiring the file generation progress in the embodiment of the present application. As shown in fig. 7, the terminal may include one or more processors 702 (only one is shown in fig. 7) (the processor 702 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 704 for storing data, and optionally a transmission device 706 for communication functions and an input-output device 708. It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely illustrative and is not intended to limit the structure of the terminal. For example, the terminal may also include more or fewer components than shown in fig. 7, or have a different configuration than shown in fig. 7.
The memory 704 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for acquiring a file generation progress in the embodiment of the present application, and the processor 702 executes the computer program stored in the memory 704 to perform various functional applications and data processing, that is, implement the above-described method. Memory 704 may include high-speed random access memory, but may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 704 may further include memory located remotely from the processor 702, such remote memory being connectable to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 706 is used to receive or transmit data via a network. The specific example of the network described above may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 706 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
The embodiment also provides a device for obtaining the file generation progress, which is used for implementing the above embodiment and the preferred embodiment, and is not described in detail. As used below, the terms "module," "unit," "sub-unit," and the like may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 8 is a block diagram of a file generation progress obtaining apparatus according to an embodiment of the present application, and as shown in fig. 6, the file generation progress obtaining apparatus 800 includes:
a data acquisition module 810, configured to acquire target data and a total number of rows of the target data; the target data represents data required for generating the target file.
The write monitor module 820 is configured to monitor the write function to obtain a current write line number of the target data.
The progress recording module 830 is configured to obtain and record a current generation progress of the target file according to the total number of lines and the current number of writing lines of the target data.
In some of these embodiments, the progress recording module 830 includes a single line number acquisition unit, a generation progress acquisition unit, and a generation progress recording unit, where:
the single-part line number acquisition unit is used for acquiring a single-part line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number indicates the line number corresponding to each data.
And the generation progress acquisition unit is used for acquiring the current generation progress of the target file according to the total line number and the current writing line number of the target data.
The generation progress recording unit is used for judging whether the current generation progress meets the preset recording condition according to the current writing line number and the single line number; and if the preset recording conditions are met, recording the current generation progress of the target file.
In some of these embodiments, the generating a progress record unit includes a remainder sub-unit, a first determination sub-unit, and a second determination sub-unit, wherein:
and the remainder taking subunit is used for taking remainder from the current writing line number according to the single line number to obtain remainder.
And the first determination subunit is used for judging whether the current generation progress meets the preset recording condition according to the remainder, and if the remainder is zero, determining that the current generation progress meets the preset recording condition.
And the second determining subunit is used for determining that the current generation progress does not meet the preset recording condition if the remainder is not zero.
In some embodiments, the progress recording module 830 further includes a flow determination unit, a first execution unit, and a second execution unit, where:
and the flow judgment unit is used for judging whether the generation flow of the target file is completed according to the current generation progress.
And the first execution unit is used for continuing to record the current generation progress of the target file if the generation flow of the target file is not completed.
And the second execution unit is used for ending the recording flow of the current generation progress of the target file if the generation flow of the target file is completed.
In some embodiments, the write monitor module 820 is further configured to call the function to monitor the write function after the data rendering is completed, and obtain the current write line number of the target data.
The above-described respective modules may be functional modules or program modules, and may be implemented by software or hardware. For modules implemented in hardware, the various modules described above may be located in the same processor; or the above modules may be located in different processors in any combination.
The present embodiment also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring target data and the total number of lines of the target data; the target data represents data required for generating a target file.
S2, monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for carrying out write processing on the target data.
And S3, acquiring and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number.
It should be noted that, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and this embodiment is not repeated herein.
In addition, in combination with the method for acquiring the file generation progress in the above embodiment, the embodiment of the application may provide a storage medium for implementation. The storage medium has a computer program stored thereon; the computer program, when executed by a processor, implements the method for acquiring the file generation progress of any one of the above embodiments.
It should be understood by those skilled in the art that the technical features of the above-described embodiments may be combined in any manner, and for brevity, all of the possible combinations of the technical features of the above-described embodiments are not described, however, they should be considered as being within the scope of the description provided herein, as long as there is no contradiction between the combinations of the technical features.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (6)

1. A method for obtaining a file generation progress, the method comprising:
acquiring target data and the total number of rows of the target data; the target data represents data required for generating a target file;
monitoring a write function to obtain the current write line number of the target data, wherein the write function is used for carrying out write processing on the target data;
acquiring and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number;
the step of obtaining and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number comprises the following steps:
obtaining a single line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number represents the line number corresponding to each data;
obtaining the current generation progress of the target file according to the total number of lines of the target data and the current writing line number;
judging whether the current generation progress meets a preset recording condition or not according to the current writing line number and the single line number; if the preset recording conditions are met, recording the current generation progress of the target file;
the step of judging whether the current generation progress meets a preset recording condition according to the current writing line number and the single line number comprises the following steps:
performing remainder processing on the current writing line number according to the single line number to obtain a remainder;
judging whether the current generation progress meets a preset recording condition according to the remainder, and if the remainder is zero, determining that the current generation progress meets the preset recording condition;
and if the remainder is not zero, determining that the current generation progress does not meet the preset recording condition.
2. The method according to claim 1, wherein the method further comprises:
judging whether the generation flow of the target file is finished according to the current generation progress;
if the generation flow of the target file is not completed, continuing to record the current generation progress of the target file;
and if the generation flow of the target file is completed, ending the recording flow of the current generation progress of the target file.
3. The method of claim 1, wherein listening for the write function to obtain a current number of write lines for the target data comprises:
and after the data rendering is completed, the function monitors the write-in function to acquire the current write-in line number of the target data.
4. An apparatus for acquiring a file generation progress, the apparatus comprising:
the data acquisition module is used for acquiring target data and the total line number of the target data; the target data represents data required for generating a target file;
the write monitoring module is used for monitoring the write function to obtain the current write line number of the target data;
the progress recording module is used for acquiring and recording the current generation progress of the target file according to the total line number of the target data and the current writing line number;
the progress recording module comprises a single line number acquisition unit, a generation progress acquisition unit and a generation progress recording unit, wherein:
the single-part line number acquisition unit is used for acquiring the single-part line number corresponding to the target data according to the total line number and the preset number of the target data; the single line number represents the line number corresponding to each data;
the generation progress acquisition unit is used for acquiring the current generation progress of the target file according to the total line number and the current writing line number of the target data;
the generation progress recording unit is used for judging whether the current generation progress meets a preset recording condition according to the current writing line number and the single line number; if the preset recording conditions are met, recording the current generation progress of the target file;
the generating progress recording unit comprises a remainder taking subunit, a first determining subunit and a second determining subunit, wherein:
a remainder taking subunit, configured to perform remainder taking processing on the current writing line number according to the single line number, so as to obtain a remainder;
the first determining subunit is configured to determine whether the current generation progress meets a preset recording condition according to the remainder, and if the remainder is zero, determine that the current generation progress meets the preset recording condition;
and the second determining subunit is used for determining that the current generation progress does not meet the preset recording condition if the remainder is not zero.
5. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of calculating a file generation progress as claimed in any of claims 1 to 3.
6. A storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the method of calculating a file generation progress of any one of claims 1 to 3.
CN202011137208.XA 2020-10-22 2020-10-22 Method and device for acquiring file generation progress, electronic device and storage medium Active CN112347745B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011137208.XA CN112347745B (en) 2020-10-22 2020-10-22 Method and device for acquiring file generation progress, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011137208.XA CN112347745B (en) 2020-10-22 2020-10-22 Method and device for acquiring file generation progress, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112347745A CN112347745A (en) 2021-02-09
CN112347745B true CN112347745B (en) 2024-03-19

Family

ID=74359699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011137208.XA Active CN112347745B (en) 2020-10-22 2020-10-22 Method and device for acquiring file generation progress, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112347745B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468705A (en) * 2015-11-18 2016-04-06 广东南方通信建设有限公司 Mobile communication background data file importing method
CN110795920A (en) * 2019-09-09 2020-02-14 国网电子商务有限公司 Document generation method and device
CN111400246A (en) * 2020-03-26 2020-07-10 广州酷旅旅行社有限公司 Asynchronous file importing method and device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10599630B2 (en) * 2015-05-29 2020-03-24 Oracle International Corporation Elimination of log file synchronization delay at transaction commit time

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468705A (en) * 2015-11-18 2016-04-06 广东南方通信建设有限公司 Mobile communication background data file importing method
CN110795920A (en) * 2019-09-09 2020-02-14 国网电子商务有限公司 Document generation method and device
CN111400246A (en) * 2020-03-26 2020-07-10 广州酷旅旅行社有限公司 Asynchronous file importing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112347745A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
CN108777033B (en) Shared charger treasure leasing method based on shared leasing equipment and terminal equipment thereof
CN107148009B (en) Multi-standard mobile communication network internet data flow measuring device and method thereof
CN111510350B (en) Data time-sharing acquisition method and device based on multiple channels
CN110321075B (en) Data migration method, device, equipment and storage medium based on nbd equipment
CN108600399A (en) Information-pushing method and Related product
CN113204451A (en) Pressure testing method and system for Redis cluster, storage medium and terminal
CN112347745B (en) Method and device for acquiring file generation progress, electronic device and storage medium
CN110896369B (en) Method, device, equipment and medium for determining working time limit of equipment
CN108347355A (en) A kind of detection method and its equipment of application state
CN113792058B (en) Index data processing method and device, electronic equipment and storage medium
CN111372027B (en) Video file storage method and device, storage medium and electronic device
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
CN115442266A (en) Gateway performance testing method and device, storage medium and electronic device
CN110572479B (en) Electronic scale management method, electronic scale and storage medium
CN112711384A (en) Data storage method and device based on multiple storage devices
CN114490374A (en) Applied pressure test method, electronic device, storage medium, and program product
CN111369270B (en) Method, device and system for distributing rewarding resources
CN112153679A (en) Network switching method and device
CN113051105A (en) Data processing method, device, equipment and storage medium
CN105188071A (en) Method, device and system for testing terminal power consumption
CN111291291B (en) Page loading time processing method, device and system
CN116881016B (en) Processing method and device of server process, storage medium and electronic equipment
CN113420171B (en) Image management method, device and storage medium
CN115243286B (en) Data processing method, device and storage medium
CN113242457B (en) Resource distribution method and device, electronic equipment and storage medium

Legal Events

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