Method and device for detecting resource packet downloading link based on request

Through the resource package download link detection function and automatic switching mechanism, the poor user experience and untimely monitoring caused by the failure of the resource package download link are solved, and the stability and efficiency of resource package download are achieved.

CN119094390APending Publication Date: 2024-12-06SHANGHAI HODE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411189945.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, manual update is required when the resource package download link fails, resulting in poor user download experience and inability to monitor the availability of download links in time, resulting in a long solution time.

Method used

By calling the resource package download link detection function, creating a probe instance to send a probe request, determining the link status based on the response status value, and automatically switching to the backup link when it is unavailable, ensuring that the user has no sense of download experience.

Benefits of technology

It realizes timely detection and automatic switching of resource package download links, improves user experience, reduces download failure rate, and shortens the time to solve problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094390A_ABST
    Figure CN119094390A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for detecting a resource packet downloading link based on a request, and the method comprises the steps: calling a resource packet downloading link detection function according to a detection triggering operation, so as to create a detection instance, transmitting a detection request through the detection instance, and determining the state of the resource packet downloading link according to a returned response state value; and if the resource packet downloading link is in the unavailable state, switching a standby resource packet downloading link for downloading. The availability of the resource packet downloading link is detected in time, when the resource packet downloading link is in an unavailable state, the resource packet downloading link can be automatically switched to the standby resource packet downloading link in time, the whole process is not perceived by a user, and normal downloading of the user is not influenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method and device for detecting a resource package download link based on a request. Background Art

[0002] Applications can provide users with quick functional services and facilitate user operations. Users need to download the application resource package and install it before they can open the application and use the various functional services provided by the application. The application resource package is generated by compiling and packaging the application code, and then uploaded to the server for users to download. Users download it through the resource package download link provided on the page, obtain the application resource package, and then install and use it.

[0003] In the prior art, when the resource package download link provided in the page fails, it is necessary to manually update the download link and republish the page to download normally, which results in a poor user download experience and reduces the success rate of application resource package download conversion. Furthermore, the availability of the resource package download link cannot be monitored in a timely manner, and problems cannot be discovered in a timely manner, resulting in a long time to resolve. Summary of the invention

[0004] In view of the above problems, embodiments of the present application are proposed to provide a method and device for detecting a resource package download link based on a request, which overcomes the above problems or at least partially solves the above problems.

[0005] According to a first aspect of an embodiment of the present application, a method for detecting a resource package download link based on a request is provided, comprising:

[0006] According to the detection trigger operation, the resource package download link detection function is called to create a detection instance, and the detection instance sends a detection request and determines the status of the resource package download link according to the returned response status value;

[0007] If the resource package download link is unavailable, switch to the backup resource package download link for download.

[0008] Optionally, the detection trigger operation includes: a page initialization operation and / or a resource package download link click operation.

[0009] Optionally, calling a resource package download link detection function according to a detection trigger operation to create a detection instance, sending a detection request by the detection instance, and determining the state of the resource package download link according to a returned response status value further includes:

[0010] According to the detection trigger operation, call the resource package download link detection function;

[0011] Create a detection instance and send a detection request of a preset type; the detection instance includes an XMLHttpRequest instance; the preset detection request includes a HEAD type detection request; the detection request parameter includes a resource package download link;

[0012] Obtain the response status value of the resource package download link, and determine whether the response status value is a preset status value;

[0013] If not, it is determined that the resource package download link is unavailable.

[0014] Optionally, determining the status of the resource package download link according to the returned response status value further includes:

[0015] The monitoring function based on the detection instance monitors the response status value of the resource package download link;

[0016] After determining the status of the resource package download link, the status of the resource package download link is asynchronously transmitted back.

[0017] Optionally, switching the backup resource package download link for downloading further includes:

[0018] Update the resource package download link to the backup resource package download link.

[0019] Optionally, there are multiple download links for the backup resource package;

[0020] Updating the resource package download link to the standby resource package download link further includes:

[0021] The resource package download link is updated to any backup resource package download link for switching, and the switched download link is detected. If the switched download link is unavailable, the resource package download link is updated to another backup resource package download link for switching until the switched download link is available.

[0022] Optionally, if the resource package download link is unavailable, the method further includes:

[0023] The alarm information of the unavailable status of the resource package download link is asynchronously reported to the log platform for alarm processing.

[0024] According to a second aspect of an embodiment of the present application, there is provided a device for detecting a resource package download link based on a request, comprising:

[0025] The detection module is adapted to call the resource package download link detection function according to the detection trigger operation to create a detection instance, the detection instance sends a detection request, and determines the status of the resource package download link according to the returned response status value;

[0026] The switching module is adapted to switch to a backup resource package download link for downloading if the resource package download link is unavailable.

[0027] According to a third aspect of an embodiment of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0028] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the method for detecting a resource package download link based on a request.

[0029] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the method for detecting a resource package download link based on a request as described above.

[0030] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the method for detecting a resource package download link based on a request as described above.

[0031] According to the method and device for detecting the resource package download link based on the request provided in the present application, the availability of the resource package download link can be detected in time. When the resource package download link is unavailable, it can be automatically switched to the backup resource package download link in time. The user is unaware of the whole process and it does not affect the user's normal download.

[0032] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0034] Figure 1 A flowchart of a method for detecting a resource package download link based on a request according to an embodiment of the present application is shown;

[0035] Figure 2 A schematic diagram showing the available status of the page resource package download link detection is shown;

[0036] Figure 3 A schematic diagram showing a page resource package download link detection unavailable state is shown;

[0037] Figure 4 A schematic diagram of a page resource package download link 1 is shown;

[0038] Figure 5 It shows a schematic diagram of the link for downloading the page resource package being switched to link 2;

[0039] Figure 6 A flowchart of a method for detecting a resource package download link based on a request according to another embodiment of the present application is shown;

[0040] Figure 7 A schematic diagram of the structure of an apparatus for detecting a resource package download link based on a request according to an embodiment of the present application is shown;

[0041] Figure 8 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0043] First, the terms involved in one or more embodiments of the present application are explained.

[0044] apk: Android application package, Android application resource package, is an application resource package file format used by the Android operating system, which is used to distribute and install mobile applications and middleware.

[0045] XHR: XMLHttpRequest, an object used to interact with the server. XMLHttpRequest can be used to request a specific URL and obtain data without refreshing the page.

[0046] Promise: It is a solution for ES6 asynchronous programming, a constructor that is used to encapsulate asynchronous operations and obtain their success or failure results.

[0047] Figure 1 A flow chart of a method for detecting a resource package download link based on a request according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:

[0048] Step S101, according to the detection trigger operation, the resource package download link detection function is called to create a detection instance, the detection instance sends a detection request, and determines the status of the resource package download link according to the returned response status value.

[0049] The page contains a download link for the application resource package. When a user clicks on the download link for the application resource package displayed on the page, if the download link is in a normal and available state, the user can download the application resource package normally. If the download link is unavailable, such as an abnormal download link, access failure, timeout, etc., it may result in a situation where the application cannot be downloaded, such as no response after the user clicks. It is necessary to solve the problem in a timely manner and improve the stability of the download link to ensure the user experience.

[0050] To avoid the above problems, this embodiment detects the download link of the application resource package on the page. Through the detection, the status of the download link of the application resource package in the page can be determined, so that disaster recovery processing can be performed in time for the unavailable resource package download link, and automatically switch to the available backup resource package download link to ensure that users can download normally and avoid causing a bad experience for users.

[0051] Specifically, a detection function of the resource package download link can be pre-constructed, and the available status of the resource package download link can be detected based on the detection function to ensure that the resource package download link in an available state can be provided to the user, so as to facilitate the user to download the resource package normally. A detection instance is created in the detection function, and the detection instance sends a detection request. The parameters of the detection request include the resource package download link. The metadata of the resource package download link is obtained through the detection request to detect the resource package download link. After sending the detection request, the status of the resource package download link can be determined according to the returned response status value. The response status value is a response to the detection request and is related to the available status of the resource package download link. If the resource package download link is currently in an available state, the returned response status value is a status code indicating that the resource package download link is normally available. According to the response status value, it can be determined that the resource package download link is in an available state. Otherwise, it is determined that the resource package download link is in an unavailable state.

[0052] The call of the detection function is determined according to the timing of the detection trigger operation, and the detection trigger operation may include, for example, page initialization operation, resource package download link click operation, etc. When the page is initialized, the resource package download link is first detected to ensure that the loaded resource package download link is available after the page initialization is completed. When the user needs to download the resource package and clicks on the resource package download link, before downloading, the resource package download link is detected to timely confirm whether the resource package download link is available. According to the unavailable state of the resource package download link, it can be switched for disaster recovery in time without affecting the user's download. In addition, in addition to the page initialization operation, the resource package download link click operation, etc., the detection trigger operation can also adjust the detection of the resource package download link according to the real-time access volume of the page. If the page has not been accessed for a long time, in order to ensure the available state of the resource package download link, the detection of the resource package download link can be increased, such as the interval preset time length, such as 1 hour without detection, the resource package download link can be automatically continuously monitored, and the status of the download link can be grasped in real time, so that it can respond quickly and repair when an abnormality occurs, reducing the impact of the unavailable state.

[0053] If the resource package download link is determined to be available according to the returned response status value, there is no need to process the resource package download link. If the resource package download link is determined to be unavailable according to the returned response status value, step S102 is executed to automatically switch the resource package download link to disaster recovery in time to avoid affecting the normal download of users.

[0054] Step S102: If the resource package download link is unavailable, switch to a backup resource package download link for downloading.

[0055] In order to ensure the download of user's application resource package, multiple resource package download links are pre-set, including the resource package download link currently used by the page and the backup resource package download link. When the resource package download link in the page is unavailable, the backup resource package download link can be automatically switched to replace the unavailable resource package download link in the page to ensure that the application resource package can be downloaded normally. When switching the backup resource package download link, the unavailable resource package download link in the page can be updated to the backup resource package download link through language such as js to achieve disaster recovery switching.

[0056] The specific detection process is as follows: Figure 2-Figure 5 As shown, the page containing the resource package download link is as follows Figure 2As shown on the left side, the "apk download button" is provided on the left side, and its link is the resource package download link. By clicking the "apk download button", the application resource package app.apk can be downloaded. The resource package download link in the current page is http: / / pkg1.cubbear.com / app.apk. When the page is initialized or the "apk download button" is clicked, the detection function detects http: / / pkg1.cubbear.com / app.apk. If it is determined that http: / / pkg1.cubbear.com / app.apk is in an available state according to the returned response status value, no processing is required. If it is determined that http: / / pkg1.cubbear.com / app.apk is in an unavailable state according to the returned response status value, such as Figure 3 As shown in the figure, the Status of app.apk is displayed as CORS error (cross-resource sharing error). You need to switch the resource package download link http: / / pkg1.cubbear.com / app.apk to disaster recovery. Figure 4 The href of resource package download link 1 shown is "http: / / pkg1.cubbear.com / app.apk", which is switched to Figure 5 The href of the resource package download link 2 shown is "http: / / pkg2.cubbear.com / app.apk". http: / / pkg2.cubbear.com / app.apk is the backup resource package download link. Further, this embodiment detects whether the resource package download link is available, rather than detecting whether the domain name where the page is located is available. Figure 3 As shown, when the Status of app.apk is displayed as CORS error (cross-resource sharing error), the Status of the page www.cubbear.com is displayed as 200 (request successful). At this time, the page domain name can be accessed normally, but the resource package download link is unavailable. Therefore, this embodiment detects the resource package download link, which can more accurately determine whether the application resource package can be downloaded normally, and promptly discovers the unavailable resource package download link for disaster recovery switching, thereby reducing the adverse impact on the user's download. The above links, domain names, status data, page displays, etc. are all examples, which are set according to the implementation situation and are not limited here.

[0057] According to the method for detecting the resource package download link based on request provided in the present application, timely detection of the availability of the resource package download link is achieved. When the resource package download link is unavailable, it can be automatically switched to the backup resource package download link in time. The user is unaware of the whole process and it does not affect the user's normal download.

[0058] Figure 6 A flow chart of a method for detecting a resource package download link based on a request according to an embodiment of the present application is shown. Figure 6 As shown, the method comprises the following steps:

[0059] Step S601: according to the detection trigger operation, the resource package download link detection function is called, a detection instance is created, and a detection request of a preset type is sent.

[0060] The page contains a resource package download link, such as <a id="download”,href="http: pkg1.cubbear.com app.apk”download="download”> apk download button , where the resource package download link on the page is http: / / pkg1.cubbear.com / app.apk.

[0061] When the page is initialized, or when the resource package download link is clicked, the resource package download link detection function is called according to the above detection trigger operation. The detection function is as follows:

[0062]

[0063]

[0064] Among them, a detection instance is created. The detection instance can adopt, for example, an XMLHttpRequest instance. A preset type of detection request is sent based on the XMLHttpRequest instance. The preset type of detection request includes a HEAD type of detection request, which can obtain the metadata of the requested resource package download link without transmitting the specific resource package. Only the response header information can be obtained, saving bandwidth and time.

[0065] The parameters of the detection request include the resource package download link of the current page, such as xhr.open('HEAD', url, true), where url is the resource package download link. When executing the detection function, line1 can be passed in to detect the resource package download link http: / / pkg11.cubbear.com / app.apk of line1.

[0066] The above code is for illustration only. The specific settings will depend on the implementation situation and are not limited here.

[0067] Step S602: Obtain a response status value of the resource package download link, and determine whether the response status value is a preset status value.

[0068] During detection, the response status value of the resource package download link is monitored based on the monitoring function of the detection instance, such as the onreadystatechange monitoring function of the detection instance xhr, and the response of the resource package download link is monitored to obtain the response status value of the resource package download link, such as xhr.status. The xhr.status is judged to determine whether the response status value is a preset status value. The preset status value is related to the request type. For example, the present embodiment adopts a HEAD type detection request. If the request is successful, it means that the resource package download link is in an available state and does not need to be downloaded. The preset status value can be 200. When the response status value is the preset status value 200, such as if (xhr.status == 200), if it is judged that xhr.status = 200, it can be determined that the resource package download link is in an available state and does not need to be switched. The parameter of resolve can be set to false. If it is judged that xhr.status ≠ 200, it is determined that the resource package download link is in an unavailable state. The parameter of resolve is set to true, that is, the resource package download link needs to be switched.

[0069] Furthermore, after determining the status of the resource package download link, the status of the resource package download link can be transmitted back in an asynchronous manner, such as by using a Promise object to obtain asynchronous operation information and using the resolve function of the Promise object, such as return new Promise(resolve), to asynchronously transmit the status of the resource package download link back.

[0070] Step S603: determine that the resource package download link is unavailable.

[0071] If it is determined that the response status value is not the preset status value, it can be determined that the resource package download link is unavailable, and resolve(true) is returned.

[0072] Step S604: Update the resource package download link to any backup resource package download link for switching, and detect the switched download link. If the switched download link is unavailable, update the resource package download link to another backup resource package download link for switching until the switched download link is available.

[0073] When it is determined that the resource package download link is unavailable, it is necessary to switch the resource package download link in time. When switching, as shown in the code in step S601, document.getElementById('download').href=line2 can be used to switch the resource package download link of the current page to the backup resource package download link line2, that is, update the resource package download link in the page to http: / / pkg2.cubbear.com / app.apk.

[0074] When using the backup resource package download link to switch and update the resource package download link of the page, if there is only one backup resource package download link, the backup resource package download link can be directly switched and updated. If the backup resource package download link contains multiple, such as line2, line3, line4, line5..., different download links can be provided for downloading application resource packages. During disaster recovery switching, the resource package download link can be first updated to any backup resource package download link to switch the download link. After switching, the switched download link can be further detected. If the switched download link is in an unavailable state, the resource package download link is updated to another backup resource package download link for switching until the switched download link is detected to be available, ensuring that the application resource package can be downloaded normally. For example, the resource package download link of the page is first switched to the line2 backup resource package download link, and line2 is detected. If line2 is in an available state, there is no need to switch again. If line2 is unavailable, the resource package download link of the page will continue to switch to line3, and detect line3 until the download link after the page switch is detected to be available, ensuring that the application resource package can be downloaded normally based on the resource package download link of the page. The above is an example, and the specific setting depends on the implementation situation, and is not limited here.

[0075] Step S605: asynchronously report the alarm information of the unavailable state of the resource package download link to the log platform for alarm processing.

[0076] When the resource package download link is unavailable, in addition to automatic switching, the alarm information of the unavailable status of the resource package download link is immediately reported to the front-end error log through asynchronous upload, such as _hmt.push(['_trackEvent', 'download link'+line1+'unavailable', 'error']), and reported to the log platform for alarm processing, so that the log platform can troubleshoot the unavailable status of the resource package download link according to the alarm information and solve the problem of unavailable download link in time. The above is an example, and the error log can also include the time of occurrence, specific error information, etc., to facilitate further analysis and optimization.

[0077] Furthermore, when the backup resource package download link is switched, if the backup resource package download link is also unavailable, it is necessary to upload the unavailability problem of the backup resource package download link for alarm, troubleshoot the backup resource package download link, and ensure that the backup resource package download link is available normally.

[0078] Furthermore, for the backup resource package download link, the backup resource package download link can also be detected at a preset time interval to ensure that the backup resource package download link can be in an available state, thereby avoiding the problem that the backup resource package download link is also in an unavailable state after switching.

[0079] According to the method for detecting the resource package download link based on the request provided by the present application, before downloading the application resource package, by detecting the resource package download link of the page, the unavailable state of the resource package download link can be discovered in time, so that the resource package download link can be switched, and the resource package download link in the available state can be provided. The unavailable resource package download link can be removed in time, and the error log can be uploaded as an alarm, so as to repair and adjust the unavailable resource package download link in time. Detecting the availability of the resource package download link can ensure the provision of a stable and available resource package download link, and users can download the application resource package without noticing, thereby improving the user experience.

[0080] Figure 7 FIG. 1 shows a schematic diagram of a structure of a device for detecting a resource package download link based on a request provided in an embodiment of the present application. Figure 7 As shown, the device comprises:

[0081] The detection module 710 is adapted to call the resource package download link detection function according to the detection trigger operation to create a detection instance, and the detection instance sends a detection request, and determines the status of the resource package download link according to the returned response status value;

[0082] The switching module 720 is adapted to switch to a backup resource package download link for downloading if the resource package download link is unavailable.

[0083] Optionally, the detection trigger operation includes: a page initialization operation and / or a resource package download link click operation.

[0084] Optionally, the detection module 710 is further adapted to:

[0085] According to the detection trigger operation, call the resource package download link detection function;

[0086] Create a detection instance and send a detection request of a preset type; the detection instance includes an XMLHttpRequest instance; the preset detection request includes a HEAD type detection request; the detection request parameter includes a resource package download link;

[0087] Obtain the response status value of the resource package download link, and determine whether the response status value is a preset status value;

[0088] If not, it is determined that the resource package download link is unavailable.

[0089] Optionally, the detection module 710 is further adapted to:

[0090] The monitoring function based on the detection instance monitors the response status value of the resource package download link;

[0091] After determining the status of the resource package download link, the status of the resource package download link is asynchronously transmitted back.

[0092] Optionally, the switching module 720 is further adapted to:

[0093] Update the resource package download link to the backup resource package download link.

[0094] Optionally, there are multiple download links for the backup resource package;

[0095] The switching module 720 is further adapted to:

[0096] The resource package download link is updated to any backup resource package download link for switching, and the switched download link is detected. If the switched download link is unavailable, the resource package download link is updated to another backup resource package download link for switching until the switched download link is available.

[0097] Optionally, the device further comprises: an alarm module 730, adapted to asynchronously report alarm information of the unavailable state of the resource package download link to the log platform for alarm processing.

[0098] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.

[0099] According to the device for detecting the resource package download link based on the request provided in the present application, the availability of the resource package download link can be detected in time. When the resource package download link is unavailable, it can be automatically switched to the backup resource package download link in time. The user is unaware of the whole process and it does not affect the user's normal download.

[0100] The present application also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute the operation corresponding to the method of detecting the resource package download link based on the request in any of the above method embodiments.

[0101] The present application also provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to execute operations corresponding to the method of detecting a resource package download link based on a request in any of the above method embodiments.

[0102] Figure 8 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.

[0103] like Figure 8 As shown, the computing device may include: a processor (processor) 802 , a communication interface (Communications Interface) 804 , a memory (memory) 806 , and a communication bus 808 .

[0104] in:

[0105] The processor 802 , the communication interface 804 , and the memory 806 communicate with each other via a communication bus 808 .

[0106] The communication interface 804 is used to communicate with other devices such as clients or other servers.

[0107] The processor 802 is used to execute the program 810, and specifically can execute the relevant steps in the above-mentioned method embodiment for detecting the resource package download link based on the request.

[0108] Specifically, the program 810 may include program codes, which include computer operation instructions.

[0109] The processor 802 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0110] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0111] Program 810 can be specifically used to enable processor 802 to execute the method of detecting the resource package download link based on request in any of the above-mentioned method embodiments. The specific implementation of each step in program 810 can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned embodiment of detecting the resource package download link based on request, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.

[0112] The algorithm or display provided here is not inherently related to any specific computer, virtual system or other device. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the application described here, and the above description of specific languages ​​is to disclose the preferred embodiment of the application.

[0113] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0114] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0115] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0116] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0117] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0118] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A method for detecting a resource package download link based on a request, comprising: According to the detection trigger operation, the resource package download link detection function is called to create a detection instance, the detection instance sends a detection request, and determines the status of the resource package download link according to the returned response status value; If the resource package download link is unavailable, switch to a backup resource package download link for downloading.

2. The method according to claim 1, wherein: The detection trigger operation includes: a page initialization operation and / or a resource package download link click operation.

3. The method according to claim 1 or 2, wherein: The step of calling a resource package download link detection function according to a detection trigger operation to create a detection instance, sending a detection request by the detection instance, and determining the status of the resource package download link according to a returned response status value further includes: According to the detection trigger operation, call the resource package download link detection function; Create a detection instance, and send a detection request of a preset type; the detection instance includes an XMLHttpRequest instance; the detection request of the preset type includes a detection request of the HEAD type; the parameters of the detection request include a resource package download link; Obtaining a response status value of the resource package download link, and determining whether the response status value is a preset status value; If not, it is determined that the resource package download link is in an unavailable state.

4. The method according to any one of claims 1 to 3, wherein: Determining the status of the resource package download link according to the returned response status value further includes: Monitoring the response status value of the resource package download link based on the monitoring function of the detection instance; After determining the state of the resource package download link, the state of the resource package download link is asynchronously transmitted back.

5. The method according to any one of claims 1 to 4, wherein: The switching of the backup resource package download link for downloading further comprises: Update the resource package download link to the backup resource package download link.

6. The method according to claim 5, wherein: There are multiple download links for the backup resource package; The updating of the resource package download link to the standby resource package download link further includes: The resource package download link is updated to any backup resource package download link for switching, and the switched download link is detected. If the switched download link is unavailable, the resource package download link is updated to another backup resource package download link for switching until the switched download link is available.

7. The method according to any one of claims 1 to 6, wherein: If the resource package download link is unavailable, the method further includes: The alarm information of the unavailable status of the resource package download link is asynchronously reported to the log platform for alarm processing.

8. A device for detecting a resource package download link based on a request, comprising: A detection module, adapted to call a resource package download link detection function according to a detection trigger operation to create a detection instance, wherein the detection instance sends a detection request and determines the status of the resource package download link according to a returned response status value; The switching module is adapted to switch to a backup resource package download link for downloading if the resource package download link is unavailable.

9. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method for detecting a resource package download link based on a request according to any one of claims 1 to 7.

10. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the method for detecting a resource package download link based on a request as described in any one of claims 1 to 7.

11. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the method for detecting a resource package download link based on a request as claimed in any one of claims 1 to 7.