WO2023217086A1 - Resource file updating method and apparatus, and device and readable storage medium - Google Patents

Resource file updating method and apparatus, and device and readable storage medium Download PDF

Info

Publication number
WO2023217086A1
WO2023217086A1 PCT/CN2023/092793 CN2023092793W WO2023217086A1 WO 2023217086 A1 WO2023217086 A1 WO 2023217086A1 CN 2023092793 W CN2023092793 W CN 2023092793W WO 2023217086 A1 WO2023217086 A1 WO 2023217086A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource file
resource
package
original
files
Prior art date
Application number
PCT/CN2023/092793
Other languages
French (fr)
Chinese (zh)
Inventor
赵易峰
Original Assignee
维沃移动通信有限公司
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 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2023217086A1 publication Critical patent/WO2023217086A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application belongs to the field of communication technology, and specifically relates to a resource file updating method, device, equipment and readable storage medium.
  • the server usually treats the new resource file package and the original resource file package used by the application as binary files, obtains the difference resource package corresponding to the new resource file package and the original resource file package through a differential algorithm, and then downloads it to the electronic device
  • This differential resource pack updates old resource files. Since binary files usually change in large areas and irregularly, the amount of data in the obtained differential resource package is usually large. As a result, the transmission of differential resource packets consumes more network traffic.
  • the purpose of the embodiments of the present application is to provide a resource file updating method, device, equipment and readable storage medium, which can solve the problem that the server needs to perform a large amount of calculations, resulting in large power consumption of the server.
  • embodiments of the present application provide a resource file updating method.
  • the method includes: an electronic device obtains a first resource file package, and obtains a third resource file package based on the first resource file package and the original resource package in the electronic device.
  • Two resource file packages wherein, the above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file package includes: at least one difference resource file, and a first parameter indicating whether each first resource file has changed.
  • Instruction information the above-mentioned first resource file is used to update the original resource file in the original resource package, and one differential resource file corresponds to one first resource file; each differential resource file is used to indicate: the corresponding first resource file is relative to the original resource Difference information for files.
  • inventions of the present application provide a resource file updating device.
  • the device includes: an acquisition module and a determination module, wherein: the above-mentioned acquisition module is used to acquire the first resource file package; the above-mentioned determination module is used to obtain the first resource file package according to the acquisition module.
  • the first resource file package obtained by the module and the original resource package in the electronic device obtain a second resource file package; wherein the above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file package includes : At least one differential resource file, first indication information indicating whether each first resource file has changed; the above-mentioned first resource file is used to update the original resource file in the original resource package; one differential resource file corresponds to one first resource file ; Each differential resource file is used to indicate: the difference information of the corresponding first resource file relative to the original resource file.
  • embodiments of the present application provide a resource file updating method, which method includes: the server generates a first resource file package based on the second resource file package, and the electronic device sends the first resource file package; wherein, The above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file is used to update the original resource file in the electronic device; the above-mentioned first resource file package includes: at least one difference resource file, a first indication Information; the above-mentioned first indication information is used to indicate whether each first resource file has changed.
  • inventions of the present application provide a resource file updating device.
  • the device includes: a generating module and a sending module, wherein: the above-mentioned generating module is used to generate a first resource file package according to the second resource file package; the above-mentioned A sending module, configured to send the first resource file package generated by the generation module to the electronic device; wherein the above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file is used to update the original resources in the electronic device file; the above-mentioned first resource file package includes: at least one difference resource file and first indication information; the above-mentioned first indication information is used to indicate whether at least one first resource file has changed.
  • inventions of the present application provide a server.
  • the server includes a processor and a memory.
  • the memory stores programs or instructions that can be run on the processor.
  • the program or instructions are executed by the processor.
  • inventions of the present application provide an electronic device.
  • the electronic device includes a processor and a memory.
  • the memory stores programs or instructions that can be run on the processor.
  • the programs or instructions are processed by the processor.
  • the processor is executed, the steps of the method as described in the third aspect are implemented.
  • embodiments of the present application provide a readable storage medium that stores programs or instructions. When the programs or instructions are executed by a processor, the method or implementation described in the first aspect is implemented. The steps of the method as described in the third aspect.
  • inventions of the present application provide a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the first aspect. the method described.
  • embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
  • the electronic device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
  • the above-mentioned second resource file package includes: N first resource files
  • the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each of the first resource files has changed;
  • the above-mentioned first resource file is used to update the original resource file in the original resource package.
  • the electronic device can obtain at least one differential resource file, and restore each first resource file through the at least one differential resource file and the original resource file in the original resource package based on the indication information indicating whether each first resource file has changed.
  • the first resource file does not need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby increasing the upgrade speed of resource files. .
  • Figure 1 is one of the flow charts of the resource file updating method provided by the embodiment of the present application.
  • Figure 2 is a schematic diagram of a resource file updating method provided by an embodiment of the present application.
  • Figure 3 is a second schematic diagram of the resource file updating method provided by the embodiment of the present application.
  • Figure 4 is the second flow chart of the resource file updating method provided by the embodiment of the present application.
  • Figure 5 is a third schematic diagram of the resource file updating method provided by the embodiment of the present application.
  • Figure 6 is a flow chart of the interaction method provided by the embodiment of the present application.
  • Figure 7 is one of the structural schematic diagrams of a resource file updating device according to an embodiment of the present application.
  • Figure 8 is a second structural schematic diagram of a resource file updating device according to an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
  • Figure 11 is a schematic diagram of the hardware structure of a server provided by an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,” “second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
  • FIG. 1 shows a flow chart of the resource file updating method provided by an embodiment of the present application.
  • the resource file updating method provided by the embodiment of the present application may include the following steps 201 and 202:
  • Step 201 The electronic device obtains the first resource file package.
  • the above-mentioned first resource file package includes:
  • At least one differential resource file At least one differential resource file
  • First indication information indicating whether each first resource file has changed.
  • one difference resource file corresponds to one first resource file
  • each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  • the above-mentioned first resource file is a new resource file used to update the original resource file of the electronic device.
  • the above-mentioned original resource files are resource files that have not been updated in the electronic device.
  • the original resource file may be a system resource file of the electronic device; or, it may be a resource file of an application in the electronic device.
  • the original resource file may be an unupdated application resource file currently used by application 1 in the electronic device.
  • the above-mentioned first indication information includes: a file identifier of each first resource file, a unique path identifier (URL) of each first resource file, and a change mark of each first resource file.
  • the change mark is used to indicate whether the first resource file has changed.
  • the value of the change flag can be represented by a logical value of true (that is, true) and a logical value of false (that is, false); or, the value of the above-mentioned change mark can be represented by 0 and 1.
  • the value of the change flag of resource file 1 is true, it means that resource file 1 has changed, and the value of the change flag of resource file 2 is false, which means that resource file 2 has not changed (that is, it is not related to the resource file 2).
  • File 2 pairs The corresponding original resource files are the same); for example, the value of the change flag of resource file 1 is 1, indicating that the resource file 1 has changed, and the value of the change flag of resource file 2 is 0, indicating that the first resource file has not changed. Variety.
  • the file identification of each first resource file can be represented by an item (ie, Item), where one item includes: a URL of the first resource file, and a change mark of the first resource file.
  • the first instruction information includes: project 1, project 2 and project 3 in sequence, where project 1 includes: a unique path identifier and a change mark of the resource file, and project 2 includes: the resource file 2 unique path identifiers and change tags.
  • Project 3 includes: 3 unique path identifiers and change tags for resource files.
  • the path of the resource file identified by item 1 is A
  • the path of the resource file identified by item 2 is B
  • the path of the resource file identified by item 3 is C.
  • A, B, and C are only used to represent unique path identifiers and do not represent actual unique path identifiers.
  • the above items may include multiple items.
  • Figure 2 takes three as an example for illustration.
  • the above items are used to identify the corresponding resource file, the above unique path identifier is used to query the corresponding resource file, and the above change mark indicates whether the corresponding resource file has changed.
  • the change mark is 1 , indicating that the resource file has changed, the change mark is 0, indicating that the resource file has not changed.
  • the electronic device may receive the first resource file package sent by the server.
  • Step 202 The electronic device obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
  • the above-mentioned second resource file package includes: N first resource files, N is a positive integer;
  • the above-mentioned original resource package is a resource package that has not been updated or needs to be updated, and the original resource package includes the above-mentioned original resource file.
  • the first resource file is used to update the original resource file in the original resource package.
  • the electronic device can restore each first resource file through the above-mentioned at least one differential resource file and the original resource file in the original resource package according to the first instruction information corresponding to each first resource file. (i.e. new resource file).
  • the electronic device after the electronic device obtains the second resource file package, it can update the original resource file package in the electronic device according to the second resource file package.
  • the electronic device when updating the original resource file package of the first application in the electronic device, can replace the original resource file of the first application with the second resource file package, thereby realizing the update of the first application. Upgrade of original resource file package.
  • the electronic device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
  • the above-mentioned second resource file package includes: N first resource files
  • the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each of the first resource files has changed;
  • the above-mentioned first resource file is used to update the original resource file in the original resource package.
  • the electronic device can obtain at least one differential resource file, and restore each first resource file through the at least one differential resource file and the original resource file in the original resource package based on the indication information indicating whether each first resource file has changed.
  • the first resource file does not need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby increasing the upgrade speed of resource files. .
  • the above-mentioned first resource file package further includes: verification information.
  • the electronic device detects that the verification information in the first resource file package is correct, based on the obtained The first resource file package and the original resource package are restored to obtain at least one new resource file. In this way, it can be ensured that safe and reliable resource files are restored without tampering with the information in the obtained first resource file package. Ensure operational safety.
  • step 202 may include the following step 202a or step 202b:
  • Step 202a If the instruction information indicates that the target first resource file has not changed, use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file.
  • Step 202b When the instruction information indicates that the target first resource file has changed, obtain the target first resource file based on the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file. resource.
  • the target first resource file is one or more resource files among the N first resource files.
  • the old (original) resource file individual can be taken out from the original resource package according to the URL of the first resource file, and then combined with the first resource file package, the first resource file
  • the individual difference information recorded in the difference resource file corresponding to the file is restored to the new resource file individual (i.e. the first resource file); for the unchanged first resource, it can be taken out from the old resource package according to the URL of the first resource file. its old resource file individual, and use the old resource file individual as a new resource file individual (ie, the first resource file).
  • the new resource file 4 can be restored according to the difference resource file corresponding to the resource file 4 and the corresponding original resource file.
  • the new resource file 5 is a new resource file that has not changed, then the original resource file corresponding to the resource file 5 is directly used as the new resource file 5 .
  • the electronic device can perform differential restoration processing on the original resource file corresponding to the first resource file and the differential resource file corresponding to the first resource file to obtain a new resource file individual.
  • the new resource file package (i.e. the second resource file package) used to update the original resource file package of the application is often a replacement or addition or deletion of some small resource files, rather than large-scale and irregular changes.
  • the electronic device can restore the changed new resource file by combining its old resource file and differential resource file to obtain the new resource file, and directly take out the corresponding old resource file from the old resource package for the new resource file that has not changed. Resource files as new resource files, thereby improving the efficiency of obtaining new resource files.
  • the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
  • step 202 may include the following step 202c:
  • Step 202c The electronic device obtains the above-mentioned N first resource files in sorting order based on at least one differential resource file and the original resource files in the original resource package.
  • the above sorting order is an order set by the user.
  • the user can sort at least one resource file so that the first resource file that needs to be accessed frequently is ranked first, or the above sorting order is the system default sorting order.
  • the electronic device can restore each first resource file in sequence according to the above sorting order.
  • the first device can restore each first resource file one by one according to the sort order of the N first resource files. Since the first resource file in the order will be restored first, it will be stored in the front position in the new resource file package after being restored. Therefore, resource files that need to be accessed frequently can be ranked first. In this way, electronic equipment When you run the application later, you can quickly access these resource files that need to be accessed frequently, so the performance of accessing resources will be improved.
  • step 202c may include the following step 202c1 or step 202c2:
  • Step 202c1 For the i-th position in the sorting order: if the first resource file corresponding to the i-th position has not changed, use the original resource file corresponding to the i-th position as the first resource corresponding to the i-th position. document;
  • Step 202c2 For the i-th position in the sorting order: when the first resource file corresponding to the i-th position changes, obtain the first resource corresponding to the i-th position based on the difference resource file corresponding to the i-th position and the original resource file. document.
  • the above-mentioned first indication information may also include the above-mentioned sequence information.
  • the first instruction information includes the above-mentioned sequence information
  • the first instruction information may also be called sequence control information.
  • the electronic device can determine the sorting order of the first resource file according to the sorting order of the at least one item. It should be noted that the explanation of the project can be found above and will not be repeated here.
  • the electronic device can traverse the N projects according to the sort order of the N projects, and obtain the first resource file identified by the project (that is, corresponding to it) according to the URL under each project.
  • the sorting order of three items that respectively indicate (identify) new resource files is Item4, Item5 and Item6, where Item4 indicates new resource file 4, Item5 indicates new resource file 5, and Item6 indicates new resource file 6.
  • the electronic device can sequentially obtain the new resource file 4, the new resource file 5, and the new resource file 6 according to the URLs of the resource files indicated by Item4, Item5, and Item6.
  • the electronic device can obtain each new resource file in a certain order, thereby improving the flexibility of resource file upgrades.
  • the above-mentioned first resource file package includes: index difference information
  • the above-mentioned index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file.
  • the resource file updating method provided by the embodiment of the present application further includes the following step 203:
  • Step 203 The electronic device obtains the index of each first resource file based on the index difference information and the index of the original resource file.
  • the above-mentioned second resource file package includes: an index of each first resource file.
  • the electronic device decompresses the index in the original resource file package and the index difference information in the first resource file package, and performs differential restoration on each index obtained after decompression to obtain the index of each first resource file. index.
  • the electronic device can differentially restore the index difference information to obtain new index information of the second resource file package without having to receive new index information from the server, thereby saving the amount of data consumed in resource file transmission.
  • the electronic device can combine the obtained index of each first resource file with the obtained first resource file to obtain the second resource file package, that is, the final new resource file package file, thereby improving the efficiency of obtaining a complete new resource file package.
  • Resource file package flexibility
  • the old resource file package 31, the difference resource file package 33 and the corresponding new resource file package 51 are shown. intention.
  • the electronic device After receiving the differential resource file package 33 (i.e., the first resource file package) sent by the server, the electronic device will, based on the status information of the update status corresponding to the new resource file (i.e., indicating whether the new resource file has changed), target the changed new resource file. 11.
  • For the new resource file 12 that has not changed use the old resource file 2 in the old resource file package as the new resource file 12.
  • the new resource file 12 in the new resource file package has not changed, that is, it is consistent with the content of the corresponding old resource file 2 in the old resource package.
  • the electronic device can directly take out the old resource file 2 from the old resource file package as the corresponding new resource file 12, without needing to receive the larger full differential resource file from the server and then determine the new resource file therefrom, thereby reducing resources.
  • FIG. 4 shows a flow chart of the resource file updating method provided by this embodiment of the present application.
  • the resource file updating method provided by the embodiment of the present application may include the following steps 401 and 402:
  • Step 401 The server generates a first resource file package based on the second resource file package.
  • the above-mentioned second resource file package includes: N first resource files, N is a positive integer;
  • the above-mentioned first resource file is used to update the original resource file in the electronic device.
  • the above-mentioned first resource file can be used to update the original resource file of the application in the electronic device, or can be used to update the original resource file of the operating system of the electronic device.
  • the details can be determined according to actual needs.
  • the embodiments of this application are not suitable for Make no restrictions.
  • the above-mentioned original resource file is a resource file to be updated.
  • the original resource file may be called an old resource file
  • the first resource file may be called a new resource file
  • the second resource file package is a resource file package obtained after packaging the above-mentioned plurality of first resource files.
  • the server packages new resource files that need to be updated to the device and obtains a new resource file package.
  • resource file package in the embodiment of the present application may also be called a resource packaging file
  • second resource file package may also be called a second resource packaging file
  • the server may obtain the second resource file package by reading the path of the storage directory of the second resource file package.
  • the above-mentioned second resource file package further includes: first index information.
  • the above-mentioned first index information includes: an index corresponding to each first resource file.
  • a complete new resource file package can be composed of two parts: a new index and a new resource file.
  • the above-mentioned first resource file package includes:
  • the above-mentioned first indication information is used to indicate whether each first resource file changes.
  • the above-mentioned first resource file package also includes: N pieces of the second resource file package. Sequence information of the sort order of the first resource file.
  • the order of the at least one first resource file is the default order of the server.
  • the default is the file order of at least one first resource file in the second resource file package; or the above-mentioned first order is an order set by the user.
  • the user can sort at least one resource file so that the first resource file that needs to be accessed frequently is ranked first. In this way, the server can preferentially access the first resource file that needs to be accessed frequently.
  • the server can record the unique path identifier (URL) of each first resource file in the second resource file package in order to obtain the above sorting order.
  • URL unique path identifier
  • the server performs differential and compression processing on the first resource file according to the status information of the update status corresponding to each first resource file, and sequentially obtains the differential resource file corresponding to the first resource file.
  • the server performs differential and compression processing on the first resource file according to the sequence information of the first order corresponding to at least one first resource file, and sequentially obtains the differential resource files corresponding to the first resource file.
  • one differential resource file corresponds to one first resource file.
  • the above-mentioned difference resource file is used to indicate: difference information of the first resource file relative to the original resource file.
  • a differential method is usually used to treat the old resource file package and the new resource file package as binary files, and run The difference algorithm obtains a diff (i.e., difference) file that stores the difference information before and after.
  • the device side then parses out the new resource file package based on the old resource file package and diff file.
  • the changing characteristics of resource files are different from ordinary binary files. They often replace or add or delete small resource files, rather than large-scale and irregular changes. Therefore, the traditional difference method cannot obtain the optimal diff file. Minimize the amount of computing and transmission traffic, and increase the speed of resource upgrades.
  • the server may perform a differential sum on the first resource file and the original resource file corresponding to the first resource file. Compress to obtain the differential resource file corresponding to the first resource file.
  • the server may not process the first resource file, that is, there is no need to record the difference resource file corresponding to the first resource file.
  • the server will perform differential and compression processing to obtain the differential resource file of the first resource file.
  • the server may not perform processing.
  • the above differential resource files can also be called diff information.
  • Step 402 The server sends the first resource file package to the electronic device.
  • the server when the server establishes a connection with the electronic device, the first resource file package is sent to the electronic device.
  • the server may send the first resource file package to the electronic device based on the TCP transmission protocol.
  • the server generates a first resource file package based on the second resource file package, and then sends the first resource file package to the electronic device; wherein, the second resource file package It includes: N first resource files; the above-mentioned first resource file is used to update the original resource file in the electronic device; the above-mentioned first resource file package includes: at least one difference resource file and first indication information.
  • the server can generate a resource upgrade package (i.e., the first resource file package) that needs to be sent to the electronic device based on whether the content of the first resource file has changed, without processing the entire old and new resource file package to obtain the resource Upgrade package, thereby reducing the amount of calculations required by the server to generate the resource upgrade package, improving server performance, and effectively reducing the amount of data in the generated differential resource file package, thereby reducing the amount of data consumed during resource file transmission.
  • a resource upgrade package i.e., the first resource file package
  • the above-mentioned first resource file package may include: verification information.
  • the server may add the verification information to the first resource file package and then send the first resource file package to the electronic device.
  • adding verification information to the file header of the first resource file package effectively prevents the electronic device from parsing and using the maliciously tampered resource files when the resource files in the resource file package are maliciously tampered with, thereby preventing the electronic device from parsing and using the maliciously tampered resource files. Ensure the safety of electronic device operations.
  • step 402 may include the following step 402a:
  • Step 402a Based on the sequence information of the sort order of the first resource files in the second resource file package of the server, compare each first resource file with the corresponding original resource file to generate at least one differential resource file.
  • the server can record the URLs of each first resource file in the second resource file package in order and generate sequence control information.
  • the sequence control information includes: multiple items (Item), and one Item indicates one In the first resource file, an Item has the content of two fields: the resource file URL and the change mark of the resource file. Then, according to the order of the above-mentioned multiple projects, according to the URL of the first resource file indicated by each project, the corresponding first resource file and the original resource file are taken out from the second resource file package and the original resource file package respectively for comparison and differentiation. Output the changed and unchanged first resource files.
  • the server performs differential and compression processing on the first resource file and the original resource file corresponding to the first resource file, and generates a differential resource file corresponding to the first resource file.
  • resource file 1 For example, assume that there are three or more resource files, resource file 1, resource file 2, and resource file 3, in the second resource file package.
  • the resource content of resource file 1 is the same as the resource content of the original resource file corresponding to resource file 1, that is, the resource The content of file 1 has not been updated (or changed), and the contents of resource file 2 and resource file 3 have both been updated.
  • the server can determine resource file 2 and resource file 3 from the second resource file package, and generate the resource file 2 and resource file 3 respectively.
  • the file size of the resource files obtained is smaller.
  • the volume of the resource files to be sent is effectively reduced, thereby saving traffic consumed when sending to the first device.
  • the server can sequentially determine whether the first resource file has changed according to the sequence information corresponding to the first resource file, and generate a corresponding difference resource file for the changed first resource file, so that the more important third resource file can be obtained first.
  • a differential resource file corresponding to one resource file improves the flexibility of generating differential resource files.
  • the above-mentioned second resource file package includes: the index of each first resource file; the above-mentioned first resource file package includes: index difference information;
  • the above index difference information includes:
  • the server combines the index in the second resource file package (ie, the new index) with the index in the original resource file package.
  • Index that is, the old index
  • Index is differentially and compressed to obtain index difference information.
  • index difference information may also be called index diff information.
  • a complete resource file package usually consists of two parts: an index and a resource file. After differential and compression processing of the index of the first resource file and the original resource file, the amount of data in the index can be effectively compressed, thereby reducing the amount of data in the index. The size of the resource file package sent to the electronic device, thereby effectively saving the amount of data consumed in resource file transmission.
  • the first resource file package in the resource file updating method provided by the embodiment of the present application will be described in detail below in conjunction with the above embodiment.
  • the above-mentioned first resource file package includes index difference information, sequence control information, difference resource files, and verification information.
  • the old resource file package 31 of the first application (i.e. the original resource file package) includes: old index, old resource file package
  • There are multiple resource files such as resource file 1, old resource file 2, and old resource file 3.
  • the new resource file package 32 (ie, the second resource file package) used to update the first application includes: a new index, and resource files.
  • a differential resource file package 33 (i.e., the first resource file package ) includes: verification information, difference index, sequence control information, and the difference resource file 4 and the difference resource file 5 corresponding to the new resource file 11 and the new resource file 13 respectively.
  • resource file 11 has changed compared to resource file 1
  • resource file 12 has not changed compared to resource file 2
  • resource file 13 has changed compared to resource file 3. Since resource file 12 has not changed, Therefore, there is no need to record the resource file 12 in the differential resource file package, thereby reducing the size of the resource file to be sent.
  • "File 12" in the dotted box indicates that the resource file 12 has not changed, and there is no need to record the difference resource file corresponding to the resource file 12 in the difference resource file.
  • Figure 5 shows the resource file package in the form of a folder interface (or window), which does not constitute a limitation on the resource file package.
  • the server needs to upgrade the resource files of the client (such as an electronic device), it only needs to send the first resource file package to the client.
  • the first resource file package is smaller in size than the traditional resource file package. , thus effectively reducing the traffic consumed during transmission.
  • FIG. 6 shows a flow chart of the interaction method provided by the embodiment of the present application.
  • the interaction method provided by the embodiment of the present application may include the following steps 501 to 504:
  • Step 501 The server generates a first resource file package based on the second resource file package.
  • Step 502 The server sends the first resource file package to the electronic device.
  • Step 503 The electronic device obtains the first resource file package.
  • Step 504 The electronic device obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
  • the above-mentioned second resource file package includes: N first resource files;
  • the above-mentioned first resource file package includes:
  • At least one differential resource file At least one differential resource file
  • First indication information indicating whether each first resource file has changed.
  • the above-mentioned first resource file is used to update the original resource file in the original resource package.
  • a difference resource file corresponds to a first resource file
  • Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  • the server can generate a first resource file package that needs to be sent to the electronic device according to whether the content of the first resource file changes. After the electronic device obtains the first resource file package, it can generate the first resource file package according to the instructions.
  • the indication information of whether each first resource file has changed is restored to the first resource file through the differential resource file corresponding to the first resource file and the original resource package in the first resource file package, effectively reducing the time spent on resource file transmission. It reduces the amount of data, effectively reduces the amount of calculations, and improves the speed of resource upgrades.
  • the execution subject may be a resource file updating device.
  • the resource file updating device performing the resource file updating method is used as an example to illustrate the resource file updating device provided by the embodiment of the present application.
  • the resource file update device 600 includes: an acquisition module 601 and a determination module 602, wherein:
  • the above-mentioned acquisition module 601 is used to acquire the first resource file package
  • the above-mentioned determination module 602 is used to obtain a second resource file package based on the first resource file package obtained by the above-mentioned acquisition module 601 and the original resource package in the electronic device;
  • the above-mentioned second resource file package includes: N first resource files;
  • the first resource file package includes:
  • At least one differential resource file At least one differential resource file
  • the first resource file is used to update the original resource file in the original resource package
  • a difference resource file corresponds to a first resource file
  • Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  • the above-mentioned determination module 602 is specifically configured to use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file when the indication information indicates that the target first resource file has not changed;
  • the above-mentioned determination module 602 is specifically configured to, when the indication information indicates that the target first resource file has changed, determine based on the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file. , get the target first resource file;
  • the above-mentioned target first resource file is one or more resource files among the N first resource files.
  • the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
  • the above-mentioned determination module 602 is specifically configured to obtain N first resource files in a sorting order based on at least one differential resource file and the original resource file in the original resource package.
  • the above-mentioned determination module 602 is specifically used to target the i-th position in the sorting order:
  • the first resource file corresponding to the i-th position changes, the first resource file corresponding to the i-th position is obtained based on the difference resource file corresponding to the i-th position and the original resource file;
  • the above-mentioned first resource file package also includes: index difference information
  • the above-mentioned index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file;
  • the above-mentioned determination module 602 is also configured to obtain the index of each first resource file based on the index difference information and the index of the original resource file after the acquisition module 601 obtains the first resource file package;
  • the above-mentioned second resource file package includes: an index of each first resource file.
  • the resource file updating device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
  • the above-mentioned second resource file package includes: N first resource files
  • the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each first resource file has changed
  • the above-mentioned third resource file includes: A resource file is used to update the original resource file in the original resource package.
  • the resource file updating device can obtain at least one differential resource file, and based on the instruction information indicating whether each first resource file has changed, restore the obtained For each first resource file, there is no need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby improving the efficiency of resource files. Upgrade speed.
  • a file resource updating device 700 includes: the device includes: a generating module 701 and a sending module 702, wherein:
  • the above-mentioned generation module is used to generate the first resource file package according to the second resource file package;
  • the above-mentioned sending module is used to send the first resource file package generated by the generating module 701 to the electronic device;
  • the above-mentioned second resource file package includes: N first resource files;
  • the first resource file is used to update the original resource file in the electronic device
  • the first resource file package includes:
  • the above-mentioned first indication information is used to indicate whether at least one first resource file changes.
  • a difference resource file corresponds to a first resource file
  • the above-mentioned difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  • the above-mentioned generation module 701 is specifically configured to compare each first resource file with the corresponding original resource file based on the sequence information of the sorting order of the first resource file in the second resource file package, and generate at least one differential resource file. .
  • the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package.
  • the above-mentioned second resource file package also includes: an index of each first resource file
  • the above-mentioned first resource file package also includes: index difference information
  • the above index difference information includes:
  • the resource file updating device is based on the second resource file. package, generate a first resource file package, and then send the first resource file package to the electronic device; wherein the second resource file package includes: N first resource files; the first resource file is used to update the electronic device The original resource file; the above-mentioned first resource file package includes: at least one differential resource file and first indication information.
  • the resource file updating device can generate a resource upgrade package (i.e., the first resource file package) that needs to be sent to the electronic device based on whether the content of the first resource file has changed, without the need to process the entire old and new resource file packages. , obtain the resource upgrade package, thereby reducing the amount of calculations required by the server to generate the resource upgrade package, and effectively reducing the amount of data in the generated differential resource file package, thereby reducing the amount of data consumed during resource file transmission.
  • a resource upgrade package i.e., the first resource file package
  • the resource file updating device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or a chip.
  • the electronic device may be a terminal or other devices other than the terminal.
  • the electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile internet device (Mobile Internet Device, MID), or augmented reality (AR)/virtual reality (VR).
  • the resource file updating device in the embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
  • the resource file updating device provided by the embodiment of the present application can implement Figures 1 to 3, or can implement various processes implemented by the method embodiments of Figures 4 and 5. To avoid duplication, they will not be described again here.
  • this embodiment of the present application also provides an electronic device 800, including a processor 801 and a memory 802.
  • the memory 802 stores programs or instructions that can be run on the processor 801.
  • each step of the above resource file updating method embodiment is implemented, and the same technical effect can be achieved. To avoid duplication, the details will not be described here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 100 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, etc. part.
  • the electronic device 100 may also include a power supply (such as a battery) that supplies power to various components.
  • the power supply may be logically connected to the processor 110 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions.
  • the structure of the electronic device shown in Figure 10 does not constitute a limitation on the electronic device.
  • the electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
  • processor 110 is used to obtain the first resource file package
  • the above-mentioned processor 110 is also configured to obtain a second resource file package based on the obtained first resource file package and the original resource package in the electronic device;
  • the above-mentioned second resource file package includes: N first resource files;
  • the first resource file package includes:
  • At least one differential resource file At least one differential resource file
  • the first resource file is used to update the original resource file in the original resource package
  • a difference resource file corresponds to a first resource file
  • Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  • the above-mentioned processor 110 is specifically configured to use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file when the instruction information indicates that the target first resource file has not changed;
  • the above-mentioned processor 110 is specifically configured to, when the instruction information indicates that the target first resource file has changed, according to the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file. , get the target first resource file;
  • the above-mentioned target first resource file is one or more resource files among the N first resource files.
  • the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
  • the above-mentioned processor 110 is specifically configured to obtain N first resource files in a sorting order based on at least one differential resource file and the original resource file in the original resource package.
  • the above-mentioned processor 110 is specifically used to target the i-th position in the sorting order:
  • the first resource file corresponding to the i-th position changes, the first resource file corresponding to the i-th position is obtained based on the difference resource file corresponding to the i-th position and the original resource file;
  • the above-mentioned first resource file package also includes: index difference information
  • the above-mentioned index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file;
  • the above-mentioned processor 110 is also configured to obtain the index of each first resource file based on the index difference information and the index of the original resource file after acquiring the first resource file package;
  • the above-mentioned second resource file package includes: an index of each first resource file.
  • the electronic device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
  • the above-mentioned second resource file package includes: N first resource files
  • the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each first resource file has changed
  • the above-mentioned third resource file includes: A resource file is used to update the original resource file in the original resource package.
  • the electronic device can obtain at least one differential resource file, and restore each first resource file through the at least one differential resource file and the original resource file in the original resource package based on the indication information indicating whether each first resource file has changed.
  • the first resource file does not need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby increasing the upgrade speed of resource files. .
  • the input unit 104 may include a graphics processor (Graphics Processing Unit (GPU) 1041 and microphone 1042, the graphics processor 1041 processes image data of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode.
  • the display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072 . Touch panel 1071 is also called a touch screen.
  • the touch panel 1071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
  • Memory 109 may be used to store software programs as well as various data.
  • the memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc.
  • memory 109 may include volatile memory or nonvolatile memory, or memory 109 may include both volatile and nonvolatile memory.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
  • Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
  • RAM Random Access Memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM Double Data Rate SDRAM
  • DDRSDRAM double data rate synchronous dynamic random access memory
  • Enhanced SDRAM, ESDRAM synchronous dynamic random access memory
  • Synch link DRAM synchronous link dynamic random access memory
  • SLDRAM direct memory
  • the processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 110 .
  • the server 1000 includes: an antenna 1001, a radio frequency device 1002, a baseband device 1003, a processor 1004, and a memory 1005.
  • Antenna 1001 is connected to radio frequency device 1002.
  • the radio frequency device 1002 receives information through the antenna 1001 and sends the received information to the baseband device 1003 for processing.
  • the baseband device 1003 processes the information to be sent and sends it to the radio frequency device 1002.
  • the radio frequency device 1002 processes the received information and sends it out through the antenna 1001.
  • the method executed by the server in the above embodiment can be implemented in the baseband device 1003, which includes a baseband processor.
  • the baseband device 1003 may include, for example, at least one baseband board on which multiple chips are disposed, as shown in FIG. Program to perform server operations in the above method embodiments.
  • the server may also include a network interface 1006, such as a common public radio interface (CPRI).
  • a network interface 1006 such as a common public radio interface (CPRI).
  • CPRI common public radio interface
  • the above-mentioned processor 1004 is used to generate a first resource file package according to the second resource file package;
  • the above-mentioned radio frequency device 1002 is used to send the first resource file package generated by the processor 1004 to the electronic device;
  • the above-mentioned second resource file package includes: N first resource files;
  • the first resource file is used to update the original resource file in the electronic device
  • the first resource file package includes:
  • the above-mentioned first indication information is used to indicate whether at least one first resource file changes.
  • a difference resource file corresponds to a first resource file
  • the above-mentioned difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  • the above-mentioned processor 1004 is specifically configured to compare each first resource file with the corresponding original resource file based on the sequence information of the sorting order of the first resource file in the second resource file package, and generate at least one differential resource file. .
  • the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package.
  • the above-mentioned second resource file package also includes: an index of each first resource file
  • the above-mentioned first resource file package also includes: index difference information
  • the above index difference information includes:
  • the resource file updating device generates a first resource file package based on the second resource file package, and then sends the first resource file package to the electronic device; wherein the second resource The file package includes: N first resource files; the above-mentioned first resource file is used to update the original resource file in the electronic device; the above-mentioned first resource file package includes: at least one difference resource file and first indication information.
  • the resource file updating device can generate a resource upgrade package (i.e., the first resource file package) that needs to be sent to the electronic device based on whether the content of the first resource file has changed, without the need to process the entire old and new resource file packages. , obtain the resource upgrade package, thereby reducing the amount of calculations required by the server to generate the resource upgrade package, and effectively reducing the amount of data in the generated differential resource file package, thereby reducing the amount of data consumed during resource file transmission.
  • a resource upgrade package i.e., the first resource file package
  • Embodiments of the present application also provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the program or instructions are executed by a processor, each process of the above resource file updating method embodiment is implemented, and can achieve The same technical effects are not repeated here to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiment.
  • the readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
  • An embodiment of the present application further provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the above resource file updating method.
  • Each process in the example can achieve the same technical effect. To avoid repetition, we will not repeat it here.
  • chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
  • Embodiments of the present application provide a computer program product, which is stored in a storage medium.
  • the program product is executed by at least one processor to implement each process of the above resource file update method embodiment, and can achieve the same technology. The effect will not be described here to avoid repetition.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The present application belongs to the technical field of communications. Disclosed are a resource file updating method and apparatus, and a device and a readable storage medium. The method comprises: an electronic device acquiring a first resource file package; and obtaining a second resource file package according to the first resource file package and an original resource package in the electronic device, wherein the second resource file package comprises N first resource files; the first resource file package comprises at least one difference resource file and first indication information for indicating whether each first resource file changes; the first resource file is used for updating an original resource file in the original resource package, and one difference resource file corresponds to one first resource file; and each difference resource file is used for indicating difference information of the corresponding first resource file with respect to the original resource file.

Description

资源文件更新方法、装置、设备及可读存储介质Resource file update method, device, equipment and readable storage medium
相关申请的交叉引用Cross-references to related applications
本申请主张在2022年05月09日在中国提交的中国专利申请号No.202210503050.6的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese Patent Application No. 202210503050.6 filed in China on May 9, 2022, the entire content of which is incorporated herein by reference.
技术领域Technical field
本申请属于通信技术领域,具体涉及一种资源文件更新方法、装置、设备及可读存储介质。This application belongs to the field of communication technology, and specifically relates to a resource file updating method, device, equipment and readable storage medium.
背景技术Background technique
目前,当电子设备中安装的应用需要更新时,通常需要从服务器端下载新的资源文件,对该应用当前的资源文件进行更新。Currently, when an application installed in an electronic device needs to be updated, it is usually necessary to download a new resource file from the server and update the current resource file of the application.
在相关技术中,通常是服务器将新资源文件包和应用所使用的原始资源文件包视为二进制文件,通过差分算法得到新资源文件包和原始资源文件包对应的差异资源包,然后电子设备下载该差异资源包进行旧资源文件的更新。由于二进制文件通常会存在大面积、无规律地变动,因此,得到的差异资源包的数据量通常较大。如此,导致差异资源包的传输需要耗费较多网络流量。In related technologies, the server usually treats the new resource file package and the original resource file package used by the application as binary files, obtains the difference resource package corresponding to the new resource file package and the original resource file package through a differential algorithm, and then downloads it to the electronic device This differential resource pack updates old resource files. Since binary files usually change in large areas and irregularly, the amount of data in the obtained differential resource package is usually large. As a result, the transmission of differential resource packets consumes more network traffic.
发明内容Contents of the invention
本申请实施例的目的是提供一种资源文件更新方法、装置、设备及可读存储介质,能够解决服务器需要进行的运算量较大,导致服务器的功耗较大的问题。The purpose of the embodiments of the present application is to provide a resource file updating method, device, equipment and readable storage medium, which can solve the problem that the server needs to perform a large amount of calculations, resulting in large power consumption of the server.
第一方面,本申请实施例提供了一种资源文件更新方法,该方法包括:电子设备获取第一资源文件包,并根据所述第一资源文件包及电子设备内的原始资源包,得到第二资源文件包;其中,上述第二资源文件包包括:N个第一资源文件;上述第一资源文件包包括:至少一个差异资源文件,以及指示每个第一资源文件是否发生变化的第一指示信息;上述第一资源文件用于更新原始资源包中的原始资源文件,一个差异资源文件对应一个第一资源文件;每个差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。In a first aspect, embodiments of the present application provide a resource file updating method. The method includes: an electronic device obtains a first resource file package, and obtains a third resource file package based on the first resource file package and the original resource package in the electronic device. Two resource file packages; wherein, the above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file package includes: at least one difference resource file, and a first parameter indicating whether each first resource file has changed. Instruction information; the above-mentioned first resource file is used to update the original resource file in the original resource package, and one differential resource file corresponds to one first resource file; each differential resource file is used to indicate: the corresponding first resource file is relative to the original resource Difference information for files.
第二方面,本申请实施例提供了一种资源文件更新装置,该装置包括:获取模块和确定模块,其中:上述获取模块,用于获取第一资源文件包;上述确定模块,用于根据获取模块获取的第一资源文件包及所述电子设备内的原始资源包,得到第二资源文件包;其中,上述第二资源文件包包括:N个第一资源文件;上述第一资源文件包包括:至少一个差异资源文件,指示每个第一资源文件是否发生变化的第一指示信息;上述第一资源文件用于更新原始资源包中的原始资源文件;一个差异资源文件对应一个第一资源文件;每个差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。In the second aspect, embodiments of the present application provide a resource file updating device. The device includes: an acquisition module and a determination module, wherein: the above-mentioned acquisition module is used to acquire the first resource file package; the above-mentioned determination module is used to obtain the first resource file package according to the acquisition module. The first resource file package obtained by the module and the original resource package in the electronic device obtain a second resource file package; wherein the above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file package includes : At least one differential resource file, first indication information indicating whether each first resource file has changed; the above-mentioned first resource file is used to update the original resource file in the original resource package; one differential resource file corresponds to one first resource file ; Each differential resource file is used to indicate: the difference information of the corresponding first resource file relative to the original resource file.
第三方面,本申请实施例提供了一种资源文件更新方法,该方法包括:服务器根据第二资源文件包,生成第一资源文件包,并电子设备发送第一资源文件包;其中, 上述第二资源文件包包括:N个第一资源文件;上述第一资源文件用于更新所述电子设备中的原始资源文件;上述第一资源文件包包括:至少一个差异资源文件,第一指示信息;上述第一指示信息用于指示每个第一资源文件是否发生变化。In a third aspect, embodiments of the present application provide a resource file updating method, which method includes: the server generates a first resource file package based on the second resource file package, and the electronic device sends the first resource file package; wherein, The above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file is used to update the original resource file in the electronic device; the above-mentioned first resource file package includes: at least one difference resource file, a first indication Information; the above-mentioned first indication information is used to indicate whether each first resource file has changed.
第四方面,本申请实施例提供了一种资源文件更新装置,该装置包括:生成模块和发送模块,其中:上述生成模块,用于根据第二资源文件包,生成第一资源文件包;上述发送模块,用于向电子设备发送生成模块生成的第一资源文件包;其中,上述第二资源文件包包括:N个第一资源文件;上述第一资源文件用于更新电子设备中的原始资源文件;上述第一资源文件包包括:至少一个差异资源文件,第一指示信息;上述第一指示信息用于指示至少一个第一资源文件是否发生变化。In the fourth aspect, embodiments of the present application provide a resource file updating device. The device includes: a generating module and a sending module, wherein: the above-mentioned generating module is used to generate a first resource file package according to the second resource file package; the above-mentioned A sending module, configured to send the first resource file package generated by the generation module to the electronic device; wherein the above-mentioned second resource file package includes: N first resource files; the above-mentioned first resource file is used to update the original resources in the electronic device file; the above-mentioned first resource file package includes: at least one difference resource file and first indication information; the above-mentioned first indication information is used to indicate whether at least one first resource file has changed.
第五方面,本申请实施例提供了一种服务器,该服务器包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a fifth aspect, embodiments of the present application provide a server. The server includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. The program or instructions are executed by the processor. When implementing the steps of the method described in the first aspect.
第六方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第三方面所述的方法的步骤。In a sixth aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. The programs or instructions are processed by the processor. When the processor is executed, the steps of the method as described in the third aspect are implemented.
第七方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法或者实现如第三方面所述的方法的步骤。In the seventh aspect, embodiments of the present application provide a readable storage medium that stores programs or instructions. When the programs or instructions are executed by a processor, the method or implementation described in the first aspect is implemented. The steps of the method as described in the third aspect.
第八方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In an eighth aspect, embodiments of the present application provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the first aspect. the method described.
第九方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。In a ninth aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
在本申请实施例中,电子设备获取第一资源文件包,并根据第一资源文件包以及电子设备内的原始资源包,得到第二资源文件包。其中,上述第二资源文件包包括:N个第一资源文件,上述第一资源文件包包括:至少一个差异资源文件,以及指示每个所述第一资源文件是否发生变化的第一指示信息;上述第一资源文件用于更新原始资源包中的原始资源文件。通过该方法,电子设备可以获取至少一个差异资源文件,并基于指示每个第一资源文件是否发生变化的指示信息,通过至少一个差异资源文件和原始资源包中的原始资源文件,还原得到每个第一资源文件,而不需要下载整个差异资源包并对整个差异资源包进行解析,从而节省了下载资源包所消耗的流量,并有效减少资源升级时的运算量,进而提高资源文件的升级速度。In this embodiment of the present application, the electronic device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device. Wherein, the above-mentioned second resource file package includes: N first resource files, the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each of the first resource files has changed; The above-mentioned first resource file is used to update the original resource file in the original resource package. Through this method, the electronic device can obtain at least one differential resource file, and restore each first resource file through the at least one differential resource file and the original resource file in the original resource package based on the indication information indicating whether each first resource file has changed. The first resource file does not need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby increasing the upgrade speed of resource files. .
附图说明Description of the drawings
图1为本申请实施例提供的资源文件更新方法的流程图之一;Figure 1 is one of the flow charts of the resource file updating method provided by the embodiment of the present application;
图2为本申请实施例提供的资源文件更新方法的示意图之一;Figure 2 is a schematic diagram of a resource file updating method provided by an embodiment of the present application;
图3为本申请实施例提供的资源文件更新方法的示意图之二;Figure 3 is a second schematic diagram of the resource file updating method provided by the embodiment of the present application;
图4为本申请实施例提供的资源文件更新方法的流程图之二;Figure 4 is the second flow chart of the resource file updating method provided by the embodiment of the present application;
图5为本申请实施例提供的资源文件更新方法的示意图之三;Figure 5 is a third schematic diagram of the resource file updating method provided by the embodiment of the present application;
图6为本申请实施例提供的交互方法的流程图; Figure 6 is a flow chart of the interaction method provided by the embodiment of the present application;
图7为本申请实施例提供资源文件更新装置的结构示意图之一;Figure 7 is one of the structural schematic diagrams of a resource file updating device according to an embodiment of the present application;
图8为本申请实施例提供资源文件更新装置的结构示意图之二;Figure 8 is a second structural schematic diagram of a resource file updating device according to an embodiment of the present application;
图9为本申请实施例提供的电子设备的结构示意图;Figure 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图10为本申请实施例提供的电子设备的硬件结构示意图;Figure 10 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
图11为本申请实施例提供的服务器的硬件结构示意图。Figure 11 is a schematic diagram of the hardware structure of a server provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的资源文件更新方法进行详细地说明。The resource file updating method provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios.
本申请实施例提供一种资源文件更新方法,图1示出了本申请实施例提供的资源文件更新方法的流程图。如图1所示,本申请实施例提供的资源文件更新方法可以包括下述的步骤201和步骤202:An embodiment of the present application provides a resource file updating method. Figure 1 shows a flow chart of the resource file updating method provided by an embodiment of the present application. As shown in Figure 1, the resource file updating method provided by the embodiment of the present application may include the following steps 201 and 202:
步骤201:电子设备获取第一资源文件包。Step 201: The electronic device obtains the first resource file package.
其中,上述第一资源文件包包括:Among them, the above-mentioned first resource file package includes:
至少一个差异资源文件;At least one differential resource file;
指示每个第一资源文件是否发生变化的第一指示信息。First indication information indicating whether each first resource file has changed.
在本申请实施例中,一个差异资源文件对应一个第一资源文件;In the embodiment of this application, one difference resource file corresponds to one first resource file;
在本申请实施例中,每个差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。In this embodiment of the present application, each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
在本申请实施例中,上述第一资源文件为用于更新电子设备的原始资源文件的新资源文件。In this embodiment of the present application, the above-mentioned first resource file is a new resource file used to update the original resource file of the electronic device.
可选地,上述原始资源文件为电子设备中未更新的资源文件。示例性地,该原始资源文件可以为电子设备的系统资源文件;或者,为电子设备中的应用的资源文件。例如,该原始资源文件可以为电子设备中的应用1的当前使用的未更新的应用资源文件。Optionally, the above-mentioned original resource files are resource files that have not been updated in the electronic device. For example, the original resource file may be a system resource file of the electronic device; or, it may be a resource file of an application in the electronic device. For example, the original resource file may be an unupdated application resource file currently used by application 1 in the electronic device.
在本申请实施例中,上述第一指示信息包括:每个第一资源文件的文件标识,每个第一资源文件的唯一路径标识(URL)以及每个第一资源文件的变化标记。In this embodiment of the present application, the above-mentioned first indication information includes: a file identifier of each first resource file, a unique path identifier (URL) of each first resource file, and a change mark of each first resource file.
可选地,该变化标记用于指示第一资源文件的是否发生变化。可选地,该变化标记的值可以为逻辑值真(即true)和逻辑值假(即false)来表示;或者,上述变化标记的值可以用0和1来表示。Optionally, the change mark is used to indicate whether the first resource file has changed. Optionally, the value of the change flag can be represented by a logical value of true (that is, true) and a logical value of false (that is, false); or, the value of the above-mentioned change mark can be represented by 0 and 1.
示例性地,假设资源文件1的变化标记的值为真,表征该资源文件1发生变化,资源文件2的变化标记的值为假,表征该资源文件2未发生变化(也就是说与该资源文件2对 应的原始资源文件相同);示例性地,资源文件1的变化标记的值为1,表征该资源文件1发生变化,资源文件2的变化标记的值为0,表征该第一资源文件未发生变化。For example, assuming that the value of the change flag of resource file 1 is true, it means that resource file 1 has changed, and the value of the change flag of resource file 2 is false, which means that resource file 2 has not changed (that is, it is not related to the resource file 2). File 2 pairs The corresponding original resource files are the same); for example, the value of the change flag of resource file 1 is 1, indicating that the resource file 1 has changed, and the value of the change flag of resource file 2 is 0, indicating that the first resource file has not changed. Variety.
可选地,上述每个第一资源文件的文件标识可以用:项目(即Item)表示,其中,一个项目下包括:一个第一资源文件的URL,和,一个第一资源文件的变化标记。Optionally, the file identification of each first resource file can be represented by an item (ie, Item), where one item includes: a URL of the first resource file, and a change mark of the first resource file.
例如,如图2所示,第一指示信息中依次包含:项目1,项目2和项目3,其中,项目1中包括:资源文件的1唯一路径标识和变化标记,项目2中包括:资源文件的2唯一路径标识和变化标记,项目3中包括:资源文件的3唯一路径标识和变化标记。For example, as shown in Figure 2, the first instruction information includes: project 1, project 2 and project 3 in sequence, where project 1 includes: a unique path identifier and a change mark of the resource file, and project 2 includes: the resource file 2 unique path identifiers and change tags. Project 3 includes: 3 unique path identifiers and change tags for resource files.
需要说明的是,图2中,项目1标识的资源文件的路径为A,项目2标识的资源文件的路径为B,项目3标识的资源文件的路径为C。上述A、B、C仅是用于表示唯一路径标识,不代表实际的唯一路径标识。上述项目可以包括多个,图2中是以三个为示例进行说明。It should be noted that in Figure 2, the path of the resource file identified by item 1 is A, the path of the resource file identified by item 2 is B, and the path of the resource file identified by item 3 is C. The above A, B, and C are only used to represent unique path identifiers and do not represent actual unique path identifiers. The above items may include multiple items. Figure 2 takes three as an example for illustration.
可以理解的是,上述项目用于标识相应的资源文件,上述唯一路径标识用于查询对应的资源文件,上述变化标记表征对应的资源文件是否发生变化,示例地,图2中,变化标记为1,表征资源文件发生变化,变化标记为0,表征资源文件未发生变化。It can be understood that the above items are used to identify the corresponding resource file, the above unique path identifier is used to query the corresponding resource file, and the above change mark indicates whether the corresponding resource file has changed. For example, in Figure 2, the change mark is 1 , indicating that the resource file has changed, the change mark is 0, indicating that the resource file has not changed.
可选地,在本申请实施例中,电子设备可以接收服务器发送的第一资源文件包。Optionally, in this embodiment of the present application, the electronic device may receive the first resource file package sent by the server.
步骤202:电子设备根据第一资源文件包及电子设备内的原始资源包,得到第二资源文件包。Step 202: The electronic device obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
其中,上述第二资源文件包包括:N个第一资源文件,N为正整数;Wherein, the above-mentioned second resource file package includes: N first resource files, N is a positive integer;
在本申请实施例中,上述原始资源包为未更新或者待更新的资源包,该原始资源包包括上述原始资源文件。In this embodiment of the present application, the above-mentioned original resource package is a resource package that has not been updated or needs to be updated, and the original resource package includes the above-mentioned original resource file.
在本申请实施例中,上述第一资源文件用于更新上述原始资源包中的原始资源文件。In this embodiment of the present application, the first resource file is used to update the original resource file in the original resource package.
在本申请实施例中,电子设备可以根据每个第一资源文件对应的第一指示信息,通过上述至少一个差异资源文件,以及原始资源包中的原始资源文件,还原得到每个第一资源文件(即新资源文件)。In this embodiment of the present application, the electronic device can restore each first resource file through the above-mentioned at least one differential resource file and the original resource file in the original resource package according to the first instruction information corresponding to each first resource file. (i.e. new resource file).
可选地,在本申请实施例中,电子设备在得到第二资源文件包之后,可以根据该第二资源文件包对电子设备内的原始资源文件包进行更新。Optionally, in this embodiment of the present application, after the electronic device obtains the second resource file package, it can update the original resource file package in the electronic device according to the second resource file package.
示例性地,在对电子设备中的第一应用的原始资源文件包进行更新时,电子设备可以将第一应用的原始资源文件,替换为该第二资源文件包,从而实现对第一应用的原始资源文件包的升级。For example, when updating the original resource file package of the first application in the electronic device, the electronic device can replace the original resource file of the first application with the second resource file package, thereby realizing the update of the first application. Upgrade of original resource file package.
在本申请实施例提供的资源文件更新方法中,电子设备获取第一资源文件包,并根据第一资源文件包以及电子设备内的原始资源包,得到第二资源文件包。其中,上述第二资源文件包包括:N个第一资源文件,上述第一资源文件包包括:至少一个差异资源文件,以及指示每个所述第一资源文件是否发生变化的第一指示信息;上述第一资源文件用于更新原始资源包中的原始资源文件。通过该方法,电子设备可以获取至少一个差异资源文件,并基于指示每个第一资源文件是否发生变化的指示信息,通过至少一个差异资源文件和原始资源包中的原始资源文件,还原得到每个第一资源文件,而不需要下载整个差异资源包并对整个差异资源包进行解析,从而节省了下载资源包所消耗的流量,并有效减少资源升级时的运算量,进而提高资源文件的升级速度。In the resource file updating method provided by the embodiment of the present application, the electronic device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device. Wherein, the above-mentioned second resource file package includes: N first resource files, the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each of the first resource files has changed; The above-mentioned first resource file is used to update the original resource file in the original resource package. Through this method, the electronic device can obtain at least one differential resource file, and restore each first resource file through the at least one differential resource file and the original resource file in the original resource package based on the indication information indicating whether each first resource file has changed. The first resource file does not need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby increasing the upgrade speed of resource files. .
可选地,在本申请实施例中,上述第一资源文件包还包括:校验信息。Optionally, in this embodiment of the present application, the above-mentioned first resource file package further includes: verification information.
可选地,电子设备在检测第一资源文件包中的校验信息正确的情况下,再基于获取的 第一资源文件包和原始资源包,还原得到至少一个新资源文件,如此,能够确保在获取到的第一资源文件包中的信息未被篡改的情况下,还原得到安全可靠的资源文件,从而保证操作的安全性。Optionally, when the electronic device detects that the verification information in the first resource file package is correct, based on the obtained The first resource file package and the original resource package are restored to obtain at least one new resource file. In this way, it can be ensured that safe and reliable resource files are restored without tampering with the information in the obtained first resource file package. Ensure operational safety.
可选地,在本申请实施例中,上述步骤202可以包括以下步骤202a或步骤202b:Optionally, in this embodiment of the present application, the above step 202 may include the following step 202a or step 202b:
步骤202a:在指示信息指示目标第一资源文件未发生变化的情况下,将原始资源包中目标第一资源文件对应的原始资源文件,作为目标第一资源文件。Step 202a: If the instruction information indicates that the target first resource file has not changed, use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file.
步骤202b:在指示信息指示目标第一资源文件发生变化的情况下,根据原始资源包中目标第一资源文件对应的原始资源文件,和目标第一资源文件对应的差异资源文件,得到目标第一资源文件。Step 202b: When the instruction information indicates that the target first resource file has changed, obtain the target first resource file based on the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file. resource.
其中,上述目标第一资源文件为上述N个第一资源文件中的一个或多个资源文件。Wherein, the target first resource file is one or more resource files among the N first resource files.
示例性地,对于有变化的第一资源文件,可以根据该第一资源文件的URL从原始资源包里取出其旧(原始)资源文件个体,然后结合第一资源文件包中,该第一资源文件对应的差异资源文件内记录的个体差异信息,还原出新资源文件个体(即第一资源文件);对于无变化的第一资源,可以根据该第一资源文件的URL从旧资源包中取出其旧资源文件个体,并将该旧资源文件个体作为新资源文件个体(即第一资源文件)。For example, for a changed first resource file, the old (original) resource file individual can be taken out from the original resource package according to the URL of the first resource file, and then combined with the first resource file package, the first resource file The individual difference information recorded in the difference resource file corresponding to the file is restored to the new resource file individual (i.e. the first resource file); for the unchanged first resource, it can be taken out from the old resource package according to the URL of the first resource file. its old resource file individual, and use the old resource file individual as a new resource file individual (ie, the first resource file).
例如,新的资源文件4为发生变化的新资源文件,则根据该资源文件4对应的差异资源文件和对应的原始资源文件,还原得到该新的资源文件4。For example, if the new resource file 4 is a changed new resource file, the new resource file 4 can be restored according to the difference resource file corresponding to the resource file 4 and the corresponding original resource file.
再例如,新的资源文件5为未发生变化的新资源文件,则直接将该资源文件5对应的原始资源文件,作为该新的资源文件5。For another example, if the new resource file 5 is a new resource file that has not changed, then the original resource file corresponding to the resource file 5 is directly used as the new resource file 5 .
具体地,电子设备可以对第一资源文件对应的原始资源文件,和该第一资源文件对应的差异资源文件进行差分还原处理,得到新资源文件个体。Specifically, the electronic device can perform differential restoration processing on the original resource file corresponding to the first resource file and the differential resource file corresponding to the first resource file to obtain a new resource file individual.
需要说明的是,差分还原处理的具体实现方式可以参考相关技术,本申请实施例对此不再赘述。It should be noted that reference may be made to related technologies for specific implementation methods of differential reduction processing, which will not be described again in the embodiments of this application.
需要说明的是,用于更新应用的原始资源文件包的新资源文件包(即第二资源文件包),它往往是替换或者增删一些的小的资源文件,而不是大面积、无规律地变动。如此,电子设备可以针对发生变化的新资源文件,结合其旧资源文件和差异资源文件进行还原,得到该新资源文件,针对未发生变化的新资源文件,直接从旧资源包中取出对应的旧资源文件作为新资源文件,从而提高得到新资源文件的效率。It should be noted that the new resource file package (i.e. the second resource file package) used to update the original resource file package of the application is often a replacement or addition or deletion of some small resource files, rather than large-scale and irregular changes. . In this way, the electronic device can restore the changed new resource file by combining its old resource file and differential resource file to obtain the new resource file, and directly take out the corresponding old resource file from the old resource package for the new resource file that has not changed. Resource files as new resource files, thereby improving the efficiency of obtaining new resource files.
进一步可选地,在本申请实施例中,上述第一资源文件包还包括:第二资源文件包中的N个第一资源文件的排序顺序的顺序信息;Further optionally, in this embodiment of the present application, the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
可选地,上述步骤202可以包括以下步骤202c:Optionally, the above step 202 may include the following step 202c:
步骤202c:电子设备基于至少一个差异资源文件和原始资源包中的原始资源文件,按照排序顺序,得到上述N个第一资源文件。Step 202c: The electronic device obtains the above-mentioned N first resource files in sorting order based on at least one differential resource file and the original resource files in the original resource package.
示例性地,上述排序顺序为用户自行设置的顺序。例如,用户可以对至少一个资源文件进行排序,将需要频繁访问的第一资源文件排在前面,或者,上述排序顺序为系统默认的排序顺序。For example, the above sorting order is an order set by the user. For example, the user can sort at least one resource file so that the first resource file that needs to be accessed frequently is ranked first, or the above sorting order is the system default sorting order.
示例性地,电子设备可以按照上述排序顺序,依次对每个的第一资源文件进行还原。For example, the electronic device can restore each first resource file in sequence according to the above sorting order.
需要说明的是,第一设备可以按照N个第一资源文件的排序顺序,来逐个还原每个第一资源文件。由于顺序靠前的第一资源文件会被先还原,因此其在被还原后会被存放在新资源文件包内靠前的位置。因此可以将需要频繁访问的资源文件排在前面。如此,电子设 备后续在运行应用程序时,能够快速访问到这些需要频繁访问的资源文件,从而访问资源的性能会得到提升。It should be noted that the first device can restore each first resource file one by one according to the sort order of the N first resource files. Since the first resource file in the order will be restored first, it will be stored in the front position in the new resource file package after being restored. Therefore, resource files that need to be accessed frequently can be ranked first. In this way, electronic equipment When you run the application later, you can quickly access these resource files that need to be accessed frequently, so the performance of accessing resources will be improved.
进一步可选地,上述步骤202c可以包括以下步骤202c1或者步骤202c2:Further optionally, the above step 202c may include the following step 202c1 or step 202c2:
步骤202c1:针对排序顺序中的第i位:在第i位对应的第一资源文件未发生变化的情况下,将第i位对应的所述原始资源文件,作为第i位对应的第一资源文件;Step 202c1: For the i-th position in the sorting order: if the first resource file corresponding to the i-th position has not changed, use the original resource file corresponding to the i-th position as the first resource corresponding to the i-th position. document;
步骤202c2:针对排序顺序中的第i位:在第i位对应的第一资源文件发生变化的情况下,基于第i位对应差异资源文件和原始资源文件,得到第i位对应的第一资源文件。Step 202c2: For the i-th position in the sorting order: when the first resource file corresponding to the i-th position changes, obtain the first resource corresponding to the i-th position based on the difference resource file corresponding to the i-th position and the original resource file. document.
其中,i∈[1,2,……,N]。Among them, i∈[1, 2,...,N].
可选地,上述第一指示信息中还可以包括上述顺序信息。Optionally, the above-mentioned first indication information may also include the above-mentioned sequence information.
需要说明的是,在第一指示信息包括上述顺序信息的情况下,该第一指示信息也可以称为顺序控制信息。It should be noted that when the first instruction information includes the above-mentioned sequence information, the first instruction information may also be called sequence control information.
示例性地,由于第一指示信息中的一个项目标识一个第一资源文件,因此电子设备可以根据上述至少一个项目的排序顺序,来确定第一资源文件的排序顺序。需要说明的是,对于项目的解释说明可以参见上文,此处不再赘述。For example, since one item in the first indication information identifies a first resource file, the electronic device can determine the sorting order of the first resource file according to the sorting order of the at least one item. It should be noted that the explanation of the project can be found above and will not be repeated here.
示例性地,电子设备可以根据N个项目的排序顺序,遍历该N个项目,并根据每个项目下的URL,获取该项目标识(即对应)的第一资源文件。For example, the electronic device can traverse the N projects according to the sort order of the N projects, and obtain the first resource file identified by the project (that is, corresponding to it) according to the URL under each project.
例如,分别指示(标识)新资源文件的三个项目的排序顺序为Item4、Item5和Item6三个项目,其中,Item4指示新资源文件4、Item5指示新资源文件5,Item6指示新资源文件6,电子设备可以根据Item4、Item5以及Item6指示的资源文件的URL,依次得到新资源文件4、新资源文件5以及新资源文件6。For example, the sorting order of three items that respectively indicate (identify) new resource files is Item4, Item5 and Item6, where Item4 indicates new resource file 4, Item5 indicates new resource file 5, and Item6 indicates new resource file 6. The electronic device can sequentially obtain the new resource file 4, the new resource file 5, and the new resource file 6 according to the URLs of the resource files indicated by Item4, Item5, and Item6.
如此,电子设备可以按照一定的顺序,依次得到每个新资源文件,从而提高资源文件升级的灵活性。In this way, the electronic device can obtain each new resource file in a certain order, thereby improving the flexibility of resource file upgrades.
可选地,在本申请实施例中,上述第一资源文件包包括:索引差异信息;Optionally, in this embodiment of the present application, the above-mentioned first resource file package includes: index difference information;
可选地,上述索引差异信息包括:每个第一资源文件的索引,与每个第一资源文件对应的原始资源文件的索引间的差异信息。Optionally, the above-mentioned index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file.
可选地,上述步骤201之后,本申请实施例提供的资源文件更新方法还包括以下步骤203:Optionally, after the above step 201, the resource file updating method provided by the embodiment of the present application further includes the following step 203:
步骤203:电子设备基于索引差异信息和原始资源文件的索引,得到每个第一资源文件的索引。Step 203: The electronic device obtains the index of each first resource file based on the index difference information and the index of the original resource file.
其中,上述第二资源文件包包括:每个第一资源文件的索引。Wherein, the above-mentioned second resource file package includes: an index of each first resource file.
示例性地,电子设备对原始资源文件包内的索引,和第一资源文件包内的索引差异信息进行解压,并对解压后得到的每个索引进行差分还原,得到每个第一资源文件的索引。如此,电子设备可以对索引差异信息进行差分还原,得到第二资源文件包的新索引信息,而不必从服务器接收新索引信息,节省了资源文件传输所消耗的数据量。For example, the electronic device decompresses the index in the original resource file package and the index difference information in the first resource file package, and performs differential restoration on each index obtained after decompression to obtain the index of each first resource file. index. In this way, the electronic device can differentially restore the index difference information to obtain new index information of the second resource file package without having to receive new index information from the server, thereby saving the amount of data consumed in resource file transmission.
进一步地,电子设备可以将得到的每个第一资源文件的索引和得到的第一资源文件进行组合,得到了第二资源文件包,即最终的新资源文件包文件,从而提高得到完整的新资源文件包的灵活性。Further, the electronic device can combine the obtained index of each first resource file with the obtained first resource file to obtain the second resource file package, that is, the final new resource file package file, thereby improving the efficiency of obtaining a complete new resource file package. Resource file package flexibility.
下面结合以上实施例,对本申请实施例提供的资源文件更新方法中的第二资源文件包进行详细说明。The second resource file package in the resource file updating method provided by the embodiment of the present application will be described in detail below in conjunction with the above embodiment.
如图3所示为旧资源文件包31、差异资源文件包33以及对应的新资源文件包51的示 意图。电子设备接收服务器发送的差异资源文件包33(即第一资源文件包)后,根据新资源文件对应的更新状态的状态信息(即指示新资源文件是否发生变化),针对有变化的新资源文件11,根据旧资源文件1和对应的差异资源文件4,还原得到该新资源文件11,针对有变化的新资源文件13,根据旧资源文件3和对应的差异资源文件5,还原得到新资源文件13,针对未发生变化的新资源文件12,将旧资源文件包中的旧资源文件2作为该新资源文件12。As shown in Figure 3, the old resource file package 31, the difference resource file package 33 and the corresponding new resource file package 51 are shown. intention. After receiving the differential resource file package 33 (i.e., the first resource file package) sent by the server, the electronic device will, based on the status information of the update status corresponding to the new resource file (i.e., indicating whether the new resource file has changed), target the changed new resource file. 11. Restore the new resource file 11 based on the old resource file 1 and the corresponding differential resource file 4. For the changed new resource file 13, restore the new resource file based on the old resource file 3 and the corresponding differential resource file 5. 13. For the new resource file 12 that has not changed, use the old resource file 2 in the old resource file package as the new resource file 12.
可以理解的是,由于新资源文件包中的新资源文件12未发生变化,即与旧资源包中其对应的旧资源文件2内容一致。如此,电子设备可以直接从旧资源文件包中取出该旧资源文件2作为对应的新资源文件12,而不需要从服务器接收体积较大的全量差异资源文件再从中确定新资源文件,从而减少资源文件传输所消耗的流量,并提高电子设备的处理效率。It can be understood that since the new resource file 12 in the new resource file package has not changed, that is, it is consistent with the content of the corresponding old resource file 2 in the old resource package. In this way, the electronic device can directly take out the old resource file 2 from the old resource file package as the corresponding new resource file 12, without needing to receive the larger full differential resource file from the server and then determine the new resource file therefrom, thereby reducing resources. The traffic consumed by file transfer and improve the processing efficiency of electronic devices.
本申请实施例提供一种资源文件更新方法,图4示出了本申请实施例提供的资源文件更新方法的流程图。如图4所示,本申请实施例提供的资源文件更新方法可以包括下述的步骤401和步骤402:This embodiment of the present application provides a resource file updating method. Figure 4 shows a flow chart of the resource file updating method provided by this embodiment of the present application. As shown in Figure 4, the resource file updating method provided by the embodiment of the present application may include the following steps 401 and 402:
步骤401:服务器根据第二资源文件包,生成第一资源文件包。Step 401: The server generates a first resource file package based on the second resource file package.
其中,上述第二资源文件包包括:N个第一资源文件,N为正整数;Wherein, the above-mentioned second resource file package includes: N first resource files, N is a positive integer;
在本申请实施例中,上述第一资源文件用于更新电子设备中的原始资源文件。In this embodiment of the present application, the above-mentioned first resource file is used to update the original resource file in the electronic device.
可选地,上述第一资源文件可以用于更新电子设备中应用的原始资源文件,或者可以用于更新电子设备的操作系统的原始资源文件,具体可以根据实际需求确定,本申请实施例对不做任何限定。Optionally, the above-mentioned first resource file can be used to update the original resource file of the application in the electronic device, or can be used to update the original resource file of the operating system of the electronic device. The details can be determined according to actual needs. The embodiments of this application are not suitable for Make no restrictions.
在本申请实施例中,上述原始资源文件为待更新的资源文件。In this embodiment of the present application, the above-mentioned original resource file is a resource file to be updated.
为了便于理解,上述原始资源文件可以称为旧资源文件,上述第一资源文件可以称为新资源文件。For ease of understanding, the original resource file may be called an old resource file, and the first resource file may be called a new resource file.
在本申请实施例中,第二资源文件包是对上述多个第一资源文件进行打包处理后,得到的资源文件包。例如,服务器对需要更新到设备端的新资源文件进行打包处理,得到新的资源文件包。In this embodiment of the present application, the second resource file package is a resource file package obtained after packaging the above-mentioned plurality of first resource files. For example, the server packages new resource files that need to be updated to the device and obtains a new resource file package.
需要说明的是,本申请实施例中的资源文件包也可以称为资源打包文件,上述第二资源文件包也可以称为第二资源打包文件。It should be noted that the resource file package in the embodiment of the present application may also be called a resource packaging file, and the above-mentioned second resource file package may also be called a second resource packaging file.
在本申请实施例中,服务器可以通过读取第二资源文件包的存储目录的路径,来获取该第二资源文件包。In this embodiment of the present application, the server may obtain the second resource file package by reading the path of the storage directory of the second resource file package.
在本申请实施例中,上述第二资源文件包还包括:第一索引信息。可选地,上述第一索引信息包括:每个第一资源文件对应的索引。In this embodiment of the present application, the above-mentioned second resource file package further includes: first index information. Optionally, the above-mentioned first index information includes: an index corresponding to each first resource file.
需要说明的是,一个完整的新资源文件包,可以由新索引和新资源文件两部分构成。It should be noted that a complete new resource file package can be composed of two parts: a new index and a new resource file.
在本申请实施例中,上述第一资源文件包包括:In this embodiment of the present application, the above-mentioned first resource file package includes:
至少一个差异资源文件,at least one differential resource file,
第一指示信息;first instruction information;
其中,上述第一指示信息用于指示每个第一资源文件是否发生变化。Wherein, the above-mentioned first indication information is used to indicate whether each first resource file changes.
需要说明的是,对于差异资源文件以及第一指示信息的解释可以参见上文,此处不再赘述。It should be noted that the explanation of the differential resource file and the first instruction information can be found above and will not be described again here.
可选地,在本申请实施例中,上述第一资源文件包还包括:第二资源文件包中的N个 第一资源文件的排序顺序的顺序信息。Optionally, in this embodiment of the present application, the above-mentioned first resource file package also includes: N pieces of the second resource file package. Sequence information of the sort order of the first resource file.
示例性地,上述至少一个第一资源文件的顺序为服务器默认的顺序。例如,默认为至少一个第一资源文件在第二资源文件包中的文件顺序;或者,上述第一顺序为用户自行设置的顺序。例如,用户可以对至少一个资源文件进行排序,将需要频繁访问的第一资源文件排在前面。如此,服务器能够优先访问到需要频繁访问的第一资源文件。For example, the order of the at least one first resource file is the default order of the server. For example, the default is the file order of at least one first resource file in the second resource file package; or the above-mentioned first order is an order set by the user. For example, the user can sort at least one resource file so that the first resource file that needs to be accessed frequently is ranked first. In this way, the server can preferentially access the first resource file that needs to be accessed frequently.
具体地,服务器可以将第二资源文件包内的每个第一资源文件的唯一路径标识(URL),按顺序记录下来,得到上述排序顺序。Specifically, the server can record the unique path identifier (URL) of each first resource file in the second resource file package in order to obtain the above sorting order.
可选地,在本申请实施例中,服务器根据每个第一资源文件对应的更新状态的状态信息,对第一资源文件进行差分和压缩处理,依次得到第一资源文件对应的差异资源文件Optionally, in this embodiment of the present application, the server performs differential and compression processing on the first resource file according to the status information of the update status corresponding to each first resource file, and sequentially obtains the differential resource file corresponding to the first resource file.
可选地,在本申请实施例中,服务器根据至少一个第一资源文件对应的第一顺序的顺序信息,对第一资源文件进行差分和压缩处理,依次得到第一资源文件对应的差异资源文件。Optionally, in this embodiment of the present application, the server performs differential and compression processing on the first resource file according to the sequence information of the first order corresponding to at least one first resource file, and sequentially obtains the differential resource files corresponding to the first resource file. .
可选地,在本申请实施例中,一个差异资源文件;一个差异资源文件对应一个第一资源文件。Optionally, in this embodiment of the present application, one differential resource file; one differential resource file corresponds to one first resource file.
示例性地,上述差异资源文件用于指示:第一资源文件相对于原始资源文件的差异信息。For example, the above-mentioned difference resource file is used to indicate: difference information of the first resource file relative to the original resource file.
在相关技术中,当应用的原始资源文件包(旧资源文件包)需要更新时,为减少传输的流量,通常采用差分的方式,将旧资源文件包和新资源文件包视为二进制文件,运行差分算法,得到存储了前后差异信息的diff(即差异)文件。设备端再根据旧的资源文件包和diff文件,解析出新的资源文件包。但资源文件变化的特点,跟一般的二进制文件不同,往往是替换或者增删一些的小的资源文件,而不是大面积、无规律地变动,所以传统的差分方式无法得到最优的diff文件,无法最大限度地减少运算量以及传输流量、提升资源升级速度。In related technologies, when the original resource file package (old resource file package) of an application needs to be updated, in order to reduce the transmission traffic, a differential method is usually used to treat the old resource file package and the new resource file package as binary files, and run The difference algorithm obtains a diff (i.e., difference) file that stores the difference information before and after. The device side then parses out the new resource file package based on the old resource file package and diff file. However, the changing characteristics of resource files are different from ordinary binary files. They often replace or add or delete small resource files, rather than large-scale and irregular changes. Therefore, the traditional difference method cannot obtain the optimal diff file. Minimize the amount of computing and transmission traffic, and increase the speed of resource upgrades.
在一些可能的实现方式中,服务器在第一资源文件对应的更新状态指示第一资源文件发生变化的情况下,可以对该第一资源文件和该第一资源文件对应的原始资源文件进行差分和压缩,得到该第一资源文件对应的差异资源文件。服务器在第一资源文件对应的更新状态指示第一资源文件未发生变化的情况下,可以不对该第一资源文件进行处理,即不需要在记录该第一资源文件对应的差异资源文件。In some possible implementations, when the update status corresponding to the first resource file indicates that the first resource file has changed, the server may perform a differential sum on the first resource file and the original resource file corresponding to the first resource file. Compress to obtain the differential resource file corresponding to the first resource file. When the update status corresponding to the first resource file indicates that the first resource file has not changed, the server may not process the first resource file, that is, there is no need to record the difference resource file corresponding to the first resource file.
可以理解,针对有变化的第一资源文件,服务器会进行差分和压缩处理,得到该第一资源文件的差异资源文件,对于未变化的第一资源文件,服务器可以不做处理。需要说明的是,上述差异资源文件也可以称为diff信息。It can be understood that for the changed first resource file, the server will perform differential and compression processing to obtain the differential resource file of the first resource file. For the unchanged first resource file, the server may not perform processing. It should be noted that the above differential resource files can also be called diff information.
步骤402:服务器向电子设备发送第一资源文件包。Step 402: The server sends the first resource file package to the electronic device.
在本申请实施例中,在服务器与电子设备建立连接的情况下,向电子设备发送第一资源文件包。In this embodiment of the present application, when the server establishes a connection with the electronic device, the first resource file package is sent to the electronic device.
可选地,在本申请实施例中,服务器可以基于TCP传输协议向电子设备发送第一资源文件包。Optionally, in this embodiment of the present application, the server may send the first resource file package to the electronic device based on the TCP transmission protocol.
需要说明的是,服务器向电子设备发送资源文件包的具体实现方式可以参考现有技术,本申请实施例对此不再赘述。It should be noted that the specific implementation method of the server sending the resource file package to the electronic device may refer to the existing technology, and will not be described again in the embodiments of this application.
在本申请实施例提供的资源文件更新方法中,服务器根据第二资源文件包,生成第一资源文件包,然后,向电子设备发送上述第一资源文件包;其中,上述第二资源文件包包 括:N个第一资源文件;上述第一资源文件用于更新电子设备中的原始资源文件;上述第一资源文件包包括:至少一个差异资源文件和第一指示信息。通过该方法,服务器可以根据第一资源文件的内容是否发生变化,生成需要向电子设备发送的资源升级包(即第一资源文件包),而不需要对整个新旧资源文件包进行处理,得到资源升级包,从而减少服务器生成资源升级包的运算量,提高服务器的性能,并且有效减少生成的差异资源文件包的数据量,从而减少资源文件传输时消耗的数据量。In the resource file updating method provided by the embodiment of the present application, the server generates a first resource file package based on the second resource file package, and then sends the first resource file package to the electronic device; wherein, the second resource file package It includes: N first resource files; the above-mentioned first resource file is used to update the original resource file in the electronic device; the above-mentioned first resource file package includes: at least one difference resource file and first indication information. Through this method, the server can generate a resource upgrade package (i.e., the first resource file package) that needs to be sent to the electronic device based on whether the content of the first resource file has changed, without processing the entire old and new resource file package to obtain the resource Upgrade package, thereby reducing the amount of calculations required by the server to generate the resource upgrade package, improving server performance, and effectively reducing the amount of data in the generated differential resource file package, thereby reducing the amount of data consumed during resource file transmission.
可选地,在本申请实施例中,上述第一资源文件包可以包括:校验信息。Optionally, in this embodiment of the present application, the above-mentioned first resource file package may include: verification information.
示例性地,服务器可以在第一资源文件包中增加校验信息后,向电子设备发送该第一资源文件包。如此,在该第一资源文件包的文件头部增加校验信息,有效防止在该资源文件包中的资源文件被恶意篡改的情况下,电子设备对恶意篡改的资源文件进行解析和使用,从而保证电子设备端操作的安全性。For example, the server may add the verification information to the first resource file package and then send the first resource file package to the electronic device. In this way, adding verification information to the file header of the first resource file package effectively prevents the electronic device from parsing and using the maliciously tampered resource files when the resource files in the resource file package are maliciously tampered with, thereby preventing the electronic device from parsing and using the maliciously tampered resource files. Ensure the safety of electronic device operations.
可选地,在本申请实施例中,上述步骤402可以包括以下步骤402a:Optionally, in this embodiment of the present application, the above step 402 may include the following step 402a:
步骤402a:服务器第二资源文件包中的第一资源文件的排序顺序的顺序信息,将每个第一资源文件和对应的原始资源文件进行比对,生成至少一个差异资源文件。Step 402a: Based on the sequence information of the sort order of the first resource files in the second resource file package of the server, compare each first resource file with the corresponding original resource file to generate at least one differential resource file.
示例性地,服务器可以将第二资源文件包中的每个第一资源文件的URL按顺序记录下来,生成顺序控制信息,该顺序控制信息中包括:多个项目(Item),一个Item指示一个第一资源文件,一个Item有两个字段的内容:资源文件URL,资源文件的变化标记。然后,按照上述多个项目的顺序,依次按照各个项目指示的第一资源文件的URL,分别从第二资源文件包和原始资源文件包取出对应的第一资源文件和原始资源文件进行对比,区分出有变化和无变化的第一资源文件。For example, the server can record the URLs of each first resource file in the second resource file package in order and generate sequence control information. The sequence control information includes: multiple items (Item), and one Item indicates one In the first resource file, an Item has the content of two fields: the resource file URL and the change mark of the resource file. Then, according to the order of the above-mentioned multiple projects, according to the URL of the first resource file indicated by each project, the corresponding first resource file and the original resource file are taken out from the second resource file package and the original resource file package respectively for comparison and differentiation. Output the changed and unchanged first resource files.
进一步地,针对有变化的第一资源文件,服务器根对该第一资源文件和该第一资源文件对应的原始资源文件进行差分和压缩处理,生成该第一资源文件对应的差异资源文件。Further, for the changed first resource file, the server performs differential and compression processing on the first resource file and the original resource file corresponding to the first resource file, and generates a differential resource file corresponding to the first resource file.
例如,假设第二资源文件包中存在资源文件1、资源文件2和资源文件3以上三个资源文件,资源文件1的资源内容与该资源文件1对应的原始资源文件的资源内容相同,即资源文件1的内容未发生更新(或变化),资源文件2和资源文件3的内容均发生了更新,则服务器可以从第二资源文件包中确定出资源文件2和资源文件3,并分别生成该资源文件2和资源文件3对应的差异资源文件。For example, assume that there are three or more resource files, resource file 1, resource file 2, and resource file 3, in the second resource file package. The resource content of resource file 1 is the same as the resource content of the original resource file corresponding to resource file 1, that is, the resource The content of file 1 has not been updated (or changed), and the contents of resource file 2 and resource file 3 have both been updated. Then the server can determine resource file 2 and resource file 3 from the second resource file package, and generate the resource file 2 and resource file 3 respectively. The difference resource files corresponding to resource file 2 and resource file 3.
可以理解的是,仅针对第一资源文件中发生变化的资源文件进行差分和压缩处理,得到的资源文件的文件体积更小,相比于传统的向电子设备发送的全量的新资源文件包,或者整个新资源文件包和整个原始资源文件包的差异资源文件相比,均有效减小了待发送的资源文件的体积,从而能够节省向第一设备发送时消耗的流量。It can be understood that by performing differential and compression processing only on the resource files that have changed in the first resource file, the file size of the resource files obtained is smaller. Compared with the traditional full new resource file package sent to the electronic device, Or compared with the differential resource files of the entire new resource file package and the entire original resource file package, the volume of the resource files to be sent is effectively reduced, thereby saving traffic consumed when sending to the first device.
如此,服务器可以按照第一资源文件对应的顺序信息,依次判断第一资源文件是否发生变化,并针对发生变化的第一资源文件,生成其对应的差异资源文件,从而能够优先得到较为重要的第一资源文件对应的差异资源文件,提高生成差异资源文件的灵活性。In this way, the server can sequentially determine whether the first resource file has changed according to the sequence information corresponding to the first resource file, and generate a corresponding difference resource file for the changed first resource file, so that the more important third resource file can be obtained first. A differential resource file corresponding to one resource file improves the flexibility of generating differential resource files.
可选地,在本申请实施例中,上述第二资源文件包包括:每个第一资源文件的索引;上述第一资源文件包包括:索引差异信息;Optionally, in this embodiment of the present application, the above-mentioned second resource file package includes: the index of each first resource file; the above-mentioned first resource file package includes: index difference information;
其中,上述索引差异信息包括:Among them, the above index difference information includes:
每个第一资源文件的索引,与每个所述第一资源文件对应的原始资源文件的索引间的差异信息。The index of each first resource file and the difference information between the index of the original resource file corresponding to each first resource file.
示例性地,服务器将第二资源文件包内的索引(即新索引)和原始资源文件包内的索 引(即旧索引),作为二进制数据块,进行差分和压缩处理,得到索引差异信息。For example, the server combines the index in the second resource file package (ie, the new index) with the index in the original resource file package. Index (that is, the old index), as a binary data block, is differentially and compressed to obtain index difference information.
为了便于理解,上述索引差异信息也可以称为索引diff信息。For ease of understanding, the above index difference information may also be called index diff information.
可以理解的是,一个完整的资源文件包通常由索引和资源文件两部分组成,对第一资源文件和原始资源文件的索引进行差分和压缩处理后,能够有效压缩索引的数据量,从而较少向电子设备发送的资源文件包的体积,进而有效节省资源文件传输所消耗的数据量。It can be understood that a complete resource file package usually consists of two parts: an index and a resource file. After differential and compression processing of the index of the first resource file and the original resource file, the amount of data in the index can be effectively compressed, thereby reducing the amount of data in the index. The size of the resource file package sent to the electronic device, thereby effectively saving the amount of data consumed in resource file transmission.
下面结合以上实施例,对本申请实施例提供的资源文件更新方法中的第一资源文件包进行详细说明。The first resource file package in the resource file updating method provided by the embodiment of the present application will be described in detail below in conjunction with the above embodiment.
示例性地,上述第一资源文件包包括索引差异信息、顺序控制信息、差异资源文件,以及校验信息。For example, the above-mentioned first resource file package includes index difference information, sequence control information, difference resource files, and verification information.
如图5所示为第二资源文件包、原始资源文件包以及对应的第一资源文件包的示意图,第一应用的旧资源文件包31(即原始资源文件包)中包括:旧索引、旧资源文件1、旧资源文件2和旧资源文件3等多个资源文件,用于对第一应用进行更新的新资源文件包32(即第二资源文件包)中包括:新索引、与资源文件1对应的新资源文件11、与资源文件2对应的新资源文件12、与资源文件3对应的新资源文件13等多个资源文件,生成的差异资源文件包33(即,第一资源文件包)中包括:校验信息,差异索引,顺序控制信息,以及新资源文件11和新资源文件13分别对应的差异资源文件4和差异资源文件5。As shown in Figure 5 is a schematic diagram of the second resource file package, the original resource file package and the corresponding first resource file package. The old resource file package 31 of the first application (i.e. the original resource file package) includes: old index, old resource file package There are multiple resource files such as resource file 1, old resource file 2, and old resource file 3. The new resource file package 32 (ie, the second resource file package) used to update the first application includes: a new index, and resource files. Multiple resource files such as a new resource file 11 corresponding to resource file 2, a new resource file 12 corresponding to resource file 2, a new resource file 13 corresponding to resource file 3, etc., generate a differential resource file package 33 (i.e., the first resource file package ) includes: verification information, difference index, sequence control information, and the difference resource file 4 and the difference resource file 5 corresponding to the new resource file 11 and the new resource file 13 respectively.
可以理解的是,资源文件11相比于资源文件1发生变化,资源文件12相比于资源文件2未发生变化,资源文件13相比于资源文件3发生变化,由于资源文件12没有发生变化,因此不需要将资源文件12记录在差异资源文件包从而减少待发送资源文件的体积。虚线框中的“文件12”表示资源文件12未变化,不需要在差异资源文件中记录该资源文件12对应的差异资源文件。It can be understood that resource file 11 has changed compared to resource file 1, resource file 12 has not changed compared to resource file 2, and resource file 13 has changed compared to resource file 3. Since resource file 12 has not changed, Therefore, there is no need to record the resource file 12 in the differential resource file package, thereby reducing the size of the resource file to be sent. "File 12" in the dotted box indicates that the resource file 12 has not changed, and there is no need to record the difference resource file corresponding to the resource file 12 in the difference resource file.
需要说明的是,为了清楚地直观地描述资源文件包中包括的信息,图5中以文件夹界面(或者窗口)的形式示出了资源文件包,而不构成对资源文件包的限定。It should be noted that, in order to clearly and intuitively describe the information included in the resource file package, Figure 5 shows the resource file package in the form of a folder interface (or window), which does not constitute a limitation on the resource file package.
可以理解的是,当服务器需要升级客户端(如电子设备)的资源文件时,只要发送第一资源文件包给客户端即可,该第一资源文件包相比于传统的资源文件包体积小,因此能够有效减少传输时所消耗的流量。It can be understood that when the server needs to upgrade the resource files of the client (such as an electronic device), it only needs to send the first resource file package to the client. The first resource file package is smaller in size than the traditional resource file package. , thus effectively reducing the traffic consumed during transmission.
本申请实施例提供一种交互方法,图6示出了本申请实施例提供的交互方法的流程图。如图6所示,本申请实施例提供的交互方法可以包括下述的步骤501至步骤504:The embodiment of the present application provides an interaction method. Figure 6 shows a flow chart of the interaction method provided by the embodiment of the present application. As shown in Figure 6, the interaction method provided by the embodiment of the present application may include the following steps 501 to 504:
步骤501:服务器根据第二资源文件包,生成第一资源文件包。Step 501: The server generates a first resource file package based on the second resource file package.
步骤502:服务器向电子设备发送第一资源文件包。Step 502: The server sends the first resource file package to the electronic device.
步骤503:电子设备获取第一资源文件包。Step 503: The electronic device obtains the first resource file package.
步骤504:电子设备根据第一资源文件包及电子设备内的原始资源包,得到第二资源文件包。Step 504: The electronic device obtains the second resource file package based on the first resource file package and the original resource package in the electronic device.
其中,上述第二资源文件包包括:N个第一资源文件;Wherein, the above-mentioned second resource file package includes: N first resource files;
上述第一资源文件包包括:The above-mentioned first resource file package includes:
至少一个差异资源文件;At least one differential resource file;
指示每个第一资源文件是否发生变化的第一指示信息。First indication information indicating whether each first resource file has changed.
其中,上述第一资源文件用于更新原始资源包中的原始资源文件。Wherein, the above-mentioned first resource file is used to update the original resource file in the original resource package.
一个差异资源文件对应一个第一资源文件;A difference resource file corresponds to a first resource file;
每个差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。 Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
在本申请实施例提供的交互方法中,服务器可以根据第一资源文件的内容是否发生变化,生成需要向电子设备发送的第一资源文件包,电子设备获取该第一资源文件包后,根据指示每个第一资源文件是否发生变化的指示信息,通过第一资源文件包中,第一资源文件对应的差异资源文件以及原始资源包,还原得到第一资源文件,有效减少资源文件传输所耗费的数据量,并且有效减少运算量,提高资源升级速度。In the interaction method provided by the embodiment of the present application, the server can generate a first resource file package that needs to be sent to the electronic device according to whether the content of the first resource file changes. After the electronic device obtains the first resource file package, it can generate the first resource file package according to the instructions. The indication information of whether each first resource file has changed is restored to the first resource file through the differential resource file corresponding to the first resource file and the original resource package in the first resource file package, effectively reducing the time spent on resource file transmission. It reduces the amount of data, effectively reduces the amount of calculations, and improves the speed of resource upgrades.
需要说明的是,本申请各个实施例可以独立执行,或者相互结合执行。It should be noted that each embodiment of the present application can be executed independently or in combination with each other.
本申请实施例提供的方法,执行主体可以为资源文件更新装置。本申请实施例中以资源文件更新装置执行资源文件更新方法为例,说明本申请实施例提供的资源文件更新装置。For the method provided by the embodiment of the present application, the execution subject may be a resource file updating device. In the embodiment of the present application, the resource file updating device performing the resource file updating method is used as an example to illustrate the resource file updating device provided by the embodiment of the present application.
如图7所示,本申请实施例提供一种资源文件更新装置的结构示意图,如图7所示,资源文件更新装置600包括:获取模块601和确定模块602,其中:As shown in Figure 7, this embodiment of the present application provides a schematic structural diagram of a resource file update device. As shown in Figure 7, the resource file update device 600 includes: an acquisition module 601 and a determination module 602, wherein:
上述获取模块601,用于获取第一资源文件包;The above-mentioned acquisition module 601 is used to acquire the first resource file package;
上述确定模块602,用于根据上述获取模块601获取的第一资源文件包及电子设备内的原始资源包,得到第二资源文件包;The above-mentioned determination module 602 is used to obtain a second resource file package based on the first resource file package obtained by the above-mentioned acquisition module 601 and the original resource package in the electronic device;
其中,上述第二资源文件包包括:N个第一资源文件;Wherein, the above-mentioned second resource file package includes: N first resource files;
第一资源文件包包括:The first resource file package includes:
至少一个差异资源文件;At least one differential resource file;
指示每个第一资源文件是否发生变化的第一指示信息;First indication information indicating whether each first resource file has changed;
第一资源文件用于更新原始资源包中的原始资源文件;The first resource file is used to update the original resource file in the original resource package;
一个差异资源文件对应一个第一资源文件;A difference resource file corresponds to a first resource file;
每个差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述确定模块602,具体用于在指示信息指示目标第一资源文件未发生变化的情况下,将原始资源包中目标第一资源文件对应的原始资源文件,作为目标第一资源文件;The above-mentioned determination module 602 is specifically configured to use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file when the indication information indicates that the target first resource file has not changed;
上述确定模块602,具体用于在指示信息指示目标第一资源文件发生变化的情况下,根据原始资源包中目标第一资源文件对应的原始资源文件,和目标第一资源文件对应的差异资源文件,得到目标第一资源文件;The above-mentioned determination module 602 is specifically configured to, when the indication information indicates that the target first resource file has changed, determine based on the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file. , get the target first resource file;
其中,上述目标第一资源文件为N个第一资源文件中的一个或多个资源文件。Wherein, the above-mentioned target first resource file is one or more resource files among the N first resource files.
可选地,在本申请实施例中,上述第一资源文件包还包括:第二资源文件包中的N个第一资源文件的排序顺序的顺序信息;Optionally, in this embodiment of the present application, the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
上述确定模块602,具体用于基于至少一个差异资源文件和原始资源包中的原始资源文件,按照排序顺序,得到N个第一资源文件。The above-mentioned determination module 602 is specifically configured to obtain N first resource files in a sorting order based on at least one differential resource file and the original resource file in the original resource package.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述确定模块602,具体用于针对排序顺序中的第i位:The above-mentioned determination module 602 is specifically used to target the i-th position in the sorting order:
在第i位对应的第一资源文件未发生变化的情况下,将第i位对应的所述原始资源文件,作为第i位对应的第一资源文件;When the first resource file corresponding to the i-th position has not changed, use the original resource file corresponding to the i-th position as the first resource file corresponding to the i-th position;
在第i位对应的第一资源文件发生变化的情况下,基于第i位对应差异资源文件和原始资源文件,得到第i位对应的第一资源文件;When the first resource file corresponding to the i-th position changes, the first resource file corresponding to the i-th position is obtained based on the difference resource file corresponding to the i-th position and the original resource file;
其中,i∈[1,2,……,N]。Among them, i∈[1, 2,...,N].
可选地,在本申请实施例中, Optionally, in the embodiment of this application,
上述第一资源文件包还包括:索引差异信息;The above-mentioned first resource file package also includes: index difference information;
上述索引差异信息包括:每个第一资源文件的索引,与每个第一资源文件对应的原始资源文件的索引间的差异信息;The above-mentioned index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file;
上述确定模块602,还用于在获取模块601获取第一资源文件包之后,基于索引差异信息和原始资源文件的索引,得到每个第一资源文件的索引;The above-mentioned determination module 602 is also configured to obtain the index of each first resource file based on the index difference information and the index of the original resource file after the acquisition module 601 obtains the first resource file package;
其中,上述第二资源文件包包括:每个第一资源文件的索引。Wherein, the above-mentioned second resource file package includes: an index of each first resource file.
在本申请实施例提供的资源文件更新装置中,资源文件更新装置获取第一资源文件包,并根据第一资源文件包以及电子设备内的原始资源包,得到第二资源文件包。其中,上述第二资源文件包包括:N个第一资源文件,上述第一资源文件包包括:至少一个差异资源文件,以及指示每个第一资源文件是否发生变化的第一指示信息;上述第一资源文件用于更新原始资源包中的原始资源文件。通过该方法,资源文件更新装置可以获取至少一个差异资源文件,并基于指示每个第一资源文件是否发生变化的指示信息,通过至少一个差异资源文件和原始资源包中的原始资源文件,还原得到每个第一资源文件,而不需要下载整个差异资源包并对整个差异资源包进行解析,从而节省了下载资源包所消耗的流量,并有效减少资源升级时的运算量,进而提高资源文件的升级速度。In the resource file updating device provided by the embodiment of the present application, the resource file updating device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device. Wherein, the above-mentioned second resource file package includes: N first resource files, the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each first resource file has changed; the above-mentioned third resource file includes: A resource file is used to update the original resource file in the original resource package. Through this method, the resource file updating device can obtain at least one differential resource file, and based on the instruction information indicating whether each first resource file has changed, restore the obtained For each first resource file, there is no need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby improving the efficiency of resource files. Upgrade speed.
如图8所示,本申请实施例提供一种资源文件更新装置的结构示意图,如图8所示,文件资源更新装置700包括:所述装置包括:生成模块701和发送模块702,其中:As shown in Figure 8, an embodiment of the present application provides a schematic structural diagram of a resource file updating device. As shown in Figure 8, a file resource updating device 700 includes: the device includes: a generating module 701 and a sending module 702, wherein:
上述生成模块,用于根据第二资源文件包,生成第一资源文件包;The above-mentioned generation module is used to generate the first resource file package according to the second resource file package;
上述发送模块,用于向电子设备发送生成模块701生成的第一资源文件包;The above-mentioned sending module is used to send the first resource file package generated by the generating module 701 to the electronic device;
其中,上述第二资源文件包包括:N个第一资源文件;Wherein, the above-mentioned second resource file package includes: N first resource files;
第一资源文件用于更新电子设备中的原始资源文件;The first resource file is used to update the original resource file in the electronic device;
第一资源文件包包括:The first resource file package includes:
至少一个差异资源文件,at least one differential resource file,
第一指示信息;first instruction information;
上述第一指示信息用于指示至少一个第一资源文件是否发生变化。The above-mentioned first indication information is used to indicate whether at least one first resource file changes.
可选地,在本申请实施例中,一个差异资源文件对应一个第一资源文件;Optionally, in this embodiment of the present application, a difference resource file corresponds to a first resource file;
上述差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。The above-mentioned difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述生成模块701,具体用于基于第二资源文件包中的第一资源文件的排序顺序的顺序信息,将每个第一资源文件和对应的原始资源文件进行比对,生成至少一个差异资源文件。The above-mentioned generation module 701 is specifically configured to compare each first resource file with the corresponding original resource file based on the sequence information of the sorting order of the first resource file in the second resource file package, and generate at least one differential resource file. .
可选地,在本申请实施例中,上述第一资源文件包还包括:第二资源文件包中的N个第一资源文件的排序顺序的顺序信息。Optionally, in this embodiment of the present application, the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述第二资源文件包还包括:每个第一资源文件的索引;The above-mentioned second resource file package also includes: an index of each first resource file;
上述第一资源文件包还包括:索引差异信息;The above-mentioned first resource file package also includes: index difference information;
其中,上述索引差异信息包括:Among them, the above index difference information includes:
每个第一资源文件的索引,与每个第一资源文件对应的原始资源文件的索引间的差异信息。The index of each first resource file and the difference information between the index of the original resource file corresponding to each first resource file.
在本申请实施例提供的资源文件更新装置中,资源文件更新装置根据第二资源文件 包,生成第一资源文件包,然后,向电子设备发送上述第一资源文件包;其中,上述第二资源文件包包括:N个第一资源文件;上述第一资源文件用于更新电子设备中的原始资源文件;上述第一资源文件包包括:至少一个差异资源文件和第一指示信息。通过该方法,资源文件更新装置可以根据第一资源文件的内容是否发生变化,生成需要向电子设备发送的资源升级包(即第一资源文件包),而不需要对整个新旧资源文件包进行处理,得到资源升级包,从而减少服务器生成资源升级包的运算量,并且有效减少生成的差异资源文件包的数据量,从而减少资源文件传输时消耗的数据量。In the resource file updating device provided by the embodiment of the present application, the resource file updating device is based on the second resource file. package, generate a first resource file package, and then send the first resource file package to the electronic device; wherein the second resource file package includes: N first resource files; the first resource file is used to update the electronic device The original resource file; the above-mentioned first resource file package includes: at least one differential resource file and first indication information. Through this method, the resource file updating device can generate a resource upgrade package (i.e., the first resource file package) that needs to be sent to the electronic device based on whether the content of the first resource file has changed, without the need to process the entire old and new resource file packages. , obtain the resource upgrade package, thereby reducing the amount of calculations required by the server to generate the resource upgrade package, and effectively reducing the amount of data in the generated differential resource file package, thereby reducing the amount of data consumed during resource file transmission.
本申请实施例中的资源文件更新装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The resource file updating device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile internet device (Mobile Internet Device, MID), or augmented reality (AR)/virtual reality (VR). ) equipment, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (personal digital assistants, PDA), etc., and can also be servers, network attached storage (Network Attached Storage), NAS), personal computer (PC), television (TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
本申请实施例中的资源文件更新装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为IOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The resource file updating device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的资源文件更新装置能够实现图1至图3,或者能够实现图4和图5的方法实施例实现的各个过程,为避免重复,这里不再赘述。The resource file updating device provided by the embodiment of the present application can implement Figures 1 to 3, or can implement various processes implemented by the method embodiments of Figures 4 and 5. To avoid duplication, they will not be described again here.
可选地,如图9所示,本申请实施例还提供一种电子设备800,包括处理器801和存储器802,存储器802上存储有可在所述处理器801上运行的程序或指令,该程序或指令被处理器801执行时实现上述资源文件更新方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 9, this embodiment of the present application also provides an electronic device 800, including a processor 801 and a memory 802. The memory 802 stores programs or instructions that can be run on the processor 801. When the program or instruction is executed by the processor 801, each step of the above resource file updating method embodiment is implemented, and the same technical effect can be achieved. To avoid duplication, the details will not be described here.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图10为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
该电子设备100包括但不限于:射频单元101、网络模块102、音频输出单元103、输入单元104、传感器105、显示单元106、用户输入单元107、接口单元108、存储器109、以及处理器110等部件。The electronic device 100 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, etc. part.
本领域技术人员可以理解,电子设备100还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器110逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 100 may also include a power supply (such as a battery) that supplies power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions. The structure of the electronic device shown in Figure 10 does not constitute a limitation on the electronic device. The electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
其中,上述处理器110,用于获取第一资源文件包;Wherein, the above-mentioned processor 110 is used to obtain the first resource file package;
上述处理器110,还用于根据获取的第一资源文件包及电子设备内的原始资源包,得到第二资源文件包;The above-mentioned processor 110 is also configured to obtain a second resource file package based on the obtained first resource file package and the original resource package in the electronic device;
其中,上述第二资源文件包包括:N个第一资源文件;Wherein, the above-mentioned second resource file package includes: N first resource files;
第一资源文件包包括: The first resource file package includes:
至少一个差异资源文件;At least one differential resource file;
指示每个第一资源文件是否发生变化的第一指示信息;First indication information indicating whether each first resource file has changed;
第一资源文件用于更新原始资源包中的原始资源文件;The first resource file is used to update the original resource file in the original resource package;
一个差异资源文件对应一个第一资源文件;A difference resource file corresponds to a first resource file;
每个差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述处理器110,具体用于在指示信息指示目标第一资源文件未发生变化的情况下,将原始资源包中目标第一资源文件对应的原始资源文件,作为目标第一资源文件;The above-mentioned processor 110 is specifically configured to use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file when the instruction information indicates that the target first resource file has not changed;
上述处理器110,具体用于在指示信息指示目标第一资源文件发生变化的情况下,根据原始资源包中目标第一资源文件对应的原始资源文件,和目标第一资源文件对应的差异资源文件,得到目标第一资源文件;The above-mentioned processor 110 is specifically configured to, when the instruction information indicates that the target first resource file has changed, according to the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file. , get the target first resource file;
其中,上述目标第一资源文件为N个第一资源文件中的一个或多个资源文件。Wherein, the above-mentioned target first resource file is one or more resource files among the N first resource files.
可选地,在本申请实施例中,上述第一资源文件包还包括:第二资源文件包中的N个第一资源文件的排序顺序的顺序信息;Optionally, in this embodiment of the present application, the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
上述处理器110,具体用于基于至少一个差异资源文件和原始资源包中的原始资源文件,按照排序顺序,得到N个第一资源文件。The above-mentioned processor 110 is specifically configured to obtain N first resource files in a sorting order based on at least one differential resource file and the original resource file in the original resource package.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述处理器110,具体用于针对排序顺序中的第i位:The above-mentioned processor 110 is specifically used to target the i-th position in the sorting order:
在第i位对应的第一资源文件未发生变化的情况下,将第i位对应的所述原始资源文件,作为第i位对应的第一资源文件;When the first resource file corresponding to the i-th position has not changed, use the original resource file corresponding to the i-th position as the first resource file corresponding to the i-th position;
在第i位对应的第一资源文件发生变化的情况下,基于第i位对应差异资源文件和原始资源文件,得到第i位对应的第一资源文件;When the first resource file corresponding to the i-th position changes, the first resource file corresponding to the i-th position is obtained based on the difference resource file corresponding to the i-th position and the original resource file;
其中,i∈[1,2,……,N]。Among them, i∈[1, 2,...,N].
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述第一资源文件包还包括:索引差异信息;The above-mentioned first resource file package also includes: index difference information;
上述索引差异信息包括:每个第一资源文件的索引,与每个第一资源文件对应的原始资源文件的索引间的差异信息;The above-mentioned index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file;
上述处理器110,还用于在获取第一资源文件包之后,基于索引差异信息和原始资源文件的索引,得到每个第一资源文件的索引;The above-mentioned processor 110 is also configured to obtain the index of each first resource file based on the index difference information and the index of the original resource file after acquiring the first resource file package;
其中,上述第二资源文件包包括:每个第一资源文件的索引。Wherein, the above-mentioned second resource file package includes: an index of each first resource file.
在本申请实施例提供的电子设备中,电子设备获取第一资源文件包,并根据第一资源文件包以及电子设备内的原始资源包,得到第二资源文件包。其中,上述第二资源文件包包括:N个第一资源文件,上述第一资源文件包包括:至少一个差异资源文件,以及指示每个第一资源文件是否发生变化的第一指示信息;上述第一资源文件用于更新原始资源包中的原始资源文件。通过该方法,电子设备可以获取至少一个差异资源文件,并基于指示每个第一资源文件是否发生变化的指示信息,通过至少一个差异资源文件和原始资源包中的原始资源文件,还原得到每个第一资源文件,而不需要下载整个差异资源包并对整个差异资源包进行解析,从而节省了下载资源包所消耗的流量,并有效减少资源升级时的运算量,进而提高资源文件的升级速度。In the electronic device provided by the embodiment of the present application, the electronic device obtains the first resource file package, and obtains the second resource file package based on the first resource file package and the original resource package in the electronic device. Wherein, the above-mentioned second resource file package includes: N first resource files, the above-mentioned first resource file package includes: at least one difference resource file, and first indication information indicating whether each first resource file has changed; the above-mentioned third resource file includes: A resource file is used to update the original resource file in the original resource package. Through this method, the electronic device can obtain at least one differential resource file, and restore each first resource file through the at least one differential resource file and the original resource file in the original resource package based on the indication information indicating whether each first resource file has changed. The first resource file does not need to download the entire differential resource package and parse the entire differential resource package, thereby saving the traffic consumed by downloading the resource package, effectively reducing the amount of calculations during resource upgrade, and thereby increasing the upgrade speed of resource files. .
应理解的是,本申请实施例中,输入单元104可以包括图形处理器(Graphics Processing  Unit,GPU)1041和麦克风1042,图形处理器1041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元106可包括显示面板1061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板1061。用户输入单元107包括触控面板1071以及其他输入设备1072中的至少一种。触控面板1071,也称为触摸屏。触控面板1071可包括触摸检测装置和触摸控制器两个部分。其他输入设备1072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that in this embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit (GPU) 1041 and microphone 1042, the graphics processor 1041 processes image data of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072 . Touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
存储器109可用于存储软件程序以及各种数据。存储器109可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器109可以包括易失性存储器或非易失性存储器,或者,存储器109可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器109包括但不限于这些和任意其它适合类型的存储器。Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc. Additionally, memory 109 may include volatile memory or nonvolatile memory, or memory 109 may include both volatile and nonvolatile memory. Among them, non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). Memory 109 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
处理器110可包括一个或多个处理单元;可选的,处理器110集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器110中。The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 110 .
本申请实施例还提供了一种服务器,如图11所示,该服务器1000包括:天线1001、射频装置1002、基带装置1003、处理器1004和存储器1005。天线1001与射频装置1002连接。在上行方向上,射频装置1002通过天线1001接收信息,将接收的信息发送给基带装置1003进行处理。在下行方向上,基带装置1003对要发送的信息进行处理,并发送给射频装置1002,射频装置1002对收到的信息进行处理后经过天线1001发送出去。An embodiment of the present application also provides a server. As shown in Figure 11, the server 1000 includes: an antenna 1001, a radio frequency device 1002, a baseband device 1003, a processor 1004, and a memory 1005. Antenna 1001 is connected to radio frequency device 1002. In the uplink direction, the radio frequency device 1002 receives information through the antenna 1001 and sends the received information to the baseband device 1003 for processing. In the downlink direction, the baseband device 1003 processes the information to be sent and sends it to the radio frequency device 1002. The radio frequency device 1002 processes the received information and sends it out through the antenna 1001.
以上实施例中服务器执行的方法可以在基带装置1003中实现,该基带装置503包括基带处理器。基带装置1003例如可以包括至少一个基带板,该基带板上设置有多个芯片,如图11所示,其中一个芯片例如为基带处理器,通过总线接口与存储器1005连接,以调用存储器1005中的程序,执行以上方法实施例中服务器操作。The method executed by the server in the above embodiment can be implemented in the baseband device 1003, which includes a baseband processor. The baseband device 1003 may include, for example, at least one baseband board on which multiple chips are disposed, as shown in FIG. Program to perform server operations in the above method embodiments.
服务器还可以包括网络接口1006,该接口例如为通用公共无线接口(common public radio interface,CPRI)。The server may also include a network interface 1006, such as a common public radio interface (CPRI).
其中,上述处理器1004,用于根据第二资源文件包,生成第一资源文件包;Wherein, the above-mentioned processor 1004 is used to generate a first resource file package according to the second resource file package;
上述射频装置1002,用于向电子设备发送处理器1004生成的第一资源文件包;The above-mentioned radio frequency device 1002 is used to send the first resource file package generated by the processor 1004 to the electronic device;
其中,上述第二资源文件包包括:N个第一资源文件;Wherein, the above-mentioned second resource file package includes: N first resource files;
第一资源文件用于更新电子设备中的原始资源文件; The first resource file is used to update the original resource file in the electronic device;
第一资源文件包包括:The first resource file package includes:
至少一个差异资源文件,at least one differential resource file,
第一指示信息;first instruction information;
上述第一指示信息用于指示至少一个第一资源文件是否发生变化。The above-mentioned first indication information is used to indicate whether at least one first resource file changes.
可选地,在本申请实施例中,一个差异资源文件对应一个第一资源文件;Optionally, in this embodiment of the present application, a difference resource file corresponds to a first resource file;
上述差异资源文件用于指示:对应的第一资源文件相对于原始资源文件的差异信息。The above-mentioned difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述处理器1004,具体用于基于第二资源文件包中的第一资源文件的排序顺序的顺序信息,将每个第一资源文件和对应的原始资源文件进行比对,生成至少一个差异资源文件。The above-mentioned processor 1004 is specifically configured to compare each first resource file with the corresponding original resource file based on the sequence information of the sorting order of the first resource file in the second resource file package, and generate at least one differential resource file. .
可选地,在本申请实施例中,上述第一资源文件包还包括:第二资源文件包中的N个第一资源文件的排序顺序的顺序信息。Optionally, in this embodiment of the present application, the above-mentioned first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package.
可选地,在本申请实施例中,Optionally, in the embodiment of this application,
上述第二资源文件包还包括:每个第一资源文件的索引;The above-mentioned second resource file package also includes: an index of each first resource file;
上述第一资源文件包还包括:索引差异信息;The above-mentioned first resource file package also includes: index difference information;
其中,上述索引差异信息包括:Among them, the above index difference information includes:
每个第一资源文件的索引,与每个第一资源文件对应的原始资源文件的索引间的差异信息。The index of each first resource file and the difference information between the index of the original resource file corresponding to each first resource file.
在本申请实施例提供的资源文件更新装置中,资源文件更新装置根据第二资源文件包,生成第一资源文件包,然后,向电子设备发送上述第一资源文件包;其中,上述第二资源文件包包括:N个第一资源文件;上述第一资源文件用于更新电子设备中的原始资源文件;上述第一资源文件包包括:至少一个差异资源文件和第一指示信息。通过该方法,资源文件更新装置可以根据第一资源文件的内容是否发生变化,生成需要向电子设备发送的资源升级包(即第一资源文件包),而不需要对整个新旧资源文件包进行处理,得到资源升级包,从而减少服务器生成资源升级包的运算量,并且有效减少生成的差异资源文件包的数据量,从而减少资源文件传输时消耗的数据量。In the resource file updating device provided by the embodiment of the present application, the resource file updating device generates a first resource file package based on the second resource file package, and then sends the first resource file package to the electronic device; wherein the second resource The file package includes: N first resource files; the above-mentioned first resource file is used to update the original resource file in the electronic device; the above-mentioned first resource file package includes: at least one difference resource file and first indication information. Through this method, the resource file updating device can generate a resource upgrade package (i.e., the first resource file package) that needs to be sent to the electronic device based on whether the content of the first resource file has changed, without the need to process the entire old and new resource file packages. , obtain the resource upgrade package, thereby reducing the amount of calculations required by the server to generate the resource upgrade package, and effectively reducing the amount of data in the generated differential resource file package, thereby reducing the amount of data consumed during resource file transmission.
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述资源文件更新方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above resource file updating method embodiment is implemented, and can achieve The same technical effects are not repeated here to avoid repetition.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述资源文文件更新方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the above resource file updating method. Each process in the example can achieve the same technical effect. To avoid repetition, we will not repeat it here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述资源文件更新方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application provide a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above resource file update method embodiment, and can achieve the same technology. The effect will not be described here to avoid repetition.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非 排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that in this article, the terms "include", "includes" or any other variations thereof are intended to cover non- Exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not expressly listed, or that are inherent to such process, method, article, or apparatus elements. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。 The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.

Claims (20)

  1. 一种资源文件更新方法,所述方法包括:A resource file updating method, the method includes:
    电子设备获取第一资源文件包;The electronic device obtains the first resource file package;
    所述电子设备根据所述第一资源文件包及所述电子设备内的原始资源包,得到第二资源文件包;The electronic device obtains a second resource file package based on the first resource file package and the original resource package in the electronic device;
    其中,所述第二资源文件包包括:N个第一资源文件;Wherein, the second resource file package includes: N first resource files;
    所述第一资源文件包包括:The first resource file package includes:
    至少一个差异资源文件,at least one differential resource file,
    指示每个所述第一资源文件是否发生变化的第一指示信息;First indication information indicating whether each of the first resource files has changed;
    所述第一资源文件用于更新所述原始资源包中的原始资源文件;The first resource file is used to update the original resource file in the original resource package;
    一个所述差异资源文件对应一个所述第一资源文件;One of the difference resource files corresponds to one of the first resource files;
    每个所述差异资源文件用于指示:对应的所述第一资源文件相对于所述原始资源文件的差异信息。Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  2. 根据权利要求1所述的方法,其中,所述电子设备根据所述第一资源文件包及所述电子设备内的原始资源包,得到第二资源文件包,包括:The method according to claim 1, wherein the electronic device obtains a second resource file package based on the first resource file package and the original resource package in the electronic device, including:
    在所述指示信息指示目标第一资源文件未发生变化的情况下,将所述原始资源包中目标第一资源文件对应的原始资源文件,作为所述目标第一资源文件;When the instruction information indicates that the target first resource file has not changed, use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file;
    在所述指示信息指示目标第一资源文件发生变化的情况下,根据所述原始资源包中目标第一资源文件对应的原始资源文件,和所述目标第一资源文件对应的差异资源文件,得到所述目标第一资源文件;When the instruction information indicates that the target first resource file has changed, according to the original resource file corresponding to the target first resource file in the original resource package and the difference resource file corresponding to the target first resource file, we obtain The target first resource file;
    其中,所述目标第一资源文件为所述N个第一资源文件中的一个或多个资源文件。Wherein, the target first resource file is one or more resource files among the N first resource files.
  3. 根据权利要求1所述的方法,其中,所述第一资源文件包还包括:所述第二资源文件包中的所述N个第一资源文件的排序顺序的顺序信息;The method according to claim 1, wherein the first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
    所述电子设备根据所述第一资源文件包及所述电子设备内的原始资源包,得到第二资源文件包,包括:The electronic device obtains a second resource file package based on the first resource file package and the original resource package in the electronic device, including:
    所述电子设备基于所述至少一个差异资源文件和所述原始资源包中的原始资源文件,按照所述排序顺序,得到所述N个第一资源文件。The electronic device obtains the N first resource files in the sorting order based on the at least one differential resource file and the original resource files in the original resource package.
  4. 根据权利要求3所述的方法,其中,所述电子设备基于所述至少一个差异资源文件和所述原始资源包中的原始资源文件,按照所述排序顺序,得到所述N个第一资源文件,包括:The method of claim 3, wherein the electronic device obtains the N first resource files in the sorting order based on the at least one differential resource file and the original resource files in the original resource package. ,include:
    针对所述排序顺序中的第i位:For position i in the sort order:
    在所述第i位对应的所述第一资源文件未发生变化的情况下,将所述第i位对应的所述原始资源文件,作为所述第i位对应的所述第一资源文件;If the first resource file corresponding to the i-th position does not change, use the original resource file corresponding to the i-th position as the first resource file corresponding to the i-th position;
    在所述第i位对应的所述第一资源文件发生变化的情况下,基于所述第i位对应所述差异资源文件和所述原始资源文件,得到所述第i位对应的所述第一资源文件;When the first resource file corresponding to the i-th bit changes, based on the difference resource file corresponding to the i-th bit and the original resource file, the i-th bit corresponding to the first resource file is obtained. a resource file;
    其中,i∈[1,2,……,N]。Among them, i∈[1, 2,...,N].
  5. 根据权利要求1至4任一项所述的方法,其中,The method according to any one of claims 1 to 4, wherein,
    所述第一资源文件包还包括:索引差异信息;The first resource file package also includes: index difference information;
    所述索引差异信息包括:每个所述第一资源文件的索引,与每个所述第一资源文 件对应的所述原始资源文件的索引间的差异信息;The index difference information includes: the index of each first resource file, and the index of each first resource file. Difference information between the indexes of the original resource files corresponding to the files;
    所述电子设备获取第一资源文件包之后,所述方法还包括:After the electronic device obtains the first resource file package, the method further includes:
    基于所述索引差异信息和所述原始资源文件的索引,得到每个所述第一资源文件的索引;Obtain the index of each first resource file based on the index difference information and the index of the original resource file;
    其中,所述第二资源文件包包括:每个所述第一资源文件的索引。Wherein, the second resource file package includes: an index of each of the first resource files.
  6. 一种资源文件更新方法,所述方法包括:A resource file updating method, the method includes:
    服务器根据第二资源文件包,生成第一资源文件包;The server generates the first resource file package based on the second resource file package;
    所述服务器向电子设备发送所述第一资源文件包;The server sends the first resource file package to the electronic device;
    其中,所述第二资源文件包包括:N个第一资源文件;Wherein, the second resource file package includes: N first resource files;
    所述第一资源文件用于更新所述电子设备中的原始资源文件;The first resource file is used to update the original resource file in the electronic device;
    所述第一资源文件包包括:The first resource file package includes:
    至少一个差异资源文件,at least one differential resource file,
    第一指示信息;first instruction information;
    所述第一指示信息用于指示每个所述第一资源文件是否发生变化。The first indication information is used to indicate whether each of the first resource files has changed.
  7. 根据权利要求6所述的方法,其中,一个所述差异资源文件对应一个所述第一资源文件;The method according to claim 6, wherein one of the difference resource files corresponds to one of the first resource files;
    所述差异资源文件用于指示:对应的所述第一资源文件相对于所述原始资源文件的差异信息。The difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  8. 根据权利要求7所述的方法,其中,所述服务器根据第二资源文件包,生成第一资源文件包,包括:The method according to claim 7, wherein the server generates the first resource file package according to the second resource file package, including:
    所述服务器基于所述第二资源文件包中的第一资源文件的排序顺序的顺序信息,将每个所述第一资源文件和对应的原始资源文件进行比对,生成所述至少一个差异资源文件。The server compares each first resource file with the corresponding original resource file based on the sequence information of the sort order of the first resource files in the second resource file package, and generates the at least one differential resource. document.
  9. 根据权利要求6所述的方法,其中,所述第一资源文件包还包括:所述第二资源文件包中的所述N个第一资源文件的排序顺序的顺序信息。The method according to claim 6, wherein the first resource file package further includes: sequence information of the sort order of the N first resource files in the second resource file package.
  10. 根据权利要求6至9任一项所述的方法,其中,The method according to any one of claims 6 to 9, wherein,
    所述第二资源文件包还包括:每个所述第一资源文件的索引;The second resource file package further includes: an index of each of the first resource files;
    所述第一资源文件包还包括:索引差异信息;The first resource file package also includes: index difference information;
    其中,所述索引差异信息包括:Wherein, the index difference information includes:
    每个所述第一资源文件的索引,与每个所述第一资源文件对应的所述原始资源文件的索引间的差异信息。The index of each first resource file and the difference information between the indexes of the original resource files corresponding to each first resource file.
  11. 一种资源文件更新装置,所述装置包括:获取模块和确定模块,其中:A resource file updating device, the device includes: an acquisition module and a determination module, wherein:
    所述获取模块,用于获取第一资源文件包;The acquisition module is used to acquire the first resource file package;
    所述确定模块,用于根据所述获取模块获取的所述第一资源文件包及所述电子设备内的原始资源包,得到第二资源文件包;The determining module is configured to obtain a second resource file package based on the first resource file package obtained by the acquisition module and the original resource package in the electronic device;
    其中,所述第二资源文件包包括:N个第一资源文件;Wherein, the second resource file package includes: N first resource files;
    所述第一资源文件包包括:The first resource file package includes:
    至少一个差异资源文件;At least one differential resource file;
    指示每个所述第一资源文件是否发生变化的第一指示信息;First indication information indicating whether each of the first resource files has changed;
    所述第一资源文件用于更新所述原始资源包中的原始资源文件; The first resource file is used to update the original resource file in the original resource package;
    一个所述差异资源文件对应一个所述第一资源文件;One of the difference resource files corresponds to one of the first resource files;
    每个所述差异资源文件用于指示:对应的所述第一资源文件相对于所述原始资源文件的差异信息。Each difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  12. 根据权利要求11所述的装置,其中,The device of claim 11, wherein:
    所述确定模块,具体用于在所述指示信息指示目标第一资源文件未发生变化的情况下,将所述原始资源包中目标第一资源文件对应的原始资源文件,作为所述目标第一资源文件;The determination module is specifically configured to use the original resource file corresponding to the target first resource file in the original resource package as the target first resource file when the instruction information indicates that the target first resource file has not changed. resource;
    所述确定模块,具体用于在所述指示信息指示目标第一资源文件发生变化的情况下,根据所述原始资源包中目标第一资源文件对应的原始资源文件,和所述目标第一资源文件对应的差异资源文件,得到所述目标第一资源文件;The determination module is specifically configured to determine the original resource file corresponding to the target first resource file in the original resource package and the target first resource when the instruction information indicates that the target first resource file has changed. The differential resource file corresponding to the file is used to obtain the target first resource file;
    其中,所述目标第一资源文件为所述N个第一资源文件中的一个或多个资源文件。Wherein, the target first resource file is one or more resource files among the N first resource files.
  13. 根据权利要求11所述的装置,其中,所述第一资源文件包还包括:所述第二资源文件包中的所述N个第一资源文件的排序顺序的顺序信息;The device according to claim 11, wherein the first resource file package further includes: sequence information of the sorting order of the N first resource files in the second resource file package;
    所述确定模块,具体用于基于所述至少一个差异资源文件和所述原始资源包中的原始资源文件,按照所述排序顺序,得到所述N个第一资源文件。The determination module is specifically configured to obtain the N first resource files in the sorting order based on the at least one differential resource file and the original resource files in the original resource package.
  14. 根据权利要求13所述的装置,其中,The device of claim 13, wherein:
    所述确定模块,具体用于针对所述排序顺序中的第i位:The determination module is specifically used to target the i-th position in the sorting order:
    在所述第i位对应的所述第一资源文件未发生变化的情况下,将所述第i位对应的所述原始资源文件,作为所述第i位对应的所述第一资源文件;If the first resource file corresponding to the i-th position does not change, use the original resource file corresponding to the i-th position as the first resource file corresponding to the i-th position;
    在所述第i位对应的所述第一资源文件发生变化的情况下,基于所述第i位对应所述差异资源文件和所述原始资源文件,得到所述第i位对应的所述第一资源文件;When the first resource file corresponding to the i-th bit changes, based on the difference resource file corresponding to the i-th bit and the original resource file, the i-th bit corresponding to the first resource file is obtained. a resource file;
    其中,i∈[1,2,……,N]。Among them, i∈[1, 2,...,N].
  15. 根据权利要求11至14任一项所述的装置,其中,The device according to any one of claims 11 to 14, wherein,
    所述第一资源文件包还包括:索引差异信息;The first resource file package also includes: index difference information;
    所述索引差异信息包括:每个所述第一资源文件的索引,与每个所述第一资源文件对应的所述原始资源文件的索引间的差异信息;The index difference information includes: the index of each first resource file, and the difference information between the indexes of the original resource files corresponding to each first resource file;
    所述确定模块,还用于在所述获取模块获取第一资源文件包之后,基于所述索引差异信息和所述原始资源文件的索引,得到每个所述第一资源文件的索引;The determination module is also configured to obtain the index of each first resource file based on the index difference information and the index of the original resource file after the acquisition module obtains the first resource file package;
    其中,所述第二资源文件包包括:每个所述第一资源文件的索引。Wherein, the second resource file package includes: an index of each of the first resource files.
  16. 一种资源文件更新装置,所述装置包括:生成模块和发送模块,其中:A resource file updating device, the device includes: a generating module and a sending module, wherein:
    所述生成模块,用于根据第二资源文件包,生成第一资源文件包;The generation module is used to generate a first resource file package according to the second resource file package;
    所述发送模块,用于向电子设备发送所述生成模块生成的所述第一资源文件包;The sending module is configured to send the first resource file package generated by the generating module to an electronic device;
    其中,所述第二资源文件包包括:N个第一资源文件;Wherein, the second resource file package includes: N first resource files;
    所述第一资源文件用于更新所述电子设备中的原始资源文件;The first resource file is used to update the original resource file in the electronic device;
    所述第一资源文件包包括:The first resource file package includes:
    至少一个差异资源文件,at least one differential resource file,
    第一指示信息;first instruction information;
    所述第一指示信息用于指示所述至少一个第一资源文件是否发生变化。The first indication information is used to indicate whether the at least one first resource file changes.
  17. 根据权利要求16所述的装置,其中,一个所述差异资源文件对应一个所述第一资源文件; The device according to claim 16, wherein one of the difference resource files corresponds to one of the first resource files;
    所述差异资源文件用于指示:对应的所述第一资源文件相对于所述原始资源文件的差异信息。The difference resource file is used to indicate: difference information of the corresponding first resource file relative to the original resource file.
  18. 根据权利要求17所述的装置,其中,The device of claim 17, wherein:
    所述生成模块,具体用于基于所述第二资源文件包中的第一资源文件的排序顺序的顺序信息,将每个所述第一资源文件和对应的原始资源文件进行比对,生成所述至少一个差异资源文件。The generation module is specifically configured to compare each first resource file with the corresponding original resource file based on the sequence information of the sorting order of the first resource files in the second resource file package, and generate the Describes at least one differential resource file.
  19. 根据权利要求16所述的装置,其中,所述第一资源文件包还包括:所述第二资源文件包中的所述N个第一资源文件的排序顺序的顺序信息。The apparatus according to claim 16, wherein the first resource file package further includes: sequence information of the sort order of the N first resource files in the second resource file package.
  20. 根据权利要求16至19任一项所述的装置,其中,The device according to any one of claims 16 to 19, wherein,
    所述第二资源文件包还包括:每个所述第一资源文件的索引;The second resource file package further includes: an index of each of the first resource files;
    所述第一资源文件包还包括:索引差异信息;The first resource file package also includes: index difference information;
    其中,所述索引差异信息包括:Wherein, the index difference information includes:
    每个所述第一资源文件的索引,与每个所述第一资源文件对应的所述原始资源文件的索引间的差异信息。 The index of each first resource file and the difference information between the indexes of the original resource files corresponding to each first resource file.
PCT/CN2023/092793 2022-05-09 2023-05-08 Resource file updating method and apparatus, and device and readable storage medium WO2023217086A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210503050.6A CN114860295A (en) 2022-05-09 2022-05-09 Resource file updating method, device, equipment and readable storage medium
CN202210503050.6 2022-05-09

Publications (1)

Publication Number Publication Date
WO2023217086A1 true WO2023217086A1 (en) 2023-11-16

Family

ID=82638150

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092793 WO2023217086A1 (en) 2022-05-09 2023-05-08 Resource file updating method and apparatus, and device and readable storage medium

Country Status (2)

Country Link
CN (1) CN114860295A (en)
WO (1) WO2023217086A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860295A (en) * 2022-05-09 2022-08-05 维沃移动通信有限公司 Resource file updating method, device, equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143766A1 (en) * 2011-06-30 2014-05-22 Xiaomi Inc. Method for re-skinning a third party's application
US20180173857A1 (en) * 2016-12-16 2018-06-21 International Business Machines Corporation Prevention of unauthorized resource updates
CN109908585A (en) * 2019-03-06 2019-06-21 珠海金山网络游戏科技有限公司 A kind of document handling method and system calculate equipment and storage medium
CN111556127A (en) * 2020-04-24 2020-08-18 广东乐心医疗电子股份有限公司 Wearable device upgrading method and related device
CN111562929A (en) * 2020-04-29 2020-08-21 米哈游科技(上海)有限公司 Method, device and equipment for generating patch file and storage medium
CN114860295A (en) * 2022-05-09 2022-08-05 维沃移动通信有限公司 Resource file updating method, device, equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143766A1 (en) * 2011-06-30 2014-05-22 Xiaomi Inc. Method for re-skinning a third party's application
US20180173857A1 (en) * 2016-12-16 2018-06-21 International Business Machines Corporation Prevention of unauthorized resource updates
CN109908585A (en) * 2019-03-06 2019-06-21 珠海金山网络游戏科技有限公司 A kind of document handling method and system calculate equipment and storage medium
CN111556127A (en) * 2020-04-24 2020-08-18 广东乐心医疗电子股份有限公司 Wearable device upgrading method and related device
CN111562929A (en) * 2020-04-29 2020-08-21 米哈游科技(上海)有限公司 Method, device and equipment for generating patch file and storage medium
CN114860295A (en) * 2022-05-09 2022-08-05 维沃移动通信有限公司 Resource file updating method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN114860295A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
US10574770B2 (en) Managing notifications across multiple devices
US9787706B1 (en) Modular architecture for analysis database
US20190236300A1 (en) Service processing method and apparatus, data sharing system, and storage medium
CA2924997C (en) Data management for connected devices
WO2022143540A1 (en) Block chain index storage method and apparatus, computer device and medium
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
US20120072969A1 (en) Determining a sensitivity label of document information in real time
WO2023217086A1 (en) Resource file updating method and apparatus, and device and readable storage medium
WO2009158084A2 (en) Maintenance of exo-file system metadata on removable storage device
CN112199442A (en) Distributed batch file downloading method and device, computer equipment and storage medium
CN112947981A (en) Application program resource updating method and device, terminal equipment and server
WO2023151677A1 (en) Method and apparatus for determining file integrity in file system, and electronic device
US20240103928A1 (en) Information processing method and apparatus for animation resource, device, medium and product
US20220245208A1 (en) Method for switching skin of mini-program page, and electronic device
CN109636460B (en) Service processing method, device, equipment and storage medium
CN114780519A (en) DBC file generation method, device, equipment and medium based on CAN communication
CN113902574A (en) Protocol data processing method, device, computer equipment and storage medium
CN113609479A (en) File detection method and device, electronic equipment and readable storage medium
WO2023202618A1 (en) Data sending method and apparatus
US10133759B1 (en) System for determining storage or output of data objects
CN116032614A (en) Container network micro-isolation method, device, equipment and medium
CN108616603A (en) A kind of intranet and extranet method of data synchronization and system
CN114528509A (en) Page display processing method and device, electronic equipment and storage medium
CN109002710A (en) A kind of detection method, device and computer readable storage medium
CN113890753A (en) Digital identity management method, device, system, computer equipment and storage medium

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: 23802856

Country of ref document: EP

Kind code of ref document: A1