Resource reloading method and apparatus, electronic device, and storage medium

By responding to configuration update events, obtaining and adjusting configuration information, and determining the results of configuration changes, it solves the problem that resource reloading cannot take effect immediately after user-defined settings, and realizes resource reloading takes effect immediately without restarting the application or system. , which improves the user experience.

WO2024212776A1PCT designated stage expired Publication Date: 2024-10-17SHENZHEN TCL NEW-TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/082727
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-14
Filing Date
2024-03-20
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

In the existing technology, when users customize settings, resource reloading cannot take effect immediately, and the application or operating system needs to be restarted, which affects the user experience.

Method used

By responding to configuration update events, we obtain initial and historical configuration information, make adjustments based on configuration change identifiers, determine the results of configuration changes, and reload resources without restarting the application or system to achieve immediate effect.

Benefits of technology

Resource reloading can be completed without restarting the application or system, improving user experience and realizing immediate effect of resource reloading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082727_17102024_PF_FP_ABST
    Figure CN2024082727_17102024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in embodiments of the present application are a resource reloading method and apparatus, an electronic device, and a storage medium. The method comprises: in response to a configuration updating event, acquiring initial current configuration information, wherein the initial current configuration information comprises extension configuration sub-information, and the extension configuration sub-information comprises a configuration change identifier; on the basis of the configuration updating event, adjusting the configuration change identifier to obtain current target configuration information; acquiring historical configuration information, wherein the historical configuration information comprises historical extension configuration sub-information, and the historical extension configuration sub-information comprises a historical configuration change identifier; on the basis of the configuration change identifier in the current target configuration information and the historical configuration change identifier, determining a configuration change result corresponding to the configuration updating event; and when the configuration change result indicates that the configuration change has occurred, performing resource reloading on the basis of configuration data of the configuration updating event.
Need to check novelty before this filing date? Find Prior Art

Description

Resource reloading method, device, electronic device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 14, 2023, with application number 202310438089.9 and application name “A resource overloading method, device, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a resource reloading method, device, electronic device, and storage medium. Background Art

[0003] With the rapid development of the current economy and technology, users have higher and higher requirements for the functions, experience, and interaction of electronic products. Many operating systems or applications support user-defined settings to enhance the user experience. SUMMARY OF THE INVENTION

[0004] Currently, the main method for implementing user customization is to reload resources based on the user's settings to achieve updates that meet user needs. However, this solution generally requires restarting the application or operating system to complete the resource reload, and the user's settings do not take effect immediately, affecting the user experience.

[0005] The embodiments of the present application provide a resource reloading method, device, electronic device and storage medium, which can complete resource reloading without restarting the application or system, improve the user experience, and realize the immediate effect of resource reloading.

[0006] This embodiment of the present application provides a resource reloading method, including:

[0007] In response to a configuration update event, obtaining initial current configuration information, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier;

[0008] Based on the configuration update event, adjusting the configuration change identifier to obtain target current configuration information;

[0009] Acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier;

[0010] Determining a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information;

[0011] When the configuration change result indicates that a configuration change has occurred, resources are reloaded based on the configuration data of the configuration update event.

[0012] Accordingly, an embodiment of the present application further provides a resource reloading device, comprising:

[0013] A first information acquisition unit is configured to acquire initial current configuration information in response to a configuration update event, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier;

[0014] an identification adjustment unit, configured to adjust the configuration change identification based on the configuration update event to obtain target current configuration information;

[0015] A second information acquisition unit is configured to acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier;

[0016] A result determining unit, configured to determine a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information;

[0017] The resource reloading unit is configured to reload resources based on the configuration data of the configuration update event when the configuration change result indicates that a configuration change has occurred.

[0018] In some optional embodiments, the current configuration information further includes original configuration sub-information, and the historical configuration information includes historical original configuration sub-information;

[0019] The result determination unit is configured to determine an information change result corresponding to the configuration update event based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information;

[0020] Comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event;

[0021] A configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.

[0022] In some optional embodiments, the result determination unit is configured to call a configuration update method in a process management service using the initial current configuration information as a call parameter, wherein the configuration update method includes a configuration information comparison method;

[0023] The configuration information comparison method is used to compare the original configuration sub-information with the historical original configuration sub-information to determine an information change result.

[0024] In some optional embodiments, the original configuration sub-information includes at least one type of original device configuration feature, and the historical original configuration sub-information includes at least one type of historical original device configuration feature, and the type of the historical original device configuration feature is the same as that of the original device configuration feature;

[0025] The result determination unit is used to compare the original device configuration features in the original configuration sub-information with the historical original device configuration features in the historical original configuration sub-information of the same type through the configuration information comparison method to determine the information change result.

[0026] In some optional embodiments, the result determination unit is configured to collect call information of the configuration information comparison method through a preset program probe;

[0027] Based on the calling information, calling the extended configuration comparison method of the extended configuration sub-information;

[0028] The extended configuration comparison method is used to compare the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event.

[0029] In some optional embodiments, the identification adjustment unit is configured to determine an update condition corresponding to the configuration update event based on the configuration update event;

[0030] When the update condition belongs to a preset configuration change condition, obtaining a target change identifier corresponding to the update condition from a preset change identifier set;

[0031] The attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.

[0032] In some optional embodiments, the configuration data includes target display data, and the resource reloading unit is configured to obtain the target display data corresponding to the configuration update event when the configuration change result indicates that a configuration change has occurred;

[0033] The restart process is stopped, and resources are reloaded on the original display data based on the target display data to display the target display effect corresponding to the target display data.

[0034] Correspondingly, an embodiment of the present application also provides an electronic device, including a memory and a processor; the memory stores an application, and the processor is used to run the application in the memory to execute the steps in any resource reloading method provided in the embodiment of the present application.

[0035] Accordingly, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the steps in any one of the resource reloading methods provided in the embodiment of the present application.

[0036] In addition, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps in any one of the resource reloading methods provided in the embodiments of the present application. Beneficial effects

[0037] By adopting the scheme of the embodiment of the present application, it is possible to obtain initial current configuration information in response to a configuration update event, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier. Based on the configuration update event, the configuration change identifier is adjusted to obtain the target current configuration information, and historical configuration information is obtained. The historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier. Based on the configuration change identifier and the historical configuration change identifier in the target current configuration information, the configuration change result corresponding to the configuration update event is determined. When the configuration change result indicates that a configuration change has occurred, resources are reloaded based on the configuration data of the configuration update event. Since, in the embodiment of the present application, whether a configuration change has occurred is determined by additionally setting the extended configuration sub-information, a mechanism is established to determine whether resource reloading is required based on the configuration change identifier. Therefore, resource reloading can be completed without restarting the application or system, thereby improving the user experience and achieving immediate effect of resource reloading. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0039] FIG1 is a schematic diagram of a scenario of a resource reloading method provided in an embodiment of the present application;

[0040] FIG2 is a flow chart of a resource reloading method provided in an embodiment of the present application;

[0041] FIG3 is a schematic diagram of a UML class diagram of configuration information provided in an embodiment of the present application;

[0042] FIG4 is a flow diagram of a configuration change triggering an application update according to an embodiment of the present application;

[0043] FIG5 is a schematic structural diagram of a resource reloading device provided in an embodiment of the present application;

[0044] FIG6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Modes for Carrying Out the Invention

[0045] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0046] The embodiments of the present application provide a resource reloading method, apparatus, electronic device, and computer-readable storage medium. Specifically, the embodiments of the present application provide a resource reloading method applicable to a resource reloading apparatus, which can be integrated into an electronic device.

[0047] The electronic device can be a terminal or other device, including but not limited to a mobile terminal and a fixed terminal. For example, a mobile terminal includes but is not limited to a smart phone, a smart watch, a tablet computer, a laptop computer, a smart car terminal, etc., wherein a fixed terminal includes but is not limited to a desktop computer, a smart TV, etc.

[0048] The electronic device can also be a server or other device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but is not limited to these.

[0049] The resource reloading method of the embodiment of the present application can be implemented by the server, or can be implemented by the terminal and the server together.

[0050] The following describes the method by taking the example of a terminal and a server jointly implementing the resource reloading method.

[0051] As shown in Figure 1, the resource overloading system provided in an embodiment of the present application includes a terminal 10 and a server 20, etc.; the terminal 10 and the server 20 are connected through a network, for example, through a wired or wireless network connection, etc., wherein the terminal 10 can exist as a terminal with customized settings by the user.

[0052] Among them, the terminal 10 can be used to respond to a configuration update event, obtain initial current configuration information, the initial current configuration information includes extended configuration sub-information, the extended configuration sub-information includes a configuration change identifier, based on the configuration update event, adjust the configuration change identifier to obtain the target current configuration information, obtain historical configuration information, the historical configuration information includes historical extended configuration sub-information, the historical extended configuration sub-information includes a historical configuration change identifier, based on the configuration change identifier in the target current configuration information and the historical configuration change identifier, determine the configuration change result corresponding to the configuration update event, and when the configuration change result indicates that a configuration change has occurred, reload resources based on the configuration data of the configuration update event.

[0053] Specifically, the server 20 may store part or all of the configuration data of the configuration update event.

[0054] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.

[0055] The embodiments of the present application will be described from the perspective of a resource overloading device, which can be specifically integrated into a terminal.

[0056] As shown in FIG2 , the specific process of the resource reloading method of this embodiment may be as follows:

[0057] 201. In response to a configuration update event, obtain initial current configuration information, where the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier.

[0058] The configuration update event may be any event that causes a change in the configuration of a system or application. The configuration update event may be used to notify the corresponding system or application to perform corresponding operations based on the new configuration.

[0059] For example, a configuration update event may be an event generated by a user's operation such as setting the color of an application program or setting a system switching animation.

[0060] The initial current configuration information is the configuration information at the current moment when the configuration parameters have not been modified. For example, in the Android operating system, the initial current configuration information can be the native Configuration class in AOSP (Android Open Source Project).

[0061] Specifically, the extended configuration sub-information is a type of information additionally set for the configuration information in the embodiment of the present application. The extended configuration sub-information can be sub-information customized by a technician in the initial current configuration information or the target current configuration information.

[0062] For example, the extended configuration sub-information can be a customized ConfigurationExt class. This customized ConfigurationExt class serves as a customized configuration class, and its instance is a member variable of the native AOSP Configuration class. When the ActivityManagerService (AMS) triggers a configuration update, it uses member methods within Configuration to determine whether the configuration has changed. As a member variable of the native Configuration, the customized ConfigurationExt participates in the Configuration change determination, influencing the result. This impact on the determination results in the system deeming the configuration changed and notifying the application, causing a reload of application resources and a UI update.

[0063] For example, in actual application, the relationship between the customized ConfigurationExt class and the native Configuration class can be shown in the UML (Unified Modeling Language) class diagram of the customized configuration provided in FIG3 .

[0064] Specifically, a class diagram shows a set of classes, interfaces, collaborations, and the relationships between them. The visibility of class attributes and operations is represented by +, #, and - to indicate public, protected, and private, respectively. Interfaces are represented in class diagrams by < <interface>> to indicate.

[0065] For example, in Figure 3, through the connection relationship, it can be shown that the interface class IConfigurationExt and the Configuration class are implemented through the interface Comparable, the interface class IConfigurationExt and the Configuration class are in an aggregation relationship, and the ConfigurationExt class is implemented based on the interface class IConfigurationExt.

[0066] In the ConfigurationExt class, there are extraData: Bundle and changedFlags: int properties. Operations such as compareTo and diff can be implemented through the ConfigurationExt class.

[0067] The configuration change identifier is identification information indicating whether the extended configuration sub-information has changed.

[0068] For example, the customized ConfigurationExt class defines a Bundle member variable that stores data when the configuration changes. The changedFlags member of the class serves as a flag for the configuration change, and the updateFlags method of the class is used to update the flag. The changedFlags member of the class serves as a flag for the configuration change.

[0069] 202. Based on the configuration update event, adjust the configuration change identifier to obtain target current configuration information.

[0070] The target current configuration information is the configuration information at the current moment when the configuration parameters are modified. For example, in the Android operating system, the target current configuration information can be the Configuration class after the changedFlags in the ConfigurationExt class has changed.

[0071] In some optional embodiments, the step of “adjusting the configuration change identifier based on the configuration update event to obtain target current configuration information” may specifically include:

[0072] Based on the configuration update event, determining an update condition corresponding to the configuration update event;

[0073] When the update condition belongs to a preset configuration change condition, obtaining a target change identifier corresponding to the update condition from a preset change identifier set;

[0074] The attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.

[0075] For example, when certain conditions change, you can get the current Configuration, take out the ConfigurationExt type member variables, and change the changedFlags flag in ConfigurationExt through the updateFlags method.

[0076] It is understandable that different configuration change conditions may correspond to different target change identifiers. For example, configuration change condition 1 may correspond to change identifier 1, and configuration change condition 2 may correspond to change identifier 2.

[0077] Alternatively, various configuration change conditions may correspond to the same target change identifier, that is, as long as a configuration update event that meets the configuration change condition occurs, the configuration change identifier is set to a specific target change identifier.

[0078] 203. Obtain historical configuration information, where the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier.

[0079] The historical configuration information may be the initial current configuration information, or the historical configuration information may be the most initial configuration information of the system or application, and so on.

[0080] 204. Determine a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information.

[0081] The configuration change result may indicate that a configuration change has occurred or that no configuration change has occurred. The form and content of the configuration change result may be set by a technician, and the present embodiment does not limit this.

[0082] In some optional embodiments, the current configuration information also includes original configuration sub-information, and the historical configuration information includes historical original configuration sub-information. The step of "determining the configuration change result corresponding to the configuration update event based on the configuration change identifier in the target current configuration information and the historical configuration change identifier" may specifically include:

[0083] Determining an information change result corresponding to the configuration update event based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information;

[0084] Comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event;

[0085] A configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.

[0086] For example, when the ActivityManagerService (AMS) triggers a configuration update, it uses some member methods in Configuration to determine whether the configuration has changed. The customized ConfigurationExt, as a member variable of the native Configuration, participates in the configuration change determination, affecting the determination result. This impact on the determination result can cause the system to believe that the configuration has changed, notify the application side, and cause the application resource to be reloaded and the interface to be updated.

[0087] In some optional embodiments, the information change result may be obtained by comparing the original configuration sub-information with the historical original configuration sub-information using a specific comparison method. That is, the step of "determining the information change result corresponding to the configuration update event based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information" may specifically include:

[0088] Using the initial current configuration information as a calling parameter, calling a configuration update method in a process management service, wherein the configuration update method includes a configuration information comparison method;

[0089] The configuration information comparison method is used to compare the original configuration sub-information with the historical original configuration sub-information to determine an information change result.

[0090] For example, you can use the current Configuration as a parameter to reflectively call the updateConfiguration method of ActivityManagerService.

[0091] In some optional examples, the original configuration sub-information includes at least one type of original device configuration feature, and the historical original configuration sub-information includes at least one type of historical original device configuration feature, and the type of the historical original device configuration feature is the same as the original device configuration feature.

[0092] Accordingly, the step of "comparing the original configuration sub-information with the historical original configuration sub-information using the configuration information comparison method to determine the information change result" may specifically include:

[0093] By using the configuration information comparison method, the original device configuration features in the original configuration sub-information are compared with the historical original device configuration features in the historical original configuration sub-information of the same type to determine the information change result.

[0094] For example, the Configuration comparison method will compare the configuration items involved (screen density, orientation, language, etc.) one by one.

[0095] The subsequent call process of AMS's updateConfiguration will compare the differences between the current Configuration and the previous Configuration, and confirm whether the configuration has changed in the form of a bit mark through some comparison methods of Configuration (compareTo, diff...).

[0096] In some optional embodiments, our customized ConfigurationExt is also added to the comparison through instrumentation, and the comparison method (compareTo, diff...) of ConfigurationExt is called. The step of "comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine the identifier change result corresponding to the configuration update event" may specifically include:

[0097] Collecting call information of the configuration information comparison method through a preset program probe;

[0098] Based on the calling information, calling the extended configuration comparison method of the extended configuration sub-information;

[0099] The extended configuration comparison method is used to compare the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event.

[0100] Program probes are implemented through hooking technology. Hooking involves inserting probes into a program while maintaining the integrity of the original program logic. The probes collect information from the code (such as the method itself, method parameter values, and return values) by inserting code segments at specific locations, thereby collecting dynamic context information during program runtime.

[0101] 205. When the configuration change result indicates that a configuration change has occurred, reload resources based on the configuration data of the configuration update event.

[0102] In some optional embodiments, the ConfigurationExt comparison method compares the changedFlags of the new and old configurations. If the flags are inconsistent, the configuration is considered to have changed, which affects the comparison result of the Configuration comparison method. Changes in the comparison result trigger the native resource reload and interface reconstruction mechanism to update the application resources.

[0103] Resources that are overridden can include additional files and static content used by your code, such as bitmaps, layout files, strings, animations, colors, and dimensions. At runtime, Android uses the appropriate resources based on the current configuration. For example, you might need to provide different UI layouts based on screen size or different strings based on language settings. Resource compilation generates a mapping between resource IDs and resource paths or values. Applications use resource IDs to find corresponding resources to define the styles and attributes of UI elements.

[0104] Specifically, configuration data can be a class that describes all device configuration information that may affect the resources retrieved by the application. This includes user-specified configuration options (list of locales and scaling) and device configuration (such as input mode, screen size, and screen orientation).

[0105] In some examples, the step of "the configuration data includes target display data, and when the configuration change result indicates that a configuration change has occurred, reloading resources based on the configuration data of the configuration update event" may specifically include:

[0106] When the configuration change result indicates that a configuration change has occurred, acquiring target display data corresponding to the configuration update event;

[0107] The restart process is stopped, and resources are reloaded on the original display data based on the target display data to display the target display effect corresponding to the target display data.

[0108] As shown in FIG4 , in the Android operating system, the above process will go through the ResourcesManager stage, in which the application's resources will be updated.

[0109] For example, if the present invention is applied to a theme reskinning scenario on an Android system, based on the user's skin reskinning operation, when the operating system detects a configuration change, it can execute the AMS.updateConfiguration method to notify the corresponding application of the configuration change. Furthermore, it can execute the ActivityThread.applyConfigurationToResources method to notify the resource object class corresponding to the theme reskinning to perform resource configuration.

[0110] During the ResourcesManager phase, you can manage the configuration resources related to theme reskinning. For example, you can use the ResourcesManager.applyConfigurationToResourcesLocked method to cache and update theme package resources. During subsequent interface reconstruction, you can implement resource overwriting by intercepting the resource acquisition process.

[0111] By calling the Resources.updateSystemConfiguration method, you can obtain the configuration information that needs to be updated when performing a theme change. By calling the Resourceslmpl.updateConfiguration method, you can update the configuration related to the theme change application. By calling the ActivityThread.handleConfigurationChanged method, you can ensure that the latest configuration information is obtained. By calling the Activity.onConfigurationChanged method, you can modify the configuration information directly related to the theme change in the theme change application.

[0112] This innovation solves this problem by eliminating the need to kill processes or restart the system to reload resources and rebuild the interface, significantly improving the user experience. Furthermore, in scenarios where the interface or functionality needs to be differentiated based on the configuration, and the existing configuration doesn't meet the needs, this customized configuration is also a good solution.

[0113] Existing technologies mostly rely on callbacks or other notification mechanisms, which have the disadvantages of limited application scenarios, narrow coverage, and low scalability. This application, through customized configuration and leveraging Android's native resource reloading mechanism when configuration changes occur, solves the problem of enabling instant configuration changes during interaction and transmitting them to the application to refresh related interfaces and utilize resources. This mechanism is more robust and stable, with wider coverage and more convenient and efficient processing. Only instrumentation and processing are required on the system side, eliminating the need for extensive application adaptation.

[0114] Most existing products on the market use notifications, database listener callbacks, publish-subscribe, and other methods to handle configuration change notifications and interface restarts to complete resource reloads. This method cleverly leverages Android's native Configuration mechanism, providing greater coverage and reliability.

[0115] As can be seen from the above, the embodiment of the present application can obtain initial current configuration information in response to a configuration update event, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier. Based on the configuration update event, the configuration change identifier is adjusted to obtain the target current configuration information, and historical configuration information is obtained. The historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier. Based on the configuration change identifier and the historical configuration change identifier in the target current configuration information, the configuration change result corresponding to the configuration update event is determined. When the configuration change result indicates that a configuration change has occurred, resource reloading is performed based on the configuration data of the configuration update event. Since, in the embodiment of the present application, whether a configuration change has occurred is determined by additionally setting the extended configuration sub-information, a mechanism is established to determine whether resource reloading is required based on the configuration change identifier. Therefore, resource reloading can be completed without restarting the application or system, thereby improving the user experience and achieving immediate effectiveness of resource reloading.

[0116] In order to better implement the above method, accordingly, an embodiment of the present application also provides a resource reloading device.

[0117] Referring to FIG5 , the apparatus comprises:

[0118] A first information acquisition unit 501 is configured to acquire initial current configuration information in response to a configuration update event, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier;

[0119] An identifier adjustment unit 502 is configured to adjust the configuration change identifier based on the configuration update event to obtain target current configuration information;

[0120] The second information acquisition unit 503 is configured to acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier;

[0121] A result determination unit 504 is configured to determine a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information;

[0122] The resource reloading unit 505 is configured to reload resources based on the configuration data of the configuration update event when the configuration change result indicates that a configuration change has occurred.

[0123] In some optional embodiments, the current configuration information further includes original configuration sub-information, and the historical configuration information includes historical original configuration sub-information;

[0124] The result determination unit 504 is configured to determine an information change result corresponding to the configuration update event based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information;

[0125] Comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event;

[0126] A configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.

[0127] In some optional embodiments, the result determination unit 504 is configured to call a configuration update method in a process management service using the initial current configuration information as a call parameter, wherein the configuration update method includes a configuration information comparison method;

[0128] The configuration information comparison method is used to compare the original configuration sub-information with the historical original configuration sub-information to determine an information change result.

[0129] In some optional embodiments, the original configuration sub-information includes at least one type of original device configuration feature, and the historical original configuration sub-information includes at least one type of historical original device configuration feature, and the type of the historical original device configuration feature is the same as that of the original device configuration feature;

[0130] The result determination unit 504 is configured to compare the original device configuration features in the original configuration sub-information with the historical original device configuration features in the historical original configuration sub-information of the same type using the configuration information comparison method to determine an information change result.

[0131] In some optional embodiments, the result determination unit 504 is configured to collect call information of the configuration information comparison method through a preset program probe;

[0132] Based on the calling information, calling the extended configuration comparison method of the extended configuration sub-information;

[0133] The extended configuration comparison method is used to compare the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event.

[0134] In some optional embodiments, the identification adjustment unit 502 is configured to determine an update condition corresponding to the configuration update event based on the configuration update event;

[0135] When the update condition belongs to a preset configuration change condition, obtaining a target change identifier corresponding to the update condition from a preset change identifier set;

[0136] The attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.

[0137] In some optional embodiments, the configuration data includes target display data, and the resource reloading unit 505 is configured to obtain the target display data corresponding to the configuration update event when the configuration change result indicates that a configuration change has occurred;

[0138] The restart process is stopped, and resources are reloaded on the original display data based on the target display data to display the target display effect corresponding to the target display data.

[0139] As can be seen from the above, through the resource reloading device, it is possible to respond to a configuration update event and obtain initial current configuration information, the initial current configuration information including extended configuration sub-information, the extended configuration sub-information including a configuration change identifier, based on the configuration update event, adjust the configuration change identifier to obtain the target current configuration information, obtain historical configuration information, the historical configuration information including historical extended configuration sub-information, the historical extended configuration sub-information including a historical configuration change identifier, based on the configuration change identifier and the historical configuration change identifier in the target current configuration information, determine the configuration change result corresponding to the configuration update event, when the configuration change result indicates that a configuration change has occurred, reload the resource based on the configuration data of the configuration update event; because in the embodiment of the present application, whether a configuration change has occurred is determined by additionally setting the extended configuration sub-information, a mechanism is established to determine whether resource reloading is required based on the configuration change identifier, therefore, resource reloading can be completed without restarting the application or system, thereby improving the user experience and achieving immediate effectiveness of resource reloading.

[0140] In addition, an embodiment of the present application further provides an electronic device, which may be a terminal or a server, etc. As shown in FIG6 , it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application. Specifically:

[0141] The electronic device may include components such as a radio frequency (RF) circuit 601, a memory 602 including one or more computer-readable storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a wireless fidelity (WiFi) module 607, a processor 608 including one or more processing cores, and a power supply 609. Those skilled in the art will appreciate that the electronic device structure shown in FIG6 does not limit the electronic device and may include more or fewer components than shown, or combine certain components, or arrange the components differently. Among them:

[0142] The RF circuit 601 can be used to receive and transmit signals during information transmission or calls. Specifically, it receives downlink information from the base station and transmits it to one or more processors 608 for processing. It also transmits uplink data to the base station. Typically, the RF circuit 601 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, and the like. Furthermore, the RF circuit 601 can communicate with the network and other devices via wireless communication. Wireless communication can utilize any communication standard or protocol, including but not limited to Global System of Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).

[0143] Memory 602 can be used to store software programs and modules. Processor 608 executes various functional applications and data processing by running the software programs and modules stored in memory 602. Memory 602 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as sound playback or image playback). The data storage area may store data generated based on the use of the electronic device (such as audio data and a phone book). Memory 602 may also include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 602 may also include a memory controller to provide access to memory 602 by processor 608 and input unit 603.

[0144] The input unit 603 can be used to receive digital or character input and generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control. Specifically, in one embodiment, the input unit 603 may include a touch-sensitive surface and other input devices. A touch-sensitive surface, also known as a touch display or touchpad, can detect user touch operations on or near it (for example, operations performed on or near the touch-sensitive surface using a finger, stylus, or any other suitable object or accessory) and drive corresponding connected devices according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. The touch detection device detects the user's touch position and detects signals generated by the touch operation, transmitting the signals to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then transmits it to the processor 608. The touch controller can also receive and execute commands from the processor 608. Furthermore, touch-sensitive surfaces can be implemented using various types of technologies, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface, the input unit 603 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0145] The display unit 604 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, videos, or any combination thereof. The display unit 604 may include a display panel. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Furthermore, a touch-sensitive surface can cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to the processor 608 to determine the type of touch event. The processor 608 then provides a corresponding visual output on the display panel based on the type of touch event. Although the touch-sensitive surface and the display panel are shown as two separate components to implement input and output functions in FIG6 , in some embodiments, the touch-sensitive surface and the display panel can be integrated to implement input and output functions.

[0146] The electronic device may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and / or backlight when the electronic device is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes) and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of the mobile phone (such as switching between horizontal and vertical screens, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the electronic device may also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described in detail here.

[0147] Audio circuit 606, speakers, and microphones provide an audio interface between the user and the electronic device. Audio circuit 606 converts received audio data into electrical signals and transmits them to the speaker, which then converts them into sound signals for output. The microphone, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 606 and converted into audio data. The audio data is then processed by output processor 608 and transmitted via RF circuit 601 to, for example, another electronic device. Alternatively, the audio data is output to memory 602 for further processing. Audio circuit 606 may also include an earphone jack to allow communication between external headphones and the electronic device.

[0148] WiFi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through WiFi module 607, providing users with wireless broadband Internet access. Although FIG6 shows WiFi module 607, it is understood that it is not a required component of the electronic device and can be omitted as needed without changing the essence of the application.

[0149] Processor 608 is the control center of the electronic device. It connects all parts of the phone using various interfaces and circuits. It executes software programs and / or modules stored in memory 602 and accesses data stored in memory 602 to perform various functions of the electronic device and process data. Optionally, processor 608 may include one or more processing cores. Preferably, processor 608 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 608.

[0150] The electronic device also includes a power supply 609 (e.g., a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 608 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 609 can also include any of one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other components.

[0151] Although not shown, the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 608 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 608 will run the application programs stored in the memory 602 to implement various functions as follows:

[0152] In response to a configuration update event, obtaining initial current configuration information, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier;

[0153] Based on the configuration update event, adjusting the configuration change identifier to obtain target current configuration information;

[0154] Acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier;

[0155] Determining a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information;

[0156] When the configuration change result indicates that a configuration change has occurred, resources are reloaded based on the configuration data of the configuration update event.

[0157] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0158] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute the steps of any of the resource reloading methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0159] In response to a configuration update event, obtaining initial current configuration information, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier;

[0160] Based on the configuration update event, adjusting the configuration change identifier to obtain target current configuration information;

[0161] Acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier;

[0162] Determining a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information;

[0163] When the configuration change result indicates that a configuration change has occurred, resources are reloaded based on the configuration data of the configuration update event.

[0164] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0165] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0166] Since the instructions stored in the computer-readable storage medium can execute the steps in any resource reloading method provided in the embodiments of the present application, the beneficial effects that can be achieved by any resource reloading method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0167] According to one aspect of the present application, a computer program product or computer program is also provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in various optional implementations of the above embodiments.

[0168] The above is a detailed introduction to a resource overloading method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.< / interface>

Claims

1. A resource reloading method, wherein: include: In response to a configuration update event, initial current configuration information is acquired, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier; Based on the configuration update event, adjusting the configuration change identifier to obtain target current configuration information; Acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier; Determine a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information; When the configuration change result indicates that a configuration change has occurred, resources are reloaded based on the configuration data of the configuration update event.

2. The resource reloading method according to claim 1, wherein: The current configuration information also includes original configuration sub-information, and the historical configuration information includes historical original configuration sub-information; The determining, based on the configuration change identifier and the historical configuration change identifier in the target current configuration information, a configuration change result corresponding to the configuration update event includes: Determine, based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information, an information change result corresponding to the configuration update event; Comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event; The configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.

3. The resource reloading method according to claim 2, wherein: The determining, based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information, an information change result corresponding to the configuration update event includes: Using the initial current configuration information as a calling parameter, calling a configuration update method in a process management service, wherein the configuration update method includes a configuration information comparison method; The configuration information comparison method is used to compare the original configuration sub-information with the historical original configuration sub-information to determine the information change result.

4. The resource reloading method according to claim 3, wherein: The original configuration sub-information includes at least one type of original device configuration feature, and the historical original configuration sub-information includes at least one type of historical original device configuration feature, and the type of the historical original device configuration feature is the same as the original device configuration feature; The comparing method of the configuration information to compare the original configuration sub-information with the historical original configuration sub-information to determine the information change result includes: By using the configuration information comparison method, the original device configuration features in the original configuration sub-information are compared with the historical original device configuration features in the historical original configuration sub-information of the same type to determine the information change result.

5. The resource reloading method according to claim 3, wherein: The comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine the identifier change result corresponding to the configuration update event includes: Collecting the calling information of the configuration information comparison method through a preset program probe; Based on the calling information, calling the extended configuration comparison method of the extended configuration sub-information; By using the extended configuration comparison method, the configuration change identifier in the target current configuration information and the historical configuration change identifier in the historical configuration information are compared to determine the identifier change result corresponding to the configuration update event.

6. The resource reloading method according to claim 5, wherein: The program probe is a program code implemented by plugging in. The plugging in refers to inserting a probe into a program on the basis of ensuring the logical integrity of the original program.

7. The resource reloading method according to claim 1, wherein: The step of adjusting the configuration change identifier based on the configuration update event to obtain target current configuration information includes: Based on the configuration update event, determining an update condition corresponding to the configuration update event; When the update condition belongs to a preset configuration change condition, obtaining a target change identifier corresponding to the update condition from a preset change identifier set; The attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.

8. The resource reloading method according to claim 1, wherein: The configuration data includes target display data, and when the configuration change result indicates that a configuration change has occurred, reloading resources based on the configuration data of the configuration update event includes: When the configuration change result indicates that a configuration change has occurred, acquiring target display data corresponding to the configuration update event; The restart process is stopped, and resources are reloaded on the original display data based on the target display data to display the target display effect corresponding to the target display data.

9. The resource reloading method according to claim 1, wherein: The configuration change identifier is identification information indicating whether the extended configuration sub-information has changed, and the resources for resource reloading include additional files and static contents used by the code.

10. A resource reloading device, wherein: include: A first information acquisition unit, configured to acquire initial current configuration information in response to a configuration update event, wherein the initial current configuration information includes extended configuration sub-information, and the extended configuration sub-information includes a configuration change identifier; an identification adjustment unit, configured to adjust the configuration change identification based on the configuration update event to obtain target current configuration information; A second information acquisition unit, configured to acquire historical configuration information, wherein the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier; A result determination unit, configured to determine a configuration change result corresponding to the configuration update event based on the configuration change identifier and the historical configuration change identifier in the target current configuration information; The resource reloading unit is configured to reload resources based on the configuration data of the configuration update event when the configuration change result indicates that a configuration change has occurred.

11. The resource reloading device according to claim 10, wherein: The current configuration information also includes original configuration sub-information, and the historical configuration information includes historical original configuration sub-information; The result determination unit is used to determine the information change result corresponding to the configuration update event based on the original configuration sub-information in the target current configuration information and the historical original configuration sub-information in the historical configuration information; Comparing the configuration change identifier in the target current configuration information with the historical configuration change identifier in the historical configuration information to determine an identifier change result corresponding to the configuration update event; The configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.

12. The resource reloading device according to claim 11, wherein: The result determination unit is used to call a configuration update method in a process management service with the initial current configuration information as a calling parameter, wherein the configuration update method includes a configuration information comparison method; The configuration information comparison method is used to compare the original configuration sub-information with the historical original configuration sub-information to determine the information change result.

13. The resource reloading device according to claim 12, wherein: The original configuration sub-information includes at least one type of original device configuration feature, and the historical original configuration sub-information includes at least one type of historical original device configuration feature, and the type of the historical original device configuration feature is the same as the original device configuration feature; The result determination unit is used to compare the original device configuration features in the original configuration sub-information with the historical original device configuration features in the historical original configuration sub-information of the same type through the configuration information comparison method to determine the information change result.

14. The resource reloading device according to claim 12, wherein: The result determination unit is used to collect the calling information of the configuration information comparison method through a preset program probe; Based on the calling information, calling the extended configuration comparison method of the extended configuration sub-information; By using the extended configuration comparison method, the configuration change identifier in the target current configuration information and the historical configuration change identifier in the historical configuration information are compared to determine the identifier change result corresponding to the configuration update event.

15. The resource reloading device according to claim 14, wherein: The program probe is a program code implemented by plugging in. The plugging in refers to inserting a probe into a program on the basis of ensuring the logical integrity of the original program.

16. The resource reloading device according to claim 10, wherein: The identification adjustment unit is used to determine the update condition corresponding to the configuration update event based on the configuration update event; When the update condition belongs to a preset configuration change condition, obtaining a target change identifier corresponding to the update condition from a preset change identifier set; The attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.

17. The resource reloading device according to claim 10, wherein: The configuration data includes target display data, and the resource reloading unit is used to obtain the target display data corresponding to the configuration update event when the configuration change result indicates that a configuration change has occurred; The restart process is stopped, and resources are reloaded on the original display data based on the target display data to display the target display effect corresponding to the target display data.

18. The resource reloading device according to claim 10, wherein: The configuration change identifier is identification information indicating whether the extended configuration sub-information has changed, and the resources for resource reloading include additional files and static contents used by the code.

19. An electronic device, wherein: It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the resource overloading method according to any one of claims 1 to 9.

20. A computer-readable storage medium, wherein: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the resource reloading method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • UI interface configuration method of mobile communication terminal

    CN101551746A

  • Topic revision method and device

    CN106843830A

  • System typeface switching method, mobile terminal and computer readable storage medium

    CN107229470A

  • Container configuration updating method and device, computer equipment and storage medium

    CN111651178A

  • Updating method and device for user interface of application program

    CN114579164A