Network resource acquisition method, device, mobile terminal and computer storage medium
By detecting network speed in the mobile terminal and limiting the cumulative trigger events, the problem of page load crash is solved, and the success rate of network resource acquisition tasks and page loading is improved.
Patent Information
- Application Number
- CN202010911067.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-02
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-09-02
AI Technical Summary
The mobile terminal may have a crash problem during the page loading process, resulting in the inability to jump to the corresponding page smoothly.
When the current network speed is below the preset threshold, the trigger event for requesting network resources is detected, and the cumulative number of triggers is limited to reduce the number of network resource acquisition tasks performed simultaneously, so as to reduce the network load and increase the success rate of page loading.
By limiting the network resource acquisition tasks corresponding to the event, the problem of page crashes is reduced, and the success rate of network resource acquisition tasks and page loading is improved.
Smart Images

Figure CN112000907B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method, device, mobile terminal and computer storage medium for acquiring network resources. Background Art
[0002] At present, a mobile terminal can detect a user's click operation on a link displayed on a page of an application, and load a page in response to the click operation, thereby jumping to another page different from the currently displayed page. However, in practice, it is found that there may be a loading crash problem during the page loading process, resulting in the application being unable to smoothly jump to the corresponding page. Summary of the invention
[0003] The embodiments of the present application disclose a method, device, mobile terminal and computer storage medium for acquiring network resources, which can reduce the problem of page loading crash.
[0004] An embodiment of the present application discloses a method for acquiring network resources, the method comprising: when a current network speed is lower than a preset network speed threshold, detecting a trigger event for requesting to acquire network resources; accumulating the detected trigger events to obtain a cumulative number of triggers; after the cumulative number of triggers reaches a preset number threshold, if a trigger event for requesting to acquire the network resource is still detected, treating the trigger event detected after the cumulative number of triggers reaches the preset number threshold as a post-trigger event, and limiting the execution progress of the network resource acquisition task corresponding to the post-trigger event.
[0005] The embodiment of the present application discloses a network resource acquisition device, including: a detection module, which is used to detect a trigger event for requesting to obtain network resources when the current network speed is lower than a preset network speed threshold; an accumulation module, which is used to accumulate the detected trigger events to obtain a cumulative number of triggers; and a control module, which is used to, after the cumulative number of triggers reaches the preset number threshold, if a trigger event for requesting to obtain the network resource is still detected, treat the trigger event detected after the cumulative number of triggers reaches the preset number threshold as a post-trigger event, and limit the execution progress of the network resource acquisition task corresponding to the post-trigger event.
[0006] An embodiment of the present application discloses a mobile terminal, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method for acquiring network resources disclosed in the embodiment of the present application.
[0007] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for acquiring network resources disclosed in the embodiment of the present application.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0009] In an embodiment of the present application, when it is detected that the current network speed is lower than a preset network speed threshold, the trigger event for requesting to obtain network resources can be detected and the number of trigger times can be accumulated; after the accumulated number of trigger times reaches the preset number threshold, the execution progress of the network resource acquisition task corresponding to the trigger event still detected (i.e., the post-trigger event) will be restricted, thereby reducing the number of network resource acquisition tasks that simultaneously transmit data to the server, so as to reduce the network load, thereby improving the success rate of network resource acquisition tasks in completing network resource acquisition, and then increasing the success rate of page loading based on the acquired network resources, thereby reducing the occurrence of page crashes. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0011] Figure 1 It is an application scenario diagram of a method for acquiring network resources disclosed in an embodiment of the present application;
[0012] Figure 2 It is a flowchart of a method for acquiring network resources disclosed in an embodiment of the present application;
[0013] Figure 3 It is a flowchart of another method for acquiring network resources disclosed in an embodiment of the present application;
[0014] Figure 4A This is an example diagram of a display interface of a virtual isolation space disclosed in an embodiment of the present application;
[0015] Figure 4B This is an example diagram of an application scenario for recovering a post-trigger event disclosed in an embodiment of the present application;
[0016] Figure 4C This is another example diagram of an application scenario for recovering a post-trigger event disclosed in an embodiment of the present application;
[0017] Figure 5 It is a flowchart of another method for acquiring network resources disclosed in an embodiment of the present application;
[0018] Figure 6 It is a flowchart of another method for acquiring network resources disclosed in an embodiment of the present application;
[0019] Figure 7 It is a structural diagram of a network resource acquisition device disclosed in an embodiment of the present application;
[0020] Figure 8 It is a structural schematic diagram of a mobile terminal disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0023] The embodiments of the present application disclose a method, device, mobile terminal and computer storage medium for acquiring network resources, which can reduce the problem of page loading crash.
[0024] First, see Figure 1 , Figure 1 This is an application scenario diagram of a method for acquiring network resources disclosed in an embodiment of the present application. Figure 1 As shown, a mobile terminal 10 and a server 20 may be included. Data may be transmitted between the mobile terminal 10 and the server 20 via a communication network, and the communication network may be a mobile data network such as 2G / 3G / 4G / 5G, or a wireless communication network such as Wi-Fi (Wireless Fidelity), without limitation. The mobile terminal 10 may include, but is not limited to, electronic devices such as smart phones, tablet computers, personal computers, and smart watches.
[0025] Embodiment 1
[0026] See also Figure 2 , Figure 2 : is a flowchart of a method for acquiring network resources disclosed in an embodiment of the present application. Figure 2The described method for acquiring network resources is applicable to a mobile terminal, and the operating system of the mobile terminal may include but is not limited to an Android operating system, an IOS operating system, a Symbian operating system, a Black Berry operating system, a Windows Phone operating system, etc., and the present application embodiment does not limit this. Figure 2 As shown, the method for acquiring the network resource may include the following steps:
[0027] 210. When the current network speed is lower than a preset network speed threshold, detect a triggering event for requesting to obtain network resources.
[0028] In an embodiment of the present application, the mobile terminal can detect the data transmission speed of the currently used communication network in real time, thereby obtaining the current network speed. The preset network speed threshold can be set with reference to the data transmission speed of the communication network currently used by the mobile terminal when there is a delay in page loading. That is, when the current network speed is higher than or equal to the preset network speed threshold, the time required for the mobile terminal to obtain network resources from the server through the communication network is shorter, and the time required to load the page according to the obtained network resources is also shorter, and it is difficult for the user to perceive the delay in page loading; when the current network speed is lower than the preset network speed threshold, the time required for the mobile terminal to obtain network resources from the server through the communication network is longer, resulting in a longer time required to load the page, and the user can easily perceive the delay in page loading.
[0029] In the embodiment of the present application, once it is detected that the current network speed is lower than the preset network speed threshold, a trigger event for requesting to obtain network resources can be detected. The trigger event for requesting to obtain network resources can refer to an event that triggers the mobile terminal to request network resources from the server, which can include but is not limited to: a user clicking a jump link or a virtual button or other control click event, a user inputting a search command through voice or gesture, etc.
[0030] 220. Accumulate the detected trigger events to obtain a cumulative number of trigger times.
[0031] In the embodiment of the present application, when the current network speed is lower than the preset network speed threshold, the above trigger events can be continuously detected to accumulate the detected trigger events. Optionally, the accumulated trigger events can be trigger events that have not been executed, that is, trigger events for which the corresponding network resource acquisition tasks are completed.
[0032] 230. After the cumulative number of triggers reaches a preset threshold, if a trigger event for requesting to obtain network resources is still detected, the trigger event detected after the cumulative number of triggers reaches the preset threshold is regarded as a post-trigger event, and the execution progress of the network resource acquisition task corresponding to the post-trigger event is restricted.
[0033] In the embodiment of the present application, if the cumulative number of triggers reaches the preset number threshold, it means that the network resource acquisition is not completed, the page to be jumped to is not loaded successfully, and the number of trigger events for the user to input a request to obtain network resources is too many. Among them, the above-mentioned preset number threshold can be set by the user according to his own needs, or by the developer of the application or the manufacturer of the mobile terminal based on experience, and can be set to 3 times, 4 times, etc., without specific limitation.
[0034] It should be noted that, in the embodiment of the present application, the trigger event for requesting to obtain network resources detected before the cumulative number of triggers exceeds the preset number threshold can be used as the first trigger event. For example, assuming that the preset number threshold is 3, each trigger event is named according to the triggering order of the trigger event, then event 1, event 2 and event 3 are first trigger events, and event 4 and the trigger events detected after event 4 are later trigger events.
[0035] In the embodiment of the present application, when a first trigger event or a second trigger event is detected, the mobile terminal can generate a network resource acquisition task corresponding to the first trigger event or the second trigger event. The mobile terminal executing the network resource acquisition task may include but is not limited to the following steps: sending a resource acquisition request to the server through the above-mentioned communication network, and receiving the network resources returned by the server according to the resource acquisition request.
[0036] In the embodiment of the present application, if the current network speed is low, there may be multiple network resource acquisition tasks corresponding to the first triggering event and multiple network resource acquisition tasks corresponding to the later triggering event being performed at the same time. The above-mentioned restriction on the execution progress of the network resource acquisition task corresponding to the later triggering event can be performed by delaying, pausing or stopping the network resource acquisition task corresponding to the later triggering event, giving priority to the network resource acquisition task corresponding to the first triggering event, so as to reduce the number of network resource acquisition tasks performed at the same time, thereby reducing the network load, improving the success rate of the execution of the network resource acquisition task, and then increasing the success rate of loading the page according to the acquired network resources, and reducing the problem of page crashes.
[0037] The following is an introduction to the specific implementation method of limiting the execution progress of the network resource acquisition task corresponding to the post-trigger event disclosed in the embodiment of the present application.
[0038] Please also read Figure 3 , Figure 3 FIG. 1 is a flow chart of another method for acquiring network resources disclosed in an embodiment of the present application. The method can be applied to a mobile terminal, such as Figure 3 As shown, the method for acquiring the network resource may include the following steps:
[0039] 310. When the current network speed is lower than a preset network speed threshold, detect a triggering event for requesting to obtain network resources.
[0040] 320. Accumulate the detected trigger events to obtain a cumulative number of trigger times.
[0041] 330. After the cumulative number of trigger times reaches a preset number threshold, if a trigger event for requesting to obtain network resources is still detected, the trigger event detected after the cumulative number of trigger times reaches the preset number threshold is taken as a post-trigger event.
[0042] 340. Suspend the network resource acquisition task corresponding to the post-trigger event.
[0043] In an embodiment of the present application, pausing the network resource acquisition task corresponding to the post-trigger event may include but is not limited to: pausing sending a resource acquisition request to the server; or pausing receiving the network resources returned by the server according to the resource acquisition request.
[0044] 350. Detect user actions for one or more post-trigger events.
[0045] In an embodiment of the present application, the mobile terminal can display the detected post-trigger event. As an optional implementation, the detected post-trigger event can be moved into a virtual isolation space and the virtual isolation space can be displayed. The above-mentioned virtual isolation space can refer to a collection of multiple post-trigger events.
[0046] Further optionally, when displaying the virtual isolation space, each post-triggering event can be arranged according to a preset first sorting rule, and each post-triggering event can be displayed according to the sorted order, so that the user can intuitively see the triggering order of each post-triggering event. The above-mentioned first sorting rule may include but is not limited to: arranging in order from the triggering time of each post-triggering event from first to last; or arranging in order from the triggering time of each post-triggering event from last to first.
[0047] Further optionally, when displaying the virtual isolation space, the resource acquisition progress corresponding to the network resource acquisition task corresponding to each post-triggering event when it is suspended can be further displayed, so that the user can understand the network resource acquisition task with a faster or slower resource acquisition progress. It should be noted that in an embodiment of the present application, after receiving the resource acquisition request sent by the mobile terminal when executing a certain network resource acquisition task, the server can feedback to the mobile terminal the total amount of network resource data that the network resource acquisition task should acquire. When the mobile terminal receives the network resources returned by the server according to the resource acquisition request, it can calculate the current resource acquisition progress of the network resource acquisition task based on the current amount of data received and the total amount of network resource data.
[0048] Further optionally, the above-mentioned first sorting rule may also include: sorting each post-trigger event in order from large to small according to the resource acquisition progress when the corresponding network resource acquisition task is suspended; or sorting each post-trigger event in order from small to large according to the resource acquisition progress when the corresponding network resource acquisition task is suspended.
[0049] For example, please refer to Figure 4A , Figure 4A is an example diagram of a display interface of a virtual isolation space disclosed in an embodiment of the present application. In this example, the preset number threshold may be 3, and event 4 and the triggering events detected after event 4 are post-triggering events. Figure 4A As shown, in the display interface of the virtual isolation space, each post-trigger event is arranged in descending order according to the corresponding resource acquisition progress.
[0050] In an embodiment of the present application, after the mobile terminal displays one or more post-trigger events, the user operation on the display interface for one or more post-trigger events can be detected. It should be noted that in some possible embodiments, one or more post-trigger events can also be output by voice or other means, and the display interface of the virtual isolation space is optional. Accordingly, the user can also input user operations for one or more post-trigger events by voice input or gesture input, without specific limitation.
[0051] 360. Restore or delete the network resource acquisition task corresponding to each post-triggering event according to the detected indication information of the user operation.
[0052] In the embodiment of the present application, the indication information of the detected user operation may include, but is not limited to: restoring or deleting the post-trigger event.
[0053] As an optional implementation, the specific implementation of step 360 may include:
[0054] When the detected indication information of the user operation indicates to restore the post-trigger event, a target trigger event is determined from each post-trigger event according to the detected indication information of the user operation; and the network resource acquisition task corresponding to the target trigger event is restored.
[0055] By implementing this embodiment, compared with the network resource acquisition task corresponding to the first trigger event, the execution progress of the network resource acquisition task corresponding to the target trigger event that the user indicates to resume has been delayed, while in each post-trigger event, the execution progress of the network resource acquisition tasks corresponding to the remaining post-trigger events that the user has not indicated to resume is in a suspended state, which can effectively reduce the number of network resource acquisition tasks executed simultaneously.
[0056] For example, please refer to Figure 4B , Figure 4B is an example diagram of an application scenario for recovering a post-trigger event disclosed in an embodiment of the present application. Figure 4B As shown, the user can select the post-trigger event by clicking the selection box 401, and then click the restore virtual button 402 to indicate the restoration of the post-trigger event. That is, the user operation indicating the restoration detected by the mobile terminal may include: the click operation of clicking the selection box 401 and the click operation of clicking the restore virtual button 402. Accordingly, the target trigger event may be Figure 4B In event 7 shown, the mobile terminal resumes the network resource acquisition task corresponding to event 7, and continues to receive the network resources sent by the server to the mobile terminal on the basis that the network resource acquisition task corresponding to event 8 has acquired 60% of the resources.
[0057] As another optional implementation, the specific implementation of step 360 may also include:
[0058] When the detected user operation indication information indicates deletion of the post-trigger event, the event to be deleted is determined from each post-trigger event according to the detected user operation indication information; the network resource acquisition task corresponding to the event to be deleted is deleted, and the network resource acquisition tasks corresponding to the remaining post-trigger events are restored.
[0059] By implementing this embodiment, the network resource acquisition tasks corresponding to the event to be deleted can be deleted according to the user's instructions, thereby directly reducing the number of network resource acquisition tasks that need to be executed. As for the remaining network resource acquisition tasks corresponding to the post-triggering events that the user has not instructed to delete, after being restored, their execution progress has been delayed compared to the network resource acquisition tasks corresponding to the pre-triggering events, which can also effectively reduce the number of network resource acquisition tasks executed simultaneously.
[0060] For example, please refer to Figure 4C , Figure 4C 2 is another example diagram of an application scenario for recovering a post-trigger event disclosed in an embodiment of the present application. Figure 4C As shown, the user can select the post-triggering event by clicking the selection box 401, and then delete the post-triggering event by clicking the virtual delete button 403. That is, the user operation indicating deletion detected by the mobile terminal may include: clicking the selection box 401 and clicking the virtual delete button 403. Figure 4CFor events 7 and 8 shown, the mobile terminal may delete the network resource acquisition tasks corresponding to events 7 and 8, respectively, and restore the network resource acquisition tasks corresponding to events 4, 5, and 6, respectively.
[0061] In addition, as an optional implementation, in the embodiment of the present application, if no user operation for one or more post-trigger events is detected within the first preset time, the network resource acquisition task corresponding to each post-trigger event can be deleted. That is, if the user ignores the network resource acquisition task corresponding to each post-trigger event that has been suspended within a certain time, it can be deleted, which can directly reduce the number of network resource acquisition tasks that need to be executed. Among them, the above-mentioned first preset time can be an empirical value, which can be set to 1 minute, 3 minutes, etc., and is not specifically limited.
[0062] Further optionally, in the embodiment of the present application, the implementation method of deleting the network resource acquisition task corresponding to each post-trigger event may include but is not limited to:
[0063] Delete each network resource acquisition task in the order of the triggering time of the corresponding post-triggering event from first to last. That is, the network resource acquisition task corresponding to the post-triggering event with the earlier triggering time will be deleted first. Or,
[0064] Delete each network resource acquisition task in the order of the triggering time of the corresponding post-triggering event from the last to the first. That is, the network resource acquisition task corresponding to the post-triggering event with the later triggering time will be deleted first. Or,
[0065] Delete each network resource acquisition task in descending order of the resource acquisition progress when the corresponding network resource acquisition task is suspended. That is, the network resource acquisition task with a larger resource acquisition progress will be deleted first. Or,
[0066] Delete each network resource acquisition task in the order of the resource acquisition progress from small to large when the corresponding network resource acquisition task is suspended. That is, the network resource acquisition task with a smaller resource acquisition progress will be deleted first. That is, the network resource acquisition task with a smaller resource acquisition progress will be deleted first.
[0067] That is, in the embodiment of the present application, if no user operation is detected within the first preset time, the network resource acquisition task corresponding to each post-triggering event is deleted according to the preset first sorting rule. The preset first sorting rule may include but is not limited to: sorting from the triggering time of each post-triggering event from back to front or from back to front; or sorting each post-triggering event from large to small or from small to large according to the resource acquisition progress when the corresponding network resource acquisition task is suspended.
[0068] It can be seen that in an embodiment of the present application, a first implementation method for limiting the execution progress of the network resource acquisition task corresponding to the post-trigger event may include: first pausing the network resource acquisition tasks corresponding to each post-trigger event, and then restoring or deleting the network resource acquisition tasks corresponding to one or more post-trigger events according to the user's instructions, so as to reduce the number of network resource acquisition tasks executed simultaneously.
[0069] Please also read Figure 5 , Figure 5 FIG. 1 is a flow chart of another method for acquiring network resources disclosed in an embodiment of the present application. The method can be applied to a mobile terminal, such as Figure 5 As shown, the method for acquiring the network resource may include the following steps:
[0070] 510. When the current network speed is lower than a preset network speed threshold, a trigger event for requesting to obtain network resources is detected.
[0071] 520. Accumulate the detected trigger events to obtain a cumulative number of trigger times.
[0072] 530. After the cumulative number of trigger times reaches a preset number threshold, if a trigger event for requesting to obtain network resources is still detected, the trigger event detected after the cumulative number of trigger times reaches the preset number threshold is taken as a post-trigger event.
[0073] 540. Suspend the network resource acquisition task corresponding to the post-trigger event.
[0074] In an embodiment of the present application, as an optional implementation, the detected post-trigger event can be moved into a virtual isolation space, and the network resource acquisition task corresponding to the post-trigger event moved into the virtual isolation space is suspended.
[0075] 550. Sort the network resource acquisition tasks corresponding to the respective post-trigger events according to a preset second sorting rule to obtain an arrangement order of the network resource acquisition tasks.
[0076] In the embodiment of the present application, the second sorting rule may be consistent with the above-mentioned first sorting rule, and the following content will not be repeated.
[0077] 560. According to the obtained arrangement order, select the first N network resource acquisition tasks and restore them in sequence.
[0078] In the embodiment of the present application, N is a positive integer and may be less than or equal to the total number of post-trigger events, that is, the network resource acquisition tasks corresponding to some or all of the post-trigger events may be selected for recovery.
[0079] The first N network resource acquisition tasks are selected according to the arrangement order and restored in sequence. The network resource acquisition tasks corresponding to the post-trigger events with earlier triggering times can be restored first. The resource acquisition progress of the network resource acquisition tasks corresponding to the post-trigger events with earlier triggering times may be greater than the resource acquisition progress of the network resource acquisition tasks corresponding to the post-trigger events with later triggering times. This can not only delay the execution progress of the restored network resource acquisition tasks, but also reduce the time required to complete the execution of the restored network resource acquisition tasks, thereby improving the success rate of the execution of the network resource acquisition tasks.
[0080] Alternatively, the post-triggering events of the corresponding network resource acquisition tasks with a larger resource acquisition progress can be restored first, thereby reducing the time required to complete the restored network resource acquisition tasks and improving the success rate of completing the network resource acquisition tasks.
[0081] In an embodiment of the present application, when executing step 560 to select the top N network resource acquisition tasks for recovery according to the obtained arrangement order, the selected N network resource acquisition tasks can be recovered at the same time, or the top N network resource acquisition tasks can be selected and recovered in sequence at predetermined time intervals according to the obtained arrangement order, without specific limitation.
[0082] In an embodiment of the present application, according to the obtained arrangement order, the network resource acquisition tasks ranked in the top N are selected for recovery at predetermined time intervals, that is, each suspended network resource acquisition task is restored in turn according to the arrangement order, and there is a certain interval between the recovery times corresponding to two network resource acquisition tasks adjacent in the arrangement order, so that the execution progress of the network resource acquisition tasks can be gradually delayed, reducing the number of network resource acquisition tasks executed simultaneously.
[0083] Among them, the above-mentioned predetermined time interval can be a fixed time interval or a variable time interval. Optionally, if the time interval is variable, the later the arrangement order, the longer the corresponding time interval when two adjacent network resource acquisition tasks are resumed. Exemplarily, if the preset quantity threshold is 3, the post-triggering events include event 4, event 5, event 6 and event 7, and the corresponding network resource acquisition tasks can be task 4, task 5, task 6 and task 7 respectively. After tasks 4-7 are suspended, tasks 4-task 7 are resumed in sequence. Among them, the time interval between resuming event 4 and resuming event 5 can be set to 24 milliseconds, and the time interval between resuming event 5 and resuming event 6 can be set to 26 milliseconds.
[0084] In addition, the above N may be a fixed value preset by a user or an application developer, a mobile terminal manufacturer, etc. Alternatively, the above N may also be determined according to a second preset duration and a time interval corresponding to when each network resource acquisition task is restored, and the second preset duration may refer to a deadline for restoring the network resource acquisition task.
[0085] That is, as an optional implementation, the specific implementation of selecting the top N network resource acquisition tasks for sequential restoration at predetermined time intervals according to the obtained arrangement order may include:
[0086] According to the obtained arrangement order, the network resource acquisition tasks corresponding to each post-trigger event are restored in turn at predetermined time intervals; the continuous recovery duration of the network resource acquisition task is determined based on the recovery time corresponding to the first restored network resource acquisition task and the current time; when the continuous recovery duration reaches a second preset duration, stop restoring the unrestored network resource acquisition tasks.
[0087] Exemplarily, if the preset number threshold is 3, the post-triggering events include event 4, event 5, event 6, and event 7, and the corresponding network resource acquisition tasks may be task 4, task 5, task 6, and task 7. The second preset duration is 1.5 seconds. Assuming that the time interval is fixed at 1 second, the first network resource acquisition task to be restored is task 4. The restoration time of task 5 needs to be 1 second apart from the restoration time of task 4, so task 5 can also be restored. However, the restoration time of task 6 needs to be 2 seconds apart from the restoration time of task 4, which is greater than the second preset duration. Task 6 and task 7 will not be restored. That is, in this example, the continuous restoration time required to restore the two network resource acquisition tasks has exceeded the second preset duration, and N is 2.
[0088] In this embodiment, by setting a second preset time as the deadline for recovering the network resource acquisition task, the execution of the network resource acquisition task corresponding to the excessively frequent triggering events within a unit time can be restricted, thereby further reducing the number of network resource acquisition tasks executed simultaneously.
[0089] It can be seen that in the embodiment of the present application, the second implementation method of limiting the execution progress of the network resource acquisition task corresponding to the post-trigger event may include: first pausing the network resource acquisition tasks corresponding to each post-trigger event, and then selecting N network resource acquisition tasks from them in a certain order of arrangement to be restored in sequence, which can give priority to restoring the network resource acquisition tasks corresponding to the post-trigger event with an earlier triggering time, and can also delay the execution progress of the restored network resource acquisition tasks.
[0090] Please also read Figure 6 , Figure 6 FIG. 1 is a flow chart of another method for acquiring network resources disclosed in an embodiment of the present application. The method can be applied to a mobile terminal, such as Figure 6 As shown, the method for acquiring the network resource may include the following steps:
[0091] 610. When the current network speed is lower than a preset network speed threshold, detect a triggering event for requesting to obtain network resources.
[0092] 620. Accumulate the detected trigger events to obtain a cumulative number of trigger times.
[0093] 630. After the cumulative number of trigger times reaches a preset number threshold, if a trigger event for requesting to obtain network resources is still detected, the trigger event detected after the cumulative number of trigger times reaches the preset number threshold is taken as a post-trigger event.
[0094] 640. Count resource acquisition progress of the network resource acquisition task corresponding to each first triggering event and each later triggering event at the target time.
[0095] In the embodiment of the present application, the target time can be any time, and is not specifically limited. The first trigger event is a trigger event detected before the cumulative number of triggers exceeds the preset number threshold, and the second trigger event is a trigger event detected after the cumulative number of triggers reaches the preset number threshold. The mobile terminal can perform real-time detection of the resource acquisition progress of the network resource acquisition task corresponding to each first trigger event or second trigger event.
[0096] 650. Compare the resource acquisition progress corresponding to the event that triggers the maximum progress first and the event that triggers the maximum progress later, respectively, to obtain a first comparison result.
[0097] In the embodiment of the present application, the first-trigger maximum progress event may be the first-trigger event with the largest corresponding resource acquisition progress, and the second-trigger maximum progress event may be the second-trigger event with the largest corresponding resource acquisition progress.
[0098] 660. Determine an event to be deleted from the first triggering event and the later triggering event according to the first comparison result, and delete the network resource acquisition task corresponding to the event to be deleted.
[0099] In the embodiment of the present application, the event to be deleted may be a first triggering event or a later triggering event, which may be specifically determined based on the first comparison result mentioned above.
[0100] As an optional implementation manner, determining the event to be deleted from the first triggering event and the later triggering event according to the first comparison result may include:
[0101] When the first comparison result is that the resource acquisition progress corresponding to the first-trigger maximum progress event is greater than the resource acquisition progress corresponding to the second-trigger maximum progress event, the resource acquisition progress corresponding to the second-trigger maximum progress event is compared with the resource acquisition progress corresponding to the remaining first-trigger events one by one to obtain a second comparison result. That is, the resource acquisition progress corresponding to the second-trigger maximum progress event and the remaining first-trigger events except the first-trigger maximum progress event are compared. Exemplarily, assuming that 5 triggering events are detected and the preset number threshold is 3, then event 1, event 2 and event 3 are first-triggering events, and event 4 and event 5 are later-triggering events. If the first-trigger maximum progress event is event 2, the second-trigger maximum progress event is event 5, and the resource acquisition progress corresponding to event 2 is greater than the resource acquisition progress corresponding to event 5, then continue to compare the resource acquisition progress corresponding to event 5 and event 1, and compare the resource acquisition progress corresponding to event 5 and event 3.
[0102] According to the second comparison result, the event to be deleted is determined from the remaining first-trigger events and the later-trigger events. That is, the event with the largest progress that is triggered first will not be determined as the event to be deleted, so that the task with the largest resource acquisition progress among all current network resource acquisition tasks can be retained, thereby reducing the time required for the network resource acquisition task to be completed and improving the success rate of the network resource acquisition task to be completed.
[0103] The above-mentioned determining the event to be deleted from the remaining first-triggering events and the later-triggering events according to the second comparison result may include:
[0104] When the second comparison result shows that the resource acquisition progress corresponding to any of the other first triggering events is less than the resource acquisition progress corresponding to the later triggering maximum progress event, all triggering events detected after the first triggering maximum progress event are determined as events to be deleted; or
[0105] When the second comparison result is that the resource acquisition progress corresponding to the other first-triggering events are all greater than the resource acquisition progress corresponding to the later-triggering maximum progress event, the later-triggering event is determined as the event to be deleted.
[0106] That is to say, if, except for the event that triggers the maximum progress first, the resource acquisition progress corresponding to any of the events that triggers first is smaller than the resource acquisition progress corresponding to the event that triggers later, the event that triggers first and the event that triggers later will be determined as events to be deleted; if, except for the event that triggers the maximum progress first, the resource acquisition progress corresponding to the events that triggers first are all larger than the resource acquisition progress corresponding to the event that triggers later, only the event that triggers later will be determined as the event to be deleted.
[0107] Exemplarily, it is assumed that event 1, event 2, and event 3 are first triggered events, and event 4 and event 5 are later triggered events, the first triggered event with the maximum progress is event 2, and the later triggered event with the maximum progress is event 5, and the resource acquisition progress corresponding to event 2 is greater than the resource acquisition progress corresponding to event 5. The resource acquisition progress corresponding to event 5 and event 1, and event 5 and event 3 are compared respectively. If the resource acquisition progress corresponding to event 1 and event 3 are both greater than the resource acquisition progress corresponding to event 5, then the events to be deleted are event 4 and event 5; if the resource acquisition progress corresponding to event 1 or event 3 is less than the resource acquisition progress corresponding to event 5, then the events to be deleted are event 3, event 4, and event 5.
[0108] As another optional implementation, determining the event to be deleted from the first triggering event and the later triggering event according to the first comparison result may include:
[0109] When the first comparison result is that the resource acquisition progress corresponding to the later-triggering maximum progress event is greater than the resource acquisition progress corresponding to the earlier-triggering maximum progress event, the earlier-triggering maximum progress event is determined as the event to be deleted; and all trigger events detected after the earlier-triggering maximum progress event in the earlier-triggering event are determined as events to be deleted; and all trigger events detected after the earlier-triggering maximum progress event in the later-triggering event except the later-triggering maximum progress event are determined as events to be deleted.
[0110] That is to say, in this implementation, the event with the largest progress that is triggered later will not be determined as the event to be deleted, and the task with the largest resource acquisition progress among all current network resource acquisition tasks can be retained. Then, the event with the largest progress that is triggered first can be determined as the event to be deleted, and the remaining triggering events detected after the event with the largest progress that is triggered first can be determined as the events to be deleted, and the network resource acquisition tasks corresponding to the triggering events with later triggering times and smaller resource acquisition progress can be deleted.
[0111] It can be seen that in the embodiment of the present application, the third implementation method of limiting the execution progress of the network resource acquisition task corresponding to the post-triggering event may include: counting the resource acquisition progress of the network resource acquisition tasks corresponding to each pre-triggering event and the post-triggering event, retaining the network resource acquisition task with the largest resource acquisition progress, and deleting the network resource acquisition task with a smaller resource acquisition progress according to different comparison results. The network resource acquisition task with the largest resource acquisition progress may be the task that completes resource download and successfully completes page loading the fastest. Therefore, by retaining the network resource acquisition task with the largest resource acquisition progress and deleting other network resource acquisition tasks with smaller resource acquisition progress, it is possible to reduce the time required to complete the execution of the network resource acquisition task and reduce the number of network resource acquisition tasks executed simultaneously.
[0112] The above content introduces three implementation methods for limiting the execution progress of the network resource acquisition task corresponding to the post-trigger event disclosed in the embodiments of this application. It should be noted that in some possible embodiments, when limiting the execution progress of the network resource acquisition task corresponding to the post-trigger time, any one of the above implementation methods can be adopted, or a combination of the above multiple implementation methods can be adopted.
[0113] Please also read Figure 7 , Figure 7 1 is a schematic diagram of a network resource acquisition device disclosed in an embodiment of the present application. The network resource acquisition device can be applied to a mobile terminal, and the device can be a terminal device in the aforementioned embodiment, or a component located in the terminal device, such as a chip. Moreover, the device can implement all the functions of the terminal device in the aforementioned embodiment. Figure 7 As shown, the network resource acquisition device 700 may include:
[0114] The detection module 710 is used to detect a triggering event for requesting to obtain network resources when the current network speed is lower than a preset network speed threshold;
[0115] The accumulation module 720 is used to accumulate the detected trigger events to obtain the accumulated trigger times; optionally, the accumulated trigger events may be trigger events that have not been fully executed;
[0116] The control module 730 is used to, after the cumulative number of trigger times reaches a preset number threshold, if the detection module 710 still detects a trigger event for requesting to obtain network resources, treat the trigger event detected after the cumulative number of trigger times reaches the preset number threshold as a post-trigger event, and limit the execution progress of the network resource acquisition task corresponding to the post-trigger event.
[0117] As an optional implementation, the control module 730 may include: a pause unit, a detection unit, and a restriction unit.
[0118] A pause unit, used to pause the network resource acquisition task corresponding to the post-trigger event;
[0119] A detection unit, configured to detect a user operation on one or more post-triggering events;
[0120] The first limiting unit is used to restore or delete the network resource acquisition task corresponding to each post-triggering event according to the instruction information of the user operation.
[0121] As an optional implementation, the first restriction unit may be specifically configured to determine a target trigger event from various post-trigger events according to the indication information of the user operation when the indication information of the user operation indicates restoration; and restore the network resource acquisition task corresponding to the target trigger event; or,
[0122] It can be used to determine the event to be deleted from various post-trigger events according to the instruction information of the user operation when the instruction information of the user operation indicates deletion; delete the network resource acquisition task corresponding to the event to be deleted, and restore the network resource acquisition tasks corresponding to the remaining post-trigger events.
[0123] As an optional implementation, the first limiting unit may also be configured to delete the network resource acquisition task corresponding to each post-trigger event when no user operation for one or more post-trigger events is detected within a first preset time period.
[0124] As an optional implementation, the first restriction unit may also be configured to sequentially delete the network resource acquisition tasks corresponding to each post-triggering event according to a preset first sorting rule when no user operation is detected within a first preset time period.
[0125] Optionally, the above-mentioned preset first sorting rule includes: sorting in order from earliest to latest according to the triggering time of each post-triggering event; or, sorting in order from latest to earliest according to the triggering time of each post-triggering event; or, sorting each post-triggering event in order from largest to smallest according to the resource acquisition progress when the corresponding network resource acquisition task is suspended; or, sorting each post-triggering event in order from smallest to largest according to the resource acquisition progress when the corresponding network resource acquisition task is suspended.
[0126] As an optional implementation, the control module 730 may also include: a sorting unit and a second limiting unit.
[0127] The sorting unit may be used to sort the network resource acquisition tasks corresponding to each post-triggering event according to a preset second sorting rule after the pausing unit suspends the network resource acquisition task corresponding to the post-triggering event, so as to obtain an arrangement order of each network resource acquisition task;
[0128] The second limiting unit may be used to select the first N network resource acquisition tasks according to the obtained arrangement order and restore them in sequence, where N is a positive integer and is less than or equal to the total number of subsequent triggering events.
[0129] Optionally, the above-mentioned preset second sorting rule may include: sorting in order from earliest to latest according to the triggering time of each post-triggering event; or, sorting in order from latest to earliest according to the triggering time of each post-triggering event; or, sorting each post-triggering event in order from largest to smallest according to the resource acquisition progress when the corresponding network resource acquisition task is suspended; or, sorting each post-triggering event in order from smallest to largest according to the resource acquisition progress when the corresponding network resource acquisition task is suspended.
[0130] As an optional implementation, the second restriction unit can be specifically used to select the network resource acquisition tasks arranged in the top N according to the obtained arrangement order and restore them in sequence at predetermined time intervals. The time interval can be fixed or variable. If the time is a variable time interval, the later the arrangement order, the longer the corresponding time interval when two adjacent network resource acquisition tasks are restored.
[0131] As an optional implementation, the second limiting unit can be specifically used to restore the network resource acquisition tasks corresponding to each post-triggering event according to the obtained arrangement order and the first time interval; determine the continuous recovery time of the network resource acquisition task according to the recovery time corresponding to the first restored network resource acquisition task and the current time; when the continuous recovery time reaches the second preset time, stop restoring the unrestored network resource acquisition tasks. That is, the above-mentioned N can be determined according to the second preset time and the time interval.
[0132] As an optional implementation, the control module 730 may also include: a statistical unit, a comparison unit, a determination unit and a deletion unit.
[0133] A statistical unit, used to count the resource acquisition progress of the network resource acquisition task corresponding to each first trigger event and each later trigger event at the target time; the first trigger event is a trigger event detected before the cumulative number of triggers exceeds a preset number threshold;
[0134] A comparison unit, used to compare the resource acquisition progress corresponding to the first triggering maximum progress event and the second triggering maximum progress event, respectively, to obtain a first comparison result; the first triggering maximum progress event is the first triggering event with the largest corresponding resource acquisition progress, and the second triggering maximum progress event is the second triggering event with the largest corresponding resource acquisition progress;
[0135] a determination unit, configured to determine an event to be deleted from a first triggering event and a later triggering event according to a first comparison result;
[0136] The deleting unit is used to delete the network resource acquisition task corresponding to the event to be deleted.
[0137] As an optional implementation, the determination unit can be specifically used to compare the resource acquisition progress corresponding to the later-triggered maximum progress event with the resource acquisition progress corresponding to the remaining first-triggered events one by one to obtain a second comparison result when the first comparison result is that the resource acquisition progress corresponding to the first-triggered maximum progress event is greater than the resource acquisition progress corresponding to the later-triggered maximum progress event; the remaining first-triggered events are the first-triggered events other than the first-triggered maximum progress event; according to the second comparison result, determine the event to be deleted from the remaining first-triggered events and the later-triggered events; or,
[0138] When the first comparison result is that the resource acquisition progress corresponding to the later-triggering maximum progress event is greater than the resource acquisition progress corresponding to the earlier-triggering maximum progress event, the earlier-triggering maximum progress event is determined as the event to be deleted; and all triggering events detected after the earlier-triggering maximum progress event in the earlier-triggering event are determined as events to be deleted; and all triggering events in the later-triggering event except the later-triggering maximum progress event are determined as events to be deleted.
[0139] As an optional implementation manner, the implementation manner in which the determination unit determines the event to be deleted from the remaining first-triggering events and the later-triggering events according to the second comparison result may include:
[0140] If the second comparison result is that any of the other first-triggering events has a resource acquisition progress corresponding to a smaller resource acquisition progress than the later-triggering maximum progress event, all triggering events detected after the first-triggering maximum progress event are determined as events to be deleted; or
[0141] If the second comparison result is that the resource acquisition progress corresponding to the other first-triggering events are all greater than the resource acquisition progress corresponding to the later-triggering maximum progress event, the later-triggering event is determined as the event to be deleted.
[0142] The network resource acquisition device disclosed in the embodiment of the present application can limit the execution progress of the network resource acquisition task corresponding to the post-trigger event, thereby reducing the number of network resource acquisition tasks that simultaneously transmit data to the server, thereby reducing the network load, thereby improving the success rate of network resource acquisition tasks in completing network resource acquisition, and further increasing the success rate of page loading based on the acquired network resources, thereby reducing the occurrence of page crashes.
[0143] Please also read Figure 8 , Figure 8 Schematic diagram of the structure of a mobile terminal disclosed in the embodiment of the present application. Figure 8As shown, the mobile terminal 800 may include one or more of the following components: a processor 810, a memory 820 coupled to the processor 810, and a wireless communication module 830 coupled to the processor 810. The memory 820 may store one or more application programs, and the one or more application programs may be configured to be executed by one or more processors 810, and the one or more programs are configured to execute the network resource acquisition method described in the above embodiments.
[0144] The processor 810 may include one or more processing cores. The processor 810 uses various interfaces and lines to connect various parts of the entire mobile terminal 800, and executes various functions and processes data of the mobile terminal 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 820, and calling data stored in the memory 820. Optionally, the processor 810 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 810 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 810, but may be implemented separately through a communication chip.
[0145] The memory 820 may include a random access memory (RAM) or a read-only memory (ROM). The memory 820 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 820 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the mobile terminal 800 during use, etc.
[0146] The wireless communication module 830 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile terminal 800. The wireless communication module 860 can be one or more devices integrating at least one communication processing module. The mobile terminal 800 can establish a communication connection with the massage device through the wireless communication module 830, thereby realizing data transmission between the massage device and the massage device.
[0147] It is understandable that the mobile terminal 800 may include more or fewer structural elements than those in the above structural block diagram, for example, including a power supply, input buttons, a camera, a speaker, a screen, an RF (Radio Frequency) circuit, a sensor, etc., which are not limited here.
[0148] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program implements the methods described in the above embodiments when executed by a processor.
[0149] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.
[0150] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM), etc.
[0151] As used herein, any reference to memory, storage, database, or other medium may include nonvolatile and / or volatile memory. Suitable nonvolatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0152] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0153] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0154] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0156] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0157] The above is a detailed introduction to a network resource acquisition method, device, mobile terminal and computer-readable storage medium disclosed in the embodiment of the present application. The principle and implementation method of the present application are described in detail using specific examples herein. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for acquiring network resources, characterized in that: The method comprises: When the current network speed is lower than a preset network speed threshold, detecting a trigger event for requesting to obtain network resources; Accumulate the detected trigger events to obtain the cumulative number of trigger times; After the cumulative number of triggers reaches the preset number threshold, if a trigger event requesting to obtain the network resource is still detected, the trigger event detected after the cumulative number of triggers reaches the preset number threshold is regarded as a post-trigger event, and the execution progress of the network resource acquisition task corresponding to the post-trigger event is restricted; The limiting the execution progress of the network resource acquisition task corresponding to the post-triggering event includes: Counting the resource acquisition progress of the network resource acquisition task corresponding to each first triggering event and each of the second triggering events at the target time; the first triggering event is a triggering event detected before the cumulative number of triggering times exceeds the preset number threshold; Compare the resource acquisition progresses corresponding to the first triggered maximum progress event and the second triggered maximum progress event, respectively, to obtain a first comparison result; the first triggered maximum progress event is the first triggered event with the largest corresponding resource acquisition progress, and the second triggered maximum progress event is the second triggered event with the largest corresponding resource acquisition progress; Determine an event to be deleted from the first triggering event and the later triggering event according to the first comparison result; Delete the network resource acquisition task corresponding to the event to be deleted.
2. The method according to claim 1, characterized in that The limiting the execution progress of the network resource acquisition task corresponding to the post-triggering event also includes: Suspending the network resource acquisition task corresponding to the post-triggering event; detecting a user action on one or more of the post-triggering events; The network resource acquisition tasks corresponding to each of the post-triggering events are restored or deleted according to the indication information of the user operation.
3. The method according to claim 2, characterized in that The restoring or deleting the network resource acquisition task corresponding to each of the post-triggering events according to the indication information of the user operation includes: When the indication information of the user operation indicates recovery, determining a target trigger event from each of the post-trigger events according to the indication information of the user operation; Resume the network resource acquisition task corresponding to the target triggering event.
4. The method according to claim 2, characterized in that: The restoring or deleting the network resource acquisition task corresponding to each of the post-triggering events according to the indication information of the user operation includes: When the indication information of the user operation indicates deletion, determining an event to be deleted from each of the post-triggering events according to the indication information of the user operation; The network resource acquisition task corresponding to the event to be deleted is deleted, and the remaining network resource acquisition tasks corresponding to the post-triggering events are restored.
5. The method according to claim 2, characterized in that: After detecting the user operation for one or more post-trigger events, the method further includes: If the user operation is not detected within the first preset time period, the network resource acquisition task corresponding to each of the post-trigger events is deleted.
6. The method according to claim 5, characterized in that If the user operation is not detected within the first preset time period, deleting the network resource acquisition task corresponding to each post-trigger event includes: If the user operation is not detected within the first preset time period, the network resource acquisition tasks corresponding to the post-trigger events are deleted in sequence according to a preset first sorting rule.
7. The method according to claim 6, characterized in that The preset first sorting rule includes: Sorting the triggering moments of the post-triggering events from earliest to latest; or, Sorting the triggering moments of the post-triggering events from the last to the first; or, sorting the post-triggering events in descending order of the resource acquisition progress when the corresponding network resource acquisition task is suspended; or, The post-triggering events are sorted in ascending order of the resource acquisition progress when the corresponding network resource acquisition task is suspended.
8. The method according to claim 1, characterized in that The limiting the execution progress of the network resource acquisition task corresponding to the post-triggering event also includes: Suspending the network resource acquisition task corresponding to the post-triggering event; Sorting the network resource acquisition tasks corresponding to each of the post-trigger events according to a preset second sorting rule to obtain an arrangement order of each of the network resource acquisition tasks; According to the obtained arrangement order, the first N network resource acquisition tasks are selected and restored in sequence, where N is a positive integer and is less than or equal to the total number of the post-triggering events.
9. The method according to claim 8, characterized in that The preset second sorting rule includes: Sorting the triggering moments of the post-triggering events from earliest to latest; or, Sorting the triggering moments of the post-triggering events from the last to the first; or, sorting the post-triggering events in descending order of the resource acquisition progress when the corresponding network resource acquisition task is suspended; or, The post-triggering events are sorted in ascending order of the resource acquisition progress when the corresponding network resource acquisition task is suspended.
10. The method according to claim 8, characterized in that The method of selecting the first N network resource acquisition tasks according to the obtained arrangement order and restoring them in sequence includes: According to the obtained arrangement order, the network resource acquisition tasks arranged in the first N are selected at every predetermined time interval and restored in sequence.
11. The method according to claim 10, characterized in that The predetermined time interval is a variable time interval, and the corresponding time interval when two adjacent network resource acquisition tasks are restored is positively correlated with the arrangement order.
12. The method according to claim 10, characterized in that The N is determined according to the second preset duration and the time interval; and the network resource acquisition tasks arranged in the first N are selected and restored in sequence at predetermined time intervals according to the obtained arrangement order, including: According to the obtained arrangement order, the network resource acquisition tasks corresponding to the post-triggering events are sequentially restored at predetermined time intervals; Determine the continuous recovery duration of the network resource acquisition task according to the recovery time corresponding to the first restored network resource acquisition task and the current time; When the continuous recovery time reaches a second preset time, the recovery of the unrecovered network resource acquisition task is stopped.
13. The method according to claim 1, characterized in that The determining the event to be deleted from the first triggering event and the later triggering event according to the first comparison result includes: When the first comparison result is that the resource acquisition progress corresponding to the first-trigger maximum progress event is greater than the resource acquisition progress corresponding to the later-trigger maximum progress event, the resource acquisition progress corresponding to the later-trigger maximum progress event is compared one by one with the resource acquisition progress corresponding to the remaining first-trigger events to obtain a second comparison result; the remaining first-trigger events are the first-trigger events other than the first-trigger maximum progress event; Determine an event to be deleted from the remaining first-triggering events and the later-triggering events according to the second comparison result.
14. The method according to claim 13, characterized in that The determining the event to be deleted from the remaining first-triggering events and the later-triggering events according to the second comparison result includes: If the second comparison result is that the resource acquisition progress corresponding to any of the other first-triggering events is less than the resource acquisition progress corresponding to the later-triggering maximum progress event, all triggering events detected after the first-triggering maximum progress event are determined as events to be deleted.
15. The method according to claim 13, characterized in that The determining the event to be deleted from the remaining first-triggering events and the later-triggering events according to the second comparison result includes: If the second comparison result is that the resource acquisition progress corresponding to the other first-triggering events are all greater than the resource acquisition progress corresponding to the later-triggering maximum progress event, the later-triggering event is determined as an event to be deleted.
16. The method according to claim 1, characterized in that The determining the event to be deleted from the first triggering event and the later triggering event according to the first comparison result includes: When the first comparison result is that the resource acquisition progress corresponding to the later-triggered maximum progress event is greater than the resource acquisition progress corresponding to the earlier-triggered maximum progress event, determining the earlier-triggered maximum progress event as an event to be deleted; and Determine all triggering events detected after the first triggering maximum progress event among the first triggering events as events to be deleted; and All triggering events except the post-triggering maximum progress event in the post-triggering events are determined as events to be deleted.
17. The method according to any one of claims 1 to 16, characterized in that: The accumulated triggering events detected are accumulated to obtain the accumulated triggering times, including: The trigger events that have not been executed are accumulated to obtain the accumulated trigger times.
18. A network resource acquisition device, characterized in that: The device comprises: A detection module, used to detect a triggering event for requesting to obtain network resources when the current network speed is lower than a preset network speed threshold; The accumulation module is used to accumulate the detected trigger events to obtain the accumulated trigger times; A control module, configured to, after the cumulative number of triggers reaches a preset number threshold, if a trigger event requesting to obtain the network resource is still detected, treat the trigger event detected after the cumulative number of triggers reaches the preset number threshold as a post-trigger event, and limit the execution progress of the network resource acquisition task corresponding to the post-trigger event; The control module comprises: A statistical unit, used to count the resource acquisition progress of the network resource acquisition task corresponding to each first trigger event and each later trigger event at the target time; the first trigger event is a trigger event detected before the cumulative number of triggers exceeds a preset number threshold; A comparison unit, used to compare the resource acquisition progress corresponding to the first triggering maximum progress event and the second triggering maximum progress event, respectively, to obtain a first comparison result; the first triggering maximum progress event is the first triggering event with the largest corresponding resource acquisition progress, and the second triggering maximum progress event is the second triggering event with the largest corresponding resource acquisition progress; a determination unit, configured to determine an event to be deleted from a first triggering event and a later triggering event according to a first comparison result; The deleting unit is used to delete the network resource acquisition task corresponding to the event to be deleted.
19. A mobile terminal, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 17.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 17 is implemented.
