WO2018120429A1 - Resource update method, terminal, computer readable storage medium and resource update device - Google Patents
Resource update method, terminal, computer readable storage medium and resource update device Download PDFInfo
- Publication number
- WO2018120429A1 WO2018120429A1 PCT/CN2017/076521 CN2017076521W WO2018120429A1 WO 2018120429 A1 WO2018120429 A1 WO 2018120429A1 CN 2017076521 W CN2017076521 W CN 2017076521W WO 2018120429 A1 WO2018120429 A1 WO 2018120429A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- update
- resource
- application
- parameter
- signature file
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000012545 processing Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 12
- 230000006870 function Effects 0.000 description 10
- 230000008447 perception Effects 0.000 description 8
- 238000011161 development Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a resource update method, a terminal, a computer readable storage medium, and a resource update device.
- APPs Applications
- hybrid APP native mixed hybrid APPs
- software developers usually introduce some resources such as files and pictures into the APP, and in order to repair bugs in the resources of the APP or to achieve performance optimization of the APP, software development People usually post new resources, and users can improve the performance and stability of the app by updating the resources in the app to new resources.
- the current method for updating resources in the APP is usually to manually upgrade the APP to obtain new resources, and the manner of updating the resources requires manual participation, long time, and affects the user experience.
- the embodiments of the present invention provide a resource update method, a terminal, a computer readable storage medium, and a resource update device, which can automatically update resources and improve user experience without a user's perception.
- an embodiment of the present invention provides a resource update method, where the method includes: if it is detected that an application in a terminal is started, determining whether the application needs to update a resource; if the application needs to update a resource, the slave server Acquiring update information related to the application, the update information includes a preset update parameter, and a resource download address; acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter; determining the local Whether the parameter is within the range of the preset update parameter; if yes, downloading a corresponding resource update package according to the resource download address; and updating the resource in the application according to the downloaded resource update package and the set update type .
- the embodiment of the present invention provides a terminal, where the terminal includes a first determining unit, configured to determine, if the application in the terminal is started, whether the application needs to update resources, and the first acquiring unit, configured to: If the application needs to update the resource, the update information related to the application is obtained from the server, the update information includes a preset update parameter and a resource download address, and the second obtaining unit is configured to update the parameter according to the preset.
- the second determining unit is configured to determine whether the local parameter is within a range of the preset update parameter; and downloading, if yes, according to the resource
- the downloading address downloads the corresponding resource update package; and the updating unit is configured to update the resource in the application according to the downloaded resource update package and the set update type.
- an embodiment of the present invention provides a computer readable storage medium having one or more programs, the one or more programs being used by one or more processors to perform the following steps. If it is detected that the application in the terminal is started, it is determined whether the application needs to update the resource; if the application needs to update the resource, the update information related to the application is obtained from the server, and the update information includes a preset update parameter.
- a resource download address obtaining a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if yes, according to the The resource download address downloads the corresponding resource update package; and the resource in the application is updated according to the downloaded resource update package and the set update type.
- an embodiment of the present invention provides a resource update device, including a memory and a processor, where the memory is used to store an instruction, and the processor reads an instruction in the memory and performs the following operations according to the instruction. If it is detected that the application in the terminal is started, it is determined whether the application needs to update the resource; if the application needs to update the resource, the update information related to the application is obtained from the server, and the update information includes a preset update parameter.
- a resource download address obtaining a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if yes, according to the The resource download address downloads the corresponding resource update package; and the resource in the application is updated according to the downloaded resource update package and the set update type.
- the embodiment of the present invention determines whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, where the update information includes the preset update parameter and the resource download address, and then according to the pre- The update parameter is configured to obtain a local parameter corresponding to the preset update parameter, and determine whether the local parameter is within the range of the preset update parameter, and if yes, download the corresponding resource update package according to the resource download address, and update according to the downloaded resource.
- the package updates the resources of the app with the set update type.
- the embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
- FIG. 1 is a schematic flowchart of a method for updating a resource according to an embodiment of the present invention
- FIG. 2 is a schematic diagram of a sub-flow of step S101 in FIG. 1;
- FIG. 3 is a schematic flowchart of another method for resource update according to an embodiment of the present invention.
- FIG. 4 is a schematic flowchart of another method for resource update according to an embodiment of the present invention.
- FIG. 5 is a schematic block diagram of a terminal according to an embodiment of the present disclosure.
- Figure 6 is a schematic block diagram of the first determining unit of Figure 5;
- FIG. 7 is a schematic block diagram of another terminal according to an embodiment of the present disclosure.
- FIG. 8 is a schematic block diagram of another terminal according to an embodiment of the present disclosure.
- FIG. 9 is a schematic block diagram of a resource update device according to an embodiment of the present invention.
- a method for updating a resource according to an embodiment of the present invention is applied to a terminal, where the terminal includes but is not limited to any electronic product capable of interacting with a user, such as a smart phone, a tablet computer, a handheld power device, a notebook computer, or the like. .
- the foregoing electronic device is only an example, and is not exhaustive.
- the terminal provided by the embodiment of the present invention includes but is not limited to the above electronic device.
- FIG. 1 is a schematic flowchart of a method for updating a resource according to an embodiment of the present invention. As shown in the figure, the method for updating a resource includes steps S101 to S106.
- a plurality of different applications are usually installed in the terminal to meet different usage requirements of the user, and the user can start the application by clicking a shortcut icon applied on the terminal interface, and the terminal often starts multiple different applications at the same time.
- the terminal often starts multiple different applications at the same time.
- one of the applications is the current application
- other launched applications run in the background of the terminal for the user to quickly switch between different applications.
- resources include files, pictures, characters, etc. added to the application to meet the application's use function.
- the developer of the application When an application is installed on the terminal, the developer of the application will later develop a new version of the application or develop resources such as plug-ins related to the application to fix bugs in the in-app resource or optimize the performance of the application, and by using the application.
- the resources are updated to new resources to improve the performance and stability of the application.
- step S101 includes steps S201 to S204.
- the first signature file is generated for the resource, that is, the first signature file is formed after the MD5 signature is performed on the resource on the server.
- the first signature file corresponds to the newly released resource on the server. If the latest resource is not published on the server, the first signature file corresponds to the current latest resource in the server.
- the terminal locally acquires the resource corresponding to the resource after the resource is obtained from the server.
- the signature file corresponding to the local resource is set as the second signature file.
- the server it is determined whether a new resource is released on the server by comparing the first signature file corresponding to the latest resource on the server with the second signature file corresponding to the local resource. If the first signature file is the same as the second signature file, the latest resource is not released on the server, that is, the current latest resource on the server is the same as the local resource on the terminal, so the application resource does not need to be updated;
- the signature file is different from the second signature file, which means that a new resource is published on the server, and the application's resources need to be updated according to the new resources published on the server.
- the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address.
- step S101 if the application needs to update the resource, it indicates that the application has released a new resource on the server, and in order to update the resource of the application, the application needs to be acquired from the server.
- the update information includes at least a preset update parameter and a download address of the resource.
- the preset update parameter is used to determine whether the update condition is met, and the preset update parameter includes, for example, a preset model, a resource version number, an operating system, an application version number, and the like.
- the download address of the resource may be a storage path of the resource in the server or a download address on the network to obtain a new resource according to the download address of the resource.
- a resource corresponding to multiple different applications is usually stored.
- the server may set a mapping relationship list, such as the identifier of the application and the storage path of the latest resource corresponding thereto. Corresponding storage to quickly find out if the app has released new resources and quickly finds the download address of the new resource.
- the preset update parameter includes a preset model, a resource version number, an operating system, a version number of the application, and the like.
- the preset update parameter is obtained according to the preset update parameter.
- the local parameter is the model of the terminal, the version number of the resource in the terminal, the operating system in the terminal, and the version number applied in the terminal.
- determining whether the obtained local parameter is within the preset update parameter range to determine whether the application of the terminal meets the update condition for example, including determining whether the model of the terminal is a preset model, and the preset model includes at least one
- the model can determine whether the resource can run on the terminal of the model by determining whether the terminal model is a preset model; determining whether the resource version number in the terminal is smaller than the resource version number in the server, that is, determining the The resources in the terminal are compared to the resources in the server. If the operating system in the terminal is within the preset operating system, the operating system in the terminal needs to be judged whether the operating system in the terminal is running.
- the default operating system range is determined; whether the version number of the application is within the preset application version number, that is, the version of the application may be updated according to the new resource; when the local parameter is in the preset update parameter range If the application meets the condition of the resource update, step S105 is performed, if the local parameter is not in the preset update Within the parameter range, the application does not meet the criteria for resource update. It should be noted that, when each local parameter is within the preset update parameter range, the application satisfies the condition of resource update; if any local parameter is not within the preset update parameter range, , the application does not meet the criteria for resource update.
- the application satisfies the resource update condition, and downloads a corresponding resource update package according to the resource download address, where the resource update package includes the required update of the application. Resources.
- the resources in the application are updated according to the downloaded resource update package and the set update type.
- the update type includes a forced update and a silent update, wherein the forced update is to obtain a resource update package during the current startup process of the application, and update the resource in the application according to the obtained resource update package; silently update to the current application
- the resource update package is obtained during startup, and the resource of the application is updated according to the resource update in the next startup of the application.
- the embodiment of the present invention determines whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, where the update information includes the preset update parameter and the resource download address, and then according to the pre- The update parameter is configured to obtain a local parameter corresponding to the preset update parameter, and determine whether the local parameter is within the range of the preset update parameter, and if yes, download the corresponding resource update package according to the resource download address, and update according to the downloaded resource.
- the package updates the resources of the app with the set update type.
- the embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
- FIG. 3 is a schematic flowchart of another method for resource update according to an embodiment of the present invention. As shown in the figure, the method for updating a resource includes steps S301 to S310.
- the signature processing is to perform MD5 signature on the update information to obtain a third signature file.
- MD5 Message Digest Algorithm MD5
- hash function widely used in the field of computer security to provide message integrity protection to ensure complete and consistent information transmission.
- whether the third signature file and the first signature file are the same may be determined by comparing the MD5 value. If the MD5 value is the same, the third signature file is the same as the first signature file, and step S307 is performed. If the MD5 value is different, the third signature file is different from the first signature file. It can be understood that the integrity of the update resource acquired from the server is further verified by comparing the first signature file with the third signature file to improve the accuracy of the application update resource.
- the process ends.
- the first signature file and the second signature file are compared to determine whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, and the update information includes preset update parameters and resources. Downloading the address, and signing the update information to obtain a third signature file, and then comparing whether the third signature file is identical to the first signature file to further verify the integrity of the update information, if the third signature file and the first signature.
- the file is the same, and the local parameter corresponding to the preset update parameter is obtained according to the preset update parameter, and it is determined whether the local parameter is within the range of the preset update parameter, and if so, the corresponding resource update package is downloaded according to the resource download address, and
- the application's resources are updated based on the downloaded resource update package and the set update type.
- the embodiments of the present invention can reduce manual operations and implement automatic update of resources in a situation where the user is not aware, improve the user experience, and improve the accuracy of the update resources by further verifying the integrity of the updated resources.
- FIG. 4 is a schematic flowchart of another method for resource update according to an embodiment of the present invention. As shown in the figure, the method for updating a resource includes steps S401 to S409.
- update information related to the application includes a preset update parameter and a resource download address.
- the update type includes a forced update and a silent update, wherein the forced update is to acquire a resource update package in the current startup process of the application, and update the resource in the application according to the obtained resource update package; the silent update is in the application.
- the resource update package is obtained during the startup process, and the application resource is updated according to the resource update in the next startup of the application.
- different identifiers are set corresponding to the mandatory update and the silent update, for example, the forced update identifier is set to “A”, and the silent update is set to “B” for automatic identification.
- the forced update and the silent update can be set to two states of “0” and “1” corresponding to one binary bit, which is not limited herein.
- the resource in the application is replaced according to the acquired resource update package.
- the obtained resource update package may be an update of a part of a picture, a file, or the like of the corresponding application, or an update of a loan module in a different module such as a wealth management application in the application
- the forced update is performed according to the forced update. Simply replace the corresponding resource in the application.
- the application running in the background of the terminal can directly replace the resources of the corresponding application according to the obtained resource update package, and the current application of the terminal can also set an operation triggering the update instruction, such as The current application is a wealth management application.
- the current application is a wealth management application.
- the silent update table includes at least an identifier of the application and a resource update package corresponding to the application. If the update type is identified as a silent update, the obtained resource update package is stored in the silent update table during the current running of the application, and the resource in the application is replaced according to the resource update package after the application is started next time. . In some other embodiments, the silent update table is cleared after the resource update is complete.
- the embodiment of the present invention determines whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, where the update information includes the preset update parameter and the resource download address, and then according to the pre- The update parameter is configured to obtain a local parameter corresponding to the preset update parameter, and determine whether the local parameter is within the range of the preset update parameter, and if yes, download the corresponding resource update package according to the resource download address, and identify the set update type. If the update type is forced update, replace the resource in the application according to the obtained resource update package. If the update type is silent update, replace the applied resource according to the resource update package after the application is started next time.
- the embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
- FIG. 5 is a schematic block diagram of a terminal according to an embodiment of the present invention.
- the terminal 50 in the present embodiment as shown in the figure includes a first judging unit 51, a first obtaining unit 52, a second obtaining unit 53, a second judging unit 54, a downloading unit 55, and an updating unit 56.
- the first determining unit 51 is configured to determine, if the application in the terminal is started, whether the application needs to update resources.
- a plurality of different applications are usually installed in the terminal to meet different usage requirements of the user, and the user can start the application by clicking a shortcut icon applied on the terminal interface, and the terminal often starts multiple different applications at the same time.
- the terminal often starts multiple different applications at the same time.
- one of the applications is the current application
- other launched applications run in the background of the terminal for the user to quickly switch between different applications.
- the resources include files, pictures, characters, etc. added to the application to satisfy the usage function of the application.
- the developer of the application When an application is installed on the terminal, the developer of the application will later develop a new version of the application or develop resources such as plug-ins related to the application to fix bugs in the in-app resource or optimize the performance of the application, and by using the application.
- the resources are updated to new resources to improve the performance and stability of the application.
- the first obtaining unit 52 is configured to: if the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter, and a resource download address.
- the application needs to update the resource, it indicates that the application has released a new resource on the server, and in order to update the resource of the application, the update information related to the application needs to be obtained from the server.
- the update information includes at least a preset update parameter and a download address of the resource.
- the preset update parameter is used to determine whether the update condition is met, and the preset update parameter includes, for example, a preset model, a resource version number, an operating system, an application version number, and the like.
- the download address of the resource may be a storage path of the resource in the server or a download address on the network to obtain a new resource according to the download address of the resource.
- a resource corresponding to multiple different applications is usually stored.
- the server may set a mapping relationship list, such as the identifier of the application and the storage path of the latest resource corresponding thereto. Corresponding storage to quickly find out if the app has released new resources and quickly finds the download address of the new resource.
- the second obtaining unit 53 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
- the preset update parameter includes a preset model, a resource version number, an operating system, a version number of the application, and the like.
- the preset update parameter is obtained according to the preset update parameter.
- the local parameter is the model of the terminal, the version number of the resource in the terminal, the operating system in the terminal, and the version number applied in the terminal.
- the second determining unit 54 is configured to determine whether the local parameter is within the range of the preset update parameter.
- determining whether the obtained local parameter is within the preset update parameter range to determine whether the application of the terminal meets the update condition for example, including determining whether the model of the terminal is a preset model, and the preset model includes at least one
- the model can determine whether the resource can run on the terminal of the model by determining whether the terminal model is a preset model; determining whether the resource version number in the terminal is smaller than the resource version number in the server, that is, determining the The resources in the terminal are compared to the resources in the server. If the operating system in the terminal is within the preset operating system, the operating system in the terminal needs to be judged whether the operating system in the terminal is running.
- the default operating system range is determined; whether the version number of the application is within the preset application version number, that is, the version of the application may be updated according to the new resource; when the local parameter is in the preset update parameter range If the application meets the conditions for resource update, if the local parameter is not within the preset update parameter range Indicating that the application does not meet the conditions for resource updates. It should be noted that, when each local parameter is within the preset update parameter range, the application satisfies the condition of resource update; if any local parameter is not within the preset update parameter range, , the application does not meet the criteria for resource update.
- the downloading unit 55 is configured to download the corresponding resource update package according to the resource download address.
- the application satisfies the resource update condition, and downloads a corresponding resource update package according to the resource download address, where the resource update package includes the required update of the application. Resources.
- the updating unit 56 is configured to update resources in the application according to the downloaded resource update package and the set update type. Specifically, the resources in the application are updated according to the downloaded resource update package and the set update type.
- the update type includes a forced update and a silent update, wherein the forced update is to obtain a resource update package during the current startup process of the application, and update the resource in the application according to the obtained resource update package; silently update to the current application.
- the resource update package is obtained during startup, and the resource of the application is updated according to the resource update in the next startup of the application.
- the first determination unit 51 includes a third acquisition unit 511, a fourth acquisition unit 512, a first comparison unit 513, and a determination unit 514.
- the third obtaining unit 511 is configured to obtain a first signature file from a server, where the first signature file corresponds to a newly released resource on the server. Specifically, after the resource development is completed and released to the server, the first signature file is generated for the resource, that is, the first signature file is formed after the MD5 signature is performed on the resource on the server. The first signature file corresponds to the newly released resource on the server. If the latest resource is not published on the server, the first signature file corresponds to the current latest resource in the server.
- the fourth obtaining unit 5122 is configured to acquire a second signature file corresponding to the local resource.
- the terminal locally acquires the resource corresponding to the resource after acquiring the resource from the server.
- the signature file corresponding to the local resource is set as the second signature file. .
- the first comparison unit 513 is configured to compare whether the first signature file and the second signature file are the same.
- the determining unit 514 is configured to determine that the application needs to update the resource if they are not the same.
- the server it is determined whether a new resource is released on the server by comparing the first signature file corresponding to the latest resource on the server with the second signature file corresponding to the local resource. If the first signature file is the same as the second signature file, the latest resource is not released on the server, that is, the current latest resource on the server is the same as the local resource on the terminal, so the application resource does not need to be updated;
- the signature file is different from the second signature file, which means that a new resource is published on the server, and the application's resources need to be updated according to the new resources published on the server.
- the first determining unit 51 determines whether the application needs to update the resource. If the resource needs to be updated, the first obtaining unit 52 obtains the update information from the server, and the update information includes Presetting the update parameter and the resource download address, and then acquiring the local parameter corresponding to the preset update parameter by the second obtaining unit 53 according to the preset update parameter, and determining, by the second determining unit 54, whether the local parameter is in the preset update parameter If it is, the downloading unit 55 downloads the corresponding resource update package according to the resource download address, and updates the resource of the application by the update unit 56 according to the downloaded resource update package and the set update type.
- the embodiment of the invention can reduce the manual operation and realize automatic update of resources and improve user experience without the user's perception.
- FIG. 7 is a schematic block diagram of another terminal according to an embodiment of the present invention.
- the terminal 60 in this embodiment as shown in the figure includes a first determining unit 61, a first obtaining unit 62, a signing unit 63, a second comparing unit 64, a second obtaining unit 65, a second determining unit 66, and a downloading unit. 67, and update unit 68.
- the first determining unit 61 is configured to determine, if the application in the terminal is started, whether the application needs to update resources.
- the first obtaining unit 62 is configured to: if the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter, and a resource download address.
- the signing unit 63 is configured to perform signature processing on the update information acquired from the server to obtain a third signature file.
- the signature processing is to perform MD5 signature on the update information to obtain a third signature file.
- MD5 Message Digest Algorithm MD5
- MD5 is a hash function widely used in the field of computer security to provide message integrity protection to ensure complete and consistent information transmission.
- a second comparison unit 64 configured to compare whether the third signature file and the first signature file are the same; if the same, perform local acquisition corresponding to the preset update parameter according to the preset update parameter The steps of the parameters.
- whether the third signature file and the first signature file are the same can be determined by comparing the MD5 value. If the MD5 value is the same, the third signature file is the same as the first signature file; if the MD5 value is Different, the third signature file is different from the first signature file. It can be understood that the integrity of the update resource acquired from the server is further verified by comparing the first signature file with the third signature file to improve the accuracy of the application update resource.
- the second obtaining unit 65 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
- the local parameter corresponding to the preset update parameter is obtained according to the preset update parameter. If the third signature file is different from the second signature file, the process ends.
- the second determining unit 66 is configured to determine whether the local parameter is within the range of the preset update parameter.
- the download unit 67 is configured to download the corresponding resource update package according to the resource download address.
- the updating unit 68 is configured to update resources in the application according to the downloaded resource update package and the set update type.
- the first determining unit 61 determines whether the application needs to update the resource, and if the resource needs to be updated, the first obtaining unit 62 obtains the update information from the server, where the update information includes the preset update parameter and the resource download address, and The update information is signed by the signature unit 63 to obtain a third signature file, and then the second comparison unit 64 compares whether the third signature file is identical to the first signature file to further verify the integrity of the update information.
- the third signature file is the same as the first signature file, and the second acquisition unit 65 acquires the local parameter corresponding to the preset update parameter according to the preset update parameter, and determines, by the second determination unit 66, whether the local parameter is in the preset update parameter.
- the downloading unit 67 downloads the corresponding resource update package according to the resource download address, and updates the resource of the application according to the downloaded resource update package and the set update type by the update unit 68.
- the embodiments of the present invention can reduce manual operations and implement automatic update of resources in a situation where the user is not aware, improve the user experience, and improve the accuracy of the update resources by further verifying the integrity of the updated resources.
- FIG. 8 is a schematic block diagram of another terminal according to an embodiment of the present invention.
- the terminal 70 in this embodiment as shown in the figure includes a first determining unit 71, a first obtaining unit 72, a second obtaining unit 73, a second determining unit 74, a downloading unit 75, an identifying unit 76, and a first replacing unit 77.
- the first determining unit 71 is configured to determine, if the application in the terminal is started, whether the application needs to update resources.
- the first obtaining unit 72 is configured to: if the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter, and a resource download address.
- the second obtaining unit 73 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
- the second determining unit 74 is configured to determine whether the local parameter is within the range of the preset update parameter.
- the downloading unit 75 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
- the identifying unit 76 is configured to perform signature processing on the update information acquired from the server to obtain a third signature file.
- the update type includes a forced update and a silent update, wherein the forced update is to acquire a resource update package in the current startup process of the application, and update the resource in the application according to the obtained resource update package; the silent update is in the application.
- the resource update package is obtained during the startup process, and the application resource is updated according to the resource update in the next startup of the application.
- different identifiers are set corresponding to the mandatory update and the silent update, for example, the forced update identifier is set to “A”, and the silent update is set to “B” for automatic identification.
- the forced update and the silent update can be set to two states of “0” and “1” corresponding to one binary bit, which is not limited herein.
- the first replacing unit 77 is configured to replace the resources in the application according to the acquired resource update package if the update type is mandatory update. Specifically, if the update type is mandatory update, the resources in the application are replaced according to the obtained resource update package. It should be noted that, since the obtained resource update package may be an update of a part of a picture, a file, or the like of the corresponding application, or an update of a loan module in a different module such as a wealth management application in the application, the forced update is performed according to the forced update. Simply replace the corresponding resource in the application.
- the application running in the background of the terminal can directly replace the resources of the corresponding application according to the obtained resource update package, and the current application of the terminal can also set an operation triggering the update instruction, such as The current application is a wealth management application.
- the current application is a wealth management application.
- the saving unit 78 is configured to save the obtained resource update package to the silent update table of the application if the update type is a silent update.
- the second replacing unit 79 is configured to replace the resources in the application according to the resource update package if it is detected that the application in the terminal is started again.
- the silent update table includes at least an identifier of the application and a resource update package corresponding to the application. If the update type is identified as a silent update, the obtained resource update package is stored in the silent update table during the current running of the application, and the resource in the application is replaced according to the resource update package after the application is started next time. . In some other embodiments, the silent update table is cleared after the resource update is complete.
- the first determining unit 71 determines whether the application needs to update the resource, and if the resource needs to be updated, the first obtaining unit 72 obtains the update information from the server, and the update information includes the pre- The update parameter and the resource download address are set, and then the second obtaining unit 73 acquires the local parameter corresponding to the preset update parameter according to the preset update parameter, and determines, by the second determining unit 74, whether the local parameter is in the range of the preset update parameter. If yes, the download unit 75 downloads the corresponding resource update package according to the resource download address, and the identification unit 76 identifies the set update type. If the update type is forced update, the first replacement unit 77 updates the package according to the acquired resource.
- the resource in the application is replaced. If the update type is silent update, the application resource is replaced by the second update unit 79 according to the resource update package after the next startup of the application.
- the embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
- the units described in the embodiments of the present invention may also be stored in a computer readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
- a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
- the storage medium includes a USB flash drive, a removable hard disk, a read-only memory (ROM), and a random access memory (RAM, Random). Access Memory)
- RAM random access memory
- embodiments of the present invention also describe a computer readable storage medium having one or more programs, the one or more programs being executable by one or more processors to implement the following steps: Detecting that the application in the terminal is started, determining whether the application needs to update the resource; if the application needs to update the resource, obtaining update information related to the application from the server, where the update information includes preset update parameters, and a resource download address; obtaining a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if yes, downloading according to the resource The resource update package corresponding to the address download; and updating the resource in the application according to the downloaded resource update package and the set update type.
- the determining whether the application needs to update a resource comprises the steps of: acquiring a first signature file from a server, where the first signature file corresponds to a newly released resource on the server; acquiring the local resource Corresponding second signature file; comparing whether the first signature file and the second signature file are the same; if not, determining that the application needs to update resources.
- said one or more programs are further executable by said one or more processors to: perform a signature process on said update information obtained from said server to obtain a third signature file; Comparing whether the third signature file is the same as the first signature file; if the same, performing the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter.
- the update type includes a forced update and a silent update
- the updating the resource in the application according to the downloaded resource update package and the set update type includes the following steps: identifying a set update type;
- the update type is a forced update, and the resource in the application is replaced according to the obtained resource update package.
- the one or more programs are further executable by the one or more processors to implement the step of saving the obtained resource update package to the application if the update type is a silent update Silently updating the table; if it is detected that the application in the terminal is started again, replacing the resource in the application according to the resource update package.
- FIG. 9 is a schematic block diagram of a resource update device according to an embodiment of the present invention.
- the resource update device 80 includes a memory 81, one or several processors 82, one or several input devices 83, one or several output devices 84.
- the processor 82, the input device 83, the output device 84, and the memory 81 are connected by a bus 85.
- the memory 81 is used to store program data with various functions.
- the data stored in the memory 81 in the embodiment of the present invention includes program data that can be called and run.
- the memory 81 of the embodiment of the present invention may be a system memory such as volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.), or a combination of the two.
- the memory 66 of the embodiment of the present invention may also be an external memory outside the system, such as a magnetic disk, an optical disk, a magnetic tape, or the like.
- the input device 83 is for the user to launch an application in the terminal.
- the input device 93 of the embodiment of the present invention may include a keyboard, a mouse, a photoelectric input device, a sound input device, a touch input device, a scanner, and the like.
- the output device 84 is for outputting a resource update result, and the output device 84 may be a display, a speaker, a printer, or the like.
- the processor 82 reads an instruction in the memory 81 and performs an operation according to the instruction: if it is detected that an application in the terminal is started, determining whether the application needs to update a resource; if the application needs to update a resource, Acquiring update information related to the application, the update information includes a preset update parameter, and a resource download address; and acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter; Whether the local parameter is within the range of the preset update parameter; if yes, downloading a corresponding resource update package according to the resource download address; and updating the application according to the downloaded resource update package and the set update type Resources in.
- the determining whether the application needs to update the resource comprises: acquiring a first signature file from a server, where the first signature file corresponds to a newly released resource on the server; and acquiring a corresponding to the local resource Two signature files; comparing whether the first signature file and the second signature file are the same; if not, determining that the application needs to update resources.
- the processor 82 further performs an operation of performing signature processing on the update information acquired from the server to obtain a third signature file, and comparing the third signature file with the first signature file. Whether they are the same; if they are the same, performing the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter.
- the update type includes a forced update and a silent update
- the updating the resource in the application according to the downloaded resource update package and the set update type comprises: identifying a set update type; if the update The type is a forced update, and the resources in the application are replaced according to the obtained resource update package.
- the processor 82 further performs the following operations: if the update type is a silent update, save the obtained resource update package to the silent update table of the application; if it is detected that the application in the terminal is started again Replacing resources in the application according to the resource update package.
- the disclosed terminal and method may be implemented in other manners.
- the device device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device device or unit, or an electrical, mechanical or other form of connection.
- the units in the terminal in the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.
- each functional unit in each embodiment of the present invention may be integrated into one processor, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the technical solution of the present invention contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
- a number of instructions are included to cause a computer device (which may be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: U Disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access
- RAM Random Access
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Stored Programmes (AREA)
Abstract
An embodiment of the present invention discloses a resource update method, and the method comprises: determining whether an application requires an updated resource if it is detected that the application in a terminal is activated; if the application requires the updated resource, acquiring update information related to the application from a server, wherein the update information comprises a preset update parameter and a resource download address; acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if so, downloading a corresponding resource update package according to the resource download address; and updating a resource of the application according to the downloaded resource update package and a configured update type. The embodiment of the present invention further discloses a terminal, a computer readable storage medium and a resource update device. The embodiment of the present invention can reduce manual operations and realize automatic updating of a resource without involving the user, thus improving user experience.
Description
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种资源更新方法、终端、计算机可读存储介质及资源更新设备。 The present invention relates to the field of communications technologies, and in particular, to a resource update method, a terminal, a computer readable storage medium, and a resource update device.
背景技术Background technique
随着互联网技术和智能终端的发展,能够装载在智能终端上运行的APP(Application,应用)的类型也越来越丰富,如html5页面与native混合的混合型APP(hybrid
APP)由于具有成本少、开发快等优势逐渐成为APP开发的趋势。为了满足设定的使用功能,在APP开发过程中,软件开发人员通常会将一些资源如文件、图片等引入到APP中,且为了修复APP内资源中的Bug或者实现APP的性能优化,软件开发人员通常会发布新资源,用户可通过将APP内的资源更新为新资源来提高APP的性能和稳定性。但是,目前对APP内的资源更新方式通常为人工对APP进行版本升级来获取新资源,而这种资源更新的方式存在需要人工参与、耗费时间长、且影响用户体验的效果。With the development of Internet technologies and smart terminals, the types of APPs (Applications) that can be loaded on smart terminals are also becoming more and more abundant, such as html5 pages and native mixed hybrid APPs (hybrid
APP) has gradually become the trend of APP development due to its advantages of low cost and rapid development. In order to meet the set usage function, in the APP development process, software developers usually introduce some resources such as files and pictures into the APP, and in order to repair bugs in the resources of the APP or to achieve performance optimization of the APP, software development People usually post new resources, and users can improve the performance and stability of the app by updating the resources in the app to new resources. However, the current method for updating resources in the APP is usually to manually upgrade the APP to obtain new resources, and the manner of updating the resources requires manual participation, long time, and affects the user experience.
发明内容Summary of the invention
本发明实施例提供一种资源更新方法、终端、计算机可读存储介质及资源更新设备,其能够在用户无感知的情形下实现资源的自动更新、提高用户体验。The embodiments of the present invention provide a resource update method, a terminal, a computer readable storage medium, and a resource update device, which can automatically update resources and improve user experience without a user's perception.
第一方面,本发明实施例提供了一种资源更新方法,该方法包括:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;判断所述本地参数是否在所述预设更新参数的范围之内;若是,根据所述资源下载地址下载对应的资源更新包;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。In a first aspect, an embodiment of the present invention provides a resource update method, where the method includes: if it is detected that an application in a terminal is started, determining whether the application needs to update a resource; if the application needs to update a resource, the slave server Acquiring update information related to the application, the update information includes a preset update parameter, and a resource download address; acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter; determining the local Whether the parameter is within the range of the preset update parameter; if yes, downloading a corresponding resource update package according to the resource download address; and updating the resource in the application according to the downloaded resource update package and the set update type .
第二方面,本发明实施例提供了一种终端,该终端包括第一判断单元,用于若检测到终端中的应用被启动,判断所述应用是否需要更新资源;第一获取单元,用于若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;第二获取单元,用于根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;第二判断单元,用于判断所述本地参数是否在所述预设更新参数的范围之内;下载单元,用于若是,根据所述资源下载地址下载对应的资源更新包;更新单元,用于根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。In a second aspect, the embodiment of the present invention provides a terminal, where the terminal includes a first determining unit, configured to determine, if the application in the terminal is started, whether the application needs to update resources, and the first acquiring unit, configured to: If the application needs to update the resource, the update information related to the application is obtained from the server, the update information includes a preset update parameter and a resource download address, and the second obtaining unit is configured to update the parameter according to the preset. Acquiring a local parameter corresponding to the preset update parameter; the second determining unit is configured to determine whether the local parameter is within a range of the preset update parameter; and downloading, if yes, according to the resource The downloading address downloads the corresponding resource update package; and the updating unit is configured to update the resource in the application according to the downloaded resource update package and the set update type.
第三方面,本发明实施例提供了一种计算机可读存储介质,所述存储介质有一个或者一个以上程序,所述一个或者一个以上程序被一个或者一个以上的处理器用来执行以实现以下步骤:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;判断所述本地参数是否在所述预设更新参数的范围之内;若是,根据所述资源下载地址下载对应的资源更新包;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。In a third aspect, an embodiment of the present invention provides a computer readable storage medium having one or more programs, the one or more programs being used by one or more processors to perform the following steps. If it is detected that the application in the terminal is started, it is determined whether the application needs to update the resource; if the application needs to update the resource, the update information related to the application is obtained from the server, and the update information includes a preset update parameter. And a resource download address; obtaining a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if yes, according to the The resource download address downloads the corresponding resource update package; and the resource in the application is updated according to the downloaded resource update package and the set update type.
第四方面,本发明实施例提供了一种资源更新设备,包括存储器及处理器;所述存储器用于存储指令;所述处理器读取所述存储器中的指令并根据所述指令执行以下操作:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;判断所述本地参数是否在所述预设更新参数的范围之内;若是,根据所述资源下载地址下载对应的资源更新包;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。In a fourth aspect, an embodiment of the present invention provides a resource update device, including a memory and a processor, where the memory is used to store an instruction, and the processor reads an instruction in the memory and performs the following operations according to the instruction. If it is detected that the application in the terminal is started, it is determined whether the application needs to update the resource; if the application needs to update the resource, the update information related to the application is obtained from the server, and the update information includes a preset update parameter. And a resource download address; obtaining a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if yes, according to the The resource download address downloads the corresponding resource update package; and the resource in the application is updated according to the downloaded resource update package and the set update type.
本发明实施例当检测到终端的应用被启动之后,判断应用是否需要更新资源,若需要更新资源,则从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,然后根据预设更新参数获取与该预设更新参数相对应的本地参数,并判断本地参数是否在预设更新参数的范围之内,若是,根据资源下载地址下载对应的资源更新包,并根据下载的资源更新包与设定的更新类型更新该应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验。After detecting that the application of the terminal is started, the embodiment of the present invention determines whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, where the update information includes the preset update parameter and the resource download address, and then according to the pre- The update parameter is configured to obtain a local parameter corresponding to the preset update parameter, and determine whether the local parameter is within the range of the preset update parameter, and if yes, download the corresponding resource update package according to the resource download address, and update according to the downloaded resource. The package updates the resources of the app with the set update type. The embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
附图说明DRAWINGS
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are some embodiments of the present invention. For the ordinary technicians, other drawings can be obtained based on these drawings without any creative work.
图1是本发明实施例提供的一种资源更新的方法的示意流程图;1 is a schematic flowchart of a method for updating a resource according to an embodiment of the present invention;
图2是图1中步骤S101的子流程示意图;2 is a schematic diagram of a sub-flow of step S101 in FIG. 1;
图3是本发明实施例提供的另一种资源更新的方法的示意流程图;3 is a schematic flowchart of another method for resource update according to an embodiment of the present invention;
图4是本发明实施例提供的另一种资源更新的方法的示意流程图;4 is a schematic flowchart of another method for resource update according to an embodiment of the present invention;
图5是本发明实施例提供的一种终端的示意性框图;FIG. 5 is a schematic block diagram of a terminal according to an embodiment of the present disclosure;
图6是图5中第一判断单元的示意性框图;Figure 6 is a schematic block diagram of the first determining unit of Figure 5;
图7是本发明实施例提供的另一种终端的示意性框图;FIG. 7 is a schematic block diagram of another terminal according to an embodiment of the present disclosure;
图8是本发明实施例提供的另一种终端的示意性框图;FIG. 8 is a schematic block diagram of another terminal according to an embodiment of the present disclosure;
图9是本发明实施例提供的一种资源更新设备的示意性框图。FIG. 9 is a schematic block diagram of a resource update device according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和
“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或若干个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It will be understood that the terms "comprise" and "the" when used in the specification and the appended claims
"Comprising" indicates the existence of the described features, integers, steps, operations, elements and/or components, but does not exclude the presence of one or several other features, integers, steps, operations, elements, components and/or combinations thereof Add to. It is also to be understood that the terminology of the present invention is to be construed as a The singular forms "", ",",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
本发明实施例提供的一种资源更新的方法应用于终端,该终端包括但不限制于任何一种可与用户进行人机交互的电子产品,例如智能手机、平板电脑、掌上电能、笔记本电脑等。以上电子设备仅是举例,而非穷举,本发明实施例提供的终端包括但是不限制于上述电子设备。A method for updating a resource according to an embodiment of the present invention is applied to a terminal, where the terminal includes but is not limited to any electronic product capable of interacting with a user, such as a smart phone, a tablet computer, a handheld power device, a notebook computer, or the like. . The foregoing electronic device is only an example, and is not exhaustive. The terminal provided by the embodiment of the present invention includes but is not limited to the above electronic device.
参见图1,是本发明实施例提供的一种资源更新的方法的示意流程图。如图所示,该一种资源更新的方法包括步骤S101~S106。FIG. 1 is a schematic flowchart of a method for updating a resource according to an embodiment of the present invention. As shown in the figure, the method for updating a resource includes steps S101 to S106.
S101,若检测到终端中的应用被启动,判断所述应用是否需要更新资源。S101. If it is detected that an application in the terminal is started, determine whether the application needs to update resources.
具体地,终端中通常会安装多个不同的应用以满足用户不同的使用需求,且用户可通过点击终端界面上应用的快捷图标来启动应用,且终端中往往会同时启动多个不同的应用,当有多个不同的应用被启动后,且其中一个应用为当前应用,其他被启动的应用运行在终端后台以供用户在不同的应用之间快捷切换。需要说明的是,当终端中有多个应用被启动后,将会针对每一个被启动的应用来判断该应用是否需要更新资源。其中,资源包括添加到应用中的文件、图片、字符等以满足应用的使用功能。当一个应用被安装到终端之后,该应用的开发者后续会开发新版本的应用或者开发与应用相关的插件等资源来修复应用内资源中的Bug或者实现应用的性能优化,并通过将应用内的资源更新为新资源来提高应用的性能和稳定性。Specifically, a plurality of different applications are usually installed in the terminal to meet different usage requirements of the user, and the user can start the application by clicking a shortcut icon applied on the terminal interface, and the terminal often starts multiple different applications at the same time. When a plurality of different applications are started, and one of the applications is the current application, other launched applications run in the background of the terminal for the user to quickly switch between different applications. It should be noted that, after multiple applications in the terminal are started, it is determined whether the application needs to update resources for each launched application. Among them, resources include files, pictures, characters, etc. added to the application to meet the application's use function. When an application is installed on the terminal, the developer of the application will later develop a new version of the application or develop resources such as plug-ins related to the application to fix bugs in the in-app resource or optimize the performance of the application, and by using the application. The resources are updated to new resources to improve the performance and stability of the application.
具体地,参照图2,步骤S101的子流程示意图。如图所示,步骤S101包括步骤S201~S204。Specifically, referring to FIG. 2, a schematic diagram of a sub-flow of step S101. As shown in the figure, step S101 includes steps S201 to S204.
S201,从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应。S201. Acquire a first signature file from a server, where the first signature file corresponds to a newly released resource on the server.
具体地,资源开发完成并发布到服务器上之后,对该资源将会生成第一签名文件,即对服务器上的该资源进行MD5签名之后形成该第一签名文件。该第一签名文件与服务器上最新发布的资源相对应,若服务器上没有发布最新的资源,则第一签名文件与服务器中当前最新的资源相对应。Specifically, after the resource development is completed and released to the server, the first signature file is generated for the resource, that is, the first signature file is formed after the MD5 signature is performed on the resource on the server. The first signature file corresponds to the newly released resource on the server. If the latest resource is not published on the server, the first signature file corresponds to the current latest resource in the server.
S202,获取与本地资源相对应的第二签名文件。S202. Acquire a second signature file corresponding to the local resource.
具体地,终端本地在从服务器上获取资源之后会将该资源相对应的签名文件一起获取,在本发明实施例中,本地资源对应的签名文件设置为第二签名文件。Specifically, the terminal locally acquires the resource corresponding to the resource after the resource is obtained from the server. In the embodiment of the present invention, the signature file corresponding to the local resource is set as the second signature file.
S203,比对所述第一签名文件与所述第二签名文件是否相同。S203. Compare whether the first signature file and the second signature file are the same.
S204,若不相同,则判定所述应用需要更新资源。S204. If not, determining that the application needs to update resources.
具体地,在本发明实施例中,通过将服务器上的最新资源所对应的第一签名文件与本地资源对应的第二签名文件进行比对来判断服务器上是否有发布了新资源。若第一签名文件与第二签名文件相同,则说明服务器上没有发布最新的资源,即服务器上当前最新的资源与终端本地的资源相同,因此该应用的资源并不需要进行更新;当第一签名文件与第二签名文件不同,这说明服务器上发布了新资源,该应用的资源需要根据服务器上发布的新资源进行更新。Specifically, in the embodiment of the present invention, it is determined whether a new resource is released on the server by comparing the first signature file corresponding to the latest resource on the server with the second signature file corresponding to the local resource. If the first signature file is the same as the second signature file, the latest resource is not released on the server, that is, the current latest resource on the server is the same as the local resource on the terminal, so the application resource does not need to be updated; The signature file is different from the second signature file, which means that a new resource is published on the server, and the application's resources need to be updated according to the new resources published on the server.
S102,若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址。S102. If the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address.
具体地,在本发明实施例中,根据步骤S101可知若该应用需要更新资源,则说明服务器上对应该应用发布了新资源,为了对该应用的资源进行更新,需要从服务器上获取与该应用相关的更新信息。该更新信息中至少包括预设更新参数、以及资源的下载地址。其中,预设更新参数用于判断是否满足更新条件,且该预设更新参数包括如预设机型、资源版本号、操作系统、应用的版本号等。资源的下载地址可以为资源在服务器中的存放路径或者网络上的下载地址以便根据该资源的下载地址获取到新资源。Specifically, in the embodiment of the present invention, according to step S101, if the application needs to update the resource, it indicates that the application has released a new resource on the server, and in order to update the resource of the application, the application needs to be acquired from the server. Related update information. The update information includes at least a preset update parameter and a download address of the resource. The preset update parameter is used to determine whether the update condition is met, and the preset update parameter includes, for example, a preset model, a resource version number, an operating system, an application version number, and the like. The download address of the resource may be a storage path of the resource in the server or a download address on the network to obtain a new resource according to the download address of the resource.
需要说明的是,服务器中通常存放有多个不同应用所对应的资源,当对应不同应用进行存储对应的资源时,服务器可以设置映射关系列表如将应用的标识与其对应的最新资源的存放路径进行对应存储,以便快速查找到该应用是否发布了新资源以及快速查找到新资源的下载地址。It should be noted that, in the server, a resource corresponding to multiple different applications is usually stored. When the corresponding application is used to store the corresponding resource, the server may set a mapping relationship list, such as the identifier of the application and the storage path of the latest resource corresponding thereto. Corresponding storage to quickly find out if the app has released new resources and quickly finds the download address of the new resource.
S103,根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。S103. Acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
具体地,如上所述,预设更新参数包括预设机型、资源版本号、操作系统、应用的版本号等,在本发明实施例中,根据预设更新参数获取与该预设更新参数相对应的本地参数。其中,本地参数为终端的机型,终端内的资源版本号、终端内的操作系统、终端中应用的版本号等。Specifically, as described above, the preset update parameter includes a preset model, a resource version number, an operating system, a version number of the application, and the like. In the embodiment of the present invention, the preset update parameter is obtained according to the preset update parameter. Corresponding local parameters. The local parameter is the model of the terminal, the version number of the resource in the terminal, the operating system in the terminal, and the version number applied in the terminal.
S104,判断所述本地参数是否在所述预设更新参数的范围之内。S104. Determine whether the local parameter is within a range of the preset update parameter.
具体地,判断获取的本地参数是否在预设更新参数范围之内以确定该终端的应用是否满足更新条件,如包括判断终端的机型是否为预设机型,该预设机型包括至少一种机型,通过判断终端机型是否为预设机型可以确定该资源是否能够在该型号的终端上运行;判断终端内的资源版本号是否小于服务器中的资源版本号,即确定终端内的资源相比服务器中的资源是旧版本的;判断终端内的操作系统是否在预设的操作系统范围之内,由于新资源需要配套的操作系统才能正常运行,因此需要判断终端内的操作系统是否为预设的操作系统范围之内;判断应用的版本号是否在预设的应用版本号之内,即根据该新资源可以实现对那些版本的应用进行更新;当本地参数在预设更新参数范围之内时,说明应用满足资源更新的条件,执行步骤S105,若本地参数不在预设更新参数范围之内,说明该应用不满足资源更新的条件。需要说明的是,当每一个本地参数均在与之相比对的预设更新参数范围之内时,该应用才满足资源更新的条件;若有任何一个本地参数不在预设更新参数范围之内,则该应用不满足资源更新的条件。Specifically, determining whether the obtained local parameter is within the preset update parameter range to determine whether the application of the terminal meets the update condition, for example, including determining whether the model of the terminal is a preset model, and the preset model includes at least one The model can determine whether the resource can run on the terminal of the model by determining whether the terminal model is a preset model; determining whether the resource version number in the terminal is smaller than the resource version number in the server, that is, determining the The resources in the terminal are compared to the resources in the server. If the operating system in the terminal is within the preset operating system, the operating system in the terminal needs to be judged whether the operating system in the terminal is running. The default operating system range is determined; whether the version number of the application is within the preset application version number, that is, the version of the application may be updated according to the new resource; when the local parameter is in the preset update parameter range If the application meets the condition of the resource update, step S105 is performed, if the local parameter is not in the preset update Within the parameter range, the application does not meet the criteria for resource update. It should be noted that, when each local parameter is within the preset update parameter range, the application satisfies the condition of resource update; if any local parameter is not within the preset update parameter range, , the application does not meet the criteria for resource update.
S105,若是,根据所述资源下载地址下载对应的资源更新包。S105. If yes, download the corresponding resource update package according to the resource download address.
具体地,当本地参数在预设更新参数的范围之内时,说明该应用满足资源更新条件,并根据资源下载地址下载对应的资源更新包,该资源更新包内包含有更新该应用所需的资源。Specifically, when the local parameter is within the range of the preset update parameter, the application satisfies the resource update condition, and downloads a corresponding resource update package according to the resource download address, where the resource update package includes the required update of the application. Resources.
S106,根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。S106. Update the resources in the application according to the downloaded resource update package and the set update type.
具体地,根据下载的资源更新包和设定的更新类型更新该应用中的资源。更新类型包括强制更新和静默更新,其中,强制更新为在应用的本次启动过程中获取资源更新包,并根据该获取的资源更新包更新该应用中的资源;静默更新为在应用的本次启动过程中获取资源更新包,并在应用的下次启动中根据该资源更新更新该应用的资源。Specifically, the resources in the application are updated according to the downloaded resource update package and the set update type. The update type includes a forced update and a silent update, wherein the forced update is to obtain a resource update package during the current startup process of the application, and update the resource in the application according to the obtained resource update package; silently update to the current application The resource update package is obtained during startup, and the resource of the application is updated according to the resource update in the next startup of the application.
本发明实施例当检测到终端的应用被启动之后,判断应用是否需要更新资源,若需要更新资源,则从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,然后根据预设更新参数获取与该预设更新参数相对应的本地参数,并判断本地参数是否在预设更新参数的范围之内,若是,根据资源下载地址下载对应的资源更新包,并根据下载的资源更新包与设定的更新类型更新该应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验。After detecting that the application of the terminal is started, the embodiment of the present invention determines whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, where the update information includes the preset update parameter and the resource download address, and then according to the pre- The update parameter is configured to obtain a local parameter corresponding to the preset update parameter, and determine whether the local parameter is within the range of the preset update parameter, and if yes, download the corresponding resource update package according to the resource download address, and update according to the downloaded resource. The package updates the resources of the app with the set update type. The embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
参见图3,是本发明实施例提供的另一种资源更新的方法的示意流程图。如图所示,该一种资源更新的方法包括步骤S301~S310。FIG. 3 is a schematic flowchart of another method for resource update according to an embodiment of the present invention. As shown in the figure, the method for updating a resource includes steps S301 to S310.
S301,若检测到终端中的应用被启动,从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应。S301. If it is detected that the application in the terminal is started, obtain a first signature file from the server, where the first signature file corresponds to a newly released resource on the server.
S302,获取与本地资源相对应的第二签名文件。S302. Acquire a second signature file corresponding to the local resource.
S303,比对所述第一签名文件与所述第二签名文件是否相同。S303. Align whether the first signature file and the second signature file are the same.
S304,若不相同,从所述服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址。S304. If not, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address.
S305,对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件。S305. Perform signature processing on the update information acquired from the server to obtain a third signature file.
具体地,在本发明实施例中,签名处理为对该更新信息进行MD5签名以得到第三签名文件。其中MD5(Message Digest
Algorithm MD5)为计算机安全领域广泛使用的一种散列函数,用以提供消息的完整性保护,用于确保信息传输完整一致。Specifically, in the embodiment of the present invention, the signature processing is to perform MD5 signature on the update information to obtain a third signature file. Where MD5 (Message Digest)
Algorithm MD5) is a hash function widely used in the field of computer security to provide message integrity protection to ensure complete and consistent information transmission.
S306,比对所述第三签名文件与所述第一签名文件是否相同。S306. Align whether the third signature file is the same as the first signature file.
具体地,在本发明实施例中,可以比对MD5值来判断第三签名文件和第一签名文件是否相同,若MD5值相同,则说明第三签名文件和第一签名文件相同,执行步S307;若MD5值不同,则说明第三签名文件和第一签名文件不同。可以理解地,通过将第一签名文件和第三签名文件进行比对实现进一步验证该从服务器上获取的更新资源的完整性以提高该应用更新资源的准确性。Specifically, in the embodiment of the present invention, whether the third signature file and the first signature file are the same may be determined by comparing the MD5 value. If the MD5 value is the same, the third signature file is the same as the first signature file, and step S307 is performed. If the MD5 value is different, the third signature file is different from the first signature file. It can be understood that the integrity of the update resource acquired from the server is further verified by comparing the first signature file with the third signature file to improve the accuracy of the application update resource.
S307,若相同,根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。S307. If they are the same, obtain a local parameter corresponding to the preset update parameter according to the preset update parameter.
具体地,当根据步骤S306比对第三签名文件与第二签名文件相同之后,根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。若第三签名文件与第二签名文件不相同,则结束流程。Specifically, after the third signature file is identical to the second signature file according to step S306, the local parameter corresponding to the preset update parameter is acquired according to the preset update parameter. If the third signature file is different from the second signature file, the process ends.
S308,判断所述本地参数是否在所述预设更新参数的范围之内。S308. Determine whether the local parameter is within a range of the preset update parameter.
S309,若是,根据所述资源下载地址下载对应的资源更新包。S309. If yes, download the corresponding resource update package according to the resource download address.
S310,根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。S310. Update resources in the application according to the downloaded resource update package and the set update type.
本发明实施例通过将第一签名文件和第二签名文件进行比对来判断该应用是否需要更新资源,若需要更新资源,则从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,并对该更新信息进行签名处理以得到第三签名文件,然后比对第三签名文件与第一签名文件是否相同来进一步验证更新信息的完整性,若第三签名文件与第一签名文件相同,根据预设更新参数获取与该预设更新参数相对应的本地参数,并判断本地参数是否在预设更新参数的范围之内,若是,根据资源下载地址下载对应的资源更新包,并根据下载的资源更新包与设定的更新类型更新该应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验,且通过进一步验证更新资源的完整性以提高该应用更新资源的准确性。In the embodiment of the present invention, the first signature file and the second signature file are compared to determine whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, and the update information includes preset update parameters and resources. Downloading the address, and signing the update information to obtain a third signature file, and then comparing whether the third signature file is identical to the first signature file to further verify the integrity of the update information, if the third signature file and the first signature The file is the same, and the local parameter corresponding to the preset update parameter is obtained according to the preset update parameter, and it is determined whether the local parameter is within the range of the preset update parameter, and if so, the corresponding resource update package is downloaded according to the resource download address, and The application's resources are updated based on the downloaded resource update package and the set update type. The embodiments of the present invention can reduce manual operations and implement automatic update of resources in a situation where the user is not aware, improve the user experience, and improve the accuracy of the update resources by further verifying the integrity of the updated resources.
参见图4,是本发明实施例提供的另一种资源更新的方法的示意流程图。如图所示,该一种资源更新的方法包括步骤S401~S409。FIG. 4 is a schematic flowchart of another method for resource update according to an embodiment of the present invention. As shown in the figure, the method for updating a resource includes steps S401 to S409.
S401,若检测到终端中的应用被启动,判断所述应用是否需要更新资源。S401. If it is detected that an application in the terminal is started, determine whether the application needs to update resources.
S402,若所述应用需要更新资源,从所述服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址。S402. If the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address.
S403,根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。S403. Acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
S404,判断所述本地参数是否在所述预设更新参数的范围之内。S404. Determine whether the local parameter is within a range of the preset update parameter.
S405,若是,根据所述资源下载地址下载对应的资源更新包。S405. If yes, download the corresponding resource update package according to the resource download address.
S406,识别设定的更新类型。S406, identifying the set update type.
具体地,更新类型包括强制更新和静默更新,其中,强制更新为在应用的本次启动过程中获取资源更新包,并根据该获取的资源更新包更新该应用中的资源;静默更新为在应用的本次启动过程中获取资源更新包,并在应用的下次启动中根据该资源更新更新该应用的资源。在本发明实施例中,对应强制更新和静默更新分别设置不同的标识如将强制更新标识设置为“A”,将静默更新设置为“B”以便于自动识别。当然可以理解地,还可以将强制更新和静默更新设置为一个二进制位对应的“0”和“1”的两个状态,此处不作限定。Specifically, the update type includes a forced update and a silent update, wherein the forced update is to acquire a resource update package in the current startup process of the application, and update the resource in the application according to the obtained resource update package; the silent update is in the application. The resource update package is obtained during the startup process, and the application resource is updated according to the resource update in the next startup of the application. In the embodiment of the present invention, different identifiers are set corresponding to the mandatory update and the silent update, for example, the forced update identifier is set to “A”, and the silent update is set to “B” for automatic identification. Of course, it can be understood that the forced update and the silent update can be set to two states of “0” and “1” corresponding to one binary bit, which is not limited herein.
S407,若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。S407. If the update type is mandatory update, replace the resource in the application according to the acquired resource update package.
具体地,若根据步骤S406识别到更新类型为强制更新,则根据获取的资源更新包替换该应用中的资源。需要说明的是,由于获取的资源更新包可能是对应应用的一部分图片、或文件等进行的更新,又或者针对应用中不同的模块如理财类应用中的贷款模块进行的更新,因此根据强制更新直接替换该应用中对应的资源即可。需要说明的是,若终端中同时开启多个应用,对于处于终端后台运行的应用可以根据获取的资源更新包直接替换对应应用的资源,对于终端的当前应用还可以设置操作触发更新的指令,如当前应用为理财类应用,当检测到用户点击贷款模块后,则根据获取的资源更新包直接替换该应用中的资源以便在用户无感知的情形下展示给用户更新的资源。Specifically, if it is identified in step S406 that the update type is a forced update, the resource in the application is replaced according to the acquired resource update package. It should be noted that, since the obtained resource update package may be an update of a part of a picture, a file, or the like of the corresponding application, or an update of a loan module in a different module such as a wealth management application in the application, the forced update is performed according to the forced update. Simply replace the corresponding resource in the application. It should be noted that, if multiple applications are enabled in the terminal at the same time, the application running in the background of the terminal can directly replace the resources of the corresponding application according to the obtained resource update package, and the current application of the terminal can also set an operation triggering the update instruction, such as The current application is a wealth management application. When the user clicks on the loan module, the resource in the application is directly replaced according to the obtained resource update package to display the updated resource to the user without the user's perception.
S408,若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中。S408. If the update type is a silent update, save the obtained resource update package to the silent update table of the application.
S409,若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。S409. If it is detected that the application in the terminal is started again, replace the resource in the application according to the resource update package.
具体地,静默更新表中至少包括应用的标识以及与对应该应用的资源更新包。若识别出更新类型为静默更新,则在应用的本次运行过程中将获取的资源更新包存储在静默更新表中,并在应用下次启动后,根据该资源更新包替换该应用中的资源。在一些其他实施例中,资源更新完整之后,清除该静默更新表。Specifically, the silent update table includes at least an identifier of the application and a resource update package corresponding to the application. If the update type is identified as a silent update, the obtained resource update package is stored in the silent update table during the current running of the application, and the resource in the application is replaced according to the resource update package after the application is started next time. . In some other embodiments, the silent update table is cleared after the resource update is complete.
本发明实施例当检测到终端的应用被启动之后,判断应用是否需要更新资源,若需要更新资源,则从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,然后根据预设更新参数获取与该预设更新参数相对应的本地参数,并判断本地参数是否在预设更新参数的范围之内,若是,根据资源下载地址下载对应的资源更新包,识别设定的更新类型,若更新类型为强制更新,根据获取的资源更新包替换应用中的资源,若更新类型为静默更新,在应用下次启动后根据资源更新包替换应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验。After detecting that the application of the terminal is started, the embodiment of the present invention determines whether the application needs to update the resource. If the resource needs to be updated, the update information is obtained from the server, where the update information includes the preset update parameter and the resource download address, and then according to the pre- The update parameter is configured to obtain a local parameter corresponding to the preset update parameter, and determine whether the local parameter is within the range of the preset update parameter, and if yes, download the corresponding resource update package according to the resource download address, and identify the set update type. If the update type is forced update, replace the resource in the application according to the obtained resource update package. If the update type is silent update, replace the applied resource according to the resource update package after the application is started next time. The embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
参照图5,是本发明实施例提供的一种终端的示意框图。如图所示的本实施例中的终端50包括第一判断单元51、第一获取单元52、第二获取单元53、第二判断单元54、下载单元55、以及更新单元56。FIG. 5 is a schematic block diagram of a terminal according to an embodiment of the present invention. The terminal 50 in the present embodiment as shown in the figure includes a first judging unit 51, a first obtaining unit 52, a second obtaining unit 53, a second judging unit 54, a downloading unit 55, and an updating unit 56.
第一判断单元51,用于若检测到终端中的应用被启动,判断所述应用是否需要更新资源。The first determining unit 51 is configured to determine, if the application in the terminal is started, whether the application needs to update resources.
具体地,终端中通常会安装多个不同的应用以满足用户不同的使用需求,且用户可通过点击终端界面上应用的快捷图标来启动应用,且终端中往往会同时启动多个不同的应用,当有多个不同的应用被启动后,且其中一个应用为当前应用,其他被启动的应用运行在终端后台以供用户在不同的应用之间快捷切换。需要说明的是,当终端中有多个应用被启动后,将会针对每一个被启动的应用来判断该应用是否需要更新资源。其中,资源包括添加到应用中的文件、图片、字符等用于满足应用的使用功能。当一个应用被安装到终端之后,该应用的开发者后续会开发新版本的应用或者开发与应用相关的插件等资源来修复应用内资源中的Bug或者实现应用的性能优化,并通过将应用内的资源更新为新资源来提高应用的性能和稳定性。Specifically, a plurality of different applications are usually installed in the terminal to meet different usage requirements of the user, and the user can start the application by clicking a shortcut icon applied on the terminal interface, and the terminal often starts multiple different applications at the same time. When a plurality of different applications are started, and one of the applications is the current application, other launched applications run in the background of the terminal for the user to quickly switch between different applications. It should be noted that, after multiple applications in the terminal are started, it is determined whether the application needs to update resources for each launched application. The resources include files, pictures, characters, etc. added to the application to satisfy the usage function of the application. When an application is installed on the terminal, the developer of the application will later develop a new version of the application or develop resources such as plug-ins related to the application to fix bugs in the in-app resource or optimize the performance of the application, and by using the application. The resources are updated to new resources to improve the performance and stability of the application.
第一获取单元52,用于若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址。The first obtaining unit 52 is configured to: if the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter, and a resource download address.
具体地,在本发明实施例中,若该应用需要更新资源,则说明服务器上对应该应用发布了新资源,为了对该应用的资源进行更新,需要从服务器上获取与该应用相关的更新信息。该更新信息中至少包括预设更新参数、以及资源的下载地址。其中,预设更新参数用于判断是否满足更新条件,且该预设更新参数包括如预设机型、资源版本号、操作系统、应用的版本号等。资源的下载地址可以为资源在服务器中的存放路径或者网络上的下载地址以便根据该资源的下载地址获取到新资源。Specifically, in the embodiment of the present invention, if the application needs to update the resource, it indicates that the application has released a new resource on the server, and in order to update the resource of the application, the update information related to the application needs to be obtained from the server. . The update information includes at least a preset update parameter and a download address of the resource. The preset update parameter is used to determine whether the update condition is met, and the preset update parameter includes, for example, a preset model, a resource version number, an operating system, an application version number, and the like. The download address of the resource may be a storage path of the resource in the server or a download address on the network to obtain a new resource according to the download address of the resource.
需要说明的是,服务器中通常存放有多个不同应用所对应的资源,当对应不同应用进行存储对应的资源时,服务器可以设置映射关系列表如将应用的标识与其对应的最新资源的存放路径进行对应存储,以便快速查找到该应用是否发布了新资源以及快速查找到新资源的下载地址。It should be noted that, in the server, a resource corresponding to multiple different applications is usually stored. When the corresponding application is used to store the corresponding resource, the server may set a mapping relationship list, such as the identifier of the application and the storage path of the latest resource corresponding thereto. Corresponding storage to quickly find out if the app has released new resources and quickly finds the download address of the new resource.
第二获取单元53,用于根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。The second obtaining unit 53 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
具体地,如上所述,预设更新参数包括预设机型、资源版本号、操作系统、应用的版本号等,在本发明实施例中,根据预设更新参数获取与该预设更新参数相对应的本地参数。其中,本地参数为终端的机型,终端内的资源版本号、终端内的操作系统、终端中应用的版本号等。Specifically, as described above, the preset update parameter includes a preset model, a resource version number, an operating system, a version number of the application, and the like. In the embodiment of the present invention, the preset update parameter is obtained according to the preset update parameter. Corresponding local parameters. The local parameter is the model of the terminal, the version number of the resource in the terminal, the operating system in the terminal, and the version number applied in the terminal.
第二判断单元54,用于判断所述本地参数是否在所述预设更新参数的范围之内。The second determining unit 54 is configured to determine whether the local parameter is within the range of the preset update parameter.
具体地,判断获取的本地参数是否在预设更新参数范围之内以确定该终端的应用是否满足更新条件,如包括判断终端的机型是否为预设机型,该预设机型包括至少一种机型,通过判断终端机型是否为预设机型可以确定该资源是否能够在该型号的终端上运行;判断终端内的资源版本号是否小于服务器中的资源版本号,即确定终端内的资源相比服务器中的资源是旧版本的;判断终端内的操作系统是否在预设的操作系统范围之内,由于新资源需要配套的操作系统才能正常运行,因此需要判断终端内的操作系统是否为预设的操作系统范围之内;判断应用的版本号是否在预设的应用版本号之内,即根据该新资源可以实现对那些版本的应用进行更新;当本地参数在预设更新参数范围之内时,说明应用满足资源更新的条件,若本地参数不在预设更新参数范围之内,说明该应用不满足资源更新的条件。需要说明的是,当每一个本地参数均在与之相比对的预设更新参数范围之内时,该应用才满足资源更新的条件;若有任何一个本地参数不在预设更新参数范围之内,则该应用不满足资源更新的条件。Specifically, determining whether the obtained local parameter is within the preset update parameter range to determine whether the application of the terminal meets the update condition, for example, including determining whether the model of the terminal is a preset model, and the preset model includes at least one The model can determine whether the resource can run on the terminal of the model by determining whether the terminal model is a preset model; determining whether the resource version number in the terminal is smaller than the resource version number in the server, that is, determining the The resources in the terminal are compared to the resources in the server. If the operating system in the terminal is within the preset operating system, the operating system in the terminal needs to be judged whether the operating system in the terminal is running. The default operating system range is determined; whether the version number of the application is within the preset application version number, that is, the version of the application may be updated according to the new resource; when the local parameter is in the preset update parameter range If the application meets the conditions for resource update, if the local parameter is not within the preset update parameter range Indicating that the application does not meet the conditions for resource updates. It should be noted that, when each local parameter is within the preset update parameter range, the application satisfies the condition of resource update; if any local parameter is not within the preset update parameter range, , the application does not meet the criteria for resource update.
下载单元55,用于若是,根据所述资源下载地址下载对应的资源更新包。The downloading unit 55 is configured to download the corresponding resource update package according to the resource download address.
具体地,当本地参数在预设更新参数的范围之内时,说明该应用满足资源更新条件,并根据资源下载地址下载对应的资源更新包,该资源更新包内包含有更新该应用所需的资源。Specifically, when the local parameter is within the range of the preset update parameter, the application satisfies the resource update condition, and downloads a corresponding resource update package according to the resource download address, where the resource update package includes the required update of the application. Resources.
更新单元56,用于根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。具体地,根据下载的资源更新包和设定的更新类型更新该应用中的资源。更新类型包括强制更新和静默更新,其中,强制更新为在应用的本次启动过程中获取资源更新包,并根据该获取的资源更新包更新该应用中的资源;静默更新为在应用的本次启动过程中获取资源更新包,并在应用的下次启动中根据该资源更新更新该应用的资源。The updating unit 56 is configured to update resources in the application according to the downloaded resource update package and the set update type. Specifically, the resources in the application are updated according to the downloaded resource update package and the set update type. The update type includes a forced update and a silent update, wherein the forced update is to obtain a resource update package during the current startup process of the application, and update the resource in the application according to the obtained resource update package; silently update to the current application The resource update package is obtained during startup, and the resource of the application is updated according to the resource update in the next startup of the application.
进一步地,参照图6,是第一判断单元的示意性框图。如图所示,第一判断单元51包括第三获取单元511、第四获取单元512、第一比对单元513、及判定单元514。Further, referring to FIG. 6, it is a schematic block diagram of the first determining unit. As shown, the first determination unit 51 includes a third acquisition unit 511, a fourth acquisition unit 512, a first comparison unit 513, and a determination unit 514.
第三获取单元511,用于从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应。具体地,资源开发完成并发布到服务器上之后,对该资源将会生成第一签名文件,即对服务器上的该资源进行MD5签名之后形成该第一签名文件。该第一签名文件与服务器上最新发布的资源相对应,若服务器上没有发布最新的资源,则第一签名文件与服务器中当前最新的资源相对应。The third obtaining unit 511 is configured to obtain a first signature file from a server, where the first signature file corresponds to a newly released resource on the server. Specifically, after the resource development is completed and released to the server, the first signature file is generated for the resource, that is, the first signature file is formed after the MD5 signature is performed on the resource on the server. The first signature file corresponds to the newly released resource on the server. If the latest resource is not published on the server, the first signature file corresponds to the current latest resource in the server.
第四获取单元5122,用于获取与本地资源相对应的第二签名文件。The fourth obtaining unit 5122 is configured to acquire a second signature file corresponding to the local resource.
在本发明实施例中,具体地,终端本地在从服务器上获取资源之后会将该资源相对应的签名文件一起获取,在本发明实施例中,本地资源对应的签名文件设置为第二签名文件。In the embodiment of the present invention, specifically, the terminal locally acquires the resource corresponding to the resource after acquiring the resource from the server. In the embodiment of the present invention, the signature file corresponding to the local resource is set as the second signature file. .
第一比对单元513,用于比对所述第一签名文件与所述第二签名文件是否相同。The first comparison unit 513 is configured to compare whether the first signature file and the second signature file are the same.
判定单元514,用于若不相同,则判定所述应用需要更新资源。The determining unit 514 is configured to determine that the application needs to update the resource if they are not the same.
具体地,在本发明实施例中,通过将服务器上的最新资源所对应的第一签名文件与本地资源对应的第二签名文件进行比对来判断服务器上是否有发布了新资源。若第一签名文件与第二签名文件相同,则说明服务器上没有发布最新的资源,即服务器上当前最新的资源与终端本地的资源相同,因此该应用的资源并不需要进行更新;当第一签名文件与第二签名文件不同,这说明服务器上发布了新资源,该应用的资源需要根据服务器上发布的新资源进行更新。Specifically, in the embodiment of the present invention, it is determined whether a new resource is released on the server by comparing the first signature file corresponding to the latest resource on the server with the second signature file corresponding to the local resource. If the first signature file is the same as the second signature file, the latest resource is not released on the server, that is, the current latest resource on the server is the same as the local resource on the terminal, so the application resource does not need to be updated; The signature file is different from the second signature file, which means that a new resource is published on the server, and the application's resources need to be updated according to the new resources published on the server.
本发明实施例当检测到终端的应用被启动之后,通过第一判断单元51判断应用是否需要更新资源,若需要更新资源,通过第一获取单元52则从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,然后根据预设更新参数通过第二获取单元53获取与该预设更新参数相对应的本地参数,并通过第二判断单元54判断本地参数是否在预设更新参数的范围之内,若是,通过下载单元55根据资源下载地址下载对应的资源更新包,并根据下载的资源更新包与设定的更新类型通过更新单元56更新该应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验After detecting that the application of the terminal is started, the first determining unit 51 determines whether the application needs to update the resource. If the resource needs to be updated, the first obtaining unit 52 obtains the update information from the server, and the update information includes Presetting the update parameter and the resource download address, and then acquiring the local parameter corresponding to the preset update parameter by the second obtaining unit 53 according to the preset update parameter, and determining, by the second determining unit 54, whether the local parameter is in the preset update parameter If it is, the downloading unit 55 downloads the corresponding resource update package according to the resource download address, and updates the resource of the application by the update unit 56 according to the downloaded resource update package and the set update type. The embodiment of the invention can reduce the manual operation and realize automatic update of resources and improve user experience without the user's perception.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, for clarity of hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
参照图7,是本发明实施例提供的另一种终端的示意框图。如图所示的本实施例中的终端60包括第一判断单元61、第一获取单元62、签名单元63、第二比对单元64、第二获取单元65、第二判断单元66、下载单元67、及更新单元68。FIG. 7 is a schematic block diagram of another terminal according to an embodiment of the present invention. The terminal 60 in this embodiment as shown in the figure includes a first determining unit 61, a first obtaining unit 62, a signing unit 63, a second comparing unit 64, a second obtaining unit 65, a second determining unit 66, and a downloading unit. 67, and update unit 68.
第一判断单元61,用于若检测到终端中的应用被启动,判断所述应用是否需要更新资源。The first determining unit 61 is configured to determine, if the application in the terminal is started, whether the application needs to update resources.
第一获取单元62,用于若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址。The first obtaining unit 62 is configured to: if the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter, and a resource download address.
签名单元63,用于对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件。具体地,在本发明实施例中,签名处理为对该更新信息进行MD5签名以得到第三签名文件。其中MD5(Message
Digest Algorithm MD5)为计算机安全领域广泛使用的一种散列函数,用以提供消息的完整性保护,用于确保信息传输完整一致。The signing unit 63 is configured to perform signature processing on the update information acquired from the server to obtain a third signature file. Specifically, in the embodiment of the present invention, the signature processing is to perform MD5 signature on the update information to obtain a third signature file. Where MD5 (Message
Digest Algorithm MD5) is a hash function widely used in the field of computer security to provide message integrity protection to ensure complete and consistent information transmission.
第二比对单元64,用于比对所述第三签名文件与所述第一签名文件是否相同;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。a second comparison unit 64, configured to compare whether the third signature file and the first signature file are the same; if the same, perform local acquisition corresponding to the preset update parameter according to the preset update parameter The steps of the parameters.
具体地,在本发明实施例中,可以比对MD5值来判断第三签名文件和第一签名文件是否相同,若MD5值相同,则说明第三签名文件和第一签名文件相同;若MD5值不同,则说明第三签名文件和第一签名文件不同。可以理解地,通过将第一签名文件和第三签名文件进行比对实现进一步验证该从服务器上获取的更新资源的完整性以提高该应用更新资源的准确性。Specifically, in the embodiment of the present invention, whether the third signature file and the first signature file are the same can be determined by comparing the MD5 value. If the MD5 value is the same, the third signature file is the same as the first signature file; if the MD5 value is Different, the third signature file is different from the first signature file. It can be understood that the integrity of the update resource acquired from the server is further verified by comparing the first signature file with the third signature file to improve the accuracy of the application update resource.
第二获取单元65,用于根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。The second obtaining unit 65 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
具体地,当比对第三签名文件与第二签名文件相同之后,根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。若第三签名文件与第二签名文件不相同,则结束流程。Specifically, after comparing the third signature file with the second signature file, the local parameter corresponding to the preset update parameter is obtained according to the preset update parameter. If the third signature file is different from the second signature file, the process ends.
第二判断单元66,用于判断所述本地参数是否在所述预设更新参数的范围之内。The second determining unit 66 is configured to determine whether the local parameter is within the range of the preset update parameter.
下载单元67,用于若是,根据所述资源下载地址下载对应的资源更新包。The download unit 67 is configured to download the corresponding resource update package according to the resource download address.
更新单元68,用于根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。The updating unit 68 is configured to update resources in the application according to the downloaded resource update package and the set update type.
本发明实施例通过第一判断单元61判断该应用是否需要更新资源,若需要更新资源,通过第一获取单元62从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,并通过签名单元63对该更新信息进行签名处理以得到第三签名文件,然后通过第二比对单元64比对第三签名文件与第一签名文件是否相同来进一步验证更新信息的完整性,若第三签名文件与第一签名文件相同,通过第二获取单元65根据预设更新参数获取与该预设更新参数相对应的本地参数,并通过第二判断单元66判断本地参数是否在预设更新参数的范围之内,若是,通过下载单元67根据资源下载地址下载对应的资源更新包,并通过更新单元68根据下载的资源更新包与设定的更新类型更新该应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验,且通过进一步验证更新资源的完整性以提高该应用更新资源的准确性。In the embodiment of the present invention, the first determining unit 61 determines whether the application needs to update the resource, and if the resource needs to be updated, the first obtaining unit 62 obtains the update information from the server, where the update information includes the preset update parameter and the resource download address, and The update information is signed by the signature unit 63 to obtain a third signature file, and then the second comparison unit 64 compares whether the third signature file is identical to the first signature file to further verify the integrity of the update information. The third signature file is the same as the first signature file, and the second acquisition unit 65 acquires the local parameter corresponding to the preset update parameter according to the preset update parameter, and determines, by the second determination unit 66, whether the local parameter is in the preset update parameter. If it is, the downloading unit 67 downloads the corresponding resource update package according to the resource download address, and updates the resource of the application according to the downloaded resource update package and the set update type by the update unit 68. The embodiments of the present invention can reduce manual operations and implement automatic update of resources in a situation where the user is not aware, improve the user experience, and improve the accuracy of the update resources by further verifying the integrity of the updated resources.
参照图8,是本发明实施例提供的另一种终端的示意框图。如图所示的本实施例中的终端70包括第一判断单元71、第一获取单元72、第二获取单元73、第二判断单元74、下载单元75、识别单元76、第一替换单元77、保存单元78、及第二替换单元79。FIG. 8 is a schematic block diagram of another terminal according to an embodiment of the present invention. The terminal 70 in this embodiment as shown in the figure includes a first determining unit 71, a first obtaining unit 72, a second obtaining unit 73, a second determining unit 74, a downloading unit 75, an identifying unit 76, and a first replacing unit 77. The storage unit 78 and the second replacement unit 79.
第一判断单元71,用于若检测到终端中的应用被启动,判断所述应用是否需要更新资源。The first determining unit 71 is configured to determine, if the application in the terminal is started, whether the application needs to update resources.
第一获取单元72,用于若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址。The first obtaining unit 72 is configured to: if the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter, and a resource download address.
第二获取单元73,用于根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。The second obtaining unit 73 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
第二判断单元74,用于判断所述本地参数是否在所述预设更新参数的范围之内。The second determining unit 74 is configured to determine whether the local parameter is within the range of the preset update parameter.
下载单元75,用于根据所述预设更新参数获取与所述预设更新参数相对应的本地参数。The downloading unit 75 is configured to acquire a local parameter corresponding to the preset update parameter according to the preset update parameter.
识别单元76,用于对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件。The identifying unit 76 is configured to perform signature processing on the update information acquired from the server to obtain a third signature file.
具体地,更新类型包括强制更新和静默更新,其中,强制更新为在应用的本次启动过程中获取资源更新包,并根据该获取的资源更新包更新该应用中的资源;静默更新为在应用的本次启动过程中获取资源更新包,并在应用的下次启动中根据该资源更新更新该应用的资源。在本发明实施例中,对应强制更新和静默更新分别设置不同的标识如将强制更新标识设置为“A”,将静默更新设置为“B”以便于自动识别。当然可以理解地,还可以将强制更新和静默更新设置为一个二进制位对应的“0”和“1”的两个状态,此处不作限定。Specifically, the update type includes a forced update and a silent update, wherein the forced update is to acquire a resource update package in the current startup process of the application, and update the resource in the application according to the obtained resource update package; the silent update is in the application. The resource update package is obtained during the startup process, and the application resource is updated according to the resource update in the next startup of the application. In the embodiment of the present invention, different identifiers are set corresponding to the mandatory update and the silent update, for example, the forced update identifier is set to “A”, and the silent update is set to “B” for automatic identification. Of course, it can be understood that the forced update and the silent update can be set to two states of “0” and “1” corresponding to one binary bit, which is not limited herein.
第一替换单元77,用于若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。具体地,若更新类型为强制更新,则根据获取的资源更新包替换该应用中的资源。需要说明的是,由于获取的资源更新包可能是对应应用的一部分图片、或文件等进行的更新,又或者针对应用中不同的模块如理财类应用中的贷款模块进行的更新,因此根据强制更新直接替换该应用中对应的资源即可。需要说明的是,若终端中同时开启多个应用,对于处于终端后台运行的应用可以根据获取的资源更新包直接替换对应应用的资源,对于终端的当前应用还可以设置操作触发更新的指令,如当前应用为理财类应用,当检测到用户点击贷款模块后,则根据获取的资源更新包直接替换该应用中的资源以便在用户无感知的情形下展示给用户更新的资源。The first replacing unit 77 is configured to replace the resources in the application according to the acquired resource update package if the update type is mandatory update. Specifically, if the update type is mandatory update, the resources in the application are replaced according to the obtained resource update package. It should be noted that, since the obtained resource update package may be an update of a part of a picture, a file, or the like of the corresponding application, or an update of a loan module in a different module such as a wealth management application in the application, the forced update is performed according to the forced update. Simply replace the corresponding resource in the application. It should be noted that, if multiple applications are enabled in the terminal at the same time, the application running in the background of the terminal can directly replace the resources of the corresponding application according to the obtained resource update package, and the current application of the terminal can also set an operation triggering the update instruction, such as The current application is a wealth management application. When the user clicks on the loan module, the resource in the application is directly replaced according to the obtained resource update package to display the updated resource to the user without the user's perception.
保存单元78,用于若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中。The saving unit 78 is configured to save the obtained resource update package to the silent update table of the application if the update type is a silent update.
第二替换单元79,用于若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。The second replacing unit 79 is configured to replace the resources in the application according to the resource update package if it is detected that the application in the terminal is started again.
具体地,静默更新表中至少包括应用的标识以及与对应该应用的资源更新包。若识别出更新类型为静默更新,则在应用的本次运行过程中将获取的资源更新包存储在静默更新表中,并在应用下次启动后,根据该资源更新包替换该应用中的资源。在一些其他实施例中,资源更新完整之后,清除该静默更新表。Specifically, the silent update table includes at least an identifier of the application and a resource update package corresponding to the application. If the update type is identified as a silent update, the obtained resource update package is stored in the silent update table during the current running of the application, and the resource in the application is replaced according to the resource update package after the application is started next time. . In some other embodiments, the silent update table is cleared after the resource update is complete.
本发明实施例当检测到终端的应用被启动之后,通过第一判断单元71判断应用是否需要更新资源,若需要更新资源,通过第一获取单元72从服务器中获取更新信息,该更新信息包括预设更新参数及资源下载地址,然后第二获取单元73根据预设更新参数获取与该预设更新参数相对应的本地参数,并通过第二判断单元74判断本地参数是否在预设更新参数的范围之内,若是,通过下载单元75根据资源下载地址下载对应的资源更新包,通过识别单元76识别设定的更新类型,若更新类型为强制更新,由第一替换单元77根据获取的资源更新包替换应用中的资源,若更新类型为静默更新,在应用下次启动后通过第二替换单元79根据资源更新包替换应用的资源。本发明实施例能够减少人工操作,并在用户无感知的情形下实现资源的自动更新,提高用户体验。After detecting that the application of the terminal is started, the first determining unit 71 determines whether the application needs to update the resource, and if the resource needs to be updated, the first obtaining unit 72 obtains the update information from the server, and the update information includes the pre- The update parameter and the resource download address are set, and then the second obtaining unit 73 acquires the local parameter corresponding to the preset update parameter according to the preset update parameter, and determines, by the second determining unit 74, whether the local parameter is in the range of the preset update parameter. If yes, the download unit 75 downloads the corresponding resource update package according to the resource download address, and the identification unit 76 identifies the set update type. If the update type is forced update, the first replacement unit 77 updates the package according to the acquired resource. The resource in the application is replaced. If the update type is silent update, the application resource is replaced by the second update unit 79 according to the resource update package after the next startup of the application. The embodiment of the invention can reduce the manual operation and realize the automatic update of the resource without the user's perception, thereby improving the user experience.
本发明实施例中所述的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而该存储介质包括U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random
Access Memory),磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。The units described in the embodiments of the present invention may also be stored in a computer readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. The storage medium includes a USB flash drive, a removable hard disk, a read-only memory (ROM), and a random access memory (RAM, Random).
Access Memory) A variety of media that can store program code, such as a disk or a disc. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
相应的,本发明实施例还记载了一种计算机可读存储介质,该存储介质有一个或者一个以上程序,该一个或者一个以上程序可被一个或者一个以上的处理器执行以实现以下步骤:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;判断所述本地参数是否在所述预设更新参数的范围之内;若是,根据所述资源下载地址下载对应的资源更新包;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。Correspondingly, embodiments of the present invention also describe a computer readable storage medium having one or more programs, the one or more programs being executable by one or more processors to implement the following steps: Detecting that the application in the terminal is started, determining whether the application needs to update the resource; if the application needs to update the resource, obtaining update information related to the application from the server, where the update information includes preset update parameters, and a resource download address; obtaining a local parameter corresponding to the preset update parameter according to the preset update parameter; determining whether the local parameter is within a range of the preset update parameter; if yes, downloading according to the resource The resource update package corresponding to the address download; and updating the resource in the application according to the downloaded resource update package and the set update type.
优选地,所述判断所述应用是否需要更新资源时包括以下步骤:从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应;获取与本地资源相对应的第二签名文件;比对所述第一签名文件与所述第二签名文件是否相同;若不相同,则判定所述应用需要更新资源。Preferably, the determining whether the application needs to update a resource comprises the steps of: acquiring a first signature file from a server, where the first signature file corresponds to a newly released resource on the server; acquiring the local resource Corresponding second signature file; comparing whether the first signature file and the second signature file are the same; if not, determining that the application needs to update resources.
优选地,所述一个或者一个以上程序还可被所述一个或者一个以上的处理器执行以实现以下步骤:对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件;比对所述第三签名文件与所述第一签名文件是否相同;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。Advantageously, said one or more programs are further executable by said one or more processors to: perform a signature process on said update information obtained from said server to obtain a third signature file; Comparing whether the third signature file is the same as the first signature file; if the same, performing the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter.
优选地,所述更新类型包括强制更新和静默更新,所述根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源包括以下步骤:识别设定的更新类型;若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。Preferably, the update type includes a forced update and a silent update, and the updating the resource in the application according to the downloaded resource update package and the set update type includes the following steps: identifying a set update type; The update type is a forced update, and the resource in the application is replaced according to the obtained resource update package.
优选地,所述一个或者一个以上程序还可被所述一个或者一个以上的处理器执行以实现以下步骤:若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中;若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。Advantageously, the one or more programs are further executable by the one or more processors to implement the step of saving the obtained resource update package to the application if the update type is a silent update Silently updating the table; if it is detected that the application in the terminal is started again, replacing the resource in the application according to the resource update package.
参照图9,是本发明实施例提供的一种资源更新设备的示意性框图。如图所示,该资源更新设备80包括存储器81、一个或者若干个处理器82、一个或者若干个输入装置83、一个或者若干个输出装置84。上述处理器82、输入装置83、输出装置84以及存储器81通过总线85连接。FIG. 9 is a schematic block diagram of a resource update device according to an embodiment of the present invention. As shown, the resource update device 80 includes a memory 81, one or several processors 82, one or several input devices 83, one or several output devices 84. The processor 82, the input device 83, the output device 84, and the memory 81 are connected by a bus 85.
存储器81用于存储带有各种功能的程序数据。本发明实施例中存储器81存储的数据包括可调用并运行的程序数据。具体实现中,本发明实施例的存储器81可以是系统存储器,比如,挥发性的(诸如RAM),非易失性的(诸如ROM,闪存等),或者两者的结合。具体实现中,本发明实施例的存储器66还可以是系统之外的外部存储器,比如,磁盘、光盘、磁带等。The memory 81 is used to store program data with various functions. The data stored in the memory 81 in the embodiment of the present invention includes program data that can be called and run. In a specific implementation, the memory 81 of the embodiment of the present invention may be a system memory such as volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.), or a combination of the two. In a specific implementation, the memory 66 of the embodiment of the present invention may also be an external memory outside the system, such as a magnetic disk, an optical disk, a magnetic tape, or the like.
输入装置83用于供用户启动终端中的应用。具体实现中,本发明实施例的输入装置93可包括键盘、鼠标、光电输入装置、声音输入装置、触摸式输入装置、扫描仪等。The input device 83 is for the user to launch an application in the terminal. In a specific implementation, the input device 93 of the embodiment of the present invention may include a keyboard, a mouse, a photoelectric input device, a sound input device, a touch input device, a scanner, and the like.
输出装置84用于输出资源更新结果,该输出装置84可以是括显示器、扬声器、打印机等。The output device 84 is for outputting a resource update result, and the output device 84 may be a display, a speaker, a printer, or the like.
所述处理器82读取所述存储器81中的指令并根据所述指令执行以下操作:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;判断所述本地参数是否在所述预设更新参数的范围之内;若是,根据所述资源下载地址下载对应的资源更新包;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。The processor 82 reads an instruction in the memory 81 and performs an operation according to the instruction: if it is detected that an application in the terminal is started, determining whether the application needs to update a resource; if the application needs to update a resource, Acquiring update information related to the application, the update information includes a preset update parameter, and a resource download address; and acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter; Whether the local parameter is within the range of the preset update parameter; if yes, downloading a corresponding resource update package according to the resource download address; and updating the application according to the downloaded resource update package and the set update type Resources in.
进一步地,所述判断所述应用是否需要更新资源包括:从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应;获取与本地资源相对应的第二签名文件;比对所述第一签名文件与所述第二签名文件是否相同;若不相同,则判定所述应用需要更新资源。Further, the determining whether the application needs to update the resource comprises: acquiring a first signature file from a server, where the first signature file corresponds to a newly released resource on the server; and acquiring a corresponding to the local resource Two signature files; comparing whether the first signature file and the second signature file are the same; if not, determining that the application needs to update resources.
进一步地,所述处理器82还执行以下操作:对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件;比对所述第三签名文件与所述第一签名文件是否相同;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。Further, the processor 82 further performs an operation of performing signature processing on the update information acquired from the server to obtain a third signature file, and comparing the third signature file with the first signature file. Whether they are the same; if they are the same, performing the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter.
进一步地,所述更新类型包括强制更新和静默更新,所述根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源包括:识别设定的更新类型;若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。Further, the update type includes a forced update and a silent update, and the updating the resource in the application according to the downloaded resource update package and the set update type comprises: identifying a set update type; if the update The type is a forced update, and the resources in the application are replaced according to the obtained resource update package.
进一步地,所述处理器82还执行以下操作:若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中;若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。Further, the processor 82 further performs the following operations: if the update type is a silent update, save the obtained resource update package to the silent update table of the application; if it is detected that the application in the terminal is started again Replacing resources in the application according to the resource update package.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the terminal and the unit described above can be referred to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。例如,以上所描述的装置设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置设备或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided by the present application, it should be understood that the disclosed terminal and method may be implemented in other manners. For example, the device device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined. Or it can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device device or unit, or an electrical, mechanical or other form of connection.
本领域普通技术人员可以理解实现上述实施例的方法的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。并且,本发明上述实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。A person skilled in the art can understand that all or part of the steps of implementing the method of the foregoing embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium. The storage medium mentioned above may be a read only memory, a magnetic disk or an optical disk or the like. Moreover, the steps in the method of the foregoing embodiment of the present invention may be sequentially adjusted, merged, and deleted according to actual needs.
本发明实施例终端中的单元可以根据实际需要进行合并、划分和删减。The units in the terminal in the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理器中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processor, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U
盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access
Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: U
Disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access
A variety of media that can store program code, such as a memory, a disk, or an optical disk.
以上为发明的优选实施例,而非对发明做任何形式上的限制。本领域的技术人员可在上述实施例的基础上施以各种等同的更改和改进,凡在权利要求范围内所做的等同变化或修饰,均应落入发明的包含范围之内。The above is a preferred embodiment of the invention, and is not intended to limit the invention in any way. A person skilled in the art can make various equivalent modifications and improvements to the above-described embodiments, and equivalent changes or modifications made within the scope of the claims should fall within the scope of the invention.
Claims (20)
- 一种资源更新的方法,其特征在于,包括: A method for updating a resource, comprising:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;If it is detected that the application in the terminal is started, determine whether the application needs to update the resource;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;If the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;Acquiring, according to the preset update parameter, a local parameter corresponding to the preset update parameter;判断所述本地参数是否在所述预设更新参数的范围之内;Determining whether the local parameter is within the range of the preset update parameter;若是,根据所述资源下载地址下载对应的资源更新包;If yes, download the corresponding resource update package according to the resource download address;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。 The resources in the application are updated according to the downloaded resource update package and the set update type.
- 如权利要求1所述的方法,其特征在于,所述判断所述应用是否需要更新资源具体包括:The method of claim 1, wherein the determining whether the application needs to update a resource specifically includes:从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应;Obtaining a first signature file from a server, where the first signature file corresponds to a newly released resource on the server;获取与本地资源相对应的第二签名文件;Obtaining a second signature file corresponding to the local resource;比对所述第一签名文件与所述第二签名文件是否相同;Aligning whether the first signature file and the second signature file are the same;若不相同,则判定所述应用需要更新资源。If not, it is determined that the application needs to update resources.
- 如权利要求2所述的方法,其特征在于,所述方法还包括:The method of claim 2, wherein the method further comprises:对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件;Performing signature processing on the update information acquired from the server to obtain a third signature file;比对所述第三签名文件与所述第一签名文件是否相同;Aligning whether the third signature file is the same as the first signature file;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。If they are the same, the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter is performed.
- 如权利要求1所述的方法,其特征在于,所述更新类型包括强制更新和静默更新,所述根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源具体包括:The method of claim 1, wherein the update type comprises a forced update and a silent update, and the updating the resource in the application according to the downloaded resource update package and the set update type comprises:识别设定的更新类型;Identify the type of update set;若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。If the update type is a forced update, the resources in the application are replaced according to the acquired resource update package.
- 如权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, wherein the method further comprises:若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中;If the update type is a silent update, save the obtained resource update package to the silent update table of the application;若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。If it is detected that the application in the terminal is started again, the resources in the application are replaced according to the resource update package.
- 一种终端,其特征在于,包括:A terminal, comprising:第一判断单元,用于若检测到终端中的应用被启动,判断所述应用是否需要更新资源;a first determining unit, configured to determine, if the application in the terminal is started, whether the application needs to update resources;第一获取单元,用于若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;a first acquiring unit, configured to: when the application needs to update a resource, obtain update information related to the application from a server, where the update information includes a preset update parameter, and a resource download address;第二获取单元,用于根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;a second acquiring unit, configured to acquire, according to the preset update parameter, a local parameter corresponding to the preset update parameter;第二判断单元,用于判断所述本地参数是否在所述预设更新参数的范围之内;a second determining unit, configured to determine whether the local parameter is within a range of the preset update parameter;下载单元,用于若是,根据所述资源下载地址下载对应的资源更新包;a downloading unit, configured to download a corresponding resource update package according to the resource download address;更新单元,用于根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。And an updating unit, configured to update resources in the application according to the downloaded resource update package and the set update type.
- 如权利要求6所述的终端,其特征在于,所述第一判断单元具体包括:The terminal according to claim 6, wherein the first determining unit specifically comprises:第三获取单元,用于从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应;a third obtaining unit, configured to acquire a first signature file from a server, where the first signature file corresponds to a newly released resource on the server;第四获取单元,用于获取与本地资源相对应的第二签名文件;a fourth acquiring unit, configured to acquire a second signature file corresponding to the local resource;第一比对单元,用于比对所述第一签名文件与所述第二签名文件是否相同;a first comparison unit, configured to compare whether the first signature file and the second signature file are the same;判定单元,用于若不相同,则判定所述应用需要更新资源。The determining unit is configured to determine that the application needs to update the resource if they are not the same.
- 如权利要求7所述的终端,其特征在于,所述终端还包括:The terminal according to claim 7, wherein the terminal further comprises:签名单元,用于对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件;a signing unit, configured to perform signature processing on the update information acquired from the server to obtain a third signature file;第二比对单元,用于比对所述第三签名文件与所述第一签名文件是否相同;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。a second comparison unit, configured to compare whether the third signature file and the first signature file are the same; if they are the same, performing local parameters corresponding to the preset update parameter according to the preset update parameter A step of.
- 如权利要求1所述的终端,其特征在于,所述更新类型包括强制更新和静默更新,所述更新单元具体包括:The terminal according to claim 1, wherein the update type includes a forced update and a silent update, and the update unit specifically includes:识别单元,用于识别设定的更新类型;An identification unit for identifying a set update type;第一替换单元,用于若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。And a first replacement unit, configured to replace, when the update type is a mandatory update, a resource in the application according to the acquired resource update package.
- 如权利要求9所述的终端,其特征在于,所述更新单元还包括:The terminal according to claim 9, wherein the updating unit further comprises:保存单元,用于若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中;a saving unit, configured to save the obtained resource update package to the silent update table of the application if the update type is a silent update;第二替换单元,用于若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。And a second replacement unit, configured to replace, when the application in the terminal is started again, the resource in the application according to the resource update package.
- 一种计算机可读存储介质,其特征在于,所述存储介质有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行以实现以下步骤:A computer readable storage medium, characterized in that the storage medium has one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;If it is detected that the application in the terminal is started, determine whether the application needs to update the resource;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;If the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;Acquiring, according to the preset update parameter, a local parameter corresponding to the preset update parameter;判断所述本地参数是否在所述预设更新参数的范围之内;Determining whether the local parameter is within the range of the preset update parameter;若是,根据所述资源下载地址下载对应的资源更新包;If yes, download the corresponding resource update package according to the resource download address;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。The resources in the application are updated according to the downloaded resource update package and the set update type.
- 如权利要求11所述的计算机可读存储介质,其特征在于,所述判断所述应用是否需要更新资源时包括以下步骤:The computer readable storage medium according to claim 11, wherein the determining whether the application needs to update a resource comprises the following steps:从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应;Obtaining a first signature file from a server, where the first signature file corresponds to a newly released resource on the server;获取与本地资源相对应的第二签名文件;Obtaining a second signature file corresponding to the local resource;比对所述第一签名文件与所述第二签名文件是否相同;Aligning whether the first signature file and the second signature file are the same;若不相同,则判定所述应用需要更新资源。If not, it is determined that the application needs to update resources.
- 如权利要求12所述的计算机可读存储介质,其特征在于,所述一个或者一个以上程序还可被所述一个或者一个以上的处理器执行以实现以下步骤:The computer readable storage medium of claim 12, wherein the one or more programs are further executable by the one or more processors to implement the following steps:对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件;Performing signature processing on the update information acquired from the server to obtain a third signature file;比对所述第三签名文件与所述第一签名文件是否相同;Aligning whether the third signature file is the same as the first signature file;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。If they are the same, the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter is performed.
- 如权利要求11所述的计算机可读存储介质,其特征在于,所述更新类型包括强制更新和静默更新,所述根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源包括以下步骤:The computer readable storage medium of claim 11, wherein the update type comprises a forced update and a silent update, the updating of the resource update package according to the downloaded update type in the application Resources include the following steps:识别设定的更新类型;;Identify the type of update set;若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。If the update type is a forced update, the resources in the application are replaced according to the acquired resource update package.
- 如权利要求14所述的计算机可读存储介质,其特征在于,所述一个或者一个以上程序还可被所述一个或者一个以上的处理器执行以实现以下步骤:The computer readable storage medium of claim 14, wherein the one or more programs are further executable by the one or more processors to implement the following steps:若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中;If the update type is a silent update, save the obtained resource update package to the silent update table of the application;若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。If it is detected that the application in the terminal is started again, the resources in the application are replaced according to the resource update package.
- 一种资源更新设备,其特征在于,包括存储器及处理器;A resource updating device, comprising: a memory and a processor;所述存储器用于存储指令;The memory is for storing instructions;所述处理器读取所述存储器中的指令并根据所述指令执行以下操作:The processor reads an instruction in the memory and performs the following operations in accordance with the instruction:若检测到终端中的应用被启动,判断所述应用是否需要更新资源;If it is detected that the application in the terminal is started, determine whether the application needs to update the resource;若所述应用需要更新资源,从服务器中获取与所述应用相关的更新信息,所述更新信息包括预设更新参数、及资源下载地址;If the application needs to update the resource, obtain update information related to the application from the server, where the update information includes a preset update parameter and a resource download address;根据所述预设更新参数获取与所述预设更新参数相对应的本地参数;Acquiring, according to the preset update parameter, a local parameter corresponding to the preset update parameter;判断所述本地参数是否在所述预设更新参数的范围之内;Determining whether the local parameter is within the range of the preset update parameter;若是,根据所述资源下载地址下载对应的资源更新包;If yes, download the corresponding resource update package according to the resource download address;根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源。The resources in the application are updated according to the downloaded resource update package and the set update type.
- 如权利要求16所述的资源更新设备,其特征在于,所述判断所述应用是否需要更新资源包括:The resource update device according to claim 16, wherein the determining whether the application needs to update the resource comprises:从服务器上获取第一签名文件,所述第一签名文件与所述服务器上最新发布的资源相对应;Obtaining a first signature file from a server, where the first signature file corresponds to a newly released resource on the server;获取与本地资源相对应的第二签名文件;Obtaining a second signature file corresponding to the local resource;比对所述第一签名文件与所述第二签名文件是否相同;Aligning whether the first signature file and the second signature file are the same;若不相同,则判定所述应用需要更新资源。If not, it is determined that the application needs to update resources.
- 如权利要求17所述的资源更新设备,其特征在于,所述处理器还执行以下操作:The resource update device according to claim 17, wherein said processor further performs the following operations:对从所述服务器上获取的所述更新信息进行签名处理以得到第三签名文件;Performing signature processing on the update information acquired from the server to obtain a third signature file;比对所述第三签名文件与所述第一签名文件是否相同;Aligning whether the third signature file is the same as the first signature file;若相同,执行根据所述预设更新参数获取与所述预设更新参数相对应的本地参数的步骤。If they are the same, the step of acquiring a local parameter corresponding to the preset update parameter according to the preset update parameter is performed.
- 如权利要求16所述的资源更新设备,其特征在于,所述更新类型包括强制更新和静默更新,所述根据下载的所述资源更新包与设定的更新类型更新所述应用中的资源包括:The resource update device according to claim 16, wherein the update type comprises a forced update and a silent update, and the updating the resource in the application according to the downloaded resource update package and the set update type includes :识别设定的更新类型;Identify the type of update set;若所述更新类型为强制更新,根据所述获取的资源更新包替换所述应用中的资源。If the update type is a forced update, the resources in the application are replaced according to the acquired resource update package.
- 如权利要求19所述的资源更新设备,其特征在于,所述处理器还执行以下操作:A resource update device according to claim 19, wherein said processor further performs the following operations:若所述更新类型为静默更新,保存获取的所述资源更新包至所述应用的静默更新表中;If the update type is a silent update, save the obtained resource update package to the silent update table of the application;若检测到终端中的应用再次被启动,根据所述资源更新包替换所述应用中的资源。If it is detected that the application in the terminal is started again, the resources in the application are replaced according to the resource update package.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611236537.3 | 2016-12-28 | ||
CN201611236537.3A CN106648787A (en) | 2016-12-28 | 2016-12-28 | Resource updating method and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018120429A1 true WO2018120429A1 (en) | 2018-07-05 |
Family
ID=58832218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/076521 WO2018120429A1 (en) | 2016-12-28 | 2017-03-14 | Resource update method, terminal, computer readable storage medium and resource update device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106648787A (en) |
WO (1) | WO2018120429A1 (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110297647A (en) * | 2019-05-29 | 2019-10-01 | 福建天泉教育科技有限公司 | A kind of front end engineering updates the method and terminal of npm packet |
CN111142949A (en) * | 2019-12-26 | 2020-05-12 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN112035132A (en) * | 2019-05-15 | 2020-12-04 | 北京京东尚科信息技术有限公司 | Application language switching method and device |
CN112799955A (en) * | 2021-02-08 | 2021-05-14 | 腾讯科技(深圳)有限公司 | Model change detection method and device, storage medium and electronic equipment |
CN112913267A (en) * | 2018-09-25 | 2021-06-04 | 深圳市欢太科技有限公司 | Resource processing method, electronic device, and computer-readable storage medium |
CN115309431A (en) * | 2022-09-29 | 2022-11-08 | 荣耀终端有限公司 | Parameter updating method, readable medium and electronic equipment |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107315606A (en) | 2017-06-14 | 2017-11-03 | 北京小米移动软件有限公司 | Using update method and device |
CN109787802B (en) * | 2017-11-15 | 2022-04-29 | 阿里巴巴集团控股有限公司 | Resource operation method and console |
CN108182092A (en) * | 2017-12-13 | 2018-06-19 | 广州视源电子科技股份有限公司 | Method and device for updating application program resource display |
CN107844315B (en) * | 2017-12-27 | 2021-02-09 | 北京酷我科技有限公司 | Strategy for upgrading app theme skin in Android |
CN108491216B (en) * | 2018-03-05 | 2021-07-13 | 北京指掌易科技有限公司 | Method for installing and upgrading non-sensory application of Android system |
CN108845816B (en) * | 2018-06-22 | 2021-09-10 | 平安科技(深圳)有限公司 | Application program updating method, system, computer device and storage medium |
CN111078245A (en) * | 2019-10-12 | 2020-04-28 | 上海商米科技集团股份有限公司 | Application silence updating method and device |
CN110990038B (en) * | 2019-11-29 | 2023-08-22 | 中化信息技术有限公司 | Method, apparatus, electronic device and medium for applying local update |
CN113590237A (en) * | 2020-04-30 | 2021-11-02 | 安徽华米信息科技有限公司 | Resource updating method, device and equipment |
CN112165512B (en) * | 2020-09-08 | 2023-09-26 | 深圳市贰陆陆科技有限公司 | File release method and device, terminal equipment and storage medium |
CN115913947B (en) * | 2022-11-09 | 2024-12-06 | 湖北盛天网络技术股份有限公司 | Resource updating method, device and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1763713A (en) * | 2004-10-22 | 2006-04-26 | 华为技术有限公司 | Mobile terminal software edition updating method |
CN101026850A (en) * | 2007-03-09 | 2007-08-29 | 华为技术有限公司 | Mobileterminal software autmatic upgrading method and system, mobile terminal and software management server |
CN101860853A (en) * | 2010-06-09 | 2010-10-13 | 中兴通讯股份有限公司 | Software upgrading method and device |
US9075568B1 (en) * | 2012-03-21 | 2015-07-07 | Amazon Technologies, Inc. | Dynamic device skins |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103455343A (en) * | 2013-07-22 | 2013-12-18 | 小米科技有限责任公司 | Method and device for updating application programs |
CN105743984A (en) * | 2016-03-11 | 2016-07-06 | 中国建设银行股份有限公司 | Method, device and system for automatically updating mobile application |
-
2016
- 2016-12-28 CN CN201611236537.3A patent/CN106648787A/en active Pending
-
2017
- 2017-03-14 WO PCT/CN2017/076521 patent/WO2018120429A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1763713A (en) * | 2004-10-22 | 2006-04-26 | 华为技术有限公司 | Mobile terminal software edition updating method |
CN101026850A (en) * | 2007-03-09 | 2007-08-29 | 华为技术有限公司 | Mobileterminal software autmatic upgrading method and system, mobile terminal and software management server |
CN101860853A (en) * | 2010-06-09 | 2010-10-13 | 中兴通讯股份有限公司 | Software upgrading method and device |
US9075568B1 (en) * | 2012-03-21 | 2015-07-07 | Amazon Technologies, Inc. | Dynamic device skins |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112913267A (en) * | 2018-09-25 | 2021-06-04 | 深圳市欢太科技有限公司 | Resource processing method, electronic device, and computer-readable storage medium |
CN112913267B (en) * | 2018-09-25 | 2023-01-31 | 深圳市欢太科技有限公司 | Resource processing method, device, terminal, server and readable storage medium |
CN112035132A (en) * | 2019-05-15 | 2020-12-04 | 北京京东尚科信息技术有限公司 | Application language switching method and device |
CN110297647A (en) * | 2019-05-29 | 2019-10-01 | 福建天泉教育科技有限公司 | A kind of front end engineering updates the method and terminal of npm packet |
CN110297647B (en) * | 2019-05-29 | 2023-12-01 | 福建天泉教育科技有限公司 | Method and terminal for updating npm packet by front-end engineering |
CN111142949A (en) * | 2019-12-26 | 2020-05-12 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN111142949B (en) * | 2019-12-26 | 2022-03-25 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN112799955A (en) * | 2021-02-08 | 2021-05-14 | 腾讯科技(深圳)有限公司 | Model change detection method and device, storage medium and electronic equipment |
CN112799955B (en) * | 2021-02-08 | 2023-09-26 | 腾讯科技(深圳)有限公司 | Method and device for detecting model change, storage medium and electronic equipment |
CN115309431A (en) * | 2022-09-29 | 2022-11-08 | 荣耀终端有限公司 | Parameter updating method, readable medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN106648787A (en) | 2017-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018120429A1 (en) | Resource update method, terminal, computer readable storage medium and resource update device | |
WO2019114262A1 (en) | User interface loading method, smart television and computer-readable storage medium | |
WO2019100531A1 (en) | Digital signature generation method and device thereof, verification method and device thereof, and storage medium | |
WO2015035777A1 (en) | Software upgrade method and system for mobile terminal | |
WO2018120457A1 (en) | Data processing method, apparatus, device, and computer readable storage medium | |
WO2019019378A1 (en) | Service processing method and apparatus, adapter and computer-readable storage medium | |
WO2018058919A1 (en) | Identification information generating method, apparatus, device, and computer readable storage medium | |
WO2019061612A1 (en) | Loan product promotion method and apparatus, and computer-readable storage medium | |
WO2019080247A1 (en) | Method, apparatus and device for generating insurance policy approval, and computer readable storage medium | |
WO2017054592A1 (en) | Interface display method and terminal | |
WO2017084302A1 (en) | Method for playing boot video of a display terminal and display terminal | |
WO2018082482A1 (en) | Network sharing method, and method and system for accessing network | |
WO2018149190A1 (en) | Component debugging method, device and apparatus, and computer readable storage medium | |
WO2015158219A1 (en) | Remote debugging method and apparatus for mobile terminal | |
WO2019196213A1 (en) | Interface test method, apparatus and device, and computer-readable storage medium | |
WO2018233367A1 (en) | Case registration method and apparatus, terminal, and computer readable storage medium | |
WO2018188342A1 (en) | Method, apparatus and device for generating script file, and computer-readable storage medium | |
WO2018233221A1 (en) | Multi-window sound output method, television, and computer-readable storage medium | |
WO2018227887A1 (en) | Video advertisement delivery method, video advertisement generation method, device, server and readable storage medium | |
WO2019000801A1 (en) | Data synchronization method, apparatus, and device, and computer readable storage medium | |
WO2019000800A1 (en) | Credential preparation method, apparatus, and device and computer readable storage medium | |
WO2017152526A1 (en) | External device automatic mounting and notification control method and system | |
WO2019041851A1 (en) | Home appliance after-sales consulting method, electronic device and computer-readable storage medium | |
WO2018188196A1 (en) | Data version control method, data version controller, device and computer-readable storage medium | |
WO2017032122A1 (en) | Method and apparatus for detecting digital television set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17889098 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.09.2019) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17889098 Country of ref document: EP Kind code of ref document: A1 |