CN112099954A - Method, device, equipment and storage medium for deploying and downloading resources - Google Patents

Method, device, equipment and storage medium for deploying and downloading resources Download PDF

Info

Publication number
CN112099954A
CN112099954A CN202010989427.4A CN202010989427A CN112099954A CN 112099954 A CN112099954 A CN 112099954A CN 202010989427 A CN202010989427 A CN 202010989427A CN 112099954 A CN112099954 A CN 112099954A
Authority
CN
China
Prior art keywords
resource
downloading
download
updated
response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010989427.4A
Other languages
Chinese (zh)
Inventor
汪朋
王文军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu com Times Technology Beijing Co Ltd
Original Assignee
Baidu com Times Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu com Times Technology Beijing Co Ltd filed Critical Baidu com Times Technology Beijing Co Ltd
Priority to CN202010989427.4A priority Critical patent/CN112099954A/en
Publication of CN112099954A publication Critical patent/CN112099954A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources

Abstract

The application discloses a method, a device, equipment and a storage medium for deploying and downloading resources, and relates to the technical field of internet technology, resource deployment, resource downloading and browsers. The specific implementation scheme is as follows: in response to receiving the resource updating request, determining an old resource and a storage path corresponding to the resource updating request; receiving the updated resource, and storing the updated resource to the storage path; determining whether the updated resource is available in response to the updated resource being stored; in response to determining that the updated resource is available, the old resource is deleted. The realization mode can ensure the success of the resource downloading as much as possible and improve the success rate of the resource downloading.

Description

Method, device, equipment and storage medium for deploying and downloading resources
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of internet technologies, resource deployment, resource downloading, and browser technologies, and in particular, to a method, an apparatus, a device, and a storage medium for deploying and downloading resources.
Background
CI (Continuous Integration) is a software development practice, i.e., team development members often integrate their work, usually at least once per member per day, meaning that multiple integrations may occur per day. Each integration is verified by automated build (including compile, release, automated testing) to discover integration errors as early as possible.
CI systems sometimes need to download script resources to perform tasks, and these download tasks need to be stably available to ensure stable operation of CI tasks. Since the script resources are continuously iterated, and the CI task belongs to the online service and cannot be interrupted. This requires that the download task of the CI system cannot be affected when new script resources are deployed, ensuring that the CI system can download a complete available resource package at any time.
Disclosure of Invention
A method, apparatus, device and storage medium for deploying and downloading resources are provided.
According to a first aspect, there is provided a method for deploying resources, comprising: in response to receiving a resource updating request, determining an available old resource and an updating resource storage path corresponding to the resource updating request; receiving an updated resource, and storing the updated resource to the storage path; determining whether the updated resource is available in response to the storage deployment of the updated resource being completed; in response to determining that the updated resource is available, deleting the available old resource.
According to a second aspect, there is provided a method for downloading a resource, comprising: sending a resource downloading request to a server, wherein the resource downloading request comprises a resource identifier; in response to the resource downloading failure and the frequency of the downloading failure being smaller than a preset threshold value, repeatedly sending a resource downloading request to the server; changing the resource identifier in response to determining that the number of times the resource download request is sent is equal to a preset threshold; generating a new resource downloading request according to the changed resource identifier; and sending a new resource downloading request to the server.
According to a third aspect, there is provided an apparatus for deploying a resource, comprising: an update request receiving unit configured to determine, in response to receiving a resource update request, an available old resource and an updated resource corresponding to the resource update request; an update resource deployment unit configured to deploy the update resource; an update resource test unit configured to determine whether the update resource is available in response to completion of deployment of the update resource; an old resource deleting unit configured to delete the available old resource in response to determining that the updated resource is available.
According to a fourth aspect, there is provided an apparatus for downloading a resource, comprising: a download request sending unit configured to send a resource download request to the server, the resource download request including a resource identifier; the repeated sending unit is configured to respond to the resource downloading failure and the frequency of the downloading failure is smaller than a preset threshold value, and repeatedly send a resource downloading request to the server; a resource identifier changing unit configured to change the resource identifier in response to determining that the number of times of transmission of the resource download request is equal to a preset threshold; a download request generation unit configured to generate a new resource download request according to the changed resource identifier; and the downloading request sending unit is configured to send a new resource downloading request to the server.
According to a fifth aspect, there is provided an electronic device for deploying a resource, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
According to a sixth aspect, there is provided an electronic device for downloading a resource, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in the second aspect
According to a seventh aspect, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method as described in the first aspect.
According to an eighth aspect, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method as described in the first aspect.
According to the technology of the application, the resource deployment and downloading method with high stability can be provided, the success of resource downloading is guaranteed as much as possible, and the success rate of resource downloading is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for deploying resources in accordance with the present application;
FIG. 3 is a schematic diagram of one application scenario of a method for deploying resources according to the present application;
FIG. 4 is a flow diagram of another embodiment of a method for deploying resources according to the present application;
FIG. 5 is a flow diagram of one embodiment of a method for downloading a resource according to the present application;
FIG. 6 is a schematic diagram of an application scenario of a method for downloading a resource according to the present application;
FIG. 7 is a flow diagram of another embodiment of a method for downloading a resource according to the present application;
FIG. 8 is a schematic diagram illustrating one embodiment of an apparatus for deploying resources in accordance with the present application;
FIG. 9 is a schematic diagram illustrating an embodiment of an apparatus for downloading resources according to the present application;
FIG. 10 is a block diagram of an electronic device for implementing a method for deploying resources, a method for downloading resources of an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the method for deploying a resource, the method for downloading a resource, the apparatus for outputting information or the apparatus for downloading a resource of the present application may be applied.
As shown in fig. 1, system architecture 100 may include terminal devices 101, 102, 103, network 104, server 105, and database 106. Network 104 is the medium used to provide communication links between terminal devices 101, 102, 103 and server 105, server 105 and database 106, and terminal devices 101, 102, 103 and database 106. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various communication client applications, such as a resource download application, a browser application, etc., may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smart phones, tablet computers, e-book readers, car computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a backend server that deploys resources. The background server may receive the resource downloading request sent by the terminal device 101, 102, 103, and feed back the downloading path or resource of the resource to the terminal device 101, 102, 103.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
The database 106 may be a database used to store resources deployed by the server 105, which may be various types of databases, such as relational data and the like.
It should be noted that the method for deploying resources provided in the embodiment of the present application is generally performed by the server 105, and the method for downloading resources is generally performed by the terminal devices 101, 102, and 103. Accordingly, the means for deploying resources are typically provided in the server 105, and the means for downloading resources are typically provided in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for deploying resources in accordance with the present application is shown. The method for deploying resources of the embodiment comprises the following steps:
step 201, in response to receiving a resource update request, determining an available old resource and an updated resource corresponding to the resource update request.
In this embodiment, an execution subject of the method for deploying resources (e.g., the server 105 shown in fig. 1) may receive a resource update request. The resource update request may be sent by a terminal used by a technician. After receiving the resource update request, the server may analyze the resource update request, and determine an available old resource and an updated resource corresponding to the resource update request. Here, the available old resource may refer to a resource to be updated, which may be a file such as an installation package. And the available old resources are currently available. The server can also determine the updated resource for updating the available old resource. Here, the updated resource is used for replacing the resource, and the name of the updated resource may be different from that of the old resource, but the updated resource and the old resource are named according to a certain rule. For example, the name of the old resource is package-0, the name of the updated resource may be package-1, that is, the name of the updated resource differs from the name of the old resource only in number, and the value of the name of the updated resource is greater than the value of the old resource.
Step 202, deploying the updated resource.
After determining the updated resource, the server may deploy the updated resource. Specifically, the server may determine a storage path corresponding to the resource update request, and then store the updated resource to the storage path.
Step 203, in response to the deployment of the updated resource being completed, determining whether the updated resource is available.
It will be appreciated that if the update resources are large, the deployment process may last for several seconds. After the updated resource is deployed, the server can judge whether the updated resource is available. Specifically, the server may download the deployed updated resource by receiving the test download request. If the download is successful, the updated resource is considered available.
In response to determining that the updated resource is available, the available old resource is deleted, step 204.
In this embodiment, if the server determines that the updated resource is available, the available old resource may be deleted. Therefore, only the updated resources are reserved at the storage path, on one hand, the client can be ensured to acquire the latest resources, and on the other hand, the storage space can be effectively saved.
With continued reference to FIG. 3, a schematic diagram of one application scenario of a method for deploying resources in accordance with the present application is shown. In the application scenario of fig. 3, a client 301 used by a technician sends a resource update request to a server 302, and the server 302 deploys an updated resource after determining an available old resource and the updated resource. After deployment is completed, testing whether the updated resource is available. In case of availability, the available old resources are deleted.
According to the method for deploying the resources, when the resources are updated, the available old resources are deleted only under the condition that the updated resources are available, so that the client can download the available resources at any time, and the success rate of resource downloading is improved.
With continued reference to FIG. 4, a flow 400 of another embodiment of a method for deploying resources in accordance with the present application is illustrated. As shown in fig. 4, the method for deploying resources of this embodiment may include the following steps:
step 401, in response to receiving a resource update request, determining an available old resource and an updated resource corresponding to the resource update request.
Step 402, deploying the updated resource.
Step 403, in response to receiving a download request for the updated resource sent by the download client in the deployment process of the updated resource, sending a download failure message to the download client.
In the deployment process of the updated resource, if the server receives a downloading request aiming at the updated resource sent by the downloading client, a downloading failure message is sent to the downloading client. The download request may include an identification of the updated resource. The download failure message is used for prompting the download failure of the download client for the updated resource.
In step 404, in response to that the number of times of sending the download failure message to the download client is equal to the preset number threshold, outputting a first prompt message.
In this embodiment, if the downloading is failed, the current deployment process of the updated resource is still in progress, that is, the updated resource is still unavailable. If the downloading client sends the downloading request for updating the resource again, the downloading failure message is sent to the downloading client again. The server side can count the sending times of the download failure message, and if the sending times of the download failure message to the download client side is equal to a preset time threshold value, the server side outputs first prompt information to the download client side. The first prompt message is used for prompting the downloading client to download the available old resource. In some specific implementations, the first prompt message may further include an "ok" button and a "cancel" button. If the user using the download client clicks the "ok" button, it indicates that he agrees to download the available old resource.
Step 405, in response to receiving the first confirmation information for the first prompt information sent by the downloading client, sending the old resource to the downloading client.
If the server receives the first confirmation information aiming at the first prompt information sent by the downloading client, which indicates that the server agrees to download the available old resource, the server can send the available old resource to the downloading client so that the downloading client can use the old resource temporarily.
Step 406, in response to the deployment of the updated resource being completed, determines whether the updated resource is available.
After the updated resource is stored, the server can determine whether the updated resource is available.
In some optional implementations of this embodiment, the server may determine whether the update resource is available through the following steps not shown in fig. 4: in response to receiving a test downloading request sent by a test client, sending the updated resource to the test client; and determining that the updated resource is available in response to receiving response information sent by the test client for the updated resource.
In this implementation, the updated resource may be tested by the test client. Specifically, the test client may send a test download request to the server, and after receiving the test download request, the server may parse the test download request to determine a download path. And if the download path is the same as the storage path of the updated resource, sending the updated resource to the test client. After the sending is completed, if response information sent by the test client for the updated resource is received, the updated resource is determined to be available.
Step 407, in response to determining that the updated resource is available, deletes the available old resource.
Step 408, generate a check value for the updated resource.
In this embodiment, the server may further generate a check value for updating the resource. The check value may be calculated by various algorithms, for example, a hash algorithm, or an MD5 algorithm.
And step 409, generating a check file according to the check value, and deploying the check file.
After the server side obtains the check value, a check file can be generated. Specifically, the server may store the check value in a TXT file, and use the TXT file as the check file. Then, the check file is deployed. Specifically, the server may store the updated resource to a storage path where the updated resource is located.
In some optional implementations of this embodiment, the server may further generate the check file by the following steps not shown in fig. 4: determining the file name of the check file according to the name of the updated resource; and generating a check file according to the check value and the file name.
In this implementation manner, the server may determine the file name of the check file according to the name of the updated resource. Specifically, the server may use the name of the updated resource as the file name of the check file. Or, the server may add a word "check file" after updating the name of the resource, and use the name as the file name of the check file. And then, checking the value and the file name to generate a check file.
In some optional implementations of this embodiment, the method may further include the following steps not shown in fig. 4: responding to a download request aiming at the available old resource sent by a download client after the updated resource storage is finished, and outputting second prompt information; and in response to receiving second confirmation information aiming at the second prompt information and sent by the downloading client, sending the updated resource to the downloading client.
In this implementation, if the update of the resource is completed, the server receives the download request for the available old resource sent by the download client, and the server may send the second prompt message to the download client. Here, the second prompt information is used to prompt the download client whether to download the updated resource. In a particular implementation, the second prompting message may also include an "ok" button and a "cancel" button. If the user using the download client clicks the "OK" button, it indicates that he agrees to download the updated resource. And if the server receives second confirmation information aiming at the second prompt information sent by the downloading client, the server sends the updated resource to the downloading client.
According to the method for deploying the resources, provided by the embodiment of the application, when the updated resources are unavailable, available old resources can be provided for the download client; when the update resources are available, the update resources can be actively provided to the download client; and the testing client is used for testing whether the updated resource is available, so that the success rate of downloading the updated resource is improved.
With continued reference to FIG. 5, a flow 500 of one embodiment of a method for downloading a resource in accordance with the present application is shown. In the embodiment shown in fig. 5, the method for downloading resources may comprise the steps of:
step 501, sending a resource downloading request to a server.
In this embodiment, the main execution body of the method for downloading the resource is a client (for example, terminal devices 101, 102, and 103 shown in fig. 1). The client may send a resource download request to the server. The resource downloading request includes a resource identifier, where the resource identifier may be a name of the resource, such as package-0.
Step 502, in response to the resource download failure and the number of times of the download failure being less than the preset threshold, repeatedly sending a resource download request to the server.
If the resource downloading fails, the client can count the number of times of the downloading failure, and if the number of times is smaller than a preset threshold, the client can repeatedly send a resource downloading request to the server.
Step 503, in response to determining that the number of times of sending the resource download request is equal to the preset threshold, changing the resource identifier.
If the client determines that the sending times of the resource downloading request are equal to the preset threshold value, which indicates that the resource corresponding to the resource downloading request is not downloadable, the client can change the resource identifier. Specifically, the client may modify the resource identifier according to a preset naming rule. For example, the resource identifier corresponding to the resource downloading request is package-0, and the client may modify the resource identifier to package-1.
Step 504, a new resource downloading request is generated according to the changed resource identifier.
The client can generate a new resource downloading request according to the changed resource identifier. In particular, the client may encapsulate the changed resource identifier in the new resource download request.
And 505, sending a new resource downloading request to the server.
The client may then send a new resource download request to the server to download the new resource.
With continued reference to fig. 6, a schematic diagram of one application scenario of a method for downloading a resource in accordance with the present application is shown. In the application scenario of fig. 6, the client 601 may send a resource download request to the server 602, and may repeatedly send the resource download request to the server 602 when the download fails. If the sending times is equal to 3, the client 601 may change the resource identifier in the resource downloading request and send a new resource downloading request to the server 602.
The method for downloading the resource provided by the embodiment of the application can repeatedly send the request for multiple times when the downloading fails, and can change the resource identifier under the condition that the repeated sending of the request for multiple times still fails, thereby improving the success rate of the resource downloading.
In some optional implementations of this embodiment, the client may change the resource identifier by: and changing the resource identifier according to a preset resource naming rule.
In this implementation, the client may change the resource identifier according to a preset resource naming rule. The resource naming convention can be to change the number in the name by the storage time of the resource. For example, the name of the available old resource is package-0, the name of the updated resource may be package-1, that is, the name of the updated resource and the name of the available old resource differ only in number, and the value of the name of the updated resource is greater than the value of the available old resource.
In some optional implementations of this embodiment, the client may change the resource identifier by: and responding to the received third prompt message sent by the server, and changing the resource identifier according to the third prompt message.
In this implementation manner, the client may further change the resource identifier according to the third prompt information sent by the server. The third prompt message is used for prompting to replace the downloaded resource. In some specific applications, the third prompt message may further include an "ok" button and a "cancel" button. If the user clicks the "ok" button, indicating that the user wants to replace the downloaded resource, the identity of the replaced resource may be used as the new resource identity.
With continued reference to FIG. 7, a flow 700 of another embodiment of a method for downloading resources in accordance with the present application is shown. As shown in fig. 7, the method for downloading resources of this embodiment may include the following steps:
step 701, sending a resource downloading request to a server.
Step 702, in response to the resource download failure and the number of times of the download failure being less than the preset threshold, repeatedly sending a resource download request to the server.
Step 703, in response to determining that the number of times of sending the resource download request is equal to the preset threshold, changing the resource identifier.
Step 704, generating a new resource downloading request according to the changed resource identifier.
Step 705, a new resource downloading request is sent to the server.
The principle of steps 701-705 is similar to that of steps 501-505, and is not described here again.
Step 706, in response to the completion of the resource downloading, determining a first check value corresponding to the resource.
In this embodiment, after downloading the resource, the client may calculate a first check value corresponding to the resource. Specifically, the client may calculate the first check value through various algorithms, for example, through a hash algorithm or an MD5 algorithm.
Step 707, a check file corresponding to the resource is obtained.
The client can also obtain a check file corresponding to the resource. Specifically, the execution subject may obtain the check file according to the file name of the check file. The check file includes a second check value.
Step 708, responsive to determining that the first check value and the second check value do not match, determining that the resource download failed.
After the client acquires the first check value and the second check value, whether the first check value and the second check value are matched can be judged. Specifically, the client may determine whether the first check value is the same as the second check value. If the two are the same, the two are considered to be matched, otherwise, the two are considered to be not matched. Or, the client may perform a specific calculation on the first check value, and if the obtained value is the same as the second check value, it indicates that the two are matched, otherwise, it determines that the two are not matched. And if not, confirming that the resource downloading fails.
The method for downloading the resource provided by the embodiment of the application can check the resource obtained by downloading, and if the check is passed, the resource is considered to be successfully downloaded, so that the success rate of resource downloading is improved.
With further reference to fig. 8, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for deploying resources, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 8, the apparatus 800 for deploying resources of the embodiment includes: an update request receiving unit 801, an update resource deployment unit 802, an update resource test unit 803, and an old resource deletion unit 804.
An update request receiving unit 801 configured to determine, in response to receiving a resource update request, an available old resource and an updated resource corresponding to the resource update request.
An update resource deployment unit 802 configured to deploy update resources.
An update resource test unit 803 configured to determine whether the update resource is available in response to the deployment of the update resource being completed.
An old resource deleting unit 804 configured to delete the available old resource in response to determining that the updated resource is available.
In some optional implementations of this embodiment, the apparatus 800 may further include a check file deploying unit, not shown in fig. 8, configured to: generating a check value of the updated resource; and generating a check file according to the check value, and deploying the check file.
In some optional implementations of this embodiment, the check file deploying unit is further configured to: determining the file name of the check file according to the name of the updated resource; and generating a check file according to the check value and the file name.
In some optional implementations of this embodiment, the update resource deployment unit is further configured to: in response to receiving a test downloading request sent by a test client, sending the updated resource to the test client; and determining that the updated resource is available in response to receiving response information sent by the test client for the updated resource.
In some optional implementations of this embodiment, the apparatus 800 may further include, not shown in fig. 8: the device comprises a failure message sending unit, a first prompt information output unit and an old resource sending unit.
And the failure message sending unit is configured to respond to receiving a downloading request aiming at the updated resource sent by the downloading client in the deployment process of the updated resource, and send a downloading failure message to the downloading client.
And the first prompt information output unit is configured to output first prompt information in response to the number of times of sending the download failure message to the download client being equal to a preset number threshold, wherein the first prompt information is used for prompting the download client to download the available old resource.
And the old resource sending unit is configured to send the available old resources to the downloading client in response to receiving first confirmation information which is sent by the downloading client and aims at the first prompt information.
In some optional implementations of this embodiment, the apparatus 800 may further include, not shown in fig. 8: a second prompt information output unit and an update resource sending unit.
And the second prompt information output unit is configured to output second prompt information in response to receiving a downloading request which is sent by the downloading client and aims at the available old resource after the updated resource deployment is completed, wherein the second prompt information is used for prompting the downloading client to download the updated resource.
And the updating resource sending unit is configured to respond to the second confirmation information sent by the downloading client and aiming at the second prompt information, and send the updating resource to the downloading client.
It should be understood that units 801 to 804 recited in the apparatus 800 for outputting information correspond to respective steps in the method described with reference to fig. 2. Thus, the operations and features described above for the method for outputting information are equally applicable to the apparatus 800 and the units included therein and will not be described in detail here.
With further reference to fig. 9, as an implementation of the method shown in the above figures, the present application provides an embodiment of an apparatus for downloading a resource, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 5, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 9, the apparatus 900 for downloading resource of the present embodiment includes: a download request transmitting unit 901, a repeat transmitting unit 902, a resource identifier changing unit 903, a download request generating unit 904, and a download request transmitting unit 905.
A download request sending unit 901 configured to send a resource download request to the server, where the resource download request includes a resource identifier.
The repeated sending unit 902 is configured to repeatedly send a resource downloading request to the server in response to the resource downloading failure and the number of times of the downloading failure being less than a preset threshold.
A resource identifier changing unit 903 configured to change the resource identifier in response to determining that the number of times of transmission of the resource download request is equal to a preset threshold.
A download request generating unit 904 configured to generate a new resource download request according to the changed resource identifier.
A download request sending unit 905 configured to send a new resource download request to the server.
In some optional implementations of this embodiment, the resource identifier changing unit 903 may be further configured to: and changing the resource identifier according to a preset resource naming rule.
In some optional implementations of this embodiment, the resource identifier changing unit 903 may be further configured to: and responding to the received third prompt message sent by the server, and changing the resource identifier according to the third prompt message, wherein the third prompt message is used for prompting to replace the downloaded resource.
In some optional implementations of this embodiment, the apparatus 900 may further include a verification unit, not shown in fig. 9, configured to: determining a first check value corresponding to the resource in response to the completion of the resource downloading; acquiring a check file corresponding to the resource, wherein the check file comprises a second check value; in response to determining that the first check value and the second check value do not match, determining that the resource download failed.
It should be understood that units 901 to 905 recited in the apparatus 900 for outputting information correspond to respective steps in the method described with reference to fig. 5, respectively. Thus, the operations and features described above for the method for outputting information are equally applicable to the apparatus 900 and the units included therein and will not be described again here.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 10, is a block diagram of an electronic device executing a method for deploying a resource or a method for downloading a resource according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 10, the electronic apparatus includes: one or more processors 1001, memory 1002, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 10 illustrates an example of one processor 1001.
The memory 1002 is a non-transitory computer readable storage medium provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the methods for deploying resources or for downloading resources provided herein. A non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the methods for deploying a resource or for downloading a resource provided by the present application.
The memory 1002, as a non-transitory computer-readable storage medium, may be used to store a non-transitory software program, a non-transitory computer-executable program, and a module, such as program instructions/modules corresponding to the method for deploying a resource or the method for downloading a resource in the embodiments of the present application (for example, the update request receiving unit 801, the update resource receiving unit 802, the update resource storage unit 803, and the old resource deleting unit 804 shown in fig. 8, or the download request transmitting unit 901, the repeat transmitting unit 902, the resource identification changing unit 903, the download request generating unit 904, and the download request transmitting unit 905 shown in fig. 9). The processor 1001 executes various functional applications of the server and data processing, i.e., implements the method for deploying resources or the method for downloading resources in the above-described method embodiments, by executing the non-transitory software programs, instructions, and modules stored in the memory 1002.
The memory 1002 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of an electronic device that executes a method for deploying a resource or a method for downloading a resource, and the like. Further, the memory 1002 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 1002 may optionally include memory located remotely from the processor 1001, which may be connected over a network to an electronic device that performs the method for deploying the resource or the method for downloading the resource. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device performing the method for deploying resources or the method for downloading resources may further include: an input device 1003 and an output device 1004. The processor 1001, the memory 1002, the input device 1003, and the output device 1004 may be connected by a bus or other means, and the bus connection is exemplified in fig. 10.
The input device 1003 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus performing the method for deploying a resource or the method for downloading a resource, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 1004 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the success of resource downloading is ensured as much as possible, and the success rate of resource downloading is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (24)

1. A method for deploying resources, comprising:
in response to receiving a resource updating request, determining available old resources and updated resources corresponding to the resource updating request;
deploying the update resource;
determining whether the updated resource is available in response to the deployment of the updated resource being completed;
in response to determining that the updated resource is available, deleting the available old resource.
2. The method of claim 1, wherein the method further comprises:
generating a check value of the updated resource;
and generating a check file according to the check value, and deploying the check file.
3. The method of claim 2, wherein said generating a verification file from said verification value comprises:
determining the file name of the check file according to the name of the updated resource;
and generating a check file according to the check value and the file name.
4. The method of claim 1, wherein the determining whether the updated resource is available comprises:
sending the updated resource to a test client in response to receiving a test downloading request sent by the test client;
determining that the updated resource is available in response to receiving response information sent by the test client for the updated resource.
5. The method of claim 1, wherein the method further comprises:
responding to a downloading request aiming at the updated resource sent by a downloading client side and received in the deployment process of the updated resource, and sending a downloading failure message to the downloading client side;
responding to the condition that the number of times of sending the download failure message to the download client side is equal to a preset number threshold, and outputting first prompt information, wherein the first prompt information is used for prompting the download client side whether to download the available old resource;
and in response to receiving first confirmation information aiming at the first prompt information and sent by the downloading client, sending the available old resource to the downloading client.
6. The method of claim 5, wherein the method further comprises:
responding to a download request aiming at the available old resource sent by the download client after the updated resource is deployed, and outputting second prompt information, wherein the second prompt information is used for prompting the download client whether to download the updated resource;
and in response to receiving second confirmation information aiming at the second prompt information and sent by the downloading client, sending the updated resource to the downloading client.
7. A method for downloading resources, comprising:
sending a resource downloading request to a server, wherein the resource downloading request comprises a resource identifier;
in response to the resource downloading failure and the frequency of the downloading failure being smaller than a preset threshold value, repeatedly sending a resource downloading request to the server;
changing the resource identifier in response to determining that the number of times the resource download request is sent is equal to the preset threshold;
generating a new resource downloading request according to the changed resource identifier;
and sending a new resource downloading request to the server.
8. The method of claim 7, wherein said altering said resource identification comprises:
and changing the resource identifier according to a preset resource naming rule.
9. The method of claim 7, wherein said altering said resource identification comprises:
and responding to the received third prompt message sent by the server, and changing the resource identifier according to the third prompt message, wherein the third prompt message is used for prompting to replace the downloaded resource.
10. The method of claim 7, wherein the method further comprises:
responding to the completion of resource downloading, and determining a first check value corresponding to the resource;
acquiring a check file corresponding to the resource, wherein the check file comprises a second check value;
in response to determining that the first check value and the second check value do not match, determining that the resource download failed.
11. An apparatus for deploying a resource, comprising:
an update request receiving unit configured to determine, in response to receiving a resource update request, an available old resource and an updated resource corresponding to the resource update request;
an update resource deployment unit configured to deploy the update resource;
an update resource test unit configured to determine whether the update resource is available in response to completion of deployment of the update resource;
an old resource deleting unit configured to delete the available old resource in response to determining that the updated resource is available.
12. The apparatus of claim 11, wherein the apparatus further comprises a check file deployment unit configured to:
generating a check value of the updated resource;
and generating a check file according to the check value, and deploying the check file.
13. The apparatus of claim 12, wherein the verification file deployment unit is further configured to:
determining the file name of the check file according to the name of the updated resource;
and generating a check file according to the check value and the file name.
14. The apparatus of claim 11, wherein the update resource deployment unit is further configured to:
sending the updated resource to a test client in response to receiving a test downloading request sent by the test client;
determining that the updated resource is available in response to receiving response information sent by the test client for the updated resource.
15. The apparatus of claim 11, wherein the apparatus further comprises:
a failure message sending unit configured to send a download failure message to a download client in response to receiving a download request for the updated resource sent by the download client in the deployment process of the updated resource;
a first prompt information output unit configured to output first prompt information in response to a number of times of sending the download failure message to the download client being equal to a preset number threshold, the first prompt information being used to prompt the download client whether to download the available old resource;
an old resource sending unit configured to send the available old resource to the download client in response to receiving first confirmation information for the first prompt information sent by the download client.
16. The apparatus of claim 15, wherein the apparatus further comprises:
a second prompt information output unit configured to output second prompt information in response to receiving a download request for the available old resource sent by the download client after the updated resource deployment is completed, wherein the second prompt information is used for prompting the download client whether to download the updated resource;
an update resource sending unit configured to send the update resource to the download client in response to receiving second confirmation information for the second prompt information sent by the download client.
17. An apparatus for downloading resources, comprising:
a download request sending unit configured to send a resource download request to a server, the resource download request including a resource identifier;
the repeated sending unit is configured to respond to the resource downloading failure and the frequency of the downloading failure is smaller than a preset threshold value, and repeatedly send a resource downloading request to the server;
a resource identifier changing unit configured to change the resource identifier in response to determining that the number of times of transmission of the resource download request is equal to the preset threshold;
a download request generation unit configured to generate a new resource download request according to the changed resource identifier;
and the downloading request sending unit is configured to send a new resource downloading request to the server.
18. The apparatus of claim 17, wherein the resource identification alteration unit is further configured to:
and changing the resource identifier according to a preset resource naming rule.
19. The apparatus of claim 17, wherein the resource identification alteration unit is further configured to:
and responding to the received third prompt message sent by the server, and changing the resource identifier according to the third prompt message, wherein the third prompt message is used for prompting to replace the downloaded resource.
20. The apparatus of claim 17, wherein the apparatus further comprises a verification unit configured to:
responding to the completion of resource downloading, and determining a first check value corresponding to the resource;
acquiring a check file corresponding to the resource, wherein the check file comprises a second check value;
in response to determining that the first check value and the second check value do not match, determining that the resource download failed.
21. An electronic device for deploying a resource, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
22. An electronic device for downloading a resource, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 7-10.
23. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
24. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 7-10.
CN202010989427.4A 2020-09-18 2020-09-18 Method, device, equipment and storage medium for deploying and downloading resources Pending CN112099954A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010989427.4A CN112099954A (en) 2020-09-18 2020-09-18 Method, device, equipment and storage medium for deploying and downloading resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010989427.4A CN112099954A (en) 2020-09-18 2020-09-18 Method, device, equipment and storage medium for deploying and downloading resources

Publications (1)

Publication Number Publication Date
CN112099954A true CN112099954A (en) 2020-12-18

Family

ID=73759494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010989427.4A Pending CN112099954A (en) 2020-09-18 2020-09-18 Method, device, equipment and storage medium for deploying and downloading resources

Country Status (1)

Country Link
CN (1) CN112099954A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467941A (en) * 2021-06-25 2021-10-01 北京汇钧科技有限公司 Method and device for sharing information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662789A (en) * 2012-03-27 2012-09-12 株洲南车时代电气股份有限公司 Method for adding CRC (cyclic redundancy check) to ELF (executable linkable format) file
US20120233134A1 (en) * 2011-03-08 2012-09-13 Rackspace Us, Inc. Openstack file deletion
US20170237825A1 (en) * 2014-08-27 2017-08-17 Huawei Technologies Co., Ltd. Resource Download Method, Electronic Device, and Apparatus
CN109218345A (en) * 2017-06-29 2019-01-15 武汉斗鱼网络科技有限公司 Obtain method, storage medium, electronic equipment and the system of target resource
CN111506837A (en) * 2020-03-09 2020-08-07 百度在线网络技术(北京)有限公司 Searching method and device, electronic equipment and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120233134A1 (en) * 2011-03-08 2012-09-13 Rackspace Us, Inc. Openstack file deletion
CN102662789A (en) * 2012-03-27 2012-09-12 株洲南车时代电气股份有限公司 Method for adding CRC (cyclic redundancy check) to ELF (executable linkable format) file
US20170237825A1 (en) * 2014-08-27 2017-08-17 Huawei Technologies Co., Ltd. Resource Download Method, Electronic Device, and Apparatus
CN109218345A (en) * 2017-06-29 2019-01-15 武汉斗鱼网络科技有限公司 Obtain method, storage medium, electronic equipment and the system of target resource
CN111506837A (en) * 2020-03-09 2020-08-07 百度在线网络技术(北京)有限公司 Searching method and device, electronic equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467941A (en) * 2021-06-25 2021-10-01 北京汇钧科技有限公司 Method and device for sharing information

Similar Documents

Publication Publication Date Title
CN106126273B (en) A kind of method of upgrading BIOS
CN111770169A (en) Method, device, equipment and storage medium for upgrading equipment firmware
CN111782254A (en) Method, device, equipment and storage medium for upgrading object
CN111857762A (en) Micro-service updating system
CN112073994A (en) Method and device for over-the-air upgrading, electronic equipment and readable storage medium
US11824714B2 (en) Method and apparatus for updating an edge node, device, medium and program product
CN112925651A (en) Application resource deployment method, device, electronic equipment and medium
CN112099845A (en) Software version updating method, server, vehicle, and computer storage medium
CN111752843A (en) Method, device, electronic equipment and readable storage medium for determining influence surface
KR102488582B1 (en) Method and apparatus for verifying operation state of application
CN111885114B (en) Method, device and storage medium for upgrading application program interface module in gateway
CN111611168A (en) Joint debugging test method, device and system
CN112511505A (en) Authentication system, method, device, equipment and medium
CN112540914A (en) Execution method, execution device, server and storage medium for unit test
CN111290768B (en) Updating method, device, equipment and medium of containerized application system
CN112328301A (en) Method and device for maintaining consistency of operating environments, storage medium and electronic equipment
CN112199355A (en) Data migration method and device, electronic equipment and storage medium
CN109828830B (en) Method and apparatus for managing containers
CN111752587A (en) Batch processing method and device of small programs, electronic equipment and readable storage medium
CN112099954A (en) Method, device, equipment and storage medium for deploying and downloading resources
CN111770176B (en) Traffic scheduling method and device
CN112651741A (en) Data processing method and device based on block chain
CN112069137A (en) Method and device for generating information, electronic equipment and computer readable storage medium
CN111865686A (en) Cloud product capacity expansion method, device, equipment and storage medium
WO2023169193A1 (en) Method and device for generating smart contract

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination