Updating method, readable storage medium, program product and electronic equipment

By detecting update conditions and deleting old resource files that are not preset, the problem of storage space occupation during terminal device update is solved, the rational management of resource file version is realized, and the efficiency of storage space utilization is improved.

CN119166187AActive Publication Date: 2024-12-20HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411034889.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-12-20
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

When a terminal device updates a resource file, it may cause multiple versions to be stored, occupying too much storage space, and it is difficult for the existing technology to effectively manage and delete invalid resource file versions.

Method used

By detecting update conditions, obtaining a new version of the resource file, generating and storing a new version, determining and deleting old versions of non-preset versions, ensuring effective utilization of storage space.

Benefits of technology

It effectively avoids storing invalid resource file versions, reduces the storage space of terminal devices, and improves update efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166187A_ABST
    Figure CN119166187A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses an updating method, a readable storage medium, a program product and electronic equipment. Under the condition that a plurality of versions of a first resource file are stored in the electronic equipment, after the electronic equipment updates the version of the first resource file into a new version based on one version in the plurality of versions, the electronic equipment can pre-load the new version of the first resource file; and deleting all other versions except the preset version of the operating system of the electronic equipment in the plurality of versions of the first resource file. Therefore, the storage space of the electronic equipment can be prevented from being occupied by the non-valid non-preset version of the first resource file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an updating method, a readable storage medium, a program product and an electronic device. Background Art

[0002] Terminal devices can use over-the-air technology (OTA) to update applications in terminal devices and resource files that applications or operating systems depend on (such as artificial intelligence models, virus libraries, etc.).

[0003] In some scenarios, after a terminal device updates a resource file from one version to another version, multiple versions of the resource file may be stored in the terminal device, which may cause the multiple versions of the resource file to occupy too much storage space. Summary of the invention

[0004] Embodiments of the present application provide an updating method, a readable storage medium, a program product, and an electronic device.

[0005] In a first aspect, an update method is provided, which is applied to an electronic device, and the method includes: detecting that an update condition is met, obtaining a first update file of a first resource file, wherein the first update file is an update file of the mth version of the first resource file relative to the nth version of the first resource file, m and n are positive integers, and m is greater than n; generating and storing the mth version of the first resource file based on the update file; determining that the electronic device stores the kth version of the first resource file, and the kth version is not a preset version of the operating system of the electronic device, and deleting the kth version, wherein k is a positive integer less than m.

[0006] In this method, the electronic device has stored the nth version and the kth version of the first resource file. After the first resource file is updated to the mth version based on the nth version, the electronic device can delete the kth version. Based on this, it can be avoided that the kth version of the first resource file occupies the storage space of the electronic device when multiple versions of the first resource file are stored in the electronic device.

[0007] Optionally, the update conditions may include any one of the following conditions: reaching a preset update cycle, detecting a user's operation to update a resource file, receiving an update instruction sent by other electronic devices (such as an OTA server), and detecting an update instruction sent by a business module that depends on the first resource file.

[0008] It should be noted that, among the versions of the first resource file, the i-th version is newer than the i+1-th version (i is a positive integer).

[0009] In a possible implementation of the first aspect, the method further includes: when the mth version of the first resource file is not a preset version of the operating system of the electronic device, deleting the mth version.

[0010] In a possible implementation of the first aspect, the nth version of the first resource file is a preset version of an operating system of the electronic device.

[0011] In a possible implementation of the first aspect above, the generating and storing the mth version of the first resource file based on the first update file includes: when the first update file includes all data of the mth version of the first resource file, storing the mth version of the first resource file in the first update file in the first directory; when the first update file includes incremental data of the mth version of the first resource file relative to the nth version of the first resource file, merging the first update file and the nth version of the first resource file to obtain the mth version of the first resource file, and storing the mth version of the first resource file in the first directory.

[0012] In some embodiments, the first directory may be a directory under a "res" directory in a data partition of the electronic device.

[0013] In a possible implementation of the first aspect above, the type of the above-mentioned first resource file is the first type, the first directory is used to store non-preset versions of resource files of the first type, and the first resource file is a resource file that the first business module depends on; and, it is determined that the electronic device stores the kth version of the first resource file, and the kth version is not a preset version of the operating system of the electronic device, and the kth version is deleted, including: after storing the mth version of the first resource file in the first directory, calling the first business module to preload the mth version of the first resource file, the preloading is used to switch the currently effective version of the first resource file in the first business module to the mth version; after the first business module preloads the mth version of the first resource file, deleting the kth version in the first directory.

[0014] In this method, the electronic device can call the first service module to preload the mth version of the first resource file, and then delete the kth version of the first resource file. In this way, it can be avoided that the kth version of the first resource file cannot be deleted due to the kth version of the first resource file being called by the first service module.

[0015] In a possible implementation of the first aspect above, the electronic device includes at least one second business module that depends on a first type of resource file, and the at least one second business module includes a first business module; and after the first business module preloads the mth version of the first resource file, the kth version in the first directory is deleted, including: obtaining the currently effective version of the first type of resource file on which the second business module depends, and the version of the first type of resource file on which the second business module depends that is in the process of being installed; deleting other versions of the first type of resource file in the first directory except the currently effective version of the first type of resource file on which the second business module depends and the version of the first type of resource file on which the second business module depends that is in the process of being installed.

[0016] In this method, the electronic device deletes the kth version of the first resource file by deleting the first type of resource file in the first directory, except for the currently effective versions of all second business modules that depend on the first type of resource file (that is, the currently effective versions) and the versions of the first type of resource file that are in the process of being updated (or installed). In this way, even if the mth version and the kth version of the first resource file are not resource files of the same branch, the kth version of the first resource file can be deleted.

[0017] In some cases, the second service module may also only include the first service module.

[0018] In a possible implementation of the first aspect above, the first type above includes any one of the following types: large language model, large image semantic understanding model, image generation model, video generation model, speech recognition model, speech synthesis model, personalized audio model, semantic model, virus library, application whitelist, application blacklist, holiday information, and parameters of electronic devices in elderly mode.

[0019] In a second aspect, an electronic device is provided, comprising: one or more processors; one or more memories; one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the electronic device to execute a method as implemented in any one of the first to third aspects above.

[0020] In a third aspect, a computer-readable storage medium is provided, which stores computer-executable program instructions. When the computer-executable program instructions are executed on a computer, the computer executes a method implemented in any one of the first to second aspects above.

[0021] In a fourth aspect, a computer program product is provided. The computer program product includes a computer program code. When the computer program code runs on a computer, the computer executes a method as implemented in any one of the first to second aspects above.

[0022] It should be understood that the beneficial effects of the second to fourth aspects mentioned above can be referred to the description of the first and second aspects and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1A According to some embodiments of the present application, a schematic diagram of a process of updating LLM 01 of a terminal device is shown.

[0024] Figure 1B According to some embodiments of the present application, another schematic diagram of the process of updating LLM 01 of a terminal device is shown.

[0025] Figure 2A According to some embodiments of the present application, a schematic diagram of a process of updating a resource file of a terminal device is shown.

[0026] Figure 2B According to some embodiments of the present application, a schematic diagram of a terminal device deleting a resource file after updating the resource file is shown.

[0027] Figure 3 According to some embodiments of the present application, a schematic diagram of an interaction flow of another updating method is shown.

[0028] Figure 4 According to some embodiments of the present application, a flowchart of an updating method is shown.

[0029] Figure 5A According to some embodiments of the present application, a process diagram of an updating method is shown.

[0030] Figure 5B According to some embodiments of the present application, a process diagram of another updating method is shown.

[0031] Figure 6 According to some embodiments of the present application, a schematic diagram of an interaction flow of another updating method is shown.

[0032] Figure 7 According to some embodiments of the present application, a flowchart of another updating method is shown.

[0033] Figure 8 According to some embodiments of the present application, a schematic structural diagram of a terminal device 10 is shown. DETAILED DESCRIPTION

[0034] The embodiments of the present application include but are not limited to an updating method, a readable storage medium, a program product and a terminal device.

[0035] To facilitate understanding, the terms involved in this application are first introduced.

[0036] (1) Resource files

[0037] Resource files may be files that the operating system or application of the terminal device relies on to implement related functions.

[0038] Exemplarily, the terminal device can implement related functions through an artificial intelligence model, so the resource file can include an artificial intelligence model. For example, the terminal device can process images in the terminal device or images collected / acquired by the terminal device through artificial intelligence models such as a large language model (LLM), a large model for image semantic understanding, an image generation model, a video generation model, a speech recognition model, a speech synthesis model, a personalized audio model, and a semantic model, or process other forms of data (such as audio, text, etc.).

[0039] Exemplarily, an application or service related to terminal device security may perform security management on files in the terminal device based on a virus library, so the resource file may include a virus library.

[0040] Exemplarily, a communication management application or service in a terminal device may rely on a communication blacklist to manage incoming calls, messages, etc. to prevent users from being harassed by numbers in the communication blacklist, etc. Therefore, the resource file may include a communication blacklist.

[0041] Exemplarily, the terminal device can perform permission management and control of applications in the terminal device based on the application whitelist or the application blacklist (for example, limiting the management of some applications that excessively request permissions in the terminal device, etc.), resource scheduling (for example, increasing the priority of applications in the application whitelist, improving the hardware resource configuration of applications in the application whitelist, performance improvement (for example, accelerating applications in the application whitelist, etc.); reducing the priority of applications in the application blacklist, reducing the hardware resource configuration of applications in the application blacklist, etc.), etc. Therefore, the resource file may include an application whitelist, an application blacklist, etc.

[0042] Exemplarily, the terminal device can display information about holidays in different regions. Based on this, the resource file can also include information about holidays in different regions (such as dates of holidays, introductions to holidays (such as introduction text, introduction pictures, etc.), etc.).

[0043] Exemplarily, the terminal device can configure the terminal device or the application of the terminal device with different parameters for different user groups. For example, the terminal device can be configured with an elderly mode suitable for the elderly group, and the resource file can include the parameters of the terminal device in the elderly mode (such as font file, font size, font color, etc.).

[0044] It should be noted that the resource file may also be other resource files, which is not limited here.

[0045] (2) Pre-installed version

[0046] The preset version is the version of the resource file carried by the operating system of the terminal device. The application in the operating system of the terminal device does not have the authority to delete the preset version of the resource file. When the version of the operating system is updated, the operating system can replace the preset version of the resource file in the old version of the operating system with the preset version of the resource file in the new version of the operating system. However, when the electronic device updates the resource file instead of the operating system, the preset version of the resource file cannot be deleted.

[0047] The technical solution of the present application is described below in conjunction with the accompanying drawings.

[0048] It should be noted that the update method provided in the embodiment of the present application can be applied to any terminal device that can be updated through OTA. For example, the terminal device can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific form of the terminal device.

[0049] As described in the background art, in some scenarios, after a terminal device updates a resource file from one version to another version, multiple versions of the resource file may be stored in the terminal device, which may cause the multiple versions of the resource file to occupy too much storage space.

[0050] To reduce the storage space occupied by resource files, in some embodiments, after the terminal device updates version A of the resource file to version B, if version A of the resource file is not the preset version, the terminal device can delete version A of the resource file. In this way, version A of the resource file can be prevented from occupying the storage space of the terminal device.

[0051] However, in some embodiments, if version C of the resource file is stored in the terminal device before the resource file version A is updated to version B, deleting only version A of the resource file will cause version C of the resource file to occupy the storage space of the terminal device.

[0052] For example, in the case where the resource files stored in the terminal device have preset versions and non-preset versions (the version of the resource files of the non-preset versions is newer than the version of the resource files of the non-preset versions). If the user clears the cache of the business module corresponding to the resource files before updating the resource files, the terminal device will be updated based on the preset version of the resource files. In this way, after the update is completed, the terminal device will neither delete the preset version of the resource files nor the non-preset version of the resource files, resulting in the non-preset version of the resource files occupying the storage space of the terminal device.

[0053] For example, Figure 1A A schematic diagram of the process of updating LLM 01 of a terminal device is shown.

[0054] refer to Figure 1A :

[0055] Before the terminal device performs the first update on date D1, the version of LLM 01 in the terminal device is 1.0.1. The first update may be to update the version of LLM 01 from 1.0.1 (as version A) to 1.0.2 (as version B), wherein version 1.0.1 is a preset version. In the process of updating LLM 01 from 1.0.1 to 1.0.2 based on the process shown in FIG2 , since version 1.0.1 of LLM 01 is a preset version, the terminal device will not delete version 1.0.1 of LLM 01, so that the terminal device can store both version 1.0.1 and version 1.0.2 of LLM 01.

[0056] Before the terminal device performs the second update on date D2, the current version of LLM 01 in the terminal device is 1.0.2. The second update can be: updating the version of LLM 01 to version 1.0.3 (as version B). In the process of updating LLM 01 to version 1.0.3, since the cached data of business module B1 is cleared, business module B1 is updated based on the preset version of LLM 01 (version 1.0.1, as version A) (i.e., version 1.0.1 is used as the old version). Since version 1.0.1 of LLM 01 is the preset version, the terminal device will not delete version 1.0.1 of LLM 01, and the terminal device will not delete version 1.0.2 of LLM 01 (as version C). In this way, version 1.0.1, version 1.0.2 and version 1.0.3 of LLM 01 are stored in the terminal device.

[0057] Before the terminal device performs the third update on date D3, the current version of LLM 01 in the terminal device is 1.0.3. The third update may be to update the version of LLM 01 from 1.0.3 (as version A) to 1.0.4 (version B). In the process of updating LLM 01 from 1.0.3 to 1.0.4, since version 1.0.3 of LLM 01 is not a preset version, the terminal device will delete version 1.0.3 of LLM 01, and the terminal device will not delete version 1.0.2 of LLM 01 (as version C). In this way, the terminal device stores version 1.0.1, version 1.0.2 (as version C), and version 1.0.4 of LLM 01.

[0058] In the above process, after the second update, version 1.0.2 of LLM 01 (as version C) is stored in the terminal device as invalid data (business module B1 will not call version 1.0.2 of LLM 01), occupying the storage space of the terminal device.

[0059] For another example, in some embodiments, when the operating system of a terminal device is updated, the preset version of the resource file stored in the terminal device will be replaced with the preset version of the resource file carried by the new version of the operating system, and the non-preset version of the resource file will not be deleted. After the operating system update is completed, if the resource file is updated via OTA, the version of the resource file currently in effect on the terminal device is the preset version carried by the new version of the operating system, and the terminal device will not delete the non-preset version of the resource file, resulting in excessive occupation of the terminal device's storage space.

[0060] For example, Figure 1B Another schematic diagram of the process of updating LLM 01 of a terminal device is shown.

[0061] Before the terminal device performs the first update on date D1, the current version of LLM 01 in the terminal device is 1.0.1. The first update may be to update the version of LLM 01 from version 1.0.1 (as version A) to version 1.0.2 (as version B), wherein version 1.0.1 of LLM 01 is a preset version. During the process of updating LLM 01 from version 1.0.1 to version 1.0.2, since version 1.0.1 is a preset version, the terminal device will not delete version 1.0.1 of LLM 01, so that the terminal device can store both version 1.0.1 and version 1.0.2 of LLM 01.

[0062] On date D4, the terminal device is updated for the fourth time, and the fourth update is to update the operating system, and the version of LLM 01 carried in the new version of the operating system is 1.0.5 (as the preset version). During the process of updating the operating system, the terminal device will replace the preset version of LLM 01 from version 1.0.1 to version 1.0.5, and will not delete version 1.0.2 of LLM 01, so that the terminal device can store both version 1.0.5 and version 1.0.2 of LLM 01.

[0063] Before the terminal device performs the fifth update on date D5, the current version of LLM 01 in the terminal device is 1.0.5. The fifth update may be to update the version of LLM 01 from 1.0.5 (as version A) to 1.0.6 (as version B). In the process of updating LLM 01 from 1.0.5 to 1.0.6, since version 1.0.5 of LLM 01 is a preset version, the terminal device will not delete version 1.0.5 of LLM 01, and the terminal device will not delete version 1.0.2 of LLM 01 (as version C). In this way, the terminal device stores versions 1.0.2, 1.0.5, and 1.0.6 of LLM 01.

[0064] Before the terminal device performs the sixth update on date D6, the current version of LLM 01 in the terminal device is 1.0.6. The sixth update may be to update the version of LLM 01 from 1.0.6 (as version A) to 1.0.7 (as version B). In the process of updating LLM 01 from 1.0.6 to 1.0.7, since version 1.0.6 of LLM 01 is not a preset version, the terminal device may delete version 1.0.6 of LLM 01, and the terminal device will not delete version 1.0.2 of LLM 01 (as version C). In this way, the terminal device stores versions 1.0.2, 1.0.5, and 1.0.7 of LLM 01.

[0065] From the above process, it can be seen that after the fifth update, in addition to the preset version of the resource file (LLM version 1.0.5) and the currently effective version, there are also invalid resource files (LLM 01 version 1.0.2) in the terminal device, which occupy the storage space of the terminal device.

[0066] For ease of understanding, a process of updating resource files of a terminal device is introduced below.

[0067] For example, Figure 2A According to some embodiments of the present application, a schematic diagram of a process of updating a resource file of a terminal device is shown.

[0068] like Figure 2A As shown, developers can transfer the developed new version of resource files to the OTA server through the version release new platform. The business module in the terminal device (such as an application, service or other module that depends on or calls a resource file) can provide the version information of the old version of the resource file that the business module depends on to the resource update software development kit (SDK) by registering for updates to the resource update software development kit (SDK). When the software update application meets the update conditions, it can obtain the version information of the old version of the resource file from the resource update SDK, and search and download the new version update resources corresponding to the old version of the resource file from the OTA server (such as the incremental update data of the new version of the resource file (such as the B version of the resource file) relative to the old version of the resource file, or all the data of the new version of the resource file), and install the downloaded update resources. Secondly, the software update application can install the new version update resources to obtain the new version of the resource file. Finally, refer to Figure 2B , the software update application can trigger the business module to load the new version of the resource file, and after loading the new version of the resource file, if the old version of the resource file is not the preset version, delete the old version of the resource file.

[0069] It should be noted that the business module can be any application, service or other module in the terminal device that needs to rely on or call resource files. For example, the business module can include but is not limited to YOYO suggestions, smart voice, smart vision, smart input method, system manager, mobile phone manager, etc.

[0070] It should be noted that the business module can select a version of the resource file it depends on (preset version or non-preset version) from among multiple versions of the stored resource files.

[0071] It should be noted that the resource update SDK can be an SDK provided by the developer of the software update application or the developer of the terminal device to the developer of the business module, and the SDK can be used for the interaction between the business module and the software update application. The resource update SDK can be embedded in the business module, or it can be a functional module or service independent of the business module. For example, the resource update SDK can obtain the resource parameters of the business module (such as the type, branch, version, and identification of the dependent resource file, etc.), respond to the call of the software update application, and send the resource parameters of the business module to the software update application.

[0072] It should be noted that the software update application can be an application or service in the operating system of the terminal device for updating resource files or the operating system. The software update application can obtain resource parameters of the service module from the service module, obtain new versions of resource files from the OTA server, download / decompress / authenticate / differentially merge / store resource files, delete resource files, etc.

[0073] In some embodiments, the service module and the software update application may be located in the application layer of the operating system of the terminal device.

[0074] Exemplarily, the following introduces a process of a resource updating method by taking the example that business module B1 updates the resource file from resource file type1_branch1_V1 (resource file of type type1, branch branch1, and version V1) to resource file type1_branch1_V2 (resource file of type type1, branch branch1, and version V2), and business module B2 updates the resource file from resource file type1_branch2_V3 (resource file of type type1, branch branch2, and version V3) to resource file type1_branch2_V4 (resource file of type type1, branch branch2, and version V4).

[0075] It should be noted that the type is used to indicate the type of resource file, such as LLM, large model for image semantic understanding, image generation model, video generation model, speech recognition model, speech synthesis model, personalized audio model, semantic model, virus library, application whitelist, application blacklist, holiday information, parameters of terminal devices in elderly mode, etc. There can be multiple resource files of one type. Branches are used to indicate resource files with different functions or called by different business modules in a resource file of one type. For example, for a resource file of the LLM type, it can include an LLM for image processing (as a branch of the LLM), an LLM for audio processing (as a branch of the LLM), etc. In addition, a resource file can be uniquely identified based on the type, branch and version.

[0076] Specifically, Figure 3 According to some embodiments of the present application, a schematic flow chart of an updating method is shown. As shown in FIG2 , the method includes the following steps:

[0077] S301, the business module B1 sets resource parameters to the resource update SDK.

[0078] In some embodiments, when business module B1 is started or installed, it can set resource parameters to the resource update SDK. The resource parameters may include the type, branch, version, storage path of the resource files that business module B1 depends on, the identification of business module B1, the version of business module B1 and other information.

[0079] It should be noted that the business module B1 or the business module B2 mentioned below may be any application, service or module that depends on or calls a resource file.

[0080] S302, the business module B2 sets resource parameters to the resource update SDK.

[0081] In some embodiments, when business module B2 is started or installed, it can set resource parameters to the resource update SDK. The resource parameters may include the type, branch, version, storage path of the resource files that business module B2 depends on, the identification of business module B2, the version of business module B2 and other information.

[0082] S303, the software update application detects that the update condition is met, and calls the provider interface of the business module B1 to obtain the resource parameters of the business module B1.

[0083] When the software update application detects that the update conditions are met (for example, the preset update cycle is reached, or the user's update operation is detected, or an update instruction sent by the OTA server is received), it can call the provider interface of the business module B1 to obtain the resource parameters of the business module B1.

[0084] It should be noted that the provider interface can be an interface provided by the business module (or resource update SDK) that can interact with the business module (or resource update SDK), and other applications or modules can obtain resource parameters of the business module through the provider interface. In some embodiments, the provider interface can also be other interfaces with the same or similar functions.

[0085] S304 , the business module B1 responds to the call of the software update application and sends the resource parameters of the resource file type1_branch1_V1 to the software update application.

[0086] In response to the software update application's call to the provider interface, the business module B1 may send resource parameters, such as resource parameters type1_branch1_V1 of the resource file type1_branch1_V1, to the software update application.

[0087] S305, the software update application detects that the update condition is met, and calls the provider interface of the business module B2 to obtain the resource parameters of the business module B2.

[0088] When the software update application detects that the update conditions are met, it can call the provider interface of the business module B2 to obtain the resource parameters of the business module B2.

[0089] It should be noted that step S305 may be executed in parallel with step S303, or may be executed before or between step S304 and step S305.

[0090] S306 , the business module B2 sends resource parameters of the resource file type1_branch2_V3 to the software update application in response to the call of the software update application.

[0091] In response to the software update application's call to the provider interface, the service module B2 may send resource parameters, such as resource parameters type1_branch2_V3 of the resource file type1_branch2_V3, to the software update application.

[0092] S307, the software update application sends an update request to the OTA server.

[0093] After receiving the resource parameters provided by each service module, the software update application may send an update request to the OTA server, and the update request may include the resource parameters of each service module.

[0094] S308, the OTA server sends version information of the new version resource file to the software update application.

[0095] After receiving the update request, the OTA server may send version information of the new version resource file to the software update application if there is a resource file with a newer version than the resource file indicated by the update request.

[0096] For example, the OTA server may send version information (V2) of resource file type1_branch1_V2 corresponding to an updated version of resource file type1_branch1_V1 of service module B1, and version information (V4) of resource file type1_branch2_V4 corresponding to an updated version of resource file type1_branch2_V3 of service module B2 to the software update application.

[0097] S309, the software update application downloads new version update resources from the OTA server.

[0098] After receiving the version information of the new version resource file, the software update application can download the new version update resource from the OTA server. For example, the software update application can download the update resource corresponding to the resource file type1_branch1_V2 and the update resource corresponding to the resource file type1_branch2_V4 from the OTA server.

[0099] It should be noted that the new version capital update resource can be a full file of the new version resource file, or an incremental file of the new version resource file relative to the old version resource file obtained by the software update application from the business module.

[0100] S310, the software update application authenticates, decompresses, differentially merges the resource file type1_branch1_V2, and grants the business module B1 access rights to the resource file type1_branch1_V2.

[0101] After downloading the update resources corresponding to the resource file type1_branch1_V2, the software update application can authenticate and decompress the update resources corresponding to the resource file type1_branch1_V2 (or can also include differential merging (synthesizing the update resources of the resource file type1_branch1_V2 with the resource file type1_branch1_V1)), obtain and store the resource file type1_branch1_V2, and grant the business module B1 access to the resource file type1_branch1_V2.

[0102] It should be noted that differential merging means that when the updated resource only includes part of the data of the new version resource file, and another part of the data in the new version resource file is the same as that in the old version resource file, the new version of the resource file is obtained by merging the old version resource file or the other part of the data with the part of the data.

[0103] S311, the software update application authenticates, decompresses, differentially merges the resource file type1_branch2_V4, and grants the business module B2 access rights to the resource file type1_branch2_V4.

[0104] After downloading the updated resources corresponding to resource file type1_branch2_V4, the software update application can authenticate and decompress the updated resources corresponding to resource file type1_branch2_V4 (or can also include differential merging (synthesizing the updated resources of resource file type1_branch2_V4 with resource file type1_branch2_V3)), obtain and store resource file type1_branch2_V4, and grant business module B2 access to resource file type1_branch2_V4.

[0105] It should be noted that the execution order of step S311 and step S310, and step S312 to step S317 can be swapped and executed in parallel, and is not limited here.

[0106] S312, the software update application sends a preload broadcast to the service module B1.

[0107] After granting the business module B1 access to the resource file type1_branch1_V2, the software update application can send a preload broadcast to the business module B1 to enable the business module B1 to load the resource file type1_branch1_V2. In some embodiments, the preload broadcast can include resource parameters (type, branch, version, etc.) of the resource file that the business module B1 needs to preload.

[0108] S313, business module B1 preloads resource file type1_branch1_V2.

[0109] The service module B1 may preload the resource file type1_branch1_V2 in response to the preloading broadcast of the software update application.

[0110] S314, the business module B1 updates the resource parameters of the resource file type1_branch1_V2 to the resource update SDK.

[0111] After preloading the resource file type1_branch1_V2, the business module B1 may update the resource parameters of the resource file type1_branch1_V2 to the resource update SDK, so that the resource update SDK may provide the resource parameters type1_branch1_V2 to other modules when the provider interface is called.

[0112] S315, the software update application calls the provider interface to obtain resource parameters of the business module B1.

[0113] S316, the business module B1 sends the resource parameters of the resource file type1_branch1_V2 to the software update application.

[0114] In response to the software update application's call to the provider interface, the service module B1 sends the resource parameter type1_branch1_V2 of the resource file type1_branch1_V2 to the software update application.

[0115] S317 , the software update application deletes the resource file type1_branch1_V1 based on the resource parameters of the resource file type1_branch1_V2 .

[0116] After receiving the resource parameter type1_branch1_V2, the software update application may determine that the resource file type1_branch1_V2 has been updated, and delete the resource file (resource file type1_branch1_V1) corresponding to the resource parameter received in the aforementioned step S304.

[0117] It should be noted that if the resource file corresponding to the resource parameter received in the aforementioned step S304 is a preset version of the resource file, it will not be deleted.

[0118] S318, the software update application sends a preload broadcast to the service module B2.

[0119] After granting the service module B2 access rights to the resource file type1_branch2_V4, the software update application may send a preload broadcast to the service module B2 to enable the service module B2 to load the resource file type1_branch2_V4.

[0120] S319, business module B2 preloads resource file type1_branch2_V4.

[0121] The service module B2 may preload the resource file type1_branch2_V4 in response to the preloading broadcast of the software update application.

[0122] S320, the business module B2 updates the resource parameters of the resource file type1_branch2_V4 to the resource update SDK.

[0123] After preloading the resource file type1_branch2_V4, the business module B2 may update the resource parameters of the resource file type1_branch2_V4 to the resource update SDK, so that the resource update SDK may provide the resource parameters type1_branch2_V4 to other modules when the provider interface is called.

[0124] S321, the software update application calls the provider interface of the business module B2 to obtain resource parameters of the business module B2.

[0125] S322, the business module B2 sends resource parameters of the resource file type1_branch2_V4 to the software update application.

[0126] In response to the software update application's call to the provider interface, the service module B2 sends the resource parameter type1_branch2_V4 of the resource file type1_branch2_V4 to the software update application.

[0127] S323, the software update application deletes the resource file type2_branch1_V3 based on the resource parameters of the resource file type2_branch2_V4.

[0128] After receiving the resource parameter type1_branch2_V4, the software update application may determine that the resource file type1_branch2_V4 has been updated, and delete the resource file (resource file type1_branch2_V3) corresponding to the resource parameter received in the aforementioned step S306.

[0129] It should be noted that steps S318 to S323 can be executed in parallel with steps S312 to S317, which is not limited here.

[0130] Based on the above process, taking the updating of the resource file of the business module B1 as an example, after updating the version of the resource file, the terminal device will only delete the resource file of the version corresponding to the resource parameter transmitted by the business module B1 to the software update application in step S304. If there are multiple versions of the resource file of the business module B1 stored in the terminal device before the update (for example, in addition to the resource file type1_branch1_V1, the resource file type1_branch1_V0 is also stored), it may cause the software update application to store the resource file type1_branch1_V0 after deleting the resource file type1_branch1_V1, resulting in additional storage space of the terminal device being occupied.

[0131] For example, for the aforementioned Figure 1AIn the situation shown, during the second update process, the resource file type1_branch1_V1 may be version 1.0.1 of LLM 01, the resource file type1_branch1_V2 may be version 1.0.3 of LLM 01, and the resource file type1_branch1_V0 may be version 1.0.2 of LLM 01. During the third update process, the resource file type1_branch1_V1 may be version 1.0.3 of LLM 01, the resource file type1_branch1_V2 may be version 1.0.4 of LLM 01, and the resource file type1_branch1_V0 may be version 1.0.2 of LLM 01. After the update, the terminal device will not delete the resource file type1_branch1_V0 (version 1.0.2 of LLM 01), resulting in excessive occupation of the terminal device's storage space.

[0132] For example, for the aforementioned Figure 1B In the situation shown, during the fifth update, the resource file type1_branch1_V1 may be version 1.0.5 of LLM 01, the resource file type1_branch1_V2 may be version 1.0.6 of LLM 01, and the resource file type1_branch1_V0 may be version 1.0.2 of LLM 01. During the sixth update, the resource file type1_branch1_V1 may be version 1.0.6 of LLM 01, the resource file type1_branch1_V2 may be version 1.0.7 of LLM 01, and the resource file type1_branch1_V0 may be version 1.0.2 of LLM 01. After the update, the terminal device will not delete the resource file type1_branch1_V0 (version 1.0.2 of LLM 01), resulting in excessive occupation of the terminal device's storage space.

[0133] In view of this, an embodiment of the present application provides an update method, in which a terminal device can delete other versions except the preset version and the new version of the first resource file when the first resource file is updated from an old version to a new version. In this way, it is possible to avoid storing the non-preset version of the first resource file that is not effective, which is conducive to reducing the storage space occupied by the first resource file.

[0134] Exemplarily, before the update, if the terminal device stores a first version and a second version of the first resource file, and the first version is a preset version. If the currently effective version of the first resource file is the first version (as the old version), the terminal device can delete the second version of the first resource file after updating the first resource file from the first version to the third version (as the new version). If the currently effective version of the first resource file is the second version (as the old version), the terminal device can delete the second version of the first resource file after updating the first resource file from the second version to the third version (as the new version).

[0135] For example, for Figure 1A In the case shown, after the second update is completed (or during the second update), the terminal device can delete all versions of LLM 01 except version 1.0.1 (as a preset version) and version 1.0.3 (as a new version), that is, delete version 1.0.2 of LLM 01. In this way, the terminal device only needs to store version 1.0.1 and version 1.0.3 of LLM 01 without storing version 1.0.2 of LLM 01, which is conducive to reducing the storage space occupied by LLM 01.

[0136] For example, for Figure 1B In the case shown, after the fifth update is completed (or during the fifth update), the terminal device can delete all versions of LLM 01 except version 1.0.5 (as a preset version) and version 1.0.6 (as a new version), that is, delete version 1.0.2 of LLM 01. In this way, the terminal device only needs to store version 1.0.5 and version 1.0.6 of LLM 01 without storing version 1.0.2 of LLM 01, which is conducive to reducing the storage space occupied by LLM 01.

[0137] It should be noted that the first resource file can be any type of resource file, such as LLM, large image semantic understanding model, image generation model, video generation model, speech recognition model, speech synthesis model, personalized audio model, semantic model, virus library, application whitelist, application blacklist, holiday information, parameters of terminal devices in elderly mode, etc.

[0138] Next, combine Figures 4 to 8 Introduce the technical solution of this application.

[0139] For example, Figure 4 According to some embodiments of the present application, a schematic diagram of a process of updating method is shown. The execution subject of the process is a terminal device, such as Figure 4 As shown, the method comprises the following steps:

[0140] S401, detecting that an update condition is met, obtaining an update resource of a third version of a first resource file relative to an old version from an OTA server.

[0141] When the terminal device detects that the update condition is met, it can obtain the update resource of the third version of the first resource file relative to the old version from the OTA server. The update resource of the old version can be the current effective version of the first resource file in the terminal device, or it can be a preset version of the first resource file.

[0142] In some embodiments, the third version may be the latest version of the first resource file in the OTA server that is applicable to the terminal device.

[0143] Exemplarily, the terminal device may send the version information of the old version to the OTA server, so that the OTA server determines the difference file (as the update resource) between the third version (new version) of the first resource file and the old version of the first resource file. Then, the OTA server may send the update resource to the terminal device. In this case, the terminal device only needs to download the incremental file of the third version of the first resource file relative to the old version, which can reduce the amount of downloaded data.

[0144] Exemplarily, the terminal device may also send the version information of the old version to the OTA server, so that the OTA server determines the third version (new version) of the first resource file and sends the version information of the third version to the terminal device. Then, the terminal device may download the third version of the first resource file from the OTA server (as an updated resource).

[0145] In some embodiments, the update conditions may include: reaching a preset update cycle, detecting a user operation to update a resource file, detecting an instruction from a service module to update a resource file, and receiving update information sent by an OTA server.

[0146] S402: Store a third version of the first resource file based on the acquired updated resource.

[0147] After acquiring the updated resource, the terminal device may store the third version of the first resource file in the storage path of the first resource file.

[0148] For example, when the update resource is all data of the third version of the first resource file, the terminal device may directly store the third version of the first resource file in the storage path of the first resource file.

[0149] For another example, when the updated resource is the incremental data of the third version of the first resource file relative to the old version, the terminal device can merge the updated resource with the old version of the first resource file to obtain the third version of the first resource file, and store the obtained third version of the first resource file in the storage path of the first resource file.

[0150] It should be noted that, in some other embodiments, the terminal device may further perform operations such as decompression and authentication on the updated resource before storing the third version of the first resource file.

[0151] For example, in some embodiments, the path for storing resource files in the terminal device may be "data / res" (in the res folder in the data partition), and the path may include multiple folders, each of which is used to store a type of resource file. For example, the "LLM" folder under the storage path "data / res" can be used to store resource files of type LLM, the "viruslib" folder under the storage path "data / res" can be used to store resource files of type virus library, the "whitelist_app" folder under the storage path " / data / res" can be used to store resource files of type application whitelist, the "blacklist_app" folder under the storage path " / data / res" can be used to store resource files of type application blacklist, and so on.

[0152] It should be noted that the above storage path is only an example. In other embodiments, the storage path of the resource file may be any other path, which is not limited here.

[0153] S403: Delete all versions of the first resource file except the third version and the preset version.

[0154] Exemplarily, after the terminal device stores the third version of the first resource file in the storage path of the first resource file, the terminal device may delete other versions of the first resource file except the third version and the preset version.

[0155] Exemplarily, after the terminal device stores the third version of the first resource file in the storage path of the first resource file, it can call a business module that depends on the first resource file (hereinafter referred to as the associated business module of the first resource file) to preload the third version of the first resource file, so as to avoid the first resource file of the version being called by the associated business module of the first resource file being unable to be deleted. Then, after the associated business module of the first resource file preloads the third version of the first resource file, the terminal device can delete other versions of the first resource file except the third version and the preset version.

[0156] In some embodiments, the first resource file may be a resource file that the first business module depends on, and the first resource file may be a resource file of the first type. The terminal device may first call the first business module to preload the third version of the first resource file, and obtain the current effective version of the first type of resource file that the associated business module of the first type of resource file (the dependent resource file includes the business module of the first type of resource file) depends on, and the version of the first type of resource file being installed by the terminal device. Then, the terminal device may delete the directory storing the first type of resource files, except for the current effective version of the first type of resource file that the associated business module of the first type of resource file depends on and the version of the first type of resource file being installed by the terminal device. For details, please refer to the following FIG. 5A to FIG. 7 Based on this method, it can be avoided that the terminal device stores the old version of the first resource file when the third version and the old version of the first resource file belong to different branches of the first type.

[0157] Based on the above method, it can be avoided that after the version of the first resource file is updated to the third version, the terminal device still stores other versions of the first resource file except the third version and the preset version, which is beneficial to saving storage space of the terminal device.

[0158] Below, taking the first resource file including type1_branch1 (the associated business module is business module B1), type1_branch2 (the associated business module is business module B2), the version of the first resource file stored in the terminal device includes type1_branch1 v1 version (type1_branch1_v1, preset version), type1_branch1 v2 version (type1_branch1_v2, currently effective version), type1_branch2 v3 version (type1_branch2_v3, preset version), type1_branch2 v4 version (type1_branch2_v4, currently effective version), and the new version of the first resource file is type1_branch1 v5 version (type1_branch1_v5) and type1_branch2 v6 version (type1_branch1_v6) as an example, the technical solution of the present application is introduced.

[0159] For example, Figure 5A According to some embodiments of the present application, a process diagram of an updating method is shown.

[0160] like Figure 5AAs shown, before the update, the path "data / res / type1" for storing resource files of type 1 stores the v2 version of resource file type 1_branch1 and the v4 version of resource file type 1_branch2, and the v2 version of type 1_branch1 is the current effective version of business module B1, and the v4 version of type 1_branch2 is the current effective version of business module B2. In addition, the path for storing preset versions of resource files in the terminal device also stores the v1 version of resource file type 1_branch1 and the v3 version of resource file type 1_branch2.

[0161] If the update conditions are met, the terminal device can download the new version of the resource file type1_branch1 v5 version and type1_branch2 v6 version from the OTA server. Then, the terminal device can perform authentication, decompression, differential merging, authorization and other processing on the resource file type1_branch1 v5 version and the resource file type1_branch2 v6 version in parallel to store the resource file type1_branch1 v5 version and the resource file type1_branch2 v6 version in the path "data / res / type1". Secondly, the terminal device can preload the resource file type1_branch1 v5 version through the business module B1 and the resource file type1_branch2 v6 version through the business module B2.

[0162] After business module B1 successfully preloads version v5 of resource file type1_branch1, business module B2 has not yet preloaded version v6 of resource file type1_branch2. The terminal device can retain the currently effective version (the currently effective version v5 of type1_branch1 of business module B1 and the currently effective version v4 of type1_branch2 of business module B2) and the installed version of the resource file of type type1 (i.e., version v6 of type1_branch2), and delete other versions of the resource file of type type1 except the currently effective version and the installed version (i.e., delete version v2 of type1_branch1).

[0163] After business module B2 successfully preloads version v6 of resource file type1_branch2, the terminal device can retain the currently effective version (the currently effective version of business module B1, namely version v5 of type1_branch1 and the currently effective version v6 of type1_branch2 of business module B2) and the installed version of resource files of type type1 (none), and delete other versions of resource files of type type1 except the currently effective version and the installed version (i.e. delete version v4 of type1_branch2).

[0164] In this way, after the update, the versions of the first resource file stored in the terminal device include version v1 of type1_branch1 (pre-set version), version v5 of type1_branch1 (currently effective version), version v3 of type1_branch2 (pre-set version), and version v6 of type1_branch2 (currently effective version), thereby avoiding the storage of version v2 of resource file type1_branch1 and version v4 of resource file type1_branch2, and reducing the number of stored resource files.

[0165] Below, based on the aforementioned Figure 5A After the update process is completed, the terminal device updates the preset version of type1_branch1 from v1 to v7 and the preset version of type1_branch2 from v3 to v8 by updating the operating system and then updating. In this case, the first resource file includes type1_branch1 (the associated business module is business module B1) and type1_branch2 (the associated business module is business module B2). The versions of the first resource file stored in the terminal device include type1_branch1's v7 version (type1_branch1_v7, preset version, currently effective version), type1_branch1's v5 version (type1_branch1_v5), type1_branch2's v8 version (type1_branch2_v8, preset version, currently effective version), and type1_branch2's v6 version (type1_branch2_v6). Taking the new version of the first resource file as type1_branch1's v9 version (type1_branch1_v9) and type1_branch2's v10 version (type1_branch1_v10) as examples, the technical solution of the present application is introduced.

[0166] For example, Figure 5B According to some embodiments of the present application, a process diagram of another updating method is shown.

[0167] like Figure 5B As shown, before the update, the path "data / res / type1" for storing resource files of type 1 stores the v5 version of resource file type 1_branch1 and the v6 version of resource file type 1_branch2. In addition, the path for storing preset versions of resource files in the terminal device also stores the v7 version (currently effective version) of resource file type 1_branch1 and the v8 version (currently effective version) of resource file type 1_branch2.

[0168] If the update conditions are met, the terminal device can download the new version of the resource file type1_branch1 v9 version and type1_branch2 v10 version from the OTA server. Then, the terminal device can perform authentication, decompression, differential merging, authorization and other processing on the resource file type1_branch1 v9 version and the resource file type1_branch2 v10 version in parallel to store the resource file type1_branch1 v9 version and the resource file type1_branch2 v10 version in the path "data / res / type1". Secondly, the terminal device can preload the resource file type1_branch1 v9 version through the business module B1 and the resource file type1_branch2 v10 version through the business module B2.

[0169] After business module B1 successfully preloads version v9 of resource file type1_branch1, business module B2 has not yet preloaded version v10 of resource file type1_branch2. The terminal device can retain the currently effective version (the currently effective version v9 of type1_branch1 of business module B1 and the currently effective version v8 of type1_branch2 of business module B2) and the type 1 resource file of the version being installed (i.e., version v10 of type1_branch2), and delete the type 1 resource files of other versions except the currently effective version and the version being installed (i.e., delete version v5 of type1_branch1 and version v6 of type1_branch2).

[0170] After business module B2 successfully preloads version v10 of resource file type1_branch2, the terminal device can retain the currently effective version (the currently effective version v9 of type1_branch1 of business module B1 and the currently effective version v10 of type1_branch2 of business module B2) and the installed version of resource files of type 1 (none), and delete resource files of type 1 (none) of other versions except the currently effective version and the installed version.

[0171] In this way, after the update, the versions of the first resource file stored in the terminal device include version v7 of type1_branch1 (pre-set version), version v9 of type1_branch1 (currently effective version), version v8 of type1_branch2 (pre-set version), and version v10 of type1_branch2 (currently effective version), avoiding the storage of version v5 of resource file type1_branch1 and version v6 of resource file type1_branch2, thereby reducing the number of stored resource files.

[0172] Next, combine Figure 5A The situation shown introduces the technical solution of the present application.

[0173] For example, Figure 6 According to some embodiments of the present application, a schematic diagram of an interactive process of an update method is shown. Figure 6 As shown, the method comprises the following steps:

[0174] S601, the business module B1 sets resource parameters to the resource update SDK.

[0175] In some embodiments, when business module B1 is started or installed, resource parameters can be set to the resource update SDK. The resource parameters may include the type, branch, version (for example, the currently effective version, preset version, etc.), storage path of the resource files that business module B1 depends on, the identifier of business module B1, the version of business module B1 and other information.

[0176] It should be noted that the business module B1 or the business module B2 mentioned below may be any application, service or module that depends on or calls a resource file.

[0177] For example, for Figure 5A In the scenario shown, the business module B1 can configure type1_branch1_v2 to the resource update SDK to indicate that the type of the resource file that the business module B1 depends on is type1, the branch is branch1, and the current effective version is v2.

[0178] S602, the business module B1 sets the type of the resource file to type1 in the application manifest metadata.

[0179] It should be noted that the application manifest metadata is used to record parameters such as the type of resource files that the business module depends on. For example, the application manifest metadata may include a RES_TYPE field, which is used to record the type of resource files that the business module depends on.

[0180] Business module B1 may adjust the value of the RES_TYPE field of the application manifest metadata in the resource update SDK of business module B1 to type1 to indicate the type of resource file that business module B1 depends on. For example, if type1 is LLM, business module B1 may adjust the value of the RES_TYPE field to "LLM".

[0181] It should be noted that, in other embodiments, the business module B1 may also use other fields to record the type of resource file that the business module B1 depends on, which is not limited here.

[0182] In some embodiments, the types of resource files that the business module B1 depends on may be one or more, and accordingly, the value of the RES_TYPE field may also be one or more.

[0183] In some embodiments, step S601 and step S602 may be combined into one step, which is not limited here.

[0184] S603, the business module B2 sets resource parameters to the resource update SDK.

[0185] In some embodiments, when business module B2 is started or installed, it can set resource parameters to the resource update SDK. The resource parameters may include the type, branch, version (for example, the currently effective version, preset version, etc.), storage path of the resource files that business module B2 depends on, the identification of business module B2, the version of business module B2 and other information.

[0186] For example, for Figure 5A In the scenario shown, the business module B2 can configure type1_branch2_v4 to the resource update SDK to indicate that the type of the resource file that the business module B2 depends on is type1, the branch is branch2, and the current effective version is v4.

[0187] S604, the business module B2 sets the type of the resource file to type1 in the application manifest metadata.

[0188] It should be noted that the application manifest metadata is used to record parameters such as the type of resource files that the business module depends on. For example, the application manifest metadata may include a RES_TYPE field, which is used to record the type of resource files that the business module depends on.

[0189] Business module B2 may adjust the value of the RES_TYPE field of the application manifest metadata in the resource update SDK of business module B2 to type1 to indicate the type of resource file that business module B2 depends on. For example, if type1 is LLM, business module B2 may adjust the value of the RES_TYPE field to "LLM".

[0190] It should be noted that, in other embodiments, the business module B2 may also use other fields to record the type of resource files that the business module B1 depends on, which is not limited here.

[0191] In some embodiments, the types of resource files that the business module B2 depends on may be one or more, and accordingly, the value of the RES_TYPE field may also be one or more.

[0192] It should be noted that step S603 and step S604 may be executed before step S601 and step S602, or executed in parallel with step S601 and step S602, which is not limited here.

[0193] S605 , the software update application detects that the update condition is met, and calls the provider interface of the business module B1 to obtain the resource parameters of the business module B1 .

[0194] When the software update application detects that the update conditions are met (for example, the preset update cycle is reached, or the user's update operation is detected, or an update instruction sent by the OTA server is received), it can call the provider interface of the business module B1 to obtain the resource parameters of the business module B1.

[0195] It should be noted that the provider interface can be an interface provided by the business module (or resource update SDK) that can interact with the business module (or resource update SDK), and other applications or modules can obtain resource parameters of the business module through the provider interface. In some embodiments, the provider interface can also be other interfaces with the same or similar functions.

[0196] S606 , the business module B1 sends resource parameters of the resource file type1_branch1_v2 to the software update application in response to the call of the software update application.

[0197] In response to the software update application calling the provider interface, the service module B1 can send resource parameters to the software update application. Figure 5A In the illustrated situation, the resource parameter sent by the business module B1 may be the resource parameter type1_branch1_v2 of the resource file type1_branch1_v2.

[0198] It should be noted that in some scenarios, such as a scenario where the cache of the business module B1 is cleared, the business module B1 may also send resource parameters of the resource file type1_branch1_v1 to the software update application.

[0199] S607, the software update application detects that the update condition is met, and calls the provider interface of the business module B2 to obtain the resource parameters of the business module B2.

[0200] When the software update application detects that the update conditions are met, it can call the provider interface of the business module B2 to obtain the resource parameters of the business module B2.

[0201] It should be noted that step S607 may be executed in parallel with step S605, or may be executed before or between step S606 and step S607.

[0202] S608 , the business module B2 sends resource parameters of the resource file type1_branch2_v4 to the software update application in response to the call of the software update application.

[0203] In response to the software update application calling the provider interface, the service module B2 can send the currently effective version resource parameters to the software update application. Figure 5A In the illustrated situation, the resource parameter sent by the business module B2 may be the resource parameter type1_branch2_v4 of the resource file type1_branch2_v4.

[0204] It should be noted that in some scenarios, such as a scenario where the cache of the business module B2 is cleared, the business module B2 may also send resource parameters of the resource file type1_branch2_v3 to the software update application.

[0205] S609: The software update application sends an update request to the OTA server.

[0206] After receiving the resource parameters provided by each service module, the software update application can send an update request to the OTA server. The update request can include the resource parameters of each service module, such as the type, branch, version, etc. of the resource file.

[0207] For example, for Figure 5A In the illustrated scenario, the update request may include resource parameters type1_branch1_v2 of the service module B1 and resource parameters type1_branch2_v4 of the service module B2.

[0208] S610, the OTA server sends version information of the new version resource file to the software update application.

[0209] After receiving the update request, the OTA server may send version information of the new version of the resource file to the software update application if there is a resource file of a newer version than the resource file indicated by the update request.

[0210] For example, for Figure 5A In the scenario shown, the OTA server may send version information (v5) of resource file type1_branch1_v5 corresponding to an updated version of resource file type1_branch1_v2 of service module B1, and version information (v6) of resource file type1_branch2_v6 corresponding to an updated version of resource file type1_branch2_v4 of service module B2 to the software update application.

[0211] S611, the software update application downloads new version update resources from the OTA server.

[0212] After receiving the version information of the new version resource file, the software update application can download the new version update resource from the OTA server. For example, the software update application can download the update resource corresponding to the resource file type1_branch1_v5 (the incremental data or full data of the resource file type1_branch1_v5 relative to the resource file type1_branch1_v2) and the update resource corresponding to the resource file type1_branch2_v6 (the incremental data or full data of the resource file type1_branch1_v6 relative to the resource file type1_branch2_v4) from the OTA server.

[0213] It should be noted that the new version capital update resource can be the full data of the new version resource file, or it can be the incremental data of the new version resource file relative to the old version resource file obtained by the software update application from the business module.

[0214] It should be noted that in some scenarios, if the resource parameters received by the software update application are resource parameters of resource file type1_branch1_v1, the software update application may download updated resources (full data or incremental data) of resource file type1_branch1_v5 relative to resource file type1_branch1_v1.

[0215] It should be noted that in some scenarios, if the resource parameters received by the software update application are resource parameters of resource file type1_branch2_v3, the software update application may download updated resources (full data or incremental data) of resource file type1_branch1_v6 relative to resource file type1_branch2_v3.

[0216] S612, the software update application authenticates, decompresses, and differentially merges the resource file type1_branch1_v5, and grants the business module B1 access rights to the resource file type1_branch1_v5.

[0217] After downloading the updated resources corresponding to the resource file type1_branch1_v5, the software update application can authenticate and decompress the updated resources corresponding to the resource file type1_branch1_v5 (or can also include differential merging (synthesizing the updated resources of the resource file type1_branch1_v5 with the resource file type1_branch1_v2)), obtain and store the resource file type1_branch1_v5, and grant business module B1 access to the resource file type1_branch1_v5.

[0218] S613, the software update application authenticates, decompresses, and differentially merges the resource file type1_branch2_v6, and grants the business module B2 access rights to the resource file type1_branch2_v6.

[0219] After downloading the updated resources corresponding to resource file type1_branch2_v6, the software update application can authenticate and decompress the updated resources corresponding to resource file type1_branch2_v6 (or can also include differential merging (synthesizing the updated resources of resource file type1_branch2_v6 with resource file type1_branch2_v4)), obtain and store resource file type1_branch2_v6, and grant business module B2 access to resource file type1_branch2_v6.

[0220] S614, the software update application sends a preload broadcast to the service module B1.

[0221] After granting the business module B1 access to the resource file type1_branch1_v5, the software update application can send a preload broadcast to the business module B1 to enable the business module B1 to load the resource file type1_branch1_v5. In some embodiments, the preload broadcast can include resource parameters (type, branch, version, etc.) of the resource file that the business module B1 needs to preload.

[0222] In some embodiments, if there are resource files that other business modules depend on, they also include a business module preload resource file type1_branch1_v5 of type type1 and branch branch1.

[0223] In some embodiments, the service module B1 may also send a preload broadcast for preloading type1_branch1_v5 to all service modules whose dependent resource files include resource files of type 1 (eg, the service module B2).

[0224] S615, business module B1 preloads resource file type1_branch1_v5.

[0225] The service module B1 may preload the resource file type1_branch1_v5 in response to the preloading broadcast of the software update application.

[0226] S616, the business module B1 updates the resource parameters of the resource file type1_branch1_v5 to the resource update SDK.

[0227] After preloading the resource file type1_branch1_v5, the business module B1 may update the resource parameters of the resource file type1_branch1_v5 to the resource update SDK, so that the resource update SDK may provide the resource parameters type1_branch1_v5 to other modules when the provider interface is called.

[0228] S617, the software update application determines the associated business module of the resource file of type 1.

[0229] The software update application can determine the associated business module of the resource file of type type1, that is, the dependent resource file includes the business module of the resource file of type type1. Figure 5A In the illustrated situation, the associated business modules of the resource file of type 1 include business module B1 and business module B2.

[0230] It should be noted that step S617 can be executed in parallel with step S615 and step S616, or executed before step S615, which is not limited here.

[0231] It should be noted that, in some embodiments, the software update application may call the provider interface of the service module associated with the resource file of type 1 to obtain the resource parameters of the service module.

[0232] S618, the software update application calls the provider interface of the business module B1 to obtain resource parameters of the business module B1.

[0233] S619, the business module B1 sends the resource parameters of the resource file type1_branch1_v5 to the software update application.

[0234] In response to the software update application's call to the provider interface, the service module B1 sends the resource parameter type1_branch1_v5 of the resource file type1_branch1_v5 to the software update application.

[0235] S620, the software update application calls the provider interface of the business module B2 to obtain resource parameters of the business module B2.

[0236] S621, the business module B2 sends resource parameters of the resource file type1_branch2_v4 to the software update application.

[0237] In response to the software update application's call to the provider interface, the service module B2 sends the resource parameter type1_branch1_v4 of the resource file type1_branch1_v4 to the software update application.

[0238] S622: The software update application obtains resource parameters of the resource file of type 1 being installed.

[0239] For example, for Figure 5A In the illustrated scenario, before the v6 version of the resource file type1_branch2 is installed, the software update application obtains the resource parameters of the resource file of type type1 being installed, which may include type1_branch2_v6 (v6 version of type1_branch2).

[0240] S623, the software update application deletes resource files of type type 1, except for the currently effective version and the version being installed.

[0241] After the software update application obtains the resource parameters of the business module associated with the resource file of type type1 (corresponding to the currently effective version of the resource file of type type1) and the resource parameters of type type1 being installed (corresponding to the version of the resource file of type type1 being installed), it can delete the resource files of other versions in the resource file of type type1 except the currently effective version and the version being installed.

[0242] For example, corresponding to Figure 5A In the situation shown, the software update application can delete the resource files of type type1 (v2 version of resource file type1_branch1) under the path "res / data / type1", except the v5 version of resource file type1_branch1 (as the current effective version of business module B1), the v4 version of resource file type1_branch2 (as the current effective version of business module B2) and the v6 version of resource file type1_branch2 (as the version being installed).

[0243] It should be noted that, since version v1 of resource file type1_branch1 and version v3 of resource file type1_branch2 are preset versions, the software update application does not delete these two versions.

[0244] Based on this method, even if the resource parameters set by business module B1 to the resource update SDK in the aforementioned step S601 are the resource parameters of resource file type1_branch1_v1, and the resource parameters sent by business module B1 to the software update application in the aforementioned step S606 are the resource parameters of resource file type1_branch1_v1, the v2 version of the aforementioned resource file type1_branch1 can also be deleted in this step.

[0245] S624, the software update application sends a preload broadcast to the service module B2.

[0246] After granting the service module B2 access rights to the resource file type1_branch2_v6, the software update application may send a preload broadcast to the service module B2 to enable the service module B2 to load the resource file type1_branch2_v6.

[0247] S625, business module B2 preloads resource file type1_branch2_v6.

[0248] The service module B2 may preload the resource file type1_branch2_v6 in response to the preloading broadcast of the software update application.

[0249] S626, the business module B2 updates the resource parameters of the resource file type1_branch2_v6 to the resource update SDK.

[0250] After preloading the resource file type1_branch2_v6, the business module B2 may update the resource parameters of the resource file type1_branch2_v6 to the resource update SDK, so that the resource update SDK may provide the resource parameters type1_branch2_v6 to other modules when the provider interface is called.

[0251] S627, the software update application determines the associated business module of the resource file of type 1.

[0252] The software update application can determine the associated business module of the resource file of type type1, that is, the dependent resource file includes the business module of the resource file of type type1. Figure 5A In the illustrated situation, the associated business modules of the resource file of type 1 include business module B1 and business module B2.

[0253] It should be noted that step S627 can be executed in parallel with step S624 and step S625, or executed before step S624, which is not limited here.

[0254] It should be noted that, in some embodiments, the software update application may call the provider interface of the service module associated with the resource file of type 1 to obtain the resource parameters of the service module.

[0255] In some embodiments, the software update application can determine the associated business module of the resource file of type 1 according to the value of the RES_TYPE field in the application manifest metadata of each business module. If the value of the RES_TYPE field of a business module is type 1, the business module is determined as the associated business module of the resource file of type 1.

[0256] S628, the software update application calls the provider interface of the business module B1 to obtain resource parameters of the business module B1.

[0257] S629, the business module B1 sends the resource parameters of the resource file type1_branch1_v5 to the software update application.

[0258] In response to the software update application's call to the provider interface, the service module B1 sends the resource parameter type1_branch1_v5 of the resource file type1_branch1_v5 to the software update application.

[0259] S630, the software update application calls the provider interface of the business module B2 to obtain resource parameters of the business module B2.

[0260] S631, the business module B2 sends resource parameters of the resource file type1_branch2_v6 to the software update application.

[0261] In response to the software update application's call to the provider interface, the service module B2 sends the resource parameter type1_branch2_v6 of the resource file type1_branch2_v6 to the software update application.

[0262] S632: The software update application obtains resource parameters of the resource file of type 1 being installed.

[0263] For example, for Figure 5A In the situation shown, after the v6 version of the resource file type1_branch2 is preloaded, there is no resource file of type type1 being installed.

[0264] S633: The software update application deletes resource files of type 1 except for the currently effective version and the version being installed.

[0265] After the software update application obtains the resource parameters of the business module associated with the resource file of type type1 (corresponding to the currently effective version of the resource file of type type1) and the resource parameters of type type1 being installed (corresponding to the version of the resource file of type type1 being installed), it can delete the resource files of other versions in the resource file of type type1 except the currently effective version and the version being installed.

[0266] For example, corresponding to Figure 5A In the scenario shown, after the business module B2 has preloaded the resource file type1_branch2_v6, all resource files have been updated (i.e., there is no resource file of type type1 being installed). The software update application can delete the resource files of type type1 (v4 version of resource file type1_branch2) under the path "res / data / type1", except for the v5 version of resource file type1_branch1 (as the current effective version of business module B1) and the v6 version of resource file type1_branch2 (as the current effective version of business module B2).

[0267] Based on this method, even if the resource parameters set by business module B2 to the resource update SDK in the aforementioned step S603 are the resource parameters of resource file type1_branch2_v3, and the resource parameters sent by business module B2 to the software update application in the aforementioned step S608 are the resource parameters of resource file type1_branch2_v3, the v4 version of the aforementioned resource file type1_branch2 can also be deleted in this step.

[0268] It should be noted that, since version v1 of resource file type1_branch1 and version v3 of resource file type1_branch2 are preset versions, the software update application does not delete these two versions.

[0269] Based on the above method, when the terminal device is updating the resource files of the business module, after enabling a business module to preload a new version of the resource files, it can delete all other versions of the resource files except the effective version and the installed version in the resource files of the same type as the resource files of the business module. In this way, it can be avoided that the terminal device stores ineffective non-preset versions of resource files, which are not limited here. In addition, it can also avoid that the terminal device stores old versions of resource files due to different branches before and after the resource files are updated.

[0270] The embodiment of the present application also provides an updating method applied to a terminal device.

[0271] For example, Figure 7 According to some embodiments of the present application, a flowchart of an updating method is shown. The execution subject of the method is a terminal device. Figure 7 As shown, the method comprises the following steps:

[0272] S701: It is detected that an update condition is met, and an updated resource of a third version of a first resource file of a first type that a first business module depends on relative to an old version is obtained.

[0273] When the terminal device detects that the update condition is met, it can obtain the update resource of the third version of the first resource file (as a new version resource file) relative to the old version from the OTA server. The update resource can be all the data of the third version of the first resource file, or it can be the incremental data of the third version of the first resource file relative to the old version.

[0274] For example, for Figure 5A and Figure 6In the scenario shown, when the first business module is business module B1: the first type is type1, the first resource file is the resource file of branch1 in type1 (resource file type1_branch1), the third version is v5, and the old version is v2 or v1. When the first business module is business module B2: the first type is type1, the first resource file is the resource file of branch2 in type1 (resource file type1_branch2), the third version is v6, and the old version is v4 or v3.

[0275] For example, for Figure 5B In the illustrated scenario, when the first business module is business module B1: the first type is type1, the first resource file is the resource file of branch1 in type1 (resource file type1_branch1), the third version is v9, and the old version is v7. When the first business module is business module B2: the first type is type1, the first resource file is the resource file of branch2 in type1 (resource file type1_branch2), the third version is v10, and the old version is v8.

[0276] In some embodiments, the old version may be a first version or a second version. The second version may be newer or older than the first version, and the first version may be a preset version or a non-preset version.

[0277] For example, for Figure 5A and Figure 6 In the illustrated scenario, when the first service module is service module B1, the first version is v1 and the second version is v2. When the first service module is service module B2, the first version is v3 and the second version is v4.

[0278] For example, for Figure 5B In the illustrated scenario, when the first service module is service module B1, the first version is v5 and the second version is v8. When the first service module is service module B2, the first version is v6 and the second version is v10.

[0279] For example, for Figure 1A In the case of the second update, the first version can be 1.0.2, the second version can be 1.0.1, and the old version can be the second version. Figure 1B In the case of the fifth update, the first version may be 1.0.2, the second version may be 1.0.5, and the old version may be the second version.

[0280] S702: Based on the acquired updated resource, store the third version of the first resource file in the storage path of the first type of resource file.

[0281] After obtaining the updated resources of the third version of the first resource file relative to the old version, the terminal device can perform authentication, decompression, differential merging and other operations on the obtained updated resources to obtain the third version of the first resource file, and store the third version of the first resource file in the storage path of the first type of resource file.

[0282] Exemplarily, assuming that the storage path of the resource file is "data / res" and the first type is type1, the storage path of the resource file of the first type may be "data / res / type1". The terminal device may store the third version of the first resource file in "data / res / type1" when all data of the third version of the first resource file of the updated resource is stored in the updated resource. Alternatively, when the updated resource is the incremental data of the third version of the first resource file relative to the old version, the terminal device may merge the updated resource with the old version of the first resource file to obtain the third version of the first resource file, and store the obtained third version of the first resource file in "data / res / type1".

[0283] For example, for Figure 5A and Figure 6 In the illustrated scenario, when the first service module is service module B1, the terminal device may store resource file type1_branch1_v5 in the path “data / res / type1”. When the first service module is service module B2, the terminal device may store resource file type1_branch2_v6 in the path “data / res / type1”.

[0284] For example, for Figure 5B In the illustrated scenario, when the first service module is service module B1, the terminal device may store resource file type1_branch1_v9 in the path “data / res / type1”. When the first service module is service module B2, the terminal device may store resource file type1_branch2_v10 in the path “data / res / type1”.

[0285] S703: Call the first service module to preload the third version of the first resource file.

[0286] After storing the third version of the first resource file in the storage path of the first type of resource file, the terminal device can call the first service module to preload the third version of the first resource file. It should be noted that after the first service module preloads the third version of the first resource file, the current effective version of the first resource file in the first service module changes to the third version.

[0287] For example, for Figure 5A and Figure 6 In the scenario shown, when the first service module is service module B1, the terminal device can call service module B1 to preload version v5 of resource file type1_branch1. When the first service module is service module B2, the terminal device can call service module B2 to preload version v6 of resource file type1_branch2.

[0288] For example, for Figure 5B In the scenario shown, when the first service module is service module B1, the terminal device can call service module B1 to preload version v9 of resource file type1_branch1. When the first service module is service module B2, the terminal device can call service module B2 to preload version v10 of resource file type1_branch2.

[0289] S704, obtaining the currently effective version of the first type of resource file in the corresponding associated business module and the version of the first type of resource file being installed.

[0290] After the first service module preloads the third version of the first resource file, the terminal device may obtain the currently effective version of the first type of resource file in the corresponding associated service module and the version of the first type of resource file being installed.

[0291] For example, for Figure 5A and Figure 6 In the scenario shown, when the first business module is business module B1: the currently effective versions of the first type of resource files in the corresponding associated business modules include the v5 version of type1_branch1 effective in business module B1, and the v4 version of type1_branch2 effective in business module B2 (business module B2 has not yet preloaded the resource file type1_branch2_v6); the version of the first type of resource files being installed may include the v6 version of the resource file type1_branch2 being installed by business module B2.

[0292] For example, for Figure 5A and Figure 6In the situation shown, when the first business module is business module B2: the currently effective versions of the first type of resource files in the corresponding associated business modules include the v5 version of type1_branch1 effective in business module B1 (business module B1 has preloaded resource file type1_branch1_v5), and the v6 version of type1_branch2 effective in business module B2; and there is no version of the first type of resource files being installed.

[0293] For example, for Figure 5B In the scenario shown, when the first business module is business module B1: the currently effective versions of the first type of resource files in the corresponding associated business modules include the v9 version of type1_branch1 effective in business module B1, and the v8 version of type1_branch2 effective in business module B2 (business module B2 has not yet preloaded the resource file type1_branch2_v10); the version of the first type of resource files being installed may include the v10 version of the resource file type1_branch2 being installed by business module B2.

[0294] For example, for Figure 5B In the scenario shown, when the first business module is business module B2: the currently effective versions of the first type of resource files in the corresponding associated business modules include the v9 version of type1_branch1 effective in business module B1 (business module B1 has preloaded resource file type1_branch1_v9), and the v10 version of type1_branch2 effective in business module B2; and there is no version of the first type of resource files being installed.

[0295] S705 , deleting, from the storage directory of the first type of resource files, other versions of the first type of resource files except the currently effective version of the first type of resource files in the corresponding associated business module and the version of the first type of resource files being installed.

[0296] After obtaining the currently effective version of the first type of resource file in the corresponding associated business module and the version of the first type of resource file being installed, the terminal device can delete other versions of the first type of resource file in the storage directory of the first type of resource files except the currently effective version of the first type of resource file in the corresponding associated business module and the version of the first type of resource file being installed.

[0297] For example, for Figure 5AIn the scenario shown, when the first service module is service module B1, the terminal device can delete the v2 version of the resource file type1_branch1 in the storage path "data / res / type1". When the first service module is service module B2, the terminal device can delete the v4 version of the resource file type1_branch2 in the storage path "data / res / type1".

[0298] For example, for Figure 5B In the scenario shown, when the first business module is business module B1, the terminal device can delete the v5 version of the resource file type1_branch1 and the v6 version of the resource file type1_branch1 in the storage path "data / res / type1". When the first business module is business module B2, there are no other versions in the storage path "data / res / type1" except the currently effective version of the first type of resource file in the corresponding associated business module and the version of the first type of resource file being installed, so there is no need to delete them.

[0299] For example, for Figure 1A The second update and Figure 1B In the case of the fifth update, the terminal device can delete version 1.0.2 of LLM 01.

[0300] Since the resource files that the business module depends on may be updated from a resource file of one branch of one type to a resource file of another branch of the same type of resource files during the update process, deleting the old version of the resource file based on the above method can avoid the resource file of branch a occupying storage space after the resource file is updated from branch a to branch b.

[0301] Based on the above method, the terminal device can delete the ineffective non-preset version of the first resource file in time to avoid excessive occupation of the storage space of the terminal device.

[0302] In some embodiments, corresponding to each resource file updating service module, the terminal device may execute the above steps S704 to S705 to delete the ineffective non-preset version of the first resource file.

[0303] In some embodiments, the versions of the resource file may be released in sequence, for example, in the order of the 1st version, the 2nd version, the 3rd version, ..., the Nth version. The i-th version is newer than the i-1th version. Based on this, in the aforementioned embodiments, the third version may be the m-th version, the second version may be the n-th version, the first version may be the k-th version, or the third version may be the m-th version, the first version may be the n-th version, and the second version may be the k-th version, where n is less than m.

[0304] The embodiments of the present application also provide a program product, which, when executed on an electronic device, can enable the electronic device to implement the update methods provided in the aforementioned embodiments.

[0305] An embodiment of the present application also provides a readable storage medium, in which one or more programs / instructions are stored. When the one or more programs / instructions are executed by an electronic device, the electronic device implements the update method provided by the aforementioned embodiments.

[0306] further, Figure 8 According to some embodiments of the present application, a schematic structural diagram of a terminal device 10 is shown.

[0307] The terminal device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0308] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 10. In other embodiments of the present application, the terminal device 10 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. In addition, the interface connection relationship between the modules illustrated in the embodiment of the present application is a schematic illustration and does not constitute a structural limitation on the terminal device 10. In other embodiments of the present application, the terminal device 10 may also adopt an interface connection method different from the above-mentioned embodiment, or a combination of multiple interface connection methods.

[0309] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0310] The processor 110 may be the nerve center and command center of the terminal device 10. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0311] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0312] In some embodiments, the processor 110 may be configured to execute instructions of the updating methods provided in the aforementioned embodiments.

[0313] The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0314] The wireless communication function of the terminal device 10 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0315] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 10 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0316] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G etc. applied on the terminal device 10 .

[0317] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 10. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0318] In some embodiments, antenna 1 of terminal device 10 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that terminal device 10 can communicate with the network and other devices through wireless communication technology.

[0319] The terminal device 10 implements the display function through the GPU, the display screen 194, and the application processor, etc. The display screen 194 is used to display images, videos, etc.

[0320] The external memory interface 120 can be used to connect an external memory card to expand the storage capacity of the terminal device 10. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0321] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 10 (such as audio data, a phone book, etc.). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device. Flash memory devices, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 10 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0322] The terminal device 10 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0323] It should be noted that the terms used in the implementation method part of the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated obstacles, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two, "at least one" and "one or more" mean one, two or more than two.

[0324] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the definition of "first" and "second" features may explicitly or implicitly include one or more of the features.

[0325] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing at different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way.

[0326] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium, or a semiconductor medium, etc.

[0327] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: various media that can store program codes, such as read-only memory or random access memory, magnetic disk or optical disk.

[0328] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. An updating method, applied to an electronic device, characterized in that: The method comprises: It is detected that an update condition is met, and a first update file of the first resource file is obtained, wherein the first update file is an update file of the mth version of the first resource file relative to the nth version of the first resource file, where m and n are positive integers and m is greater than n; Generate and store the mth version of the first resource file based on the first update file; It is determined that the electronic device stores the kth version of the first resource file, and the kth version is not a preset version of the operating system of the electronic device, and the kth version is deleted, where k is a positive integer less than m.

2. The method according to claim 1, characterized in that The method further comprises: When the mth version of the first resource file is not a preset version of the operating system of the electronic device, the mth version is deleted.

3. The method according to claim 1, characterized in that The nth version of the first resource file is a preset version of the operating system of the electronic device.

4. The method according to any one of claims 1 to 3, wherein generating and storing the mth version of the first resource file based on the first update file comprises: In a case where the first update file includes all data of the mth version of the first resource file, storing the mth version of the first resource file in the first update file in a first directory; In the case where the first update file includes incremental data of the mth version of the first resource file relative to the nth version of the first resource file, the first update file and the nth version of the first resource file are merged to obtain the mth version of the first resource file, and the mth version of the first resource file is stored in the first directory.

5. The method according to claim 4, characterized in that The type of the first resource file is a first type, the first directory is used to store non-preset versions of resource files of the first type, and the first resource file is a resource file that a first business module depends on; and determining that the electronic device stores a kth version of the first resource file, and the kth version is not a preset version of an operating system of the electronic device, and deleting the kth version includes: After storing the mth version of the first resource file in the first directory, calling the first business module to preload the mth version of the first resource file, wherein the preloading is used to switch the currently effective version of the first resource file in the first business module to the mth version; After the first service module preloads the mth version of the first resource file, the kth version in the first directory is deleted.

6. The method according to claim 5, wherein the electronic device comprises at least one second service module dependent on the resource file of the first type, the at least one second service module comprising the first service module; and after the first service module preloads the mth version of the first resource file, deleting the kth version in the first directory comprises: Acquire a currently effective version of the resource file of the first type on which the second business module depends, and a version of the resource file of the first type on which the second business module depends that is in the process of being installed; Delete other versions of the first type of resource files in the first directory except the currently effective version of the first type of resource files that the second business module depends on and the version of the first type of resource files that the second business module depends on that is in the installation process.

7. The method according to claim 5, characterized in that The first type includes any one of the following types: a large language model, a large image semantic understanding model, an image generation model, a video generation model, a speech recognition model, a speech synthesis model, a personalized audio model, a semantic model, a virus library, an application whitelist, an application blacklist, holiday information, and parameters of the electronic device in the elderly mode.

8. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by the one or more processors, the electronic device implements the updating method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable program instructions, and when the computer-executable program instructions are executed on a computer, the computer implements the updating method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program code, which, when executed on a computer, enables the computer to implement the updating method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • File management method, electronic device and computer readable storage medium

    CN109558382A

  • Resource bundle updating method and device, storage medium and electronic device

    CN113434171A

  • Client application program updating method and device, storage medium and electronic equipment

    CN116069366A

  • Service processing method, device and equipment

    CN117215672A

  • Method and apparatus for installing and updating software

    US20140173578A1