Resource updating method, device, electronic device and readable storage medium

By using configuration information on the terminal to determine the resource download address, download resource version information from the content distribution network and update local resources, the problem of terminal resource update dependence on the server is solved, and faster resource update speed and better server processing capabilities are achieved.

CN115941472BActive Publication Date: 2025-03-25BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211510162.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2025-03-25
Estimated Expiration
2042-11-29

AI Technical Summary

Technical Problem

In the prior art, the terminal relies on the server when updating resources, resulting in slower resource update speed and increased processing pressure on the server.

Method used

By implementing a resource update method on the terminal, the resource download address is determined using the terminal's configuration information, the resource version information is downloaded from the content distribution network, and the local resources are updated based on the information.

Benefits of technology

It realizes that terminal resource updates no longer rely on the server, improve resource update speed, slow down the processing pressure on the server, and improve the processing speed of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115941472B_ABST
    Figure CN115941472B_ABST
Patent Text Reader

Abstract

The present disclosure is about a resource update method, device, electronic device and readable storage medium, the method comprising: in response to a resource update instruction, determining a resource download address based on the configuration information of the terminal; downloading resource version information from a content distribution network based on the resource download address; the resource version information is the latest version information related to the resource in the content distribution network; based on the resource version information, updating the local resources of the terminal. The technical solution provided by the present disclosure is that the terminal resource update is no longer dependent on the server, the resource update speed is no longer affected by the processing speed of the server, the resource update speed is faster, the stability is better, and at the same time, the processing pressure of the server is reduced and the processing speed of the server is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to data processing technology, and in particular to a resource updating method, device, electronic device and readable storage medium. Background Art

[0002] With the rapid development of Internet technology, the update speed of various resources provided by the server is getting faster and faster, which requires the terminal to constantly update resources. In related technologies, when updating resources, the terminal sends a data request to the server, and the server returns the latest version information to the terminal based on the data request. The resource update of the terminal depends on the server, which increases the processing pressure of the server, reduces the data processing speed of the server, and slows down the resource update speed. Summary of the invention

[0003] The present disclosure provides a resource update method, device, electronic device and readable storage medium to at least solve the problem in the related art that resource update depends on the server and the resource update speed is slow. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, a resource updating method is provided, which is applied to a terminal and includes:

[0005] In response to the resource update instruction, determining a resource download address based on the configuration information of the terminal;

[0006] Based on the resource download address, download resource version information from the content distribution network; the resource version information is the latest version information related to the resource in the content distribution network;

[0007] Based on the resource version information, the local resources of the terminal are updated.

[0008] Optionally, the configuration information includes domain name information and path information, and the path information is used to indicate a storage location of the resource version information in the content distribution network; and determining a resource download address based on the configuration information of the terminal includes:

[0009] The domain name information and the path information are concatenated to determine the resource download address.

[0010] Optionally, the domain name information includes first domain name information and second domain name information, and the domain name information and the path information are concatenated to determine a resource download address; and based on the resource download address, resource version information is downloaded from a content distribution network, including:

[0011] Concatenate the first domain name information and the path information to determine a first resource download address;

[0012] Based on the first resource download address, download the resource version information from the content distribution network; if the download is successful, obtain the resource version information; if the download fails, concatenate the second domain name information and the path information to determine the second resource download address;

[0013] Based on the second resource download address, the resource version information is downloaded from the content distribution network; if the download is successful, the resource version information is obtained; if the download fails, the resource update is terminated and the resource update instruction is generated periodically.

[0014] Optionally, after the step of periodically generating the resource update instruction, the method further includes:

[0015] Recording the information of ending the local resource update;

[0016] When the recorded information of ending the resource update indicates that the number of times the resource update is ended reaches a preset threshold, sending a version information acquisition request to the server;

[0017] Receive the resource version information returned by the server based on the version information acquisition request.

[0018] Optionally, updating the local resources of the terminal based on the resource version information includes:

[0019] In the case where the first version number in the resource version information does not match the second version number corresponding to the local resource, determining a data packet download address in the resource version information;

[0020] Downloading a target data packet from the content distribution network based on the data packet download address;

[0021] Based on the target data packet, local resources of the terminal are updated.

[0022] Optionally, when the first version number in the resource version information does not match the second version number corresponding to the local resource, determining the data packet download address in the resource version information includes:

[0023] In a case where the first version number in the resource version information is greater than the second version number corresponding to the local resource, determining the data packet download address in the resource version information;

[0024] When the first version number is smaller than the second version number, determine the rollback flag corresponding to the second version number, wherein the rollback flag is used to indicate whether to perform a rollback process; when the rollback flag indicates that a rollback process is to be performed, determine the data packet download address in the resource version information.

[0025] Optionally, downloading the target data packet from the content distribution network based on the data packet download address includes:

[0026] Displaying the data packet download address on the interface of the terminal;

[0027] In response to a download instruction input by an account, the target data package is downloaded from the content distribution network.

[0028] According to a second aspect of an embodiment of the present disclosure, there is provided a resource updating device, which is arranged in a terminal and includes:

[0029] an address determination module, configured to determine a resource download address based on the configuration information of the terminal in response to the resource update instruction;

[0030] A resource acquisition module, configured to download resource version information from a content distribution network based on the resource download address; the resource version information is the latest version information related to the resource in the content distribution network;

[0031] The resource updating module is configured to update the local resources of the terminal based on the resource version information.

[0032] Optionally, the configuration information includes domain name information and path information, and the path information is used to indicate the storage location of the resource version information in the content distribution network; the address determination module is further configured to respond to a resource update instruction, splice the domain name information and the path information, and determine the resource download address.

[0033] Optionally, the domain name information includes first domain name information and second domain name information, and the address determination module is further configured to, in response to a resource update instruction, concatenate the first domain name information and the path information to determine a first resource download address;

[0034] The resource acquisition module is further configured to download the resource version information from the content distribution network based on the first resource download address; if the download is successful, the resource version information is obtained; if the download fails, the address determination module is triggered;

[0035] The address determination module is further configured to concatenate the second domain name information and the path information to determine a second resource download address;

[0036] The resource acquisition module is further configured to download the resource version information from the content distribution network based on the second resource download address; if the download is successful, obtain the resource version information; if the download fails, end the resource update and periodically generate the resource update instruction.

[0037] Optionally, the resource acquisition module is also configured to record the information of ending the resource update; when the recorded information of ending the resource update indicates that the number of times the resource update is ended reaches a preset threshold, send a version information acquisition request to the server; and receive the resource version information returned by the server based on the version information acquisition request.

[0038] Optionally, the resource updating module includes:

[0039] a matching processing unit, configured to determine a data packet download address in the resource version information if the first version number in the resource version information does not match the second version number corresponding to the local resource;

[0040] a data packet acquisition unit, configured to download a target data packet from the content distribution network based on the data packet download address;

[0041] The resource updating unit is configured to update the local resources of the terminal based on the target data packet.

[0042] Optionally, the matching processing unit includes:

[0043] A first determining subunit is configured to determine the data packet download address in the resource version information when the first version number in the resource version information is greater than the second version number corresponding to the local resource;

[0044] The second determination sub-unit is configured to determine a rollback flag corresponding to the second version number when the first version number is smaller than the second version number, the rollback flag being used to indicate whether to perform a rollback process; and to determine the data packet download address in the resource version information when the rollback flag indicates that a rollback process is to be performed.

[0045] Optionally, the resource update module includes: a display processing unit configured to display update prompt information on the interface of the terminal, wherein the update prompt information is used to prompt the account to update the local resource.

[0046] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0047] processor;

[0048] a memory for storing instructions executable by the processor;

[0049] The processor is configured to execute the instructions to implement the resource updating method as described in the first aspect.

[0050] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, which, when an instruction processor in the storage medium executes, enables a server to execute the resource update method as described in the first aspect.

[0051] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program or a computer instruction, wherein the computer program or the computer instruction implements the resource update method described in the first aspect when executed by a processor.

[0052] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0053] In the present disclosure, after receiving the resource update instruction, the terminal determines the resource download address according to the configuration information of the terminal, and downloads the resource version information from the content distribution network according to the resource download address. The resource version information is the latest version information related to the resource in the content distribution network. After obtaining the resource version information, the terminal further updates the local resources of the terminal according to the resource version information. In the technical solution provided in the present disclosure, when the resource is updated, the latest version information is uploaded to the content distribution network, so that when the terminal updates the resource, it does not need to interact with the server, but obtains the resource version information through the content distribution network, so that the terminal resource update is no longer dependent on the server, and the resource update speed is no longer affected by the processing speed of the server. The resource update speed is faster and the stability is better. At the same time, the processing pressure of the server is reduced and the processing speed of the server is improved.

[0054] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0056] Figure 1 is a schematic diagram of an application environment of a resource updating method according to an exemplary embodiment;

[0057] Figure 2 A process of a resource updating method according to an exemplary embodiment is shown Figure 1 ;

[0058] Figure 3 is a flow chart showing a method for updating resources according to an exemplary embodiment and uploading data to a content distribution network;

[0059] Figure 4 A process of a resource updating method according to an exemplary embodiment is shown Figure 2 ;

[0060] Figure 5 A process of a resource updating method according to an exemplary embodiment is shown Figure 3 ;

[0061] Figure 6 is a block diagram of a resource updating device according to an exemplary embodiment;

[0062] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0063] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0064] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0065] See also Figure 1 , which is a schematic diagram of an application environment of a resource update method according to an exemplary embodiment, the application environment may include a terminal 11, a service server 12 on the service side, and a content distribution network 13, and the terminal 11, the service server 12 and the content distribution network 13 are connected via a wireless network.

[0066] The terminal 11 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. Client software such as an application (Application, referred to as App) providing a human-computer interaction function is installed on the terminal 11. For example, the application may be a short video application or an instant messaging application. Various applications installed on the terminal may be regarded as resources provided by the server.

[0067] The business server 12 may be a server that provides background services for the application in the terminal 11. The business server 12 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. In the related art, the business server 12 often processes the resource update of the terminal, and the business server 12 processes a large number of operations, resulting in a high probability of network timeout. At the same time, the number of user groups is large, which increases the processing pressure of the business server 12, causing the processing speed of the business server 12 to decrease, seriously affecting the speed and stability of the terminal resource update.

[0068] Content Delivery Network 13 (CDN) can be a self-built content delivery network or a third-party content delivery network. The content delivery network is an intelligent virtual network built on the existing network. It relies on multiple edge servers deployed in various places, and through the load balancing, content distribution, scheduling and other functional modules of the central platform, it enables users to obtain the required content nearby, reduce network congestion, and improve user access response speed and hit rate.

[0069] Those skilled in the art will appreciate that the number of the above terminals may be only one, dozens, hundreds, or more. The embodiments of the present disclosure do not limit the number and device types of the terminals.

[0070] Figure 2 is a flow chart of a resource updating method according to an exemplary embodiment. The resource updating method can be used as follows: Figure 1 In the terminal shown, the following steps are included.

[0071] In step S21, in response to the resource update instruction, a resource download address is determined based on the configuration information of the terminal.

[0072] In this step, the resource update instruction is used to instruct to update the resource. Specifically, the resource update instruction can be generated when the update check is started, or the resource update instruction can be generated periodically by periodically checking the update. Information is configured in advance inside the terminal to obtain configuration information, which is information related to the storage location of the download object on the content distribution network, so that after receiving the resource update instruction, in response to the resource update instruction, the resource download address is determined according to the configuration information, and the resource download address is used to download the latest version information corresponding to the resource.

[0073] In one embodiment, the configuration information includes domain name information and path information, and the path information is used to indicate the storage location of the resource version information in the content distribution network; the step S21 determines the resource download address based on the configuration information of the terminal, including:

[0074] In step S211, the domain name information and the path information are concatenated to determine a resource download address.

[0075] In this step, the relevant domain name information and path information are configured inside the terminal according to the storage location of the latest version of the resource on the content distribution network, and the domain name information and the content distribution network are fixed values. Therefore, after receiving the resource update instruction, the domain name information and the path information are spliced ​​to determine the resource download address. Specifically, the domain name information is first and the path information is later spliced ​​to obtain the resource download address. In this embodiment, by configuring the domain name information and the path information inside the terminal, it is possible to ensure that the resource download address is determined quickly and accurately.

[0076] It should be noted that if Figure 3 As shown, when there is a version update of the resource, the server packages the running files and dependencies into an installation package, uploads the installation package to the content distribution network, obtains the installation package path, and writes the latest version information file, uploads the latest version information file to the content distribution network, and the name of the latest version information file uploaded each time is the same or has a regular pattern, so that the terminal can determine the resource download address pointing to the latest version information file based on the pre-configured domain name information and path information. Of course, in a possible implementation method, the configuration information can be the resource download address pointing to the latest version information file, that is, the configuration information at this time is the spliced ​​domain name information and path information, which further ensures the accuracy and efficiency of the resource download address determination.

[0077] In step S22, based on the resource download address, resource version information is downloaded from the content distribution network; the resource version information is the latest version information related to the resource in the content distribution network.

[0078] In this step, when there is a version update of the resource, the latest version information related to the resource is uploaded to the content distribution network, specifically the latest version information file, which describes the latest version number, update method, update history file and other version related information. After the terminal obtains the resource download address, it downloads the resource version information from the content distribution network according to the resource download address.

[0079] In step S23, local resources of the terminal are updated based on the resource version information.

[0080] In this step, after obtaining the resource version information, the terminal compares the resource version information with the version information of the local resource, and controls the update of the local resource according to the comparison result.

[0081] In one embodiment, the step S23 updates the local resources of the terminal based on the resource version information, including:

[0082] In step S231, when the first version number in the resource version information does not match the second version number corresponding to the local resource, the data packet download address in the resource version information is determined.

[0083] The resource version information describes a first version number, which is the latest version number. The second version number is the version number corresponding to the local resource, which is used to indicate the resource version currently being used by the terminal. The first version number in the resource version information is compared with the second version number corresponding to the local resource. If the first version number does not match the second version number, the data packet download address in the resource version information is determined, and the data packet download address is specifically the installation package download address.

[0084] It should be noted that, when the first version number matches the second version number, the resource update is terminated. At this time, the local resource is already the latest version, and there is no need to update the local resource.

[0085] In one embodiment, when the first version number in the resource version information does not match the second version number corresponding to the local resource, step S231 determines the data packet download address in the resource version information, including:

[0086] Step S2311: when the first version number in the resource version information is greater than the second version number corresponding to the local resource, determine the data packet download address in the resource version information.

[0087] In this step, the situation where the first version number does not match the second version number includes the situation where the first version number is greater than the second version number. For example, the server updates application A from version 1.0 to version 2.0, that is, the first version number in the resource version information is 2.0 at this time. If the terminal still uses the old version, that is, version 1.0, then the first version number will be greater than the second version number. In order to update the local resource version, the data packet download address in the resource version information is determined. It should be noted that if Figure 3 As shown, the server will first obtain the installation package path, and then write the latest version information file. Therefore, the latest version information file will contain the installation package path information, that is, the data package download address.

[0088] Step S2312, when the first version number is smaller than the second version number, determine the rollback flag corresponding to the second version number, the rollback flag is used to indicate whether to perform a rollback process; when the rollback flag indicates that a rollback process is to be performed, determine the data packet download address in the resource version information.

[0089] In this embodiment, the situation where the first version number does not match the second version number also includes the situation where the first version number is smaller than the second version number. For example, the server updates application A from version 2.0 to version 3.0, but later finds that there is a problem with version 3.0, so it updates the version to version 2.0 again, that is, the first version number in the resource version information is 2.0 at this time, and some terminals will use version 3.0, then the first version number will be smaller than the second version number. At this time, it may be necessary to roll back the local resources. In order to accurately determine whether the local resources need to be rolled back, determine the rollback identifier corresponding to the second version number. The rollback identifier is used to indicate whether to roll back. When the rollback identifier indicates that a rollback is to be performed, determine the data packet download address in the resource version information.

[0090] It should be noted that, when the rollback flag corresponding to the second version number indicates that no rollback processing is to be performed, the resource update is terminated and no further processing is performed on the local resources.

[0091] For example, the application B provided by the server includes version 1.0, the latest version is version 2.0, and test versions 3.0 and 4.0 are provided. The test version 3.0 has been tested, but the test version cannot be used officially yet. Therefore, the rollback flag of the test version 3.0 is marked as "true", that is, the rollback process is performed. In order to ensure the normal test of the test version 4.0, the rollback flag of the test version 4.0 is marked as "not true", that is, the rollback process is not performed. There are terminals A, B, C and D. The second version number corresponding to the local resources of terminal A is version 1.0, the second version number corresponding to the local resources of terminal B is version 2.0, the second version number corresponding to the local resources of terminal C is version 3.0, and the second version number corresponding to the local resources of terminal D is version 4.0. When terminals A, B, C and D update resources, the first version number in the resource version information obtained is 2.0. For terminal A, the first version number is greater than the second version number, and terminal A needs to download the data packet according to the data packet download address in the resource version information to update the resources. For terminal B, the first version number is equal to the second version number, and terminal B does not need to update the local resources. For terminal C, the first version number is less than the second version number, and the rollback flag corresponding to the second version number is further determined. The rollback flag corresponding to version 3.0 is "true", and terminal C needs to download the data packet according to the data packet download address in the resource version information to roll back the resources. For terminal D, the first version number is less than the second version number, and the rollback flag corresponding to the second version number is further determined. The rollback flag corresponding to version 4.0 is "not true", and terminal D does not need to roll back the local resources.

[0092] In this embodiment, the version numbers are compared to quickly determine the comparison result, and different processing is performed for the first version number being greater than the second version number and the first version number being less than the second version number, so that resource updates can meet the needs of various possible situations. At the same time, a rollback flag is set to accurately identify situations where rollback processing is required and situations where rollback processing is not required, thereby ensuring the selectivity and accuracy of resource updates.

[0093] In step S232, the target data packet is downloaded from the content distribution network based on the data packet download address.

[0094] In this step, after the terminal obtains the data packet download address, it downloads the target data packet from the content distribution network, and the target data packet provides data support for resource update of local resources.

[0095] In one embodiment, before the step of downloading the target data packet from the content distribution network based on the data packet download address in step S232, the method further includes:

[0096] In step S234, update prompt information is displayed on the interface of the terminal, and the update prompt information is used to prompt the account to update the local resource.

[0097] In this embodiment, before downloading the target data packet, update prompt information is displayed on the terminal interface. Specifically, the update prompt information can be displayed in a pop-up window so that the user can know in time that the terminal will update the local resources.

[0098] Specifically, the update prompt information includes the data package download address and the historical version update information link. Click the historical version update information link to jump to the historical version update information display interface. On the historical version update information display interface, users can learn about historical update versions, historical update times and other information.

[0099] In one embodiment, update prompt information is displayed on the interface of the terminal, and in response to a download instruction input by the account, a target data package is downloaded from the content distribution network based on the data package download address.

[0100] In this embodiment, after the data packet download address is determined, it indicates that the terminal needs to update the local resources. Therefore, in order to prompt the user, the update prompt information is displayed on the terminal interface. And according to the download instruction input by the account, the target data packet is downloaded from the content distribution network. Of course, if the download instruction input by the account is not received, the resource update can be terminated. Therefore, when updating resources, the account is provided with a choice, and the target data packet is downloaded according to the user's choice, meeting the user's needs.

[0101] In step S233, local resources of the terminal are updated based on the target data packet.

[0102] In this step, after downloading the target data packet, the target data packet is installed, and the local resources of the terminal are updated to the version corresponding to the target data packet. In this embodiment, when the first version number in the resource version information and the second version number corresponding to the local resource do not match, the target data packet is downloaded according to the data packet download address in the resource version information, and the local resource update of the terminal is completed using the target data packet. In the process of resource update, the terminal and the server are decoupled, the server uploads the latest version information and data packet to the content distribution network, and the terminal obtains the resource version information and data packet from the content distribution network, which is conducive to improving resource utilization efficiency and alleviating pressure on the server.

[0103] In the above embodiment, after receiving the resource update instruction, the terminal determines the resource download address according to the configuration information of the terminal, and downloads the resource version information from the content distribution network according to the resource download address. The resource version information is the latest version information related to the resource in the content distribution network. After obtaining the resource version information, the terminal further updates the local resources of the terminal according to the resource version information. In the technical solution provided by the present disclosure, when the resource is updated, the latest version information is uploaded to the content distribution network, so that when the terminal updates the resource, it does not need to interact with the server, but obtains the resource version information through the content distribution network, so that the terminal resource update is no longer dependent on the server, and the resource update speed is no longer affected by the processing speed of the server. The resource update speed is faster and the stability is better. At the same time, the processing pressure of the server is reduced and the processing speed of the server is improved.

[0104] Figure 4 is a flow chart of a resource updating method according to an exemplary embodiment. The resource updating method can be used as follows: Figure 1 In the terminal shown, the following steps are included.

[0105] In step S41, in response to the resource update instruction, the first domain name information and the path information are concatenated to determine the first resource download address.

[0106] In this step, the first domain name information is the main domain name information, which is the configuration information pre-configured in the terminal. The first domain name information has priority use, that is, when determining the resource download address, the first domain name information and the path information are used for splicing to determine the first resource download address. The download object pointed to by the first resource download address is the latest version information in a content distribution network.

[0107] In step S42, based on the first resource download address, resource version information is downloaded from the content distribution network; the resource version information is the latest version information related to the resource in the content distribution network; if the download is successful, the resource version information is obtained; if the download fails, the second domain name information and the path information are spliced ​​to determine the second resource download address.

[0108] In this step, the second domain name information is the backup domain name information, which is the configuration information pre-configured in the terminal. When downloading the resource version information from the content distribution network according to the first resource download address, there are two situations: download success and download failure. If the download is successful, that is, the terminal obtains the resource version information, the subsequent step S44 can be executed; if the download fails, that is, the resource version information cannot be obtained according to the first resource download address, at this time, the second domain name information and the path information are spliced ​​to determine the second resource download address, and the second resource download address is the backup download address.

[0109] In step S43, based on the second resource download address, the resource version information is downloaded from the content distribution network; if the download is successful, the resource version information is obtained; if the download fails, the resource update is terminated and the resource update instruction is generated periodically.

[0110] In this step, when downloading resource version information from the content distribution network according to the second resource download address, there will also be two situations: download success and download failure. If the download is successful, that is, the terminal obtains the resource version information, the subsequent step S44 can be executed; if the download fails, that is, the resource version information cannot be obtained according to the second resource download address, then the resource update is terminated, and the scheduled check update is started, that is, the resource update instruction is periodically generated. After each cycle time, the resource update instruction will be generated, and step 41 will be re-executed. Therefore, in this embodiment, by configuring the first domain name information and the second domain name information, the probability of successful download of the resource version information is increased, and the prerequisite for realizing resource update is provided. And in the case of failure to download using the second resource download address, the resource update is terminated and the periodic resource update is entered to avoid the case of continuous processing of resource update failures. The terminal is regularly updated through periodic resource updates, which is conducive to timely resource updates when the resource version information is successfully obtained.

[0111] In a possible implementation, the number of second domain name information is at least two, and based on the first resource download address, the resource version information is downloaded from the content distribution network; in the event of a download failure, a target second domain name information is selected from at least two second domain name information, and the second target domain name information and the path information are spliced ​​to determine the second resource download address; based on the second resource download address, the resource version information is downloaded from the content distribution network; in the event of a download failure, the next target second domain name information is selected from at least two second domain name information until there is no second domain name information that has not been selected, and the resource update is terminated, and the resource update instruction is periodically generated.

[0112] In one embodiment, after the step of periodically generating the resource update instruction, the method further includes:

[0113] In step 45, the information of ending the resource update is recorded.

[0114] In step 46, when the recorded information of ending the resource update indicates that the number of times the resource update is ended reaches a preset threshold, a version information acquisition request is sent to the server.

[0115] In step 47, the resource version information returned by the server based on the version information acquisition request is received.

[0116] In this embodiment, after the resource update instruction is periodically generated, that is, after the scheduled check and update is started, if there is still a situation of ending the resource update, it means that the resource update has failed. When the resource update is ended, the information of ending the resource update is recorded. When the recorded information of ending the resource indicates that the number of times the resource update is ended reaches a preset threshold, it indicates that multiple resource updates have failed and it is difficult to obtain the resource version information through the resource download address. At this time, a version information acquisition request is sent to the server. The version information acquisition request can be an http (Hypertext Transfer Protocol) request. The server receives the version information acquisition request and returns the resource version information to the terminal. Specifically, when the recorded information of ending the resource update indicates that the number of times the resource update is continuously ended reaches a preset threshold, a version information acquisition request is sent to the server.

[0117] For example, if the preset threshold is 3, after the resource update instruction is periodically generated, the Nth resource update process is entered, that is, step S41 is executed again. If in the Nth resource update process, the resource version information fails to be downloaded based on the second resource download address, the resource update is terminated, that is, the Nth resource update process is terminated. At this time, the information of the end of the resource update is recorded, such as recording the number of consecutive terminations of the resource update for 1 time, and entering the N+1th resource update process; if in the N+1th resource update process, it is still necessary to terminate the resource update, that is, to terminate the N+1th resource update process, then the information of the end of the resource update is recorded again, such as changing the number of consecutive terminations of the resource update to 2 times, and entering the N+2th resource update process; if in the N+2th resource update process, it is still necessary to terminate the resource update, that is, to terminate the N+2th resource update process, then the information of the end of the resource update is recorded for the third time, such as changing the number of consecutive terminations of the resource update to 3 times. At this time, the recorded information of the end of the resource update indicates that the number of consecutive terminations of the resource update reaches the preset threshold of 3 times, and a version information acquisition request is sent to the server. In this embodiment, in the case of multiple resource update failures, resource version information is obtained through the server to avoid continuous resource update failures and improve resource update efficiency.

[0118] In step 44, local resources of the terminal are updated based on the resource version information.

[0119] In this step, after obtaining the resource version information, the terminal compares the resource version information with the version information of the local resource, and controls the update of the local resource according to the comparison result. It should be noted that the explanation of step 44 is similar to that of step 23, so it will not be repeated here. In this embodiment, the terminal resource update is no longer dependent on the server, and the resource update speed is no longer affected by the processing speed of the server. The resource update speed is fast and the stability is good. At the same time, the processing pressure of the server is reduced and the processing speed of the server is improved.

[0120] For example, if Figure 5 As shown, the terminal starts checking for updates, generates a resource update instruction, and in response to the resource update instruction, uses the first domain name information to download resource version information from the content distribution network. If the first domain name information is used to download successfully, the resource version information is obtained; if the first domain name information is used to download unsuccessfully, the second domain name information is used to download the resource version information from the content distribution network; if the second domain name information is used to download successfully, the resource version information is obtained; if the second domain name information is used to download unsuccessfully, the start of the check for updates is abandoned, that is, the resource update is terminated, and the scheduled check for updates task is started, that is, the resource update instruction is generated periodically, such as once every 10 hours; if the resource version information is successfully downloaded using the first domain name information and the second domain name information during the scheduled check for updates task, the resource version information is obtained; if after multiple scheduled checks for updates, the check for updates still fails, and when the scheduled check for updates failure threshold is reached (that is, the recorded information on the end of this resource update indicates that the number of consecutive end of this resource update has reached a preset threshold), the http request service is started to obtain the resource version information (that is, a request for obtaining version information is sent to the server). After the terminal obtains the resource version information, check the first version number in the resource version information and the second version number corresponding to the local resource, compare the first version number and the second version number, and determine the relationship between the first version number and the second version number. If the first version number is the same as the second version number, there is no need to update the local resource, and the resource update ends; if the first version number is greater than the second version number, determine the installation package download address in the resource version information, download the installation package to update the local resource; if the first version number is less than the second version number, further determine the rollback flag corresponding to the second version number; if the rollback flag is true, rollback processing is performed, determine the installation package download address in the resource version information, download the installation package to update the local resource; if the rollback flag is not true, no rollback processing is performed, and the resource update ends.

[0121] In the above example, after the terminal is started, it will download the latest version information previously uploaded by the server on the content distribution network, compare the version numbers inside the terminal, quickly determine whether to update or roll back, and download the corresponding installation package through the content distribution network. In this process, there are 2 interactions between the terminal and the content distribution network, and 0 interactions between the terminal and the server. Because when the terminal interacts with the server, it is greatly affected by the network. At the same time, when the number of terminals is large, the server is required to be high and the server processing pressure is large. In this embodiment, the terminal and the server are decoupled through the content distribution network, the efficiency of updating or rolling back is improved, and the speed and stability of resource updates are guaranteed. Furthermore, in this embodiment, the installation package includes all update files, so when updating local resources, there is no need to compare the differences between the internal update files of different versions, and the installation package is used to accurately update local resources.

[0122] Figure 6 1 is a block diagram of a resource updating device according to an exemplary embodiment, wherein the device is arranged in a terminal and comprises an address determining module 61 , a resource acquiring module 62 , and a resource updating module 63 .

[0123] The address determination module 61 is configured to determine a resource download address based on the configuration information of the terminal in response to the resource update instruction;

[0124] The resource acquisition module 62 is configured to download resource version information from the content distribution network based on the resource download address; the resource version information is the latest version information related to the resource in the content distribution network;

[0125] The resource updating module 63 is configured to update the local resources of the terminal based on the resource version information.

[0126] In an exemplary embodiment of the present disclosure, the configuration information includes domain name information and path information, and the path information is used to indicate the storage location of the resource version information in the content distribution network; the address determination module is further configured to respond to a resource update instruction, splice the domain name information and the path information, and determine the resource download address.

[0127] In an exemplary embodiment of the present disclosure, the domain name information includes first domain name information and second domain name information, and the address determination module is further configured to, in response to a resource update instruction, concatenate the first domain name information and the path information to determine a first resource download address;

[0128] The resource acquisition module is further configured to download the resource version information from the content distribution network based on the first resource download address; if the download is successful, the resource version information is obtained; if the download fails, the address determination module is triggered;

[0129] The address determination module is further configured to concatenate the second domain name information and the path information to determine a second resource download address;

[0130] The resource acquisition module is further configured to download the resource version information from the content distribution network based on the second resource download address; if the download is successful, obtain the resource version information; if the download fails, end the resource update and periodically generate the resource update instruction.

[0131] In an exemplary embodiment of the present disclosure, the resource acquisition module is further configured to record the information of ending the resource update; when the recorded information of ending the resource update indicates that the number of consecutive endings of the resource update reaches a preset threshold, send a version information acquisition request to the server; and receive the resource version information returned by the server based on the version information acquisition request.

[0132] In an exemplary embodiment of the present disclosure, the resource update module includes:

[0133] a matching processing unit, configured to determine a data packet download address in the resource version information if the first version number in the resource version information does not match the second version number corresponding to the local resource;

[0134] a data packet acquisition unit, configured to download a target data packet from the content distribution network based on the data packet download address;

[0135] The resource updating unit is configured to update the local resources of the terminal based on the target data packet.

[0136] In an exemplary embodiment of the present disclosure, the matching processing unit includes:

[0137] A first determining subunit is configured to determine the data packet download address in the resource version information when the first version number in the resource version information is greater than the second version number corresponding to the local resource;

[0138] The second determination sub-unit is configured to determine a rollback flag corresponding to the second version number when the first version number is smaller than the second version number, the rollback flag being used to indicate whether to perform a rollback process; and to determine the data packet download address in the resource version information when the rollback flag indicates that a rollback process is to be performed.

[0139] In an exemplary embodiment of the present disclosure, the resource update module includes:

[0140] The display processing unit is configured to display update prompt information on the interface of the terminal, wherein the update prompt information is used to prompt the account to update the local resource.

[0141] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0142] Figure 7 1 is a block diagram of an electronic device terminal according to an exemplary embodiment. The terminal 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0143] Reference Figure 7 The terminal 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0144] The processing component 702 generally controls the overall operation of the terminal 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0145] The memory 704 is configured to store various types of data to support operations at the terminal 700. Examples of such data include instructions for any application or method operating on the terminal 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.

[0146] Power component 706 provides power to various components of terminal 700. Power component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 700.

[0147] The multimedia component 708 includes a screen that provides an output interface between the terminal 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the terminal 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0148] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the terminal 700 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0149] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0150] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the terminal 700. For example, the sensor assembly 714 can detect the open / closed state of the terminal 700, the relative positioning of the components, such as the display and keypad of the terminal 700, and the sensor assembly 714 can also detect the position change of the terminal 700 or a component of the terminal 700, the presence or absence of contact between the user and the terminal 700, the orientation or acceleration / deceleration of the terminal 700, and the temperature change of the terminal 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0151] The communication component 716 is configured to facilitate wired or wireless communication between the terminal 700 and other devices. The terminal 700 can access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0152] In an exemplary embodiment, the terminal 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned resource update method.

[0153] In an exemplary embodiment, a storage medium including instructions is also provided, and when the instructions in the storage medium are executed by a processor of a server, the server is enabled to execute the resource update method as described in any of the above method embodiments. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0154] In an exemplary embodiment, a computer program product is also provided, which includes a readable program code, which can be executed by a processor of a terminal to complete the resource update method applied to the terminal. Optionally, the program code can be stored in a storage medium of a terminal or a server, and the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc. Those skilled in the art will easily think of other embodiments of the present disclosure after considering the disclosure disclosed herein and practicing the disclosure disclosed herein. This application is intended to cover any variation, use, or adaptive change of the present disclosure, which follows the general principles of the present disclosure and includes the common knowledge or customary technical means in the technical field not disclosed in the present disclosure. The description and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0155] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A resource updating method, characterized in that: Applied to terminals, including: In response to the resource update instruction, based on the configuration information of the terminal, the configuration information includes domain name information and path information, the domain name information includes first domain name information and second domain name information, and the path information is used to indicate the storage location of the resource version information in the content distribution network; Concatenate the first domain name information and the path information to determine a first resource download address; Based on the first resource download address, download the resource version information from the content distribution network; if the download is successful, obtain the resource version information; if the download fails, concatenate the second domain name information and the path information to determine the second resource download address; Based on the second resource download address, download the resource version information from the content distribution network; if the download is successful, obtain the resource version information; if the download fails, end the resource update and periodically generate the resource update instruction; the resource version information is the latest version information related to the resource in the content distribution network; Based on the resource version information, the local resources of the terminal are updated.

2. The method according to claim 1, characterized in that After the step of periodically generating the resource update instruction, the method further includes: Record the information of ending the resource update; When the recorded information of ending the resource update indicates that the number of times the resource update is ended reaches a preset threshold, sending a version information acquisition request to the server; Receive the resource version information returned by the server based on the version information acquisition request.

3. The method according to claim 1, characterized in that The updating of the local resources of the terminal based on the resource version information includes: In the case where the first version number in the resource version information does not match the second version number corresponding to the local resource, determining a data packet download address in the resource version information; Downloading a target data packet from the content distribution network based on the data packet download address; Based on the target data packet, local resources of the terminal are updated.

4. The method according to claim 3, characterized in that When the first version number in the resource version information does not match the second version number corresponding to the local resource, determining the data packet download address in the resource version information includes: In a case where the first version number in the resource version information is greater than the second version number corresponding to the local resource, determining the data packet download address in the resource version information; When the first version number is smaller than the second version number, determine the rollback flag corresponding to the second version number, wherein the rollback flag is used to indicate whether to perform a rollback process; when the rollback flag indicates that a rollback process is to be performed, determine the data packet download address in the resource version information.

5. The method according to claim 3, characterized in that: Before the step of downloading the target data packet from the content distribution network based on the data packet download address, the method further includes: Update prompt information is displayed on the interface of the terminal, and the update prompt information is used to prompt the account to update the local resource.

6. A resource updating device, characterized in that: Set in the terminal, including: The address determination module is configured to respond to the resource update instruction, based on the configuration information of the terminal, the configuration information includes domain name information and path information, the domain name information includes first domain name information and second domain name information, and the path information is used to indicate the storage location of the resource version information in the content distribution network; splice the first domain name information and the path information to determine the first resource download address; The resource acquisition module is configured to download the resource version information from the content distribution network based on the first resource download address; if the download is successful, the resource version information is obtained; if the download fails, the second domain name information and the path information are spliced ​​to determine the second resource download address; based on the second resource download address, the resource version information is downloaded from the content distribution network; if the download is successful, the resource version information is obtained; if the download fails, the resource update is terminated and the resource update instruction is periodically generated; the resource version information is the latest version information related to the resource in the content distribution network; The resource updating module is configured to update the local resources of the terminal based on the resource version information.

7. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the resource updating method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: When the instruction processor in the storage medium executes, the server is enabled to execute the resource updating method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Successful file downloading aided device and method

    CN105897844A

  • Resource updating method and device

    CN110809036A