CN117319376A - File downloading control method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN117319376A
CN117319376A CN202311301751.2A CN202311301751A CN117319376A CN 117319376 A CN117319376 A CN 117319376A CN 202311301751 A CN202311301751 A CN 202311301751A CN 117319376 A CN117319376 A CN 117319376A
Authority
CN
China
Prior art keywords
background
file
task
network library
keep
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
CN202311301751.2A
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202311301751.2A priority Critical patent/CN117319376A/en
Publication of CN117319376A publication Critical patent/CN117319376A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the technical field of file downloading, and discloses a file downloading control method, a file downloading control device, electronic equipment and a storage medium. The present disclosure provides a file download control method, including: responding to the received running state switching instruction, and converting the application program from a foreground to a background to run; starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library; and executing the file batch downloading task in the background through a target network library based on the residual keep-alive time length and the execution progress of the file batch downloading task, wherein the target network library comprises a mobile terminal network library and/or a bottom layer network library. According to the method and the device, after the application program is switched to the background operation, the live-keeping time of the application program in the background operation is prolonged based on the file batch downloading task currently executed by the application program, so that the application program can smoothly complete the file batch downloading task in the background, the downloading requirement of a user is met, and the use experience of the user is improved.

Description

File downloading control method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of file downloading, and in particular relates to a file downloading control method, a file downloading control device, electronic equipment and a storage medium.
Background
In the related art, when an Application (APP) is switched from the foreground to the background for running, the APP is quickly suspended in the background due to the function restriction of an API (Application Programming Interface) of a preset os, and thus the running is interrupted.
Therefore, when a batch of files need to be downloaded in the downloading queue before the application program is switched to the background for running, the batch downloading task of the files can be interrupted by running in the background, and the use experience of a user is further affected.
Disclosure of Invention
In view of this, the present disclosure provides a method, an apparatus, an electronic device, and a storage medium for controlling file downloading, so as to solve the problem that in a preset operating system, an application program cannot complete a file batch downloading task in the background.
In a first aspect, the present disclosure provides a file download control method, including:
responding to the received running state switching instruction, and converting the application program from a foreground to a background to run;
starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library;
and executing the file batch downloading task in the background through a target network library based on the residual keep-alive time length and the execution progress of the file batch downloading task, wherein the target network library comprises a mobile terminal network library and/or a bottom layer network library.
According to the method and the device, after the application program is switched to the background operation, the live-keeping time of the application program in the background operation is prolonged based on the file batch downloading task currently executed by the application program, so that the application program can smoothly complete the file batch downloading task in the background, the downloading requirement of a user is met, and the use experience of the user is improved.
In a second aspect, the present disclosure provides a file download control apparatus, the apparatus including:
the state switching module is used for responding to the received operation state switching instruction and converting the application program from the foreground to the background for operation;
the control module is used for starting a background continuous keep-alive task so as to continuously execute a file batch downloading task in the background through the mobile terminal network library;
the first execution module is used for executing the file batch downloading task in the background through the target network library based on the residual keep-alive time length and the execution progress of the file batch downloading task, and the target network library comprises a mobile terminal network library and/or a bottom layer network library.
In a third aspect, the present disclosure provides an electronic device comprising: the memory and the processor are in communication connection with each other, the memory stores computer instructions, and the processor executes the computer instructions, thereby executing the file download control method according to the first aspect or any implementation manner corresponding to the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the file download control method of the first aspect or any of the embodiments corresponding thereto.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the prior art, the drawings that are required in the detailed description or the prior art will be briefly described, it will be apparent that the drawings in the following description are some embodiments of the present disclosure, and other drawings may be obtained according to the drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flow diagram of a file download control method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another file download control method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of yet another file download control method according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of yet another file download control method according to an embodiment of the present disclosure;
FIG. 5 is a block diagram of a file download control apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are some embodiments of the present disclosure, but not all embodiments. Based on the embodiments in this disclosure, all other embodiments that a person skilled in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
The method and the device are suitable for application scenes in which an application program is switched to a background for running in the process of downloading files in batches in the foreground on the electronic equipment with the preset operating system deployed. For example: the preset operating system may be an IOS system.
In the related art, when the running state of the application program is switched from the foreground to the background, the preset operating system suspends the application program in a short time, so as to achieve the purpose of saving electric quantity. Therefore, before the running state is switched, if the application program is executing the file batch downloading task in the foreground, after the application program is switched to the background running, the application program can enter a sleep state in a short time, and further the file batch downloading task is interrupted, so that the downloading requirement of a user cannot be met, and the use experience of the user is affected.
In view of this, an embodiment of the present disclosure provides a file download control method, including: responding to the received running state switching instruction, and converting the application program from a foreground to a background to run; starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library; and executing the file batch downloading task in the background through a target network library based on the residual keep-alive time length and the execution progress of the file batch downloading task, wherein the target network library comprises a mobile terminal network library and/or a bottom layer network library. According to the file downloading control method, after the application program is switched to the background operation, the live-keeping time of the application program in the background operation is prolonged based on the file batch downloading task currently executed by the application program, and further the application program is ensured to smoothly complete the file batch downloading task in the background, so that the downloading requirement of a user is met, and the use experience of the user is improved.
According to an embodiment of the present disclosure, there is provided a file download control method embodiment, it being noted that the steps shown in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order other than that shown or described herein.
In this embodiment, a file download control method is provided, which may be used in an electronic device, such as a mobile phone, a tablet computer, etc., fig. 1 is a flowchart of a file download control method according to an embodiment of the disclosure, and as shown in fig. 1, the flowchart includes the following steps:
step S101, responding to the received operation state switching instruction, and converting the application program from the foreground to the background for operation.
In the embodiment of the present disclosure, the running state switching instruction may be understood as a switching instruction for changing the running state of the application program in the operating system from the foreground to the background. In an example, the run state switch instruction may be generated by a user triggering a specified gesture on the electronic device. In another example, the run state switch instruction may be generated based on an application switch operation.
In the process that the application program runs in the foreground, if an operation state switching instruction is received, the application program is characterized by being required to be switched to the background operation, so that the operation instruction is influenced, and the application program is switched from the foreground to the background operation.
Step S102, starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library.
In the disclosed embodiment, the application is executing a file batch download task through the mobile-side network library before the application is switched to background operation. Wherein the mobile-side network library is a network software development kit (Software Development Kit, SDK) for initiating network requests for applications, such as: cronet, AFNetworking, volley, etc.
In order to ensure that the application program can continue to execute the file batch downloading task after being switched to the background and is not interrupted by the preset operating system, after the application program is switched to the background for running, the background is started to continue the keep-alive task so as to prolong the active state of the application program, and further, the situation that the application program is forced to enter a sleep state without executing the file batch downloading task is avoided, thereby breaking the limit of running the application program in the background by the preset operating system and ensuring that the application program can smoothly complete the file batch downloading task in the background.
In one example, a background keep-alive task may be initiated using a beginbackgroudtask (withaxidationhandler:) method.
In another example, the silent audio file may be played in the background, thereby triggering the background to continue the keep-alive task so that the application may be in a keep-alive state for a long period in the background.
Step S103, based on the remaining keep-alive time length and the execution progress of the file batch downloading task, executing the file batch downloading task in the background through the target network library.
In the embodiment of the disclosure, the background continuous keep-alive task can ensure that the application program is not controlled by the IOS operating system to enter a sleep state within the appointed keep-alive time period. However, because the specified keep-alive time is limited, in order to ensure that the application program can smoothly complete the file batch downloading task in the background, the file batch downloading task is executed in the background through the target network library based on the residual keep-alive time and the execution progress of the file batch downloading task, so that the situation that the application program cannot continuously execute the file batch downloading task in the background due to the function limitation of the API called in the background by the preset operating system is avoided.
The target network library comprises a mobile terminal network library and/or an underlying network library. The bottom layer network library is provided by a preset operating system. In an example, a mobile network library or an underlying network library may be designated as the target network library, thereby meeting the user's usage needs. In another example, the mobile network library and the bottom network library can be used alternately, so that the frequency limit and/or the use limit of the bottom network library in the background can be reduced, and the batch downloading task of the files can be guaranteed to be completed smoothly as much as possible.
According to the file downloading control method, after the application program is switched to the background operation, the live-keeping time of the application program in the background operation is prolonged based on the file batch downloading task currently executed by the application program, and further the application program is guaranteed to smoothly complete the file batch downloading task in the background, so that the downloading requirement of a user is met, and the use experience of the user is improved.
In this embodiment, a file downloading control method is provided, which may be used in the above electronic device, such as a mobile phone, a tablet computer, etc., and fig. 2 is a flowchart of a file downloading control method according to an embodiment of the disclosure, as shown in fig. 2, where the flowchart includes the following steps:
step S201, in response to the received operation state switching instruction, the application program is changed from the foreground to the background for operation. Please refer to step S101 in the embodiment shown in fig. 1 in detail, which is not described herein.
Step S202, starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library. Please refer to step S102 in the embodiment shown in fig. 1 in detail, which is not described herein.
Step S203, based on the remaining keep-alive time length and the execution progress of the file batch download task, executing the file batch download task in the background through the target network library.
Specifically, the step S203 includes:
step S2031, monitoring the remaining keep-alive time period and the execution progress of the file batch download task.
In the embodiment of the disclosure, in order to determine whether an application program can successfully complete a file batch download task within a specified keep-alive time period provided by a background continuous keep-alive task, the remaining keep-alive time period and the execution progress of the file batch download task are monitored, so that when the file batch download task is considered to be possibly unable to be successfully completed within the specified keep-alive time period, the activity time period of the application program in the background can be timely prolonged.
Step S2032, stopping executing the file batch download task through the mobile terminal network library when the remaining keep-alive time is less than the specified time and the file batch download task is not completed.
In the embodiment of the disclosure, when the remaining keep-alive time is smaller than the designated time and the file batch downloading task is not completed, the file batch downloading task is characterized in that the file batch downloading task cannot be successfully completed within the designated keep-alive time, and then the file batch downloading task is stopped from being executed through the mobile terminal network library so as to stop resources and bandwidth from being continuously consumed. In one example, if the specified keep-alive time period is 30 seconds(s), the specified time period may be 50 milliseconds (ms).
Step S2033, taking the bottom layer network library as a target network library, and continuously executing file batch downloading tasks in the background through the bottom layer network library.
In the embodiment of the disclosure, the target network library is switched to the bottom network library, and then the file batch downloading task is continuously executed in the background through the bottom network library, so that the situation that the file batch downloading task is interrupted when the remaining keep-alive time length is 0 is avoided, and the executed time length of the file batch downloading task can be effectively prolonged.
According to the file downloading control method, the network library called by the application program in the background can be flexibly adjusted based on the residual keep-alive time length of the background continuous keep-alive task and the execution progress of the file batch downloading task, so that better network request and data transmission control are realized, the file batch downloading task can be sequentially completed, and therefore the efficiency and user experience of the application program are improved.
In some optional embodiments, the file download control method further includes:
step S204, returning to the starting background to continuously keep alive tasks until the file batch downloading tasks are executed.
In the embodiment of the disclosure, in the preset operating system, executing the file batch download task in the background through the underlying network library also has a duration limitation. Therefore, in order to avoid the situation that the batch file downloading task is interrupted due to the fact that the application program is suspended in the process of executing the batch file downloading task, the continuous keep-alive task is started back to enable the application program to be always in an active state in the process of executing the batch file downloading task in the background until the batch file downloading task is executed, and therefore the purpose of completing the batch file downloading task in the background is achieved.
In this embodiment, a file downloading control method is provided, which may be used in the above electronic device, such as a mobile phone, a tablet computer, etc., and fig. 3 is a flowchart of a file downloading control method according to an embodiment of the disclosure, as shown in fig. 3, where the flowchart includes the following steps:
step S301, the application program is changed from the foreground to the background to run in response to the received running state switching instruction.
Step S302, starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library.
Step S303, based on the remaining keep-alive time length and the execution progress of the file batch downloading task, executing the file batch downloading task in the background through the target network library.
Specifically, the step S203 includes:
step S3031, monitoring the remaining keep-alive time duration and the execution progress of the file batch download task.
Step S3032, when the remaining keep-alive time is smaller than the designated time and the file batch downloading task is not completed, stopping executing the file batch downloading task through the mobile terminal network library.
In step S3033, a background session object is created and configured by the session web service provided by the operating system.
In the embodiment of the disclosure, a background session object can be created and configured through a session network service (NSURLSessionConfiguration) provided by the IOS system, so that a network transmission task can be executed when an application program is in a background state.
Step S3034, a background session task is initiated through the background session object to connect with the underlying network library of the operating system.
In the embodiment of the disclosure, the background session is established on the NSURLSession API and encapsulates the bottom network library of the operating system, so that in order to ensure that the application program can continue to execute the file batch download task when switching to the background or being suspended, the background session task is initiated through the background session object, so that the application program can complete the file batch download task through the bottom network library, and the purpose of continuing to execute the file batch download task is achieved.
Step S3035, the bottom layer network library is used as a target network library, and the file batch downloading task is continuously executed in the background through the bottom layer network library.
Step S304, if the remaining keep-alive time is 0 and the batch downloading task of the file is not completed, a background downloading request is sent through the background session object.
In the embodiment of the disclosure, if the remaining keep-alive time is 0 and the file batch download task is not yet completed, the application program is indicated to be in a sleep state, but the file batch task is not completed, so, in order to enable the file batch download task to be continuously executed, a background download request is sent through a background session object to request the IOS system to allow the application program to be awakened in the background.
Step S305, in response to the background download request, the application is awakened in the background.
In the disclosed embodiments, the IOS system wakes up the application in the background in response to the background download request to allow the application to continue to be active in the background for a specified keep-alive period.
And step S306, continuing to execute the file batch downloading task in the background through the mobile terminal network library within the specified keep-alive time duration so as to complete the file batch downloading task.
In the embodiment of the disclosure, when the application program executes the file batch download task in the background within the specified keep-alive time period, the file batch download task can be continuously executed in the background through the mobile terminal network library, so that the file can be continuously downloaded from the interrupt position without downloading the whole file again, thereby saving the bandwidth and time and improving the downloading efficiency.
According to the file downloading control method, after the application program is converted into the background operation, the file batch downloading task can be alternately executed in the background through the mobile terminal network library and the bottom layer network library based on the residual keep-alive time of the application program in the background and the execution progress of the file batch downloading task, and the application program is controlled to be always in an active state, so that the situation that the task is interrupted due to the fact that the application program is suspended by a preset operating system is avoided, the purpose that the file batch downloading task can be smoothly executed in the background is achieved, and the use experience of a user is improved.
In some optional embodiments, when the remaining duration of the specified keep-alive duration is less than the specified duration and the file batch download task is not yet completed, the downloading amount of the characterized file batch download task is too large, and is still insufficient to complete the file batch download task in the background only based on the specified keep-alive duration after the current extension, and further complete the file batch download task in the background based on the underlying network library, so that the file batch download task can be smoothly performed in the background by circularly executing the above steps S303 to S306.
In other alternative embodiments, when the remaining keep-alive time is less than the specified time, but the file batch download task is completed, the characterization is not required to be in an active state in the background, and the application program is further suspended, so that the power consumption of the electronic device is saved.
In some alternative implementation scenarios, the file batch download task may be a task that performs batch download on a target number of files that are each smaller than or equal to a specified size.
In other alternative implementation scenarios, the file batch download task is a target number of file download tasks, and the size of the file to be downloaded corresponding to each file download task is smaller than or equal to the specified size. That is, a file download task may be understood as one of the sub-tasks in the file bulk download task.
In still other alternative implementation scenarios, taking a preset operating system as an IOS system as an example, as shown in fig. 4, a flow of a file download control method according to an embodiment of the disclosure includes the following steps:
in step S401, when the application runs in the foreground, a file batch download task is initiated.
Step S402, placing the batch downloading task of the target number of files into a downloading queue, waiting for scheduling, and executing the batch downloading task of the files through a mobile terminal network library.
Step S403, the application program is changed from the foreground to the background to run in response to the received running state switching instruction.
And step S404, starting a background continuous keep-alive task so that the application program can continuously execute the file batch downloading task through the mobile terminal network library.
In this manner, the application may be controlled in the background and may remain active for a specified duration of keep-alive. Wherein the specified keep-alive time period is 30s.
In step S405, it is monitored whether the remaining keep-alive time period of the application is less than 50 milliseconds.
Step S406, if the remaining keep-alive time is less than 50 ms and the file batch download task is not completed, stopping executing the file batch download task through the mobile terminal network library.
Step S407, creating and configuring a background session object through session network service provided by the operating system, and initiating a background session task through the background session object to connect with a bottom layer network library of the operating system.
Step S408, the bottom layer network library is used as a target network library, and the file batch downloading task is continuously executed in the background through the bottom layer network library.
In step S409, if the remaining keep-alive time is 0, the application enters a suspended state.
In step S410, if the file batch download task is not completed, the application program is awakened by the background session task.
In step S411, the control application program continues to execute the file batch download task in the background through the mobile terminal network library within the retrieved specified keep-alive time duration, so as to complete the file batch download task.
According to the file downloading control method, after the application program is switched to the background operation, the mobile terminal network library can be preferentially adopted to continue to execute the file batch downloading task, and further, when the application program is suspended soon, the file batch downloading task is continuously executed through the bottom layer network library. When the application program is hung up in the background, the application program can be awakened up in the background based on the background session task, so that the application program is always in an active state in the background in the process of executing the file batch downloading task, the purpose that the application program can smoothly complete the file batch downloading task in the background is achieved, and the response performance of the IOS system is improved.
The embodiment also provides a file downloading control device, which is used for implementing the above embodiment and the preferred implementation manner, and is not described in detail. As used below, the term "module" 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.
The present embodiment provides a file download control device, as shown in fig. 5, including:
the state switching module 501 is configured to respond to a received operation state switching instruction, and change an application program from a foreground to a background for operation;
the control module 502 is used for starting a background continuous keep-alive task to continuously execute a file batch downloading task in the background through the mobile terminal network library;
the first execution module 503 is configured to execute the file batch download task in the background through a target network library based on the remaining keep-alive duration and the execution progress of the file batch download task, where the target network library includes a mobile terminal network library and/or a bottom layer network library.
In some alternative embodiments, the first execution module 503 includes: the monitoring unit is used for monitoring the residual keep-alive time length and the execution progress of the file batch downloading task; the first processing unit is used for stopping executing the file batch downloading task through the mobile terminal network library when the remaining keep-alive time is smaller than the designated time and the file batch downloading task is not completed; and the second processing unit is used for taking the bottom layer network library as a target network library and continuously executing file batch downloading tasks in the background through the bottom layer network library.
In some alternative embodiments, the apparatus further comprises: and the second execution module is used for returning to the starting background to continuously keep-alive tasks until the execution of the file batch downloading tasks is completed.
In some alternative embodiments, the apparatus further comprises: the third execution module is used for creating and configuring a background session object through session network services provided by an operating system; and the fourth execution module is used for initiating a background session task through the background session object so as to be connected with a bottom network library of the operating system.
In some alternative embodiments, the apparatus further comprises: the sending module is used for sending a background downloading request through a background session object if the remaining keep-alive time is 0 and the batch downloading task of the file is not completed yet; the wake-up module is used for responding to the background downloading request and waking up the application program in the background; and the fifth execution module is used for continuously executing the file batch downloading task in the background through the mobile terminal network library within the appointed keep-alive time duration so as to complete the file batch downloading task.
In some alternative embodiments, the apparatus further comprises: and the sixth execution module is used for completing the file batch downloading task in the background based on the bottom network library when the remaining duration of the appointed keep-alive duration is smaller than the appointed duration and the file batch downloading task is not completed yet.
In some alternative embodiments, the operating system is an IOS system.
In some alternative embodiments, the file batch download task is a task that performs batch download of a target number of files each having a file size less than or equal to a specified size.
In some optional embodiments, the file batch downloading task is a target number of file downloading tasks, and a size of a file to be downloaded corresponding to each file downloading task is smaller than or equal to a specified size.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The file download control means in this embodiment is presented in the form of functional units, here referred to as ASIC (Application Specific Integrated Circuit ) circuits, processors and memories executing one or more software or fixed programs, and/or other devices that can provide the above described functions.
The embodiment of the disclosure also provides an electronic device, which is provided with the file downloading control device shown in the above figure 5.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an alternative embodiment of the disclosure, as shown in fig. 6, the electronic device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 6.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The electronic device further comprises input means 30 and output means 40. The processor 10, memory 20, input device 30, and output device 40 may be connected by a bus or other means, for example in fig. 6.
The input device 30 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, pointer stick, one or more mouse buttons, trackball, joystick, and the like. The output means 40 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. Such display devices include, but are not limited to, liquid crystal displays, light emitting diodes, displays and plasma displays. In some alternative implementations, the display device may be a touch screen.
The presently disclosed embodiments also provide a computer readable storage medium, and the methods described above according to the presently disclosed embodiments may be implemented in hardware, firmware, or as recordable storage medium, or as computer code downloaded over a network that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and is to be stored in a local storage medium, such that the methods described herein may be stored on such software processes on a storage medium using a general purpose computer, special purpose processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present disclosure have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the disclosure, and such modifications and variations are within the scope defined by the appended claims.

Claims (12)

1. A file download control method, the method comprising:
responding to the received running state switching instruction, and converting the application program from a foreground to a background to run;
starting a background continuous keep-alive task to continuously execute file batch downloading tasks in the background through a mobile terminal network library;
and executing the file batch downloading task in the background through a target network library based on the remaining keep-alive time length and the execution progress of the file batch downloading task, wherein the target network library comprises the mobile terminal network library and/or a bottom layer network library.
2. The method of claim 1, wherein the executing the file batch download task in the background via the target network library based on the remaining keep-alive time period and the execution progress of the file batch download task comprises:
monitoring the residual keep-alive time length and the execution progress of the file batch downloading task;
when the remaining keep-alive time is smaller than the designated time and the file batch downloading task is not completed, stopping executing the file batch downloading task through the mobile terminal network library;
and taking the bottom layer network library as the target network library, and continuously executing the file batch downloading task in the background through the bottom layer network library.
3. The method according to claim 2, wherein the method further comprises:
and returning to the starting background to continuously keep-alive tasks until the file batch downloading task is executed.
4. A method according to claim 2 or 3, wherein prior to taking the underlying network library as the target network library, the method further comprises:
creating and configuring a background session object through session network service provided by an operating system;
and initiating a background session task through the background session object to connect with a bottom network library of an operating system.
5. The method according to claim 4, wherein the method further comprises:
if the remaining keep-alive time is 0 and the file batch downloading task is not completed, sending a background downloading request through the background session object;
responding to the background downloading request, and waking up the application program in the background;
and continuously executing the file batch downloading task in the background through the mobile terminal network library within the appointed keep-alive time duration so as to complete the file batch downloading task.
6. The method of claim 5, wherein the method further comprises:
and when the remaining time length of the appointed keep-alive time length is smaller than the appointed time length and the file batch downloading task is not completed yet, completing the file batch downloading task in the background based on the bottom layer network library.
7. The method of claim 4, wherein the operating system is an IOS system.
8. The method of claim 1, wherein the file batch download task is a task that performs batch download on a target number of files each having a file size less than or equal to a specified size.
9. The method of claim 1, wherein the file batch download tasks are a target number of file download tasks, and a size of a file to be downloaded corresponding to each file download task is smaller than or equal to a specified size.
10. A file download control apparatus, the apparatus comprising:
the state switching module is used for responding to the received operation state switching instruction and converting the application program from the foreground to the background for operation;
the control module is used for starting a background continuous keep-alive task so as to continuously execute a file batch downloading task in the background through the mobile terminal network library;
the first execution module is used for executing the file batch downloading task in the background through a target network library based on the residual keep-alive time length and the execution progress of the file batch downloading task, and the target network library comprises the mobile terminal network library and/or a bottom layer network library.
11. An electronic device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the file download control method of any one of claims 1 to 9.
12. A computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the file download control method according to any one of claims 1 to 9.
CN202311301751.2A 2023-10-09 2023-10-09 File downloading control method and device, electronic equipment and storage medium Pending CN117319376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311301751.2A CN117319376A (en) 2023-10-09 2023-10-09 File downloading control method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311301751.2A CN117319376A (en) 2023-10-09 2023-10-09 File downloading control method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117319376A true CN117319376A (en) 2023-12-29

Family

ID=89261757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311301751.2A Pending CN117319376A (en) 2023-10-09 2023-10-09 File downloading control method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117319376A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117992131A (en) * 2024-04-07 2024-05-07 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117992131A (en) * 2024-04-07 2024-05-07 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium
CN117992131B (en) * 2024-04-07 2024-06-14 腾讯科技(深圳)有限公司 Data processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN107783803B (en) System optimization method and device of intelligent terminal, storage medium and intelligent terminal
CN102999387B (en) Process running gear and method
CN110955499B (en) Processor core configuration method, device, terminal and storage medium
CN117319376A (en) File downloading control method and device, electronic equipment and storage medium
CN110008027B (en) Process running method and device, terminal and storage medium
CN105117265B (en) A kind of method, apparatus and terminal of document upgrading
WO2015117445A1 (en) Method and device for processing task window
CN107231386B (en) Application state conversion method and device and mobile terminal
CN111625322B (en) Data processing method, system and equipment
CN110989820A (en) Method and device for controlling power consumption of processor, processor and electronic device
CN110012003B (en) Cloud application screen capturing method and device
JP2016528648A (en) Network application parallel scheduling to reduce power consumption
CN110192183B (en) Computer device, task starting method, and computer-readable storage medium
CN111124655A (en) Network request scheduling method, terminal device and storage medium
CN113805954A (en) Screen saver display method, electronic device, and computer storage medium
CN113806026A (en) Application program safety switching method, device, equipment and storage medium
CN113760403A (en) State machine linkage method and device
CN111796939A (en) Processing method and device and electronic equipment
CN108804104A (en) Implementation method, device, storage medium and the terminal of the self-defined animation of Android system
TWI812029B (en) Power sequencer for power state management
CN111221633A (en) Terminal control method and device, mobile terminal and storage medium
CN108595281B (en) Moving object processing method, moving object processing device, storage medium and terminal
WO2021068707A1 (en) Application control method and apparatus, electronic device, and storage medium
CN108369526B (en) Virtual machine starting method and device and intelligent terminal
JP2017157177A (en) Smart device, method for deleting saved data, and program for deleting saved data

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