CN115766697A - File downloading method, device, equipment and storage medium - Google Patents

File downloading method, device, equipment and storage medium Download PDF

Info

Publication number
CN115766697A
CN115766697A CN202210589804.4A CN202210589804A CN115766697A CN 115766697 A CN115766697 A CN 115766697A CN 202210589804 A CN202210589804 A CN 202210589804A CN 115766697 A CN115766697 A CN 115766697A
Authority
CN
China
Prior art keywords
target
file
target task
task
downloading
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.)
Pending
Application number
CN202210589804.4A
Other languages
Chinese (zh)
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.)
Huizhou Desay SV Automotive Co Ltd
Original Assignee
Huizhou Desay SV Automotive 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 Huizhou Desay SV Automotive Co Ltd filed Critical Huizhou Desay SV Automotive Co Ltd
Priority to CN202210589804.4A priority Critical patent/CN115766697A/en
Publication of CN115766697A publication Critical patent/CN115766697A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a file downloading method, a file downloading device, file downloading equipment and a storage medium. The method comprises the following steps: acquiring a target task identifier according to the target parameter; determining a target task state according to the target task identifier; and if the target task state is a successful operation state, downloading a target file corresponding to the target task. The embodiment of the invention monitors the task state in real time, and downloads the archived file to the local for storage after detecting that the task runs successfully. The user can automatically download the archived file to the local computer after the Jenkins task is built each time by executing the program locally, whether the building is completed or not does not need to be identified manually, the latest built product can be ensured to be obtained in time, and the problem that the work efficiency of the user is influenced due to the fact that the file is large or the network speed is low when the user downloads the file can be avoided.

Description

File downloading method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a file downloading method, apparatus, device, and storage medium.
Background
Jenkins (a continuous integration tool) can archive constructed products through plug-ins after task construction is completed, the Jenkins can call the plug-ins to copy archived files to a network path, and a user can copy the archived files to a local computer from the network path; or directly clicking the corresponding file from the Jenkins construction interface after the construction is finished, and downloading the file to the local.
When the file is small, it is convenient to use the above two methods, and once the file size is as large as several G or tens of G, and the network speed is slow, it may take several hours to download one file. For users, jenkins cannot copy archived files to a user's local computer, and can only store the archived files to a server or place the archived files on a network path for the user to copy. The local computer of the user cannot acquire the latest state files in real time, and if the files are software for debugging/testing, the downloading speed greatly influences the working efficiency of the users.
Disclosure of Invention
The invention provides a file downloading method, a file downloading device, file downloading equipment and a storage medium, which are used for solving the problem that the working efficiency of a user is influenced because the downloading speed of a file is influenced by a large file or a low network speed when the user downloads the file and have the advantage that an archived file can be automatically downloaded to a local computer.
According to an aspect of the present invention, there is provided a file downloading method, including:
acquiring a target task identifier according to the target parameter;
determining a target task state according to the target task identifier;
and if the target task state is a successful operation state, downloading a target file corresponding to the target task.
According to another aspect of the present invention, there is provided a file downloading apparatus, including:
the acquisition module is used for acquiring a target task identifier according to the target parameter;
the determining module is used for determining the target task state according to the target task identifier;
and the downloading module is used for downloading the target file corresponding to the target task if the target task state is a successful operation state.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the file download method according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the file downloading method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the target task identifier is obtained according to the target parameter, the target task state is determined according to the target task identifier, and if the target task state is the successful operation state, the target file corresponding to the target task is downloaded. The embodiment of the invention solves the problem that the working efficiency of a user is influenced because the downloading speed of the file is influenced by larger file or slower network speed when the user downloads the file, the user can automatically download the target file corresponding to the target task to the local computer after the target task is built and completed each time by executing the program locally, whether the building is completed or not does not need to be identified manually, the latest built product can be obtained in time, and the beneficial effect that the archived file can be automatically downloaded to the local computer is achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a file downloading method according to an embodiment of the present invention;
fig. 2 is a flowchart of another file downloading method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a file downloading device according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing the file downloading method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "target," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a file downloading method according to an embodiment of the present invention, where the embodiment is applicable to a file downloading situation, the method may be executed by a file downloading device, and the file downloading device may be implemented in a hardware and/or software form, and the file downloading device may be integrated in any electronic device that provides a file downloading function. As shown in fig. 1, the method includes:
and S101, acquiring a target task identifier according to the target parameter.
It should be noted that the target parameter may be a parameter for specifying a task, where one parameter corresponds to one task. Specifically, the target parameter may be input by a user.
It is to be construed that the target task may be a user-specified task. Illustratively, the target task identification may be the name of the task.
As can be appreciated, jenkins is an open-source continuous integration tool, and provides a rich function Interface Jenkins API (API is an abbreviation for Application Programming Interface). Starting from the Jenkins API, the embodiment of the invention obtains the Jenkins API through a Python script (a computer programming language), and obtains the target task identifier corresponding to the target parameter according to the target parameter input by the user.
Specifically, an HTTP (Hyper Text Transfer Protocol) Protocol mode is a non-KeepAlive mode (the non-KeepAlive mode may also be referred to as "short connection"), an account name and a password input by a user are obtained, and identity authentication is performed according to the account name and the password input by the user. And if the identity authentication is passed, inputting a target parameter by the user, and acquiring a target task identifier corresponding to the target parameter through Jenkins API according to the target parameter input by the user.
And S102, determining the target task state according to the target task identifier.
It should be noted that the target task state may be a running state of a task specified by a user. Specifically, the target task state may include: an in-service state, an out-of-service state, a successful-service state, and a failed-service state.
Specifically, a target task identifier corresponding to the target parameter is obtained according to the target parameter input by the user, and a target task state corresponding to the target task identifier is determined according to the target task identifier.
In the actual operation process, whether the target task state is the running state or the non-running state can be determined according to the target task identifier, if the target task state is the running state, jenkins server connection is established, jenkins API is called to obtain the target task identifier, and whether the target task state is the running success state, the running failure state or the running state is determined according to the target task identifier; if the target task state is the non-running state, a "waiting for construction" reminder may be printed, a target sleep time (where the target time may be preset according to an actual situation, for example, may be 5 seconds, which is not limited in the embodiment of the present invention) is set, and after the sleep is finished, the account name and the password input by the user are obtained again, and the identity verification operation is performed according to the account name and the password input by the user.
And S103, if the target task state is the operation success state, downloading a target file corresponding to the target task.
The running success state may refer to a state in which the target task runs end and the construction is successful.
It should be noted that the target file may be a file formed after the target task is finished and successfully built. Illustratively, the target file may be software used for debugging/testing.
Specifically, if the target task state is the running state, a Jenkins server connection is established, a Jenkins API is called to obtain a target task identifier, and whether the target task state is the running success state, the running failure state or the running state is determined according to the target task identifier. If the target task state is a successful operation state, downloading a target file corresponding to the target task; if the target task state is the operation failure state, printing a 'construction failure' prompt, setting a dormancy target time (wherein the target time can be preset according to an actual situation, for example, 5 seconds, which is not limited in the embodiment of the invention), and after the dormancy is finished, returning to execute the operation of acquiring the account name and the password input by the user and performing identity verification according to the account name and the password input by the user; if the target task state is the running state, the prompt of 'building' is printed, the target dormancy time is set (the target dormancy time can be preset according to the actual situation, for example, 5 seconds, and the embodiment of the invention does not limit the target dormancy time), after dormancy is finished, the Jenkins server connection is returned to be established, jenkins API is called to obtain the target task identifier, and the operation of determining the target task state according to the target task identifier is carried out.
According to the technical scheme of the embodiment of the invention, the target task identifier is obtained according to the target parameter, the target task state is determined according to the target task identifier, and if the target task state is the successful operation state, the target file corresponding to the target task is downloaded. The embodiment of the invention solves the problem that the working efficiency of a user is influenced because the downloading speed of the file is influenced by larger file or slower network speed when the user downloads the file, the user can automatically download the target file corresponding to the target task to the local computer after the target task is built and completed each time by executing the program locally, whether the building is completed or not does not need to be identified manually, the latest built product can be obtained in time, and the beneficial effect that the archived file can be automatically downloaded to the local computer is achieved.
Optionally, if the running state of the target task is a running success state, downloading a target file corresponding to the target task includes:
and if the running state of the target task is a successful running state, obtaining a target construction number corresponding to the target task identifier.
It should be noted that the target build number may be a number of a last successful build of the target task. In the actual operation process, the target task corresponds to a building number during each building.
Specifically, if the running state of the target task is a successful running state, the terminal obtains a target construction number corresponding to the successful last construction of the target task identifier.
And establishing connection with the target server according to the target construction number.
The target server may be a Jenkins server connected to the terminal.
Specifically, the terminal establishes connection with the Jenkins server according to the target construction number.
And generating a construction information acquisition instruction according to the target construction number, and sending the construction information acquisition instruction to the target server so that the target server determines the target construction information according to the target construction number.
It should be noted that the construction information obtaining instruction may be an instruction for obtaining construction information of the target task in the construction process. Specifically, the configuration information acquisition instruction may be sent to the target server by the terminal.
The target construction information may be construction information when the target task is constructed successfully last time.
Specifically, the terminal generates a construction information acquisition instruction according to the target construction number, and calls Jenkins API to send the construction information acquisition instruction to the target server, so that the target server determines the target construction information according to the target construction number.
And receiving target construction information fed back by the target server.
Specifically, after the target server determines the target construction information according to the target construction number, the target construction information is sent to the terminal, and the terminal receives the target construction information fed back by the target server.
And determining a target URL address according to the target construction information.
It should be noted that the target URL address may be a target server URL (Uniform Resource Locator) address.
Specifically, the terminal determines a target URL address of the target server according to the target construction information.
And acquiring an archived file list.
It should be noted that the archived file list may refer to an archived file list constructed when the target task is successfully constructed for the last time. Illustratively, the archived file list may be a folder. In the actual operation process, the target task corresponds to an archived file list during each construction.
Specifically, the terminal obtains an archived file list constructed when the target task is constructed successfully for the last time.
And determining a target address according to the archived file list and the target URL address.
Wherein, the target address can be a download link address for downloading the target file.
Specifically, the Jenkins server URL address and the folder where the archived file is located are spliced into a complete downloading connection.
And downloading a target file corresponding to the target task according to the target address.
Specifically, a wget (a free tool for automatically downloading files from the network) instruction is called to download the target file corresponding to the target task to the local computer according to the target address. Where the wget instruction is used to download a file from a specified URL.
In the actual file downloading process, whether the file list is traversed or not needs to be continuously judged, if the traversal is completed, the operation of acquiring the account name and the password input by the user is returned, and the identity verification operation is performed according to the account name and the password input by the user; and if the traversal is not finished, returning to execute to determine a target address according to the archived file list and the target URL address, and downloading a target file corresponding to the target task according to the target address.
Optionally, obtaining the target task identifier according to the target parameter includes:
and acquiring an account name and a password input by a user.
Wherein, the account name and the password can be input by the user for checking the user identity. Specifically, the embodiment of the present invention may be implemented by a Python script, and the account name and the password may be input by the user in a command line in the program.
Specifically, an account name and a password input by a user in a command line in a program are acquired.
And performing identity verification according to the account name and the password.
Specifically, identity authentication is performed according to an account name and a password input by a user. For example, the authentication may be performed by comparing an account name and a password input by the user with a preset account name and password. If the account name and the password input by the user are consistent with the preset account name and password, the identity authentication is passed; and if the account name and the password input by the user are inconsistent with the preset account name and the preset password, the identity authentication fails, error information is printed, and the program is ended.
And if the identity authentication is passed, acquiring the target parameters.
Specifically, if the user passes the authentication, the target parameters input by the user are obtained.
And determining a target task identifier according to the target parameters.
Specifically, a target task identifier corresponding to a target parameter is determined according to the target parameter input by a user.
Optionally, acquiring an account name and a password input by a user includes:
and when the HTTP protocol mode is a non-KeepAlive mode, acquiring an account name and a password input by the user.
Specifically, because the method needs to establish the Jenkins server connection for n times in a circulating way, in order to avoid the problem of connection failure caused by too many HTTP connections, the program sets the HTTP protocol to adopt a non-KeepAlive mode when starting to execute, namely, each request/response client and the server need to establish a new connection, and the connection is immediately disconnected after the completion. A sleep target time (where the target time may be preset according to an actual situation, for example, may be 5 seconds, which is not limited in this embodiment of the present invention) is set before each loop, and Jenkins server buffer time is given.
Optionally, the method further includes:
and if the running state of the target task is the running state, generating reminding information and displaying the reminding information.
The running state may be a state in which the target task is running and the running is not finished.
Specifically, if the target task state is the running state, the reminder information such as "being constructed" is generated, and the reminder information is displayed.
And returning to execute the operation of establishing connection with the target server according to the target construction number when the target time is reached.
The target time may be preset according to actual conditions, and may be, for example, 5 seconds, which is not limited in the embodiment of the present invention.
Specifically, if the running state of the target task is the running state, the reminding information is generated, the reminding information is displayed, and the target sleep time is set (where the target time may be preset according to the actual situation, for example, may be 5 seconds, which is not limited in the embodiment of the present invention). And when the time is in the target time, namely after the dormancy is finished, returning to execute the connection operation established with the Jenkins server according to the target construction number.
In the actual operation process, because the Jenkins server is required to be connected for a long time to monitor the task state, in order to avoid connection interruption, the connection with the Jenkins server can be reestablished every time in the execution process.
As an exemplary description of an embodiment of the present invention, fig. 2 is a flowchart of another file downloading method according to an embodiment of the present invention. As shown in fig. 2, the file downloading method specifically includes the following steps:
s201, setting the HTTP protocol mode to be a non-KeepAlive mode.
Specifically, because the method needs to establish the Jenkins server connection for n times in a circulating way, in order to avoid the problem of connection failure caused by too many HTTP connections, the program sets the HTTP protocol to adopt a non-KeepAlive mode when starting to execute, namely, each request/response client and the server need to establish a new connection, and the connection is immediately disconnected after the completion.
S202, judging whether the identity authentication is passed or not. If yes, go to S203; if not, executing S204.
Specifically, an account name and a password input by a user are obtained, authentication is performed according to the account name and the password, and whether authentication passes or not is judged. If the identity authentication is passed, executing S203 to obtain a target task identifier according to the target parameter; and if the authentication fails, performing S204 authentication failure reminding.
And S203, acquiring a target task identifier according to the target parameter.
Specifically, if the account passes the authentication according to the account name and the password, the target parameter is obtained, and the target task identifier is determined according to the target parameter.
And S204, reminding identity authentication failure.
Specifically, if the authentication is not passed after the authentication is performed according to the account name and the password, the error message is printed to remind, and the program is ended.
And S205, determining the target task state according to the target task identifier.
And S206, judging whether the target task state is the running state. If yes, executing S207; if not, go to step S208.
Specifically, whether the target task state is the running state is judged. If the target task state is the running state, executing S207 to establish Jenkins server connection; if not, S208 is executed to wait for constructing the reminder.
And S207, establishing target server connection.
Specifically, the terminal is connected with a Jenkins server.
And S208, waiting for constructing a reminder.
Specifically, if the target task state is an un-run state, a "wait for build" reminder may be printed.
S209, setting the target sleep time.
Specifically, a sleep target time is set (where the target time may be preset according to an actual situation, for example, may be 5 seconds, which is not limited in the embodiment of the present invention), after the sleep is finished, the operation returns to step S202, the account name and the password input by the user are obtained, the identity is verified according to the account name and the password input by the user, and whether the identity verification passes or not is determined.
And S210, acquiring a target task identifier according to the target parameter.
And S211, judging whether the target task state is a running state or not. If yes, go to step S212; if not, go to step S213.
Specifically, whether the target task state is the running state is judged. If the target task state is the running state, executing S212 running reminding; if not, executing S213 to determine whether the target task state is a successful operation state.
S212, running the reminding.
Specifically, if the target task state is an in-operation state, the "build" reminder is printed.
And S213, judging whether the target task state is a successful operation state. If yes, go to S215; if not, go to S216.
Specifically, whether the target task state is a successful operation state is judged. If the target task state is the successful operation state, executing S215 to download a target file corresponding to the target task; if not, S216 is executed to construct an error report reminder.
And S214, setting the target sleep time.
Specifically, a target sleep time (where the target time may be preset according to an actual situation, for example, may be 5 seconds, which is not limited in the embodiment of the present invention) is set, and after the sleep is finished, the operation of establishing the target server connection is returned to S207.
S215, downloading the target file corresponding to the target task.
S216, constructing an error reporting reminder.
Specifically, if the target task state is the operation failure state, a "build failure" prompt is printed.
S217, setting the target sleep time.
Specifically, a sleep target time is set (where the target time may be preset according to an actual situation, for example, may be 5 seconds, which is not limited in the embodiment of the present invention), after the sleep is finished, the operation returns to step S202, the account name and the password input by the user are obtained, the identity is verified according to the account name and the password input by the user, and whether the identity verification passes or not is determined.
The method in the embodiment of the invention can monitor the running state of the task in real time, does not stop running after the target file is downloaded, continuously monitors whether the task is in the running state or not, and enters the next cycle. And for certain Jenkins tasks with larger archived files, the construction of the tasks can be triggered at night, and the archived files are automatically downloaded to a local computer of a user after the construction is successful by monitoring the task execution result, so that the time required by manual downloading/copying is greatly shortened, and the development and debugging efficiency of the user is improved.
Example two
Fig. 3 is a schematic structural diagram of a file downloading device according to a second embodiment of the present invention. As shown in fig. 3, the apparatus includes: an acquisition module 301, a determination module 302, and a download module 303.
The acquiring module 301 is configured to acquire a target task identifier according to a target parameter;
a determining module 302, configured to determine a target task state according to the target task identifier;
the downloading module 303 is configured to download the target file corresponding to the target task if the target task state is the successful operation state.
Optionally, the downloading module 303 includes:
the first obtaining unit is used for obtaining a target construction number corresponding to the target task identifier if the running state of the target task is a successful running state;
the establishing unit is used for establishing connection with a target server according to the target establishing number;
the generating unit is used for generating a construction information acquisition instruction according to the target construction number and sending the construction information acquisition instruction to the target server so that the target server determines target construction information according to the target construction number;
the receiving unit is used for receiving the target construction information fed back by the target server;
a first determining unit, configured to determine a target URL address according to the target construction information;
a second acquisition unit configured to acquire an archived file list;
the second determining unit is used for determining a target address according to the archived file list and the target URL address;
and the downloading unit is used for downloading the target file corresponding to the target task according to the target address.
Optionally, the obtaining module 301 includes:
a third obtaining unit, configured to obtain an account name and a password input by a user;
the identity authentication unit is used for performing identity authentication according to the account name and the password;
the fourth obtaining unit is used for obtaining the target parameter if the identity authentication is passed;
and the third determining unit is used for determining the target task identifier according to the target parameter.
Optionally, the third determining unit is specifically configured to:
and when the HTTP protocol mode is a non-KeepAlive mode, acquiring an account name and a password input by the user.
Optionally, the apparatus further comprises:
the generating module is used for generating reminding information and displaying the reminding information if the running state of the target task is the running state;
and the execution module is used for returning and executing the operation of establishing connection with the target server according to the target construction number when the target time is reached.
The file downloading device provided by the embodiment of the invention can execute the file downloading method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE III
FIG. 4 shows a schematic block diagram of an electronic device 40 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 40 includes at least one processor 41, and a memory communicatively connected to the at least one processor 41, such as a Read Only Memory (ROM) 42, a Random Access Memory (RAM) 43, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 41 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 42 or the computer program loaded from a storage unit 48 into the Random Access Memory (RAM) 43. In the RAM 43, various programs and data necessary for the operation of the electronic apparatus 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other via a bus 44. An input/output (I/O) interface 45 is also connected to bus 44.
A number of components in the electronic device 40 are connected to the I/O interface 45, including: an input unit 46 such as a keyboard, a mouse, etc.; an output unit 47 such as various types of displays, speakers, and the like; a storage unit 48 such as a magnetic disk, an optical disk, or the like; and a communication unit 49 such as a network card, modem, wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 41 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The processor 41 performs the various methods and processes described above, such as the file download method:
acquiring a target task identifier according to the target parameter;
determining a target task state according to the target task identifier;
and if the target task state is a successful operation state, downloading a target file corresponding to the target task.
In some embodiments, the file download method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 40 via the ROM 42 and/or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the file download method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to perform the file download method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for downloading a file, comprising:
acquiring a target task identifier according to the target parameter;
determining a target task state according to the target task identifier;
and if the target task state is a successful operation state, downloading a target file corresponding to the target task.
2. The method according to claim 1, wherein if the running status of the target task is a running success status, downloading the target file corresponding to the target task comprises:
if the running state of the target task is a successful running state, obtaining a target construction number corresponding to the target task identifier;
establishing connection with a target server according to the target construction number;
generating a construction information acquisition instruction according to the target construction number, and sending the construction information acquisition instruction to the target server so that the target server determines target construction information according to the target construction number;
receiving target construction information fed back by the target server;
determining a target URL address according to the target construction information;
acquiring an archived file list;
determining a target address according to the archived file list and the target URL address;
and downloading a target file corresponding to the target task according to the target address.
3. The method of claim 1, wherein obtaining the target task identifier according to the target parameter comprises:
acquiring an account name and a password input by a user;
performing identity verification according to the account name and the password;
if the identity authentication is passed, acquiring a target parameter;
and determining a target task identifier according to the target parameter.
4. The method of claim 3, wherein obtaining the account name and password input by the user comprises:
and when the HTTP protocol mode is a non-KeepAlive mode, acquiring an account name and a password input by the user.
5. The method of claim 2, further comprising:
if the running state of the target task is the running state, generating reminding information and displaying the reminding information;
and returning to execute the operation of establishing connection with the target server according to the target construction number when the target time is reached.
6. A file downloading apparatus, comprising:
the acquisition module is used for acquiring a target task identifier according to the target parameter;
the determining module is used for determining a target task state according to the target task identifier;
and the downloading module is used for downloading the target file corresponding to the target task if the target task state is a successful operation state.
7. The apparatus of claim 6, wherein the download module comprises:
the first obtaining unit is used for obtaining a target construction number corresponding to the target task identifier if the running state of the target task is a successful running state;
the establishing unit is used for establishing connection with a target server according to the target establishing number;
the generating unit is used for generating a construction information acquisition instruction according to the target construction number and sending the construction information acquisition instruction to the target server so that the target server determines target construction information according to the target construction number;
the receiving unit is used for receiving the target construction information fed back by the target server;
a first determining unit, configured to determine a target URL address according to the target construction information;
the second acquisition unit is used for acquiring an archived file list;
the second determining unit is used for determining a target address according to the archived file list and the target URL address;
and the downloading unit is used for downloading the target file corresponding to the target task according to the target address.
8. The apparatus of claim 6, wherein the obtaining module comprises:
a third obtaining unit, configured to obtain an account name and a password input by a user;
the identity authentication unit is used for performing identity authentication according to the account name and the password;
the fourth obtaining unit is used for obtaining the target parameter if the identity authentication is passed;
and the third determining unit is used for determining the target task identifier according to the target parameter.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the file download method of any of claims 1-5.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the file download method of any one of claims 1 to 5 when executed.
CN202210589804.4A 2022-05-26 2022-05-26 File downloading method, device, equipment and storage medium Pending CN115766697A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210589804.4A CN115766697A (en) 2022-05-26 2022-05-26 File downloading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210589804.4A CN115766697A (en) 2022-05-26 2022-05-26 File downloading method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115766697A true CN115766697A (en) 2023-03-07

Family

ID=85349179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210589804.4A Pending CN115766697A (en) 2022-05-26 2022-05-26 File downloading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115766697A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117954066A (en) * 2024-02-22 2024-04-30 杭州迈尔科技有限公司 Endoscope scheduling method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117954066A (en) * 2024-02-22 2024-04-30 杭州迈尔科技有限公司 Endoscope scheduling method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113704063B (en) Performance monitoring method, device, equipment and storage medium of cloud mobile phone
CN114328132A (en) Method, device, equipment and medium for monitoring state of external data source
CN115766697A (en) File downloading method, device, equipment and storage medium
CN112965799B (en) Task state prompting method and device, electronic equipment and medium
CN115296979B (en) Fault processing method, device, equipment and storage medium
CN116627432A (en) Front-end application automatic deployment method, device, equipment and medium
CN116450176A (en) Version updating method and device, electronic equipment and storage medium
CN116301997A (en) Upgrading method, device, equipment and medium of controller
CN115509714A (en) Task processing method and device, electronic equipment and storage medium
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN112925623B (en) Task processing method, device, electronic equipment and medium
CN114924937A (en) Batch task processing method and device, electronic equipment and computer readable medium
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN111950232B (en) Method and device for automatically switching number segments
CN112395194A (en) Method and device for accessing test platform
CN112631843A (en) Equipment testing method and device, electronic equipment, readable medium and product
CN111176982A (en) Test interface generation method and device
CN113836016B (en) Writing interface storage quality testing method, system, electronic equipment and storage medium
CN114443491A (en) Automatic testing method and device, electronic equipment and storage medium
CN117596129A (en) Data backup device method, device and equipment based on intelligent network card
CN118018405A (en) Upgrading method and device of Internet of things equipment, server and storage medium
CN117608925A (en) Application restarting method and device, electronic equipment and storage medium
CN116302796A (en) Process monitoring method and device, electronic equipment and storage medium
CN117193825A (en) Method and device for calling update function, electronic equipment and storage medium
CN117520456A (en) Data synchronization 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