User interface component updating method and device, storage medium and electronic equipment

The method and device facilitate seamless hot updates of user interface components by managing resource storage and rendering through a system resource subclass, addressing the challenge of system invasion during updates.

CN119105786APending Publication Date: 2024-12-10BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310686087.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Existing methods for updating user interface components fail to allow applications to be hot-updated after a system update due to system invasion and mismatched resource changes.

Method used

A method and device for updating user interface components by obtaining target resources from a hot update package before display, using a system resource subclass to manage resource storage and rendering, ensuring compatibility with the original system resources.

Benefits of technology

Enables efficient and non-invasive hot updating of applications by eliminating the need to intercept system processes, allowing seamless updates without system invasion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105786A_ABST
    Figure CN119105786A_ABST
Patent Text Reader

Abstract

The invention relates to a user interface component updating method and device, a storage medium and electronic equipment. The method comprises the steps that before a user interface of an application program is displayed, under the condition that the user interface component is generated in a screen interaction component corresponding to the user interface, target resources of the user interface component are obtained from a hot updating package used for conducting hot updating on the application program; and rendering the user interface component according to the target resource so as to display the user interface corresponding to the screen interaction component. The technical problem that the application program cannot be subjected to efficient and convenient hot update after the system is updated is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method, device, storage medium and electronic device for updating a user interface component. Background Art

[0002] In the resource hot update process, the conventional method is usually to intercept the system process through a hook function before each interface element is generated, so as to realize the update display of the interface element.

[0003] However, the existing technology will invade the system where the hot-updated application is located. If the system version is changed, such as the system process or class file is changed, the application is not changed accordingly. Therefore, the application cannot be hot-updated under the changed system. Summary of the invention

[0004] The present application provides a method, device, storage medium and electronic device for updating a user interface component to solve the technical problem that an application cannot be hot-updated after a system update.

[0005] In a first aspect, the present application provides a method for updating a user interface component, comprising: before displaying the user interface of an application, and when the user interface component is generated in a screen interaction component corresponding to the above user interface, obtaining a target resource of the above user interface component from a hot update package used to hot update the above application; rendering the above user interface component based on the above target resource to display the above user interface corresponding to the above screen interaction component.

[0006] As an optional example, the resource directory of the hot update resource in the hot update package is consistent with the resource directory of the original resource of the application, and the original resource is the resource initially used by the application to render the user interface component. Before obtaining the target resource of the user interface component from the hot update package used to hot update the application, the method also includes: if the size of the hot update resource is greater than a predetermined threshold, storing the hot update resource in a file system; if the size of the hot update resource is less than or equal to a predetermined threshold, storing the hot update resource in a memory; or if the type of the hot update resource is a picture type, storing the hot update resource in a file system; if the picture type of the hot update resource is a non-picture type, storing the hot update resource in a memory.

[0007] In the second aspect, the present application provides an updating device for a user interface component, comprising: an acquisition module, used to acquire the target resource of the above-mentioned user interface component from a hot update package used to hot update the above-mentioned application before displaying the user interface of the application and when the user interface component is generated in the screen interaction component corresponding to the above-mentioned user interface; a rendering module, used to render the above-mentioned user interface component based on the above-mentioned target resource to display the above-mentioned user interface corresponding to the above-mentioned screen interaction component.

[0008] As an optional example, the above-mentioned acquisition module includes: a first determination unit, used to determine the first user interface component among the above-mentioned user interface components that is allowed to be hot-changed according to the label type of the user interface component; an acquisition unit, used to acquire the hot-change resource corresponding to the above-mentioned first user interface component from the above-mentioned hot-change package; and a second determination unit, used to determine the acquired hot-change resource as the above-mentioned target resource.

[0009] As an optional example, the acquisition unit includes: a determination subunit, used to determine the storage location of the hot change resource according to the size and / or type of the hot change resource in the hot change package; and a search subunit, used to search for the hot change resource from the storage location.

[0010] As an optional example, the determination subunit determines the storage location of the hot change resource according to the size and / or type of the hot change resource in the hot change package, including: when the size of the hot change resource is greater than a predetermined threshold, determining that the hot change resource is located in the file system; when the size of the hot change resource is less than or equal to the predetermined threshold, determining that the hot change resource is located in the memory; or when the type of the hot change resource is a picture type, determining that the hot change resource is located in the file system; when the type of the hot change resource is a non-picture type, determining that the hot change resource is located in the memory.

[0011] As an optional example, the acquisition unit includes: a first acquisition sub-unit, used to obtain the hot change resource from the hot change package using a system resource subclass when the hot change resource is located in the memory, wherein the system resource subclass is a subclass created for the system resource class of the system corresponding to the application, and a target device for obtaining the hot change resource is implemented in the system resource subclass.

[0012] As an optional example, the acquisition unit includes: a second acquisition sub-unit, which is used to use the system resource class to acquire the resources corresponding to the first user interface component from the original resources of the application program when the resource tag of the first user interface component is of text type and the hot change package does not include the hot change resources corresponding to the first user interface component; and use the acquired resources as the hot change resources.

[0013] As an optional example, the rendering module includes: a rendering unit, which is used to render the user interface component once according to the target resource to display the user interface when the resource tag of the user interface component is a text type; render the user interface component once according to the original resource of the application when the resource tag of the user interface component is a text format type or a picture type; and render the user interface component twice using the target resource to display the user interface, wherein the original resource is the resource initially used by the application to render the user interface component.

[0014] As an optional example, the resource directory of the hot update resources in the hot update package is consistent with the resource directory of the original resources of the application, and the original resources are the resources initially used by the application to render the user interface component. The device also includes: a storage module, which is used to store the hot update resources in the file system before obtaining the target resources of the user interface component from the hot update package used to hot update the application, if the size of the hot update resources is greater than a predetermined threshold; if the size of the hot update resources is less than or equal to the predetermined threshold, store the hot update resources in the memory; or if the type of the hot update resources is a picture type, store the hot update resources in the file system; if the picture type of the hot update resources is a non-picture type, store the hot update resources in the memory.

[0015] In a third aspect, the present application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein a computer program is stored in the memory, and the processor implements the following method when executing the computer program: before displaying the user interface of an application, and when the user interface component is generated in a screen interaction component corresponding to the user interface, obtaining a target resource of the user interface component from a hot update package for hot updating the application; rendering the user interface component based on the target resource to display the user interface corresponding to the screen interaction component.

[0016] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute any of the above-mentioned methods for updating the user interface components of the present application.

[0017] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application can obtain the target resources of the user interface component from the hot update package before displaying the user interface of the application, and when the user interface component is generated in the screen interaction component corresponding to the above user interface, and then use the target resources to render the user interface component, thereby eliminating the need to intercept the process or replace resources, and even eliminating the need to invade the system. Therefore, the technical problem in the prior art that the application cannot be efficiently and conveniently hot updated after the system is updated is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0021] Figure 1 A flowchart of a method for updating a user interface component provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of starting a hot change process provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of hot update of a text format type user interface component provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of the structure of a device for updating a user interface component provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0027] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0028] In order to solve the technical problem in the prior art that the application cannot be hot-updated after the system is updated, the present application provides a method for updating a user interface component, which can achieve the effect that the application can also be hot-updated after the system is updated.

[0029] Figure 1 A flowchart of a method for updating a user interface component provided in an embodiment of the present application is shown below. Figure 1 As shown, the updating method of the above user interface component includes:

[0030] S102, before displaying the user interface of the application, and when the user interface component is generated in the screen interaction component corresponding to the user interface, obtaining a target resource of the user interface component from a hot update package for hot updating the application;

[0031] S104: Render the user interface component according to the target resource to display the user interface corresponding to the screen interaction component.

[0032] Optionally, the hot update package in this embodiment can be a data packet for providing hot update resources for the hot update process of the application and / or the third-party SDK connected to the application, and the hot update package can include hot update resources. In other words, the technical solution in this application can perform hot updates on two different subjects, the application and / or the SDK. Generally speaking, an Android program is an apk file when it is released to the outside, but when it is generated internally, it may be implemented by n SDKs (lib projects) + its own business module (app project). As long as the relevant contents of the above solution are pre-written into the SDK during the development process, the above method can also perform hot updates on the SDK, that is, the solution of this application can be applied to both the lib project (hot update of the SDK connected to the application) and the app project (hot update of the business module of the application).

[0033] In this embodiment, the resource directory of the hot-change resource of the hot-change package can be consistent with the resource directory structure of the original resource of the application. For example, which data is located in which file, which file is located in which folder, etc., are the same in the hot-change resource and the original resource. However, since not all resources of the application need to be hot-updated, the resource directory of the hot-change resource can be less than the resource directory of the original resource, that is, the resource directory of the hot-change package is consistent with a part of the resource directory of the original resource of the application.

[0034] In this embodiment, when the user interface of the application is displayed on the terminal, a screen interaction component corresponding to the user interface is generated, and the screen interaction component includes a user interface component. The user interface component is an interactive component in the screen interaction component, such as a selection box, an input box, a button, etc., but is not limited to this, and can also be a component that is only used to display information. When the user interface component is generated, the corresponding resources are required to render in order to display the corresponding content on the user interface. In this embodiment, when the user interface component is generated, before displaying the user interface, the hot change resource can be obtained from the hot change package. When the hot change resource is obtained, the user interface component is rendered according to the hot change resource. The rendered user interface component can be displayed on the user interface.

[0035] The method provided in the embodiment of the present application can obtain the target resources of the user interface component from the hot update package before displaying the user interface of the application and when the user interface component is generated in the screen interaction component corresponding to the user interface, and then use the target resources to render the user interface component, thereby eliminating the need to intercept the system process and even more the need to invade the system. Therefore, the technical problem in the prior art that the application cannot be hot updated after the system is updated is solved.

[0036] As an optional example, before displaying the user interface of an application, and when the user interface component is generated in a screen interaction component corresponding to the user interface, obtaining a target resource of the user interface component from a hot update package for hot updating the application includes: determining, based on a tag type of the user interface component, a first user interface component that is allowed to be hot updated in the user interface components; obtaining a hot update resource corresponding to the first user interface component from the hot update package; and determining the obtained hot update resource as a target resource.

[0037] In this embodiment, different user interface components may have different labels, and labels may have different types. For example, the type may be to allow hot update or not allow hot update. For user interface components with labels that allow hot update, hot update resources may be obtained. For user interface components with labels that do not allow hot update, even if the corresponding hot update resources exist in the hot update package, the corresponding hot update resources may not be obtained for hot update.

[0038] In this embodiment, different types of labels can be added to different user interface components. For example, a label that allows updates is added to a button in the user interface of an application, and a label that does not allow updates is added to a drop-down box. Then, before the user interface is displayed, when the user interface component is started, the hot update resources of which user interface component can be determined based on the label, so that it is not necessary to obtain all the hot update resources of the hot update package, but to obtain hot update resources in a targeted manner.

[0039] As an optional example, obtaining the hot change resource corresponding to the first user interface component from the hot change package includes: determining a storage location of the hot change resource according to a size and / or type of the hot change resource in the hot change package; and searching for the hot change resource from the storage location.

[0040] In this embodiment, the hot change package may include multiple or multiple resources. Resources of different sizes and / or types may be stored in different locations. When obtaining a hot change resource, the storage location of the hot change resource is determined according to the size and / or type of the hot change resource, and the hot change resource is searched in the corresponding storage location.

[0041] For the size and / or type of the hot-change resource, an association relationship may be established with the storage location, such as what size range and what type of hot-change resource is stored in what location, and the hot-change resource may be quickly found and acquired through the association relationship.

[0042] As an optional example, the resource directory of the hot update resource in the hot update package is consistent with the resource directory of the original resource of the application, and the original resource is the initial resource of the application for rendering the user interface component. Before obtaining the target resource of the user interface component from the hot update package used to hot update the application, the method also includes: if the size of the hot update resource is greater than a predetermined threshold, storing the hot update resource in the file system; if the size of the hot update resource is less than or equal to the predetermined threshold, storing the hot update resource in the memory; or if the type of the hot update resource is a picture type, storing the hot update resource in the file system; if the picture type of the hot update resource is a non-picture type, storing the hot update resource in the memory.

[0043] In this embodiment, the resource directory of the hot-change resource of the hot-change package can be consistent with the resource directory of the original resource of the application. After obtaining the hot-change package, the resources in the hot-change package can be stored in the memory. It can also be determined whether to store the hot-change resource in the file system according to the size and / or type of the hot-change resource of the hot-change package.

[0044] The hot-change resource in the hot-change package may determine the storage location of the hot-change resource according to the size and / or type of the resource.

[0045] Taking resource size as an example, the size of the hot-change resource can be compared with a predetermined threshold, and if the size of the hot-change resource is greater than the predetermined threshold, the hot-change resource can be stored in the file system. If the size of the hot-change resource is less than or equal to the predetermined threshold, the hot-change resource can be stored in the memory.

[0046] Taking resource type as an example, if the type of the hot-change resource is an image type, the hot-change resource can be stored in the file system. If the type of the hot-change resource is a non-image type, the hot-change resource can be stored in the memory.

[0047] Taking resource size and resource type as an example, if the size of the hot-change resource is less than or equal to the predetermined threshold and the type is non-image type, the hot-change resource can be stored in the memory. If the size of the hot-change resource is greater than the predetermined threshold and the type is image type, the hot-change resource is stored in the file system.

[0048] If there is a hot-update resource whose size is less than or equal to the predetermined threshold but whose type is a picture type, or if there is a hot-update resource whose size is greater than the predetermined threshold but whose type is a non-picture type, the hot-update resource may be stored in the file system.

[0049] As an optional example, determining the storage location of the hot change resource based on the size and / or type of the hot change resource in the hot change package includes: when the size of the hot change resource is greater than a predetermined threshold, determining that the hot change resource is located in the file system; when the size of the hot change resource is less than or equal to the predetermined threshold, determining that the hot change resource is located in the memory; or when the type of the hot change resource is a picture type, determining that the hot change resource is located in the file system; when the type of the hot change resource is a non-picture type, determining that the hot change resource is located in the memory.

[0050] In this embodiment, since the hot-change resource has different sizes and / or types, the storage location of the hot-change resource is also different. Therefore, when obtaining the hot-change resource from the hot-change package, the size and / or type of the required hot-change resource can be determined first. After the size and / or type of the hot-change resource is determined, the hot-change resource can be obtained from the corresponding storage location.

[0051] By limiting the size and / or type, different hot-change resources in the hot-change package can be stored in different locations, with large files stored in the file system and small files stored in memory, thereby reducing memory usage and improving the efficiency of calling resources.

[0052] When determining the size of a hot-change resource, the size of a single or single type of hot-change resource can be determined. For example, the hot-change package includes 100 text hot-change resources, 10 text-format hot-change resources, and 5 image-type hot-change resources. The size of each hot-change resource can be compared with a predetermined threshold, or the total size of the 100 text hot-change resources can be compared with the predetermined threshold, the total size of the 10 text-format hot-change resources can be compared with the predetermined threshold, and the total size of the 5 image-type hot-change resources can be compared with the predetermined threshold, thereby determining the storage location of the hot-change resource. The hot-change resources in a hot-change package can be partially stored in the file system, partially stored in the memory, or all stored in the memory or all stored in the file system according to the comparison results.

[0053] As an optional example, obtaining a hot change resource corresponding to the first user interface component from a hot change package includes: when the hot change resource is located in memory, obtaining the hot change resource from the hot change package using a system resource subclass, wherein the system resource subclass is a subclass created for a system resource class of a system corresponding to the application, and a target method for obtaining the hot change resource is implemented in the system resource subclass.

[0054] In this embodiment, a system resource subclass can be created for the system resource class of the system where the application is located. The system resource subclass implements a method for obtaining hot-change resources. When obtaining hot-change resources, the hot-change resources are obtained through the method in the system resource subclass.

[0055] As an optional example, the above method also includes: when the resource tag of the first user interface component is of text type, and the hot update package does not include the hot update resources corresponding to the first user interface component, using the system resource class to obtain the resources corresponding to the first user interface component from the original resources of the application; and using the obtained resources as the hot update resources.

[0056] In this embodiment, when using the method in the system resource subclass to obtain the hot-change resource, if the label type of the first user interface component to be obtained is text, it means that the hot-change resource to be obtained is a text resource. Then, the corresponding text resource can be obtained from the hot-change package. If there is no corresponding text resource in the hot-change package, then the system resource class of the system where the application is located is used to obtain the resource corresponding to the first user interface component from the original resource, so as to render the first user interface component.

[0057] That is to say, for hot-change resources of text type, if they exist in the hot-change package, they are obtained from the hot-change package using the system resource subclass. If the hot-change package does not contain such resources, the system resource class is used to obtain them from the original resources of the application. This strategy can ensure that the hot-change resources are obtained for subsequent rendering of user interface components, and the problem of rendering failure due to lack of relevant resources in the hot-change package will not occur.

[0058] As an optional example, rendering the user interface component based on the target resource to display the user interface corresponding to the screen interaction component includes: when the resource tag of the user interface component is a text type, rendering the user interface component once based on the target resource to display the user interface; when the resource tag of the user interface component is a text format type or a picture type, rendering the user interface component once based on the original resource of the application; and using the target resource to perform a second rendering of the user interface component to display the user interface, wherein the original resource is the initial resource of the application for rendering the user interface component.

[0059] In this embodiment, after the hot change resources in the hot change package are obtained from the memory or the file system, the hot change resources can be used to render the user interface component. Different types of user interface components have different corresponding rendering methods. If it is a text type user interface component, the hot change resources are obtained from the hot change package when obtaining the hot change resources. If there is no corresponding hot change resource in the hot change package, then the resource is obtained from the original resource as the hot change resource. Therefore, the hot change resources to be used by the text type user interface component are prepared and can be directly used for rendering the user interface component. If the user interface component is a text format type or a picture type, then after the corresponding hot change resource is obtained from the hot change package, the user interface component is first rendered using the original resource, and then the hot change resource is used to perform a secondary rendering of the user interface component. The method in the system resource subclass used to obtain the hot change resource can implement the replacement logic (replace the system resource class method for obtaining the original resource), so a secondary rendering can be performed after the hot change resource is obtained.

[0060] Figure 2 Schematic diagram of the hot update process start of this embodiment. First, the hot update configuration is read to check whether the hot update package has been downloaded locally. If it has been downloaded locally, the application can be hot updated. If it has not been downloaded locally, the hot update package is first downloaded from the server. After the hot update package is downloaded, the hot update package is saved locally for application hot update. In the above process, the hot update configuration is used to identify whether a hot update is required, version information, etc.

[0061] Management of hot-change packages includes generation, uploading, and downloading of hot-change packages. The resource directory and content structure of the hot-change package resources are consistent with those of the original resource package of the application. All resources that need to be updated are placed in the same subdirectory of the res directory, compressed into compressed files and uploaded to the service, waiting for the client to download and decompress. Specific management processes are implemented on the client, such as loading, version comparison, and deleting hot-change resource packages. Hot-change packages can have version numbers to mark versions. For hot-change packages with multiple versions, management methods such as addition, deletion, and recovery can be used.

[0062] Figure 3This is a hot-update schematic diagram of a text-format type user interface component of this embodiment. During hot-update, first, in the initialization phase, the mapping table (xml file) data of the characters, fonts, colors and other resources in the hot-update package downloaded to the local computer is read into the memory. Secondly, when the system (such as the Android system) reads resources, the system resource class Resource class will be used to load the resources.arsc file of the application installation package (Android application package, APK) into the memory, and then the user interface component (UI component) obtains the value corresponding to the resource key value through the specific interface method getString of Resource for the first rendering. Then, a system resource subclass inherited from the system Resource is created by using the Java inheritance feature, and the getString interface method for obtaining resources is overwritten, and the logic of replacing the resource value is implemented in this method. The replacement opportunity occurs when the user interface component is generated in the Activity, and the Resource in the Activity is replaced with the above-mentioned system resource subclass Resource subclass through the system interface. When the user interface component rendering needs to obtain the resource calling method, the Resource class has been replaced with the implemented subclass, and the called method will also be transferred to the method overwritten by the corresponding subclass, thereby realizing the replacement logic and obtaining the hot-update resource.

[0063] If the user interface component is of text type, you can directly get the hot update resource from the hot update package and render it after the foreground interface Activity is started. If there is no hot update resource in the hot update package, you can directly use the original resource for rendering. By pre-marking the user interface component, you can dynamically call the getString interface before generating the Activity interface to perform dynamic replacement.

[0064] For resources of text format type and image type, such as fonts, colors and images, the methods of the system resource class are overwritten and implemented, such as getFont, getColor, getColorStateList, getDrawable, etc., and the replacement logic is implemented in these methods. Among them, images can be placed in the file system because they occupy a large amount of memory. The timing of the replacement logic is to determine whether it exists in the file system.

[0065] Each user interface component uses annotation to call the method overridden by the Resource subclass in the previous step to obtain the resources that need to be updated before the Activity interface is started and displayed. After obtaining the updated resources, each user interface component also needs to be replaced according to the public API, so each user interface component can implement a set of pre-replacement logic.

[0066] Figure 4 This is a schematic diagram of a structure of a device for updating a user interface component provided in an embodiment of the present application. Figure 4 As shown, the updating device of the above user interface component includes:

[0067] The acquisition module 402 is used to acquire the target resource of the user interface component from the hot update package used for hot updating the application program before displaying the user interface of the application program and when the user interface component is generated in the screen interaction component corresponding to the user interface;

[0068] The rendering module 404 is used to render the user interface component according to the target resource to display the user interface corresponding to the screen interaction component.

[0069] Optionally, the hot update package in this embodiment may be a data package for providing hot update resources for the hot update process of the application program. The hot update package may include hot update resources.

[0070] In this embodiment, the resource directory of the hot-change resource of the hot-change package can be consistent with the resource directory structure of the original resource of the application. For example, which data is located in which file, which file is located in which folder, etc., are the same in the hot-change resource and the original resource. However, since not all resources of the application need to be hot-updated, the resource directory of the hot-change resource can be less than the resource directory of the original resource, that is, the resource directory of the hot-change package is consistent with a part of the resource directory of the original resource of the application.

[0071] In this embodiment, when the user interface of the application is displayed on the terminal, a screen interaction component corresponding to the user interface is generated, and the screen interaction component includes a user interface component. The user interface component is an interactive component in the screen interaction component, such as a selection box, an input box, a button, etc., but is not limited to this, and can also be a component that is only used to display information. When the user interface component is generated, the corresponding resources are required to render in order to display the corresponding content on the user interface. In this embodiment, when the user interface component is generated, before displaying the user interface, the hot change resource can be obtained from the hot change package. When the hot change resource is obtained, the user interface component is rendered according to the hot change resource. The rendered user interface component can be displayed on the user interface.

[0072] The method provided in the embodiment of the present application can obtain the target resources of the user interface component from the hot update package before displaying the user interface of the application and when the user interface component is generated in the screen interaction component corresponding to the user interface, and then use the target resources to render the user interface component, thereby eliminating the need to intercept the system process and even more the need to invade the system. Therefore, the technical problem in the prior art that the application cannot be hot updated after the system is updated is solved.

[0073] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.

[0074] like Figure 5 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0075] Memory 113, used for storing computer programs;

[0076] In one embodiment of the present application, the processor 111 is used to implement the method for updating the user interface component provided by any one of the above method embodiments when executing the computer program stored in the memory 113, including:

[0077] Before displaying the user interface of the application, and when the user interface component is generated in the screen interaction component corresponding to the user interface, obtaining a target resource of the user interface component from a hot update package for hot updating the application;

[0078] The user interface component is rendered according to the target resource to display the user interface corresponding to the screen interaction component.

[0079] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of providing a method for updating a user interface component as in any of the aforementioned method embodiments are implemented.

[0080] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0082] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0083] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for updating a user interface component, characterized in that: include: Before displaying the user interface of the application, and when the user interface component is generated in the screen interaction component corresponding to the user interface, obtaining the target resource of the user interface component from a hot update package for hot updating the application; The user interface component is rendered according to the target resource to display the user interface corresponding to the screen interaction component.

2. The method according to claim 1, characterized in that Before displaying the user interface of the application, when the user interface component is generated in the screen interaction component corresponding to the user interface, obtaining the target resource of the user interface component from the hot update package for hot updating the application includes: Determining, according to the label type of the user interface component, a first user interface component that is allowed to be hot-updated among the user interface components; Acquire a hot change resource corresponding to the first user interface component from the hot change package; The acquired hot update resource is determined as the target resource.

3. The method according to claim 2, characterized in that The step of acquiring the hot update resource corresponding to the first user interface component from the hot update package includes: Determining a storage location of the hot update resource according to the size and / or type of the hot update resource in the hot update package; The hot update resource is searched from the storage location.

4. The method according to claim 3, characterized in that Determining the storage location of the hot update resource according to the size and / or type of the hot update resource in the hot update package includes: When the size of the hot-change resource is greater than a predetermined threshold, determining that the hot-change resource is located in the file system; when the size of the hot-change resource is less than or equal to the predetermined threshold, determining that the hot-change resource is located in the memory; or When the type of the hot-change resource is a picture type, it is determined that the hot-change resource is located in a file system; when the type of the hot-change resource is a non-picture type, it is determined that the hot-change resource is located in a memory.

5. The method according to claim 2, characterized in that: The step of acquiring the hot update resource corresponding to the first user interface component from the hot update package includes: In the case where the hot-change resource is located in the memory, the hot-change resource is obtained from the hot-change package using a system resource subclass, wherein the system resource subclass is a subclass created for the system resource class of the system corresponding to the application, and a target method for obtaining the hot-change resource is implemented in the system resource subclass.

6. The method according to claim 2, characterized in that The method further comprises: In the case where the resource tag of the first user interface component is of text type, and the hot update package does not include the hot update resource corresponding to the first user interface component, using the system resource class to obtain the resource corresponding to the first user interface component from the original resource of the application; The acquired resources are used as the hot update resources.

7. The method according to claim 1, characterized in that The rendering of the user interface component according to the target resource to display the user interface corresponding to the screen interaction component includes: In the case where the resource tag of the user interface component is of text type, rendering the user interface component once according to the target resource to display the user interface; When the resource tag of the user interface component is of a text format type or a picture type, the user interface component is rendered once according to the original resources of the application; and the user interface component is rendered a second time using the target resources to display the user interface, wherein the original resources are the resources initially used by the application to render the user interface component.

8. A device for updating a user interface component, characterized in that: include: an acquisition module, used for acquiring a target resource of the user interface component from a hot update package for hot updating the application before displaying the user interface of the application and when the user interface component is generated in a screen interaction component corresponding to the user interface; A rendering module is used to render the user interface component according to the target resource to display the user interface corresponding to the screen interaction component.

9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method described in any one of claims 1 to 7 of the present application.