CN107800561B - Resource updating method and device - Google Patents

Resource updating method and device Download PDF

Info

Publication number
CN107800561B
CN107800561B CN201610817523.4A CN201610817523A CN107800561B CN 107800561 B CN107800561 B CN 107800561B CN 201610817523 A CN201610817523 A CN 201610817523A CN 107800561 B CN107800561 B CN 107800561B
Authority
CN
China
Prior art keywords
resource
updated
resources
updating
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610817523.4A
Other languages
Chinese (zh)
Other versions
CN107800561A (en
Inventor
邢尧
洪宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201610817523.4A priority Critical patent/CN107800561B/en
Publication of CN107800561A publication Critical patent/CN107800561A/en
Application granted granted Critical
Publication of CN107800561B publication Critical patent/CN107800561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a resource updating method and device. The method comprises the following steps: acquiring resource information of a first resource; acquiring an updated resource data packet corresponding to the first resource according to the resource information; updating the first resource according to the updated resource data packet; extracting a dependency attribute in the resource information, and judging whether a second resource which has an association relation with the first resource exists according to the dependency attribute; if yes, the second resource is used as a new first resource, the step of obtaining the resource information of the first resource is continuously executed, and if not, the updating is completed. According to the resource updating method and device, all the second resources related to the first resources can be updated after the first resources are updated, the updating packages do not need to be downloaded and updated sequentially one by one, the resource updating speed is effectively improved, and the updating efficiency is high.

Description

Resource updating method and device
Technical Field
The invention relates to the technical field of internet, in particular to a resource updating method and device.
Background
With the rapid development of the internet technology, more and more network applications which can be installed and used on the intelligent terminal appear, and great convenience is brought to the life and work of users. Version updates for web applications are fast and often require a period of time for a user to download new update packages for updates. In a traditional manner, a network application is often divided into resource blocks, each resource block is independent, when the network application is updated, the resource blocks are required to download corresponding update packages respectively, and the update packages are updated one by one in sequence, so that the updating speed is low, and the updating efficiency is low.
Disclosure of Invention
Therefore, it is necessary to provide a resource updating method for solving the problems of slow resource updating speed and low updating efficiency.
In addition, it is necessary to provide a resource updating apparatus for solving the problems of a slow resource updating speed and low updating efficiency.
A resource update method, comprising:
acquiring resource information of a first resource;
acquiring an updated resource data packet corresponding to the first resource according to the resource information;
updating the first resource according to the updated resource data packet;
extracting a dependency attribute in the resource information, and judging whether a second resource which has an association relation with the first resource exists according to the dependency attribute;
if yes, the second resource is used as a new first resource, the step of obtaining the resource information of the first resource is continuously executed, and if not, the updating is completed.
In one embodiment, the obtaining resource information of the first resource includes:
and acquiring the resource version number and the resource identifier of the first resource according to the predefined field.
In one embodiment, the obtaining of the updated resource packet corresponding to the first resource according to the resource information includes:
sending the resource version number and the resource identifier to a server so that the server judges whether the first resource needs to be updated according to the resource identifier and the resource version number, and if so, returning a download address of an update resource packet corresponding to the first resource and a resource version number matched with the update resource packet;
receiving a download address of the updated resource data packet and a resource version number matched with the updated resource data packet;
and downloading the updated resource data packet according to the download address of the updated resource data packet.
In one embodiment, the updating the first resource according to the updated resource data packet includes:
decompressing the updated resource data packet to obtain new resource data;
and covering the new resource data on the first resource according to the resource identifier, and recording a resource version number matched with the updated resource data packet.
In one embodiment, after the step of updating the first resource according to the update resource data packet, the method further includes:
adding a preset updating mark in the first resource;
after the step of extracting the dependency attribute in the resource information and determining whether there is a second resource having an association relationship with the first resource according to the dependency attribute, the method further includes:
if the second resource has the second resource which has the incidence relation with the first resource, judging whether the second resource contains the preset updating mark, if not, taking the second resource as a new first resource, and continuing to execute the step of acquiring the resource information of the first resource.
A resource updating apparatus comprising:
the information acquisition module is used for acquiring resource information of the first resource;
a data packet obtaining module, configured to obtain, according to the resource information, an update resource data packet corresponding to the first resource;
the updating module is used for updating the first resource according to the updating resource data packet;
the judging module is used for extracting the dependency attribute in the resource information and judging whether a second resource which has an association relation with the first resource exists according to the dependency attribute;
and the information acquisition module is further used for taking the second resource as a new first resource and continuously acquiring the resource information of the new first resource if the second resource which has the association relation with the first resource is judged to exist.
In one embodiment, the information obtaining module is further configured to obtain a resource version number and a resource identifier of the first resource according to a predefined field.
In one embodiment, the packet obtaining module includes:
a sending unit, configured to send the resource version number and the resource identifier to a server, so that the server determines whether the first resource needs to be updated according to the resource identifier and the resource version number, and if so, returns a download address of an updated resource packet corresponding to the first resource and a resource version number matched with the updated resource packet;
the receiving unit is used for receiving the download address of the updated resource data packet and the resource version number matched with the updated resource data packet;
and the downloading unit is used for downloading the updated resource data packet according to the downloading address of the updated resource data packet.
In one embodiment, the update module includes:
the decompression unit is used for decompressing the updated resource data packet to obtain new resource data;
and the covering unit is used for covering the new resource data on the first resource according to the resource identifier and recording the resource version number matched with the updated resource data packet.
In one embodiment, the apparatus further comprises:
the adding module is used for adding a preset updating mark in the first resource;
the judging module is further configured to judge whether a second resource having an association relation with the first resource includes the preset update flag;
the information obtaining module is further configured to, if the second resource does not include the preset update flag, take the second resource as a new first resource, and continue to obtain resource information of the new first resource.
According to the resource updating method and device, the resource information of the first resource is obtained, the updating resource data packet corresponding to the first resource is obtained, the first resource is updated according to the updating resource data packet, when the second resource associated with the first resource exists, the second resource is used as the new first resource, the resource information of the new first resource is continuously obtained for updating, all the second resources associated with the first resource can be updated after the first resource is updated, the updating packet updating does not need to be downloaded in sequence one by one, the resource updating speed is effectively improved, and the updating efficiency is high.
Drawings
FIG. 1 is a diagram illustrating an exemplary scenario for implementing a resource update method;
FIG. 2 is a flowchart illustrating a resource update method according to an embodiment;
FIG. 3 is a flowchart illustrating an embodiment of obtaining a resource update package corresponding to a first resource according to resource information;
FIG. 4 is a flowchart illustrating updating a second resource associated with a first resource in one embodiment;
FIG. 5 is a diagram illustrating an exemplary architecture of a resource update apparatus;
FIG. 6 is a diagram illustrating an internal structure of a packet retrieving module according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of an update module according to an embodiment;
fig. 8 is a schematic structural diagram of a resource updating apparatus in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a diagram illustrating an application scenario of a resource updating method in an embodiment. As shown in fig. 1, the terminal 10 and the server 20 may be connected through a network. The terminal 10 acquires the resource information of the first resource, acquires an update resource packet corresponding to the first resource from the server 20 according to the resource information, and updates the first resource according to the acquired update resource packet. After the first resource is updated, the terminal 10 extracts the dependency attribute in the resource information of the first resource, and determines whether there is a second resource associated with the first resource according to the dependency attribute, if so, the second resource is used as a new first resource, and the step of obtaining the resource information of the first resource is continuously executed, and if not, the updating is completed.
As shown in fig. 1, there is provided a resource updating method, including the following steps:
step S210, acquiring resource information of the first resource.
Specifically, the application installed on the terminal may divide the resource into various parts and may divide the resource according to the function modules, for example, the WeChat may divide the corresponding resource according to various function modules such as friend information, chat, friend circle, and the like, but is not limited thereto. The terminal can acquire any resource needing to be updated in the application program as a first resource, and acquire resource information of the first resource, wherein the resource information can include information such as a resource version number, a resource identifier and a dependency attribute corresponding to the first resource.
In one embodiment, the step S210 obtains resource information of the first resource, including: and acquiring the resource version number and the resource identifier of the first resource according to the predefined field.
Specifically, each resource has a corresponding resource version number for indicating the current corresponding version of the resource, the resource identifier may be composed of a string of characters such as a number and a letter, and each divided resource has a corresponding unique resource identifier. The terminal can predefine the field to record the resource version number and the resource identification, and when the application program needs to be updated, the resource version number and the resource identification of the first resource can be obtained according to the predefined field.
Step S220, obtaining an updated resource packet corresponding to the first resource according to the resource information.
Specifically, the terminal may obtain, from the server, an update resource packet corresponding to the first resource according to the obtained resource information of the first resource, and update the first resource.
As shown in fig. 2, in an embodiment, the step S220 of obtaining the updated resource packet corresponding to the first resource according to the resource information includes the following steps:
step S302, sending the resource version number and the resource identifier to the server, so that the server determines whether the first resource needs to be updated according to the resource identifier and the resource version number, and if so, returning a download address of an update resource packet corresponding to the first resource and a resource version number matched with the update resource packet.
Specifically, the terminal may send the acquired resource version number and resource identifier of the first resource to the server. The server receives the resource version number and the resource identification of the first resource sent by the terminal, searches the latest resource version number corresponding to the first resource according to the resource identification, compares the received resource version number with the searched latest resource version number, judges whether the two resource version numbers are consistent, if so, indicates that the first resource is the latest version and does not need to be updated, and if not, indicates that the first resource is not the latest version and needs to be updated. If the first resource needs to be updated, the corresponding updated resource data packet is searched according to the resource identifier, and after the download address of the updated resource data packet is generated, the download address and the resource version number matched with the updated resource data packet are sent to the terminal. If the first resource does not need to be updated, the server can return the information that the first resource is the latest version to the terminal.
Step S304, receiving the download address of the updated resource packet and the resource version number matched with the updated resource packet.
Specifically, if the first resource needs to be updated, the terminal may receive the download address of the updated resource packet returned by the server and the resource version number matched with the updated resource packet, and download the updated resource packet corresponding to the first resource from the server by updating the download address of the resource packet. The terminal can update the first resource according to the downloaded update resource data packet. In other embodiments, the server may encrypt the download address of the update resource packet and the resource version number matched with the update resource packet, and then return the encrypted download address and the resource version number to the terminal, where the terminal needs to decrypt the encrypted download address and the resource version number to obtain the download address of the update resource packet and the resource version number matched with the update resource packet, and then download the update resource packet corresponding to the first resource from the server according to the download address of the update resource packet, so as to ensure the security of resource update.
Step S306, downloading the updated resource data packet according to the download address of the updated resource data packet.
Step S230, updating the first resource according to the updated resource data packet.
Specifically, after downloading the update resource packet corresponding to the first resource from the server, the terminal may update the first resource according to the update resource packet.
Step S240, extracting the dependency attribute in the resource information, and determining whether there is a second resource associated with the first resource according to the dependency attribute, if yes, executing step S250, and if not, executing step S260.
Specifically, the resource information may further include a dependency attribute, where the dependency attribute is used to record a second resource having an association relationship with the first resource, for example, the WeChat divides corresponding resources according to each function module such as friend information, chat, a friend circle, and the like, and if the friend information resource is associated with the chat resource, the chat resource is recorded in the dependency attribute of the friend information resource. If the terminal records other resources, namely a second resource having an association relation with the first resource, in the dependency attribute extracted from the resource information of the first resource, the second resource is used as a new first resource, the step of obtaining the resource information of the first resource is continuously executed, the new first resource is updated until the updated first resource does not have the second resource having the association relation, and the updating success is indicated.
Step S250, the second resource is used as the new first resource, and step S210 is continuously executed.
Specifically, one or more second resources having an association relationship may exist in the first resource, when there are multiple second resources having an association relationship, the multiple second resources may be simultaneously used as new first resources, the resource information of the first resources is acquired at the same time, the update resource packet corresponding to the first resources is acquired according to the resource information, the update step is performed according to the update resource packet, after the update is completed, each new first resource is sequentially traversed, whether the new first resource has the second resource having an association relationship is determined, and so on, until the updated first resource does not have the second resource having an association relationship, the update is completed. For example, if the resource 1 is updated, and it is determined that there are the resources 2, 3, and 4 associated with the resource 1 according to the dependency attribute of the resource 1, the resources 2, 3, and 4 are updated at the same time, and after the update is completed, it is determined whether there is the resource … … having the dependency attribute with the resources 2, 3, and 4 according to the dependency attribute of the resources 2, 3, and 4, respectively, and so on, and the update is completed until there is no resource associated with all the updated resources.
Step S260, the update is completed.
According to the resource updating method, the resource information of the first resource is acquired, the updating resource data packet corresponding to the first resource is acquired, the first resource is updated according to the updating resource data packet, when the second resource associated with the first resource exists, the second resource is used as the new first resource, the resource information of the new first resource is continuously acquired for updating, all the second resources associated with the first resource can be updated after the first resource is updated, the updating packet updating does not need to be downloaded one by one in sequence, the resource updating speed is effectively improved, and the updating efficiency is high.
In addition, when the application program is developed, the resources of each block do not need to be independently divided, the two blocks of resources can be associated, the division programs of the codes are reduced, the reusability of the codes can be increased, and the development cost is saved.
In one embodiment, the step S230 updates the first resource according to the update resource data packet, including the following steps:
(a) and decompressing and updating the resource data packet to obtain new resource data.
Specifically, after downloading the updated resource packet from the server, the terminal may decompress the updated resource packet to obtain new resource data in the updated resource packet, and update the first resource according to the new resource data.
(b) And covering the first resource with the new resource data according to the resource identifier, and recording the resource version number matched with the updated resource data packet.
Specifically, the terminal may cover the first resource with a new resource obtained by decompressing the updated resource packet according to the resource identifier of the first resource, complete the update of the first resource, record the resource version number matched with the updated resource packet, and use the resource version number as the new resource version number of the first resource, so as to detect whether the first resource needs to be updated next time.
In this embodiment, the terminal decompresses the downloaded update resource data packet, updates the first resource, and records the resource version number corresponding to the update resource data packet, so as to facilitate the next detection of whether the first resource needs to be updated, and can update all the second resources associated with the first resource after the first resource is updated, without downloading update packets for updating in sequence one by one, thereby effectively improving the speed of updating the resources, and having high update efficiency.
As shown in fig. 4, in an embodiment, after the step S230 updates the first resource according to the updated resource data packet, the method further includes the following steps:
step S402, adding a preset update flag in the first resource.
Specifically, after the first resource is updated, a preset update mark may be added to the first resource, where the update mark may include a character string such as a number and a letter, and is used to indicate that the first resource is updated.
Step S404, extracting the dependency attribute in the resource information, and determining whether there is a second resource associated with the first resource according to the dependency attribute, if yes, performing step S408, and if not, performing step S406.
Step S406, the update is completed.
Step S408 is to determine whether the second resource includes a predetermined update flag, if yes, step S412 is executed, and if no, step S410 is executed.
Specifically, if the second resource having an association relation with the first resource is determined, it may be further detected whether the second resource includes a preset update flag, if so, it indicates that the second resource has been updated, the second resource may not be processed, and if not, the second resource may be used as a new first resource, the steps of obtaining resource information of the first resource, obtaining an update resource packet corresponding to the first resource according to the resource information, and updating according to the update resource packet are performed. For example, the resource 1 is updated, the resources 2, 3 and 4 having an association relationship with the resource 1 are obtained according to the dependency attribute of the resource 1, whether preset update marks are included in the resources 2, 3 and 4 is judged respectively, the resources not including the update marks are updated simultaneously, whether the resources having an association relationship with the updated resources are included is judged continuously, the updating is performed in a circulating manner until all the updated resources do not have the resources having an association relationship, and the updating is completed.
Step S410, the second resource is used as a new first resource, and the step of obtaining the resource information of the first resource is continuously executed.
In step S412, no processing is performed.
In this embodiment, after the first resource is updated, before all the second resources associated with the first resource are updated, it is determined whether the second resources have the preset update flag, it is not necessary to download update packages for updating in sequence one by one, and it is avoided that the resource version number is repeatedly detected to determine whether the second resources need to be updated, so that the speed of updating the resources is effectively increased, and the updating efficiency is high.
As shown in fig. 5, a resource updating apparatus is provided, which includes an information obtaining module 510, a data packet obtaining module 520, an updating module 530, and a determining module 540.
An information obtaining module 510, configured to obtain resource information of the first resource.
Specifically, the application installed on the terminal may divide the resource into various parts and may divide the resource according to the function modules, for example, the WeChat may divide the corresponding resource according to various function modules such as friend information, chat, friend circle, and the like, but is not limited thereto. The terminal can acquire any resource needing to be updated in the application program as a first resource, and acquire resource information of the first resource, wherein the resource information can include information such as a resource version number, a resource identifier and a dependency attribute corresponding to the first resource.
In an embodiment, the information obtaining module 510 is further configured to obtain a resource version number and a resource identifier of the first resource according to a predefined field.
Specifically, each resource has a corresponding resource version number for indicating the current corresponding version of the resource, the resource identifier may be composed of a string of characters such as a number and a letter, and each divided resource has a corresponding unique resource identifier. The terminal can predefine the field to record the resource version number and the resource identification, and when the application program needs to be updated, the resource version number and the resource identification of the first resource can be obtained according to the predefined field.
A data packet obtaining module 520, configured to obtain an update resource data packet corresponding to the first resource according to the resource information.
Specifically, the terminal may obtain, from the server, an update resource packet corresponding to the first resource according to the obtained resource information of the first resource, and update the first resource.
As shown in fig. 6, in one embodiment, the packet obtaining module 520 includes a sending unit 522, a receiving unit 524, and a downloading unit 526.
The sending unit 522 is configured to send the resource version number and the resource identifier to the server, so that the server determines whether the first resource needs to be updated according to the resource identifier and the resource version number, and if so, returns a download address of an update resource packet corresponding to the first resource and a resource version number matched with the update resource packet.
Specifically, the terminal may send the acquired resource version number and resource identifier of the first resource to the server. The server receives the resource version number and the resource identification of the first resource sent by the terminal, searches the latest resource version number corresponding to the first resource according to the resource identification, compares the received resource version number with the searched latest resource version number, judges whether the two resource version numbers are consistent, if so, indicates that the first resource is the latest version and does not need to be updated, and if not, indicates that the first resource is not the latest version and needs to be updated. If the first resource needs to be updated, the corresponding updated resource data packet is searched according to the resource identifier, and after the download address of the updated resource data packet is generated, the download address and the resource version number matched with the updated resource data packet are sent to the terminal. If the first resource does not need to be updated, the server can return the information that the first resource is the latest version to the terminal.
The receiving unit 524 is configured to receive the download address of the update resource packet and the resource version number matched with the update resource packet.
Specifically, if the first resource needs to be updated, the terminal may receive the download address of the updated resource packet returned by the server and the resource version number matched with the updated resource packet, and download the updated resource packet corresponding to the first resource from the server by updating the download address of the resource packet. The terminal can update the first resource according to the downloaded update resource data packet. In other embodiments, the server may encrypt the download address of the update resource packet and the resource version number matched with the update resource packet, and then return the encrypted download address and the resource version number to the terminal, where the terminal needs to decrypt the encrypted download address and the resource version number to obtain the download address of the update resource packet and the resource version number matched with the update resource packet, and then download the update resource packet corresponding to the first resource from the server according to the download address of the update resource packet, so as to ensure the security of resource update.
The downloading unit 526 is configured to download the updated resource packet according to the download address of the updated resource packet.
An updating module 530, configured to update the first resource according to the updated resource data packet.
Specifically, after downloading the update resource packet corresponding to the first resource from the server, the terminal may update the first resource according to the update resource packet.
The determining module 540 is configured to extract the dependency attribute in the resource information, and determine whether there is a second resource having an association relationship with the first resource according to the dependency attribute.
Specifically, the resource information may further include a dependency attribute, where the dependency attribute is used to record a second resource having an association relationship with the first resource, for example, the WeChat divides corresponding resources according to each function module such as friend information, chat, a friend circle, and the like, and if the friend information resource is associated with the chat resource, the chat resource is recorded in the dependency attribute of the friend information resource. If the terminal records other resources, namely a second resource having an association relation with the first resource, in the dependency attribute extracted from the resource information of the first resource, the second resource is used as a new first resource, the step of obtaining the resource information of the first resource is continuously executed, the new first resource is updated until the updated first resource does not have the second resource having the association relation, and the updating success is indicated.
The information obtaining module 510 is further configured to, if it is determined that there is a second resource that has an association relationship with the first resource, take the second resource as a new first resource, and continue to obtain resource information of the new first resource.
Specifically, one or more second resources having an association relationship may exist in the first resource, when there are multiple second resources having an association relationship, the multiple second resources may be simultaneously used as new first resources, the resource information of the first resources is acquired at the same time, the update resource packet corresponding to the first resources is acquired according to the resource information, the update step is performed according to the update resource packet, after the update is completed, each new first resource is sequentially traversed, whether the new first resource has the second resource having an association relationship is determined, and so on, until the updated first resource does not have the second resource having an association relationship, the update is completed. For example, if the resource 1 is updated, and it is determined that there are the resources 2, 3, and 4 associated with the resource 1 according to the dependency attribute of the resource 1, the resources 2, 3, and 4 are updated at the same time, and after the update is completed, it is determined whether there is the resource … … having the dependency attribute with the resources 2, 3, and 4 according to the dependency attribute of the resources 2, 3, and 4, respectively, and so on, and the update is completed until there is no resource associated with all the updated resources.
According to the resource updating device, the resource information of the first resource is acquired, the updating resource data packet corresponding to the first resource is acquired, the first resource is updated according to the updating resource data packet, when the second resource associated with the first resource exists, the second resource is used as the new first resource, the resource information of the new first resource is continuously acquired for updating, all the second resources associated with the first resource can be updated after the first resource is updated, the updating packet updating does not need to be downloaded in sequence one by one, the resource updating speed is effectively improved, and the updating efficiency is high.
In addition, when the application program is developed, the resources of each block do not need to be independently divided, the two blocks of resources can be associated, the division programs of the codes are reduced, the reusability of the codes can be increased, and the development cost is saved.
As shown in FIG. 7, in one embodiment, the update module 530 includes a decompression unit 532 and an overlay unit 534.
The decompressing unit 532 is configured to decompress the updated resource packet to obtain new resource data.
Specifically, after downloading the updated resource packet from the server, the terminal may decompress the updated resource packet to obtain new resource data in the updated resource packet, and update the first resource according to the new resource data.
And the covering unit 534 is configured to cover the first resource with the new resource data according to the resource identifier, and record a resource version number matched with the updated resource data packet.
Specifically, the terminal may cover the first resource with a new resource obtained by decompressing the updated resource packet according to the resource identifier of the first resource, complete the update of the first resource, record the resource version number matched with the updated resource packet, and use the resource version number as the new resource version number of the first resource, so as to detect whether the first resource needs to be updated next time.
In this embodiment, the terminal decompresses the downloaded update resource data packet, updates the first resource, and records the resource version number corresponding to the update resource data packet, so as to facilitate the next detection of whether the first resource needs to be updated, and can update all the second resources associated with the first resource after the first resource is updated, without downloading update packets for updating in sequence one by one, thereby effectively improving the speed of updating the resources, and having high update efficiency.
As shown in fig. 8, in an embodiment, the resource updating apparatus includes an adding module 550 in addition to the information obtaining module 510, the data packet obtaining module 520, the updating module 530, and the determining module 540.
An adding module 550, configured to add a preset update flag in the first resource.
Specifically, after the first resource is updated, a preset update mark may be added to the first resource, where the update mark may include a character string such as a number and a letter, and is used to indicate that the first resource is updated.
The determining module 540 is further configured to determine whether a second resource exists in the association relationship with the first resource, where the second resource includes a preset update flag.
Specifically, if the second resource having an association relation with the first resource is determined, it may be further detected whether the second resource includes a preset update flag, if so, it indicates that the second resource has been updated, the second resource may not be processed, and if not, the second resource may be used as a new first resource, the steps of obtaining resource information of the first resource, obtaining an update resource packet corresponding to the first resource according to the resource information, and updating according to the update resource packet are performed. For example, the resource 1 is updated, the resources 2, 3 and 4 having an association relationship with the resource 1 are obtained according to the dependency attribute of the resource 1, whether preset update marks are included in the resources 2, 3 and 4 is judged respectively, the resources not including the update marks are updated simultaneously, whether the resources having an association relationship with the updated resources are included is judged continuously, the updating is performed in a circulating manner until all the updated resources do not have the resources having an association relationship, and the updating is completed.
The information obtaining module 510 is further configured to, if the second resource does not include the preset update flag, take the second resource as a new first resource, and continue to obtain resource information of the new first resource.
In this embodiment, after the first resource is updated, before all the second resources associated with the first resource are updated, it is determined whether the second resources have the preset update flag, it is not necessary to download update packages for updating in sequence one by one, and it is avoided that the resource version number is repeatedly detected to determine whether the second resources need to be updated, so that the speed of updating the resources is effectively increased, and the updating efficiency is high.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. A resource update method, comprising:
acquiring resource information of a first resource; the resource information comprises a resource version number, a resource identifier and a dependency attribute corresponding to the first resource; the resource information is divided according to the functional modules of the application programs; in the development process of the application program, resources corresponding to two or more functional modules are correlated, and when friend information resources are correlated with chat resources, the chat resources are recorded in the dependency attributes of the friend information resources;
acquiring an updated resource data packet corresponding to the first resource according to the resource information; updating the first resource according to the updated resource data packet;
extracting a dependency attribute in the resource information, and judging whether a second resource which has an association relation with the first resource exists according to the dependency attribute; the dependency attribute is used for recording a second resource which has an association relation with the first resource; wherein, the first resource has one or more second resources with incidence relation;
if yes, the second resource is used as a new first resource, the step of obtaining the resource information of the first resource is continuously executed, and if not, the updating is finished; when a plurality of second resources with incidence relations exist, simultaneously using the plurality of second resources as new first resources, simultaneously executing the step of acquiring the resource information of the first resources, after the updating is finished, sequentially traversing each new first resource, judging whether the new first resources have the second resources with the incidence relations, and so on until the updated first resources do not have the second resources with the incidence relations, and finishing the updating;
after the step of updating the first resource according to the update resource data packet, the method further includes:
adding a preset updating mark in the first resource;
after the step of extracting the dependency attribute in the resource information and determining whether there is a second resource having an association relationship with the first resource according to the dependency attribute, the method further includes:
if the second resource has the second resource which has the incidence relation with the first resource, judging whether the second resource contains the preset updating mark, if not, taking the second resource as a new first resource, and continuing to execute the step of acquiring the resource information of the first resource.
2. The method for updating resource of claim 1, wherein the obtaining resource information of the first resource comprises:
and acquiring the resource version number and the resource identifier of the first resource according to the predefined field.
3. The method according to claim 2, wherein the obtaining the updated resource packet corresponding to the first resource according to the resource information comprises:
sending the resource version number and the resource identifier to a server so that the server judges whether the first resource needs to be updated according to the resource identifier and the resource version number, and if so, returning a download address of an update resource packet corresponding to the first resource and a resource version number matched with the update resource packet;
receiving a download address of the updated resource data packet and a resource version number matched with the updated resource data packet;
and downloading the updated resource data packet according to the download address of the updated resource data packet.
4. The resource updating method according to claim 3, wherein the updating the first resource according to the updated resource data packet comprises:
decompressing the updated resource data packet to obtain new resource data;
and covering the new resource data on the first resource according to the resource identifier, and recording a resource version number matched with the updated resource data packet.
5. A resource updating apparatus, comprising:
the information acquisition module is used for acquiring resource information of the first resource; the resource information comprises a resource version number, a resource identifier and a dependency attribute corresponding to the first resource; the resource information is divided according to the functional modules of the application programs; in the development process of the application program, resources corresponding to two or more functional modules are correlated, and when friend information resources are correlated with chat resources, the chat resources are recorded in the dependency attributes of the friend information resources;
a data packet obtaining module, configured to obtain, according to the resource information, an update resource data packet corresponding to the first resource;
the updating module is used for updating the first resource according to the updating resource data packet;
the judging module is used for extracting the dependency attribute in the resource information and judging whether a second resource which has an association relation with the first resource exists according to the dependency attribute; the dependency attribute is used for recording a second resource which has an association relation with the first resource; wherein, the first resource has one or more second resources with incidence relation;
the information acquisition module is further configured to, if it is determined that a second resource having an association relationship with the first resource exists, take the second resource as a new first resource, and continue to acquire resource information of the new first resource; when a plurality of second resources with incidence relations exist, simultaneously using the plurality of second resources as new first resources, simultaneously executing to acquire resource information of the first resources, after the updating is completed, sequentially traversing each new first resource, judging whether the new first resources have the second resources with the incidence relations, and so on until the updated first resources do not have the second resources with the incidence relations, and then completing the updating;
the device further comprises:
the adding module is used for adding a preset updating mark in the first resource;
the judging module is further configured to judge whether a second resource having an association relation with the first resource includes the preset update flag;
the information obtaining module is further configured to, if the second resource does not include the preset update flag, take the second resource as a new first resource, and continue to obtain resource information of the new first resource.
6. The apparatus according to claim 5, wherein the information obtaining module is further configured to obtain the resource version number and the resource identifier of the first resource according to predefined fields.
7. The apparatus for updating resource of claim 6, wherein the packet obtaining module comprises:
a sending unit, configured to send the resource version number and the resource identifier to a server, so that the server determines whether the first resource needs to be updated according to the resource identifier and the resource version number, and if so, returns a download address of an updated resource packet corresponding to the first resource and a resource version number matched with the updated resource packet;
the receiving unit is used for receiving the download address of the updated resource data packet and the resource version number matched with the updated resource data packet;
and the downloading unit is used for downloading the updated resource data packet according to the downloading address of the updated resource data packet.
8. The resource updating apparatus according to claim 7, wherein the updating module comprises:
the decompression unit is used for decompressing the updated resource data packet to obtain new resource data;
and the covering unit is used for covering the new resource data on the first resource according to the resource identifier and recording the resource version number matched with the updated resource data packet.
CN201610817523.4A 2016-09-12 2016-09-12 Resource updating method and device Active CN107800561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610817523.4A CN107800561B (en) 2016-09-12 2016-09-12 Resource updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610817523.4A CN107800561B (en) 2016-09-12 2016-09-12 Resource updating method and device

Publications (2)

Publication Number Publication Date
CN107800561A CN107800561A (en) 2018-03-13
CN107800561B true CN107800561B (en) 2021-05-04

Family

ID=61530222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610817523.4A Active CN107800561B (en) 2016-09-12 2016-09-12 Resource updating method and device

Country Status (1)

Country Link
CN (1) CN107800561B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274433A (en) * 2018-11-20 2020-06-12 比亚迪股份有限公司 Method and device for updating voice resource library

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7873959B2 (en) * 2005-02-01 2011-01-18 Microsoft Corporation Publishing the status of and updating firmware components
US20090133014A1 (en) * 2007-11-16 2009-05-21 Nokia Corporation Methods, apparatuses and computer program product for automatic download of software dependencies on installation
JP2011055248A (en) * 2009-09-02 2011-03-17 Fuji Xerox Co Ltd Update-addition controller for software, update-addition control program for software, and composite machine
CN101656739B (en) * 2009-09-25 2012-11-28 金蝶软件(中国)有限公司 Method, system and equipment for updating assembly
CN102262544B (en) * 2010-05-24 2016-06-08 腾讯科技(深圳)有限公司 The method and apparatus of software upgrading
CN102419711A (en) * 2011-11-16 2012-04-18 深圳市佳创视讯技术股份有限公司 Package management system and method for embedded system of digital television receiving terminal
CN103795761A (en) * 2012-11-01 2014-05-14 腾讯科技(深圳)有限公司 Method and system for downloading online game data

Also Published As

Publication number Publication date
CN107800561A (en) 2018-03-13

Similar Documents

Publication Publication Date Title
CN109951435B (en) Equipment identifier providing method and device and risk control method and device
CN110287688B (en) Associated account analysis method and device and computer-readable storage medium
CN109729183B (en) Request processing method, device, equipment and storage medium
CN106649446B (en) Information pushing method and device
CN110445719B (en) Routing table management method, device, equipment and storage medium
CN110851359A (en) Application program testing method and device and server
CN106534268B (en) Data sharing method and device
CN112597138A (en) Data deduplication method and device, computer equipment and computer-readable storage medium
CN113825129A (en) Industrial internet asset mapping method under 5G network environment
CN109698814B (en) Botnet discovery method and botnet discovery device
CN108063685B (en) Log analysis method and device
CN110234082B (en) Addressing method and device of mobile terminal, storage medium and server
CN113535226B (en) Application downloading method, terminal, server, computer device and storage medium
CN108833961B (en) Method, server and system for acquiring flight record data
CN107800561B (en) Resource updating method and device
CN108460116B (en) Search method, search device, computer equipment, storage medium and search system
CN118075345A (en) Information pushing method, device, electronic equipment and computer storage medium
CN109145588A (en) Data processing method and device
CN110706035B (en) Updating effect evaluation method and device, storage medium and electronic equipment
CN109842554B (en) Routing method, device, equipment and storage medium of equipment service
CN115827280A (en) Message processing method and device, electronic equipment and storage medium
CN111159509B (en) Data processing method and related product
CN111667190B (en) Electric power construction grounding monitoring method, device and server
CN110414228B (en) Computer virus detection method and device, storage medium and computer equipment
CN110659490B (en) Malicious sample processing method and device, electronic equipment and storage medium

Legal Events

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