[go: up one dir, main page]

WO2024212776A1 - 一种资源重载方法、装置、电子设备和存储介质 - Google Patents

一种资源重载方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2024212776A1
WO2024212776A1 PCT/CN2024/082727 CN2024082727W WO2024212776A1 WO 2024212776 A1 WO2024212776 A1 WO 2024212776A1 CN 2024082727 W CN2024082727 W CN 2024082727W WO 2024212776 A1 WO2024212776 A1 WO 2024212776A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
information
historical
change
sub
Prior art date
Application number
PCT/CN2024/082727
Other languages
English (en)
French (fr)
Inventor
王帆
Original Assignee
深圳Tcl新技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳Tcl新技术有限公司 filed Critical 深圳Tcl新技术有限公司
Publication of WO2024212776A1 publication Critical patent/WO2024212776A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present application relates to the field of computer technology, and in particular to a resource overloading method, device, electronic device and storage medium.
  • the main method used to implement user customized settings is to reload resources according to user settings to achieve updates that meet user needs.
  • resources are generally reloaded by restarting the application or operating system, and the user settings cannot take effect immediately, affecting the user experience.
  • 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.
  • the present application embodiment provides a resource reloading method, including:
  • 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;
  • the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier
  • the embodiment of the present application further provides a resource reloading device, including:
  • 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.
  • the current configuration information also includes original configuration sub-information
  • 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;
  • the configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.
  • 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.
  • the original configuration sub-information includes at least one type of original device configuration feature
  • the historical original configuration sub-information includes at least one type of historical original device configuration feature
  • 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.
  • the result determination unit is used to collect the calling information of the configuration information comparison method through a preset program probe
  • 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.
  • the identification adjustment unit is used to determine an update condition corresponding to the configuration update event based on the configuration update event;
  • the attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.
  • the configuration data includes target display data
  • 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.
  • 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 overloading method provided in the embodiment of the present application.
  • 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 a processor to load to execute the steps in any one of the resource reloading methods provided in the embodiment of the present application.
  • 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.
  • initial current configuration information in response to a configuration update event, initial current configuration information can be obtained, 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, 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, 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; because in the embodiment of the present application, whether a configuration has changed is determined by additionally setting the extended configuration sub-information, a mechanism is established for determining whether resources need to be reloaded based on the configuration change identifier, therefore, resources can be reloaded without restarting the application or system,
  • FIG1 is a schematic diagram of a scenario of a resource reloading method provided in an embodiment of the present application.
  • FIG2 is a flow chart of a resource reloading method provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a UML class diagram of configuration information provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a flow chart of a configuration change triggering an application update according to an embodiment of the present application
  • FIG5 is a schematic diagram of the structure of a resource reloading device provided in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the embodiments of the present application provide a resource reloading method, device, electronic device and computer-readable storage medium. Specifically, the embodiments of the present application provide a resource reloading method applicable to a resource reloading device, and the resource reloading device can be integrated in an electronic device.
  • the electronic device can be a terminal or other device, including but not limited to a mobile terminal and a fixed terminal.
  • a mobile terminal includes but is not limited to a smart phone, a smart watch, a tablet computer, a laptop computer, a smart car-mounted terminal, etc.
  • a fixed terminal includes but is not limited to a desktop computer, a smart TV, etc.
  • the electronic device may also be a device such as a server.
  • the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be 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), as well as big data and artificial intelligence platforms, but is not limited to these.
  • 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.
  • the method is described below by taking the case where a terminal and a server jointly implement the resource reloading method as an example.
  • the resource overloading system provided in the 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.
  • 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.
  • the server 20 may store part or all of the configuration data of the configuration update event.
  • the specific process of the resource reloading method of this embodiment may be as follows:
  • initial current configuration information 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.
  • the configuration update event may be any event that causes a change in the configuration of a system or application program.
  • the configuration update event may be used to notify the corresponding system or application program to perform corresponding operations according to the new configuration.
  • the 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.
  • the initial current configuration information is the configuration information when the configuration parameters are not modified at the current moment.
  • the initial current configuration information may be a native Configuration class in AOSP (Android Open Source Project).
  • 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 the technician in the initial current configuration information or the target current configuration information.
  • the extended configuration sub-information can be a customized ConfigurationExt class by a technician.
  • the customized ConfigurationExt class is used as a customized configuration class, and the instance of this class is used as a member variable of the AOSP native Configuration class.
  • AMS ActivityManagerService
  • AMS ActivityManagerService
  • the customized ConfigurationExt as a member variable of the native Configuration, will participate in the judgment of Configuration changes and affect the judgment result. The impact on the judgment result will cause the system to believe that the configuration has changed, notify the application side, and cause the application resources to be reloaded and the interface to be updated.
  • the relationship between the ConfigurationExt class customized by the technician and the native Configuration class can be shown in the UML (Unified Modeling Language) class diagram of the customized configuration provided in FIG. 3 .
  • UML Unified Modeling Language
  • 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>>.
  • connection relationships, etc. 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.
  • the configuration change identifier is identification information indicating whether the extended configuration sub-information has changed.
  • the Bundle member variable defined in the customized ConfigurationExt class is used to save some data when the configuration is changed; the changedFlags of this class is used as a flag for configuration changes; and the updateFlags method of this class is used to update the flag.
  • the changedFlags information is the configuration change flag.
  • the target current configuration information is the configuration information when the configuration parameters are modified at the current moment.
  • the target current configuration information may be the Configuration class after the changedFlags in the ConfigurationExt class is changed.
  • the step of “adjusting the configuration change identifier based on the configuration update event to obtain the target current configuration information” may specifically include:
  • the attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.
  • configuration change condition 1 may correspond to change identifier 1
  • configuration change condition 2 may correspond to change identifier 2.
  • various configuration change conditions may correspond to the same target change identifier, that is, as long as a configuration update event that satisfies the configuration change condition occurs, the configuration change identifier is set to a specific target change identifier.
  • 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.
  • the configuration change result may indicate that a configuration change has occurred, or may indicate that no configuration change has occurred.
  • the form and content of the configuration change result may be set by the technician, and the present application embodiment does not limit this.
  • the current configuration information also includes original configuration sub-information
  • the historical configuration information includes historical original configuration sub-information
  • the configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.
  • AMS ActivityManagerService
  • ConfigurationExt a member variable of the native Configuration
  • the impact on the judgment result will cause the system to believe that the configuration has changed, notify the application side, and cause the application resources to be reloaded and the interface to be updated.
  • the information change result may be obtained by comparing the original configuration sub-information with the historical original configuration sub-information through 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:
  • 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.
  • the original configuration sub-information includes at least one type of original device configuration feature
  • the historical original configuration sub-information includes at least one type of historical original device configuration feature
  • the type of the historical original device configuration feature is the same as the original device configuration feature
  • the step of “comparing the original configuration sub-information with the historical original configuration sub-information through the configuration information comparison method to determine the information change result” may specifically include:
  • 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.
  • the Configuration comparison method will compare the configuration items involved (screen density, orientation, language, etc.) one by one.
  • the subsequent call process of AMS updateConfiguration will compare the difference 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).
  • our customized ConfigurationExt is also added to the comparison through plugging, 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:
  • 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.
  • program probes are program codes implemented through hooking technology. Hooking means inserting probes into the program on the basis of ensuring the integrity of the original program logic, and inserting code segments at specific locations to collect information in the code (method itself, method parameter values, return values, etc.) through probes, so as to collect dynamic context information when the program is running.
  • the comparison method of ConfigurationExt will compare the changedFlags of the new and old configurations. If the flags are inconsistent, it is considered that the configuration has changed, thereby affecting the comparison result of the Configuration comparison method.
  • the change in the comparison result triggers the mechanism of native resource reloading and interface reconstruction to achieve the update of application resources.
  • the resources for resource overloading can refer to additional files and static content used by the code, such as bitmaps, layout files, strings, animations, colors, sizes, etc.
  • Android will use appropriate resources based on the current configuration. For example, you may need to provide different interface layouts based on screen size, or different strings based on language settings.
  • a mapping relationship between resource IDs and resource paths or resource values is generated. When applying, the corresponding resource is found through the resource ID to define the style and attributes of the interface elements.
  • 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).
  • 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:
  • 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.
  • the above process will go through the ResourcesManager stage, in which the resources of the application will be updated.
  • the AMS.updateConfiguration method can be executed to notify the corresponding application of the configuration change.
  • the ActivityThread.applyConfigurationToResources method is executed to notify the resource object class corresponding to the theme skinning to perform resource configuration.
  • the ResourcesManager stage you can manage the configuration resources related to theme skinning. For example, you can use the ResourcesManager.applyConfigurationToResourcesLocked method to cache and update the theme package resources. When the interface is rebuilt later, you can implement resource coverage by intercepting the resource acquisition process.
  • This innovation can solve the problem of reloading resources and rebuilding the interface without killing the process or restarting, which is of great significance to improving the user experience.
  • customization through this customized configuration is also a good solution.
  • This application uses customized configuration and borrows the resource overload mechanism when Android native configuration changes to solve the problem of implementing relevant interface refresh and resource utilization through instant configuration changes during the interaction process and passing them to the application side.
  • the mechanism is more sound and stable, with a wide coverage range and more convenient and quick processing. It only needs to be plugged in and processed on the system side, and the application does not need to do too much adaptation.
  • the embodiment of the present application can 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 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 resources based on the configuration data of the configuration update event; because in the embodiment of the present application, whether a configuration has changed 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
  • the embodiment of the present application also provides a resource reloading device.
  • the device comprises:
  • 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;
  • An identification adjustment unit 502 configured to adjust the configuration change identification based on the configuration update event to obtain target current configuration information
  • a second information acquisition unit 503 is used 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 504 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 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.
  • the current configuration information also includes original configuration sub-information
  • the historical configuration information includes historical original configuration sub-information
  • the result determination unit 504 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;
  • the configuration change result corresponding to the configuration update event is determined according to the identification change result and the information change result.
  • the result determination unit 504 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.
  • the original configuration sub-information includes at least one type of original device configuration feature
  • the historical original configuration sub-information includes at least one type of historical original device configuration feature
  • the type of the historical original device configuration feature is the same as the original device configuration feature
  • the result determination unit 504 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.
  • the result determination unit 504 is used to collect the calling information of the configuration information comparison method through a preset program probe
  • 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.
  • the identification adjustment unit 502 is used to determine an update condition corresponding to the configuration update event based on the configuration update event;
  • the attribute value of the configuration change identifier is modified to the target change identifier to obtain the target current configuration information.
  • the configuration data includes target display data
  • the resource reloading unit 505 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.
  • the initial current configuration information in response to a configuration update event, can be obtained, 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, the configuration change identifier is adjusted to obtain the target current configuration information, and the historical configuration information is obtained, 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 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, the resource is reloaded based on the configuration data of the configuration update event; because in the embodiment of the present application, whether a configuration has changed is determined by additionally setting the extended configuration sub-information, a mechanism is established to determine whether a resource reload is required based on the configuration change identifier, therefore, the resource reload can be
  • an embodiment of the present application further provides an electronic device, which may be a terminal or a server, etc.
  • an electronic device which may be a terminal or a server, etc.
  • FIG6 a schematic diagram of the structure of the electronic device involved in the embodiment of the present application is shown. Specifically:
  • 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.
  • RF radio frequency
  • a memory 602 including one or more computer-readable storage media
  • the RF circuit 601 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 608 for processing; in addition, the data related to the uplink is sent to the base station.
  • 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, etc.
  • SIM subscriber identity module
  • LNA low noise amplifier
  • the RF circuit 601 can also communicate with the network and other devices through wireless communication.
  • Wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the memory 602 can be used to store software programs and modules.
  • the processor 608 executes various functional applications and data processing by running the software programs and modules stored in the memory 602.
  • the memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, a phone book, etc.), etc.
  • the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 608 and the input unit 603 with access to the memory 602.
  • the input unit 603 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • the input unit 603 may include a touch-sensitive surface and other input devices.
  • the touch-sensitive surface also known as a touch display screen or a touch pad, can collect the user's touch operations on or near it (such as the user's operation on or near the touch-sensitive surface using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a pre-set program.
  • the touch-sensitive surface may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 608, and can receive and execute the command sent by the processor 608.
  • the touch-sensitive surface can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave.
  • 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.
  • the display unit 604 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof.
  • the display unit 604 may include a display panel.
  • the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • the touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 608 to determine the type of touch event, and then the processor 608 provides corresponding visual output on the display panel according to the type of touch event.
  • the touch-sensitive surface and the display panel are implemented as two independent components to implement input and output functions, in some embodiments, the touch-sensitive surface and the display panel can be integrated to implement input and output functions.
  • the electronic device may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein 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.
  • the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary.
  • the audio circuit 606, the speaker, and the microphone can provide an audio interface between the user and the electronic device.
  • the audio circuit 606 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 606 and converted into audio data, and then the audio data is output to the processor 608 for processing, and then sent to another electronic device through the RF circuit 601, or the audio data is output to the memory 602 for further processing.
  • the audio circuit 606 may also include an earplug jack to provide communication between an external headset and the electronic device.
  • WiFi is a short-range wireless transmission technology.
  • the electronic device can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 607, which provides users with wireless broadband Internet access.
  • FIG6 shows the WiFi module 607, it is understandable that it is not a necessary component of the electronic device and can be omitted as needed without changing the essence of the application.
  • the processor 608 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 602, and calling data stored in the memory 602.
  • the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 608.
  • the electronic device also includes a power supply 609 (such as a battery) for supplying power to each component.
  • a power supply 609 (such as a battery) for supplying power to each component.
  • the power supply can be logically connected to the processor 608 through a power management system, so that the power management system can manage charging, discharging, and power consumption management.
  • the power supply 609 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
  • the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
  • the processor 608 in the electronic device will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 608 will run the application stored in the memory 602 to achieve various functions, as follows:
  • 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;
  • the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier
  • an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any resource reloading method provided in the embodiment of the present application.
  • the instructions can execute the following steps:
  • 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;
  • the historical configuration information includes historical extended configuration sub-information, and the historical extended configuration sub-information includes a historical configuration change identifier
  • the computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
  • the instructions stored in the computer-readable storage medium can execute the steps in any one of the resource overloading methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the resource overloading methods 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.
  • a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium.
  • a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本申请实施例公开了一种资源重载方法、装置、电子设备和存储介质;可以响应于配置更新事件,获取初始当前配置信息,初始当前配置信息中包括扩展配置子信息,扩展配置子信息中包括配置更改标识,基于配置更新事件,对配置更改标识进行调整,得到目标当前配置信息,获取历史配置信息,历史配置信息中包括历史扩展配置子信息,历史扩展配置子信息中包括历史配置更改标识,基于目标当前配置信息中的配置更改标识和历史配置更改标识,确定配置更新事件对应的配置更改结果,当配置更改结果指示发生了配置更改时,基于配置更新事件的配置数据进行资源重载。

Description

一种资源重载方法、装置、电子设备和存储介质
本申请要求于2023年04月14日提交中国专利局、申请号为202310438089.9、申请名称为“一种资源重载方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,具体涉及一种资源重载方法、装置、电子设备和存储介质。
背景技术
随着当前经济和科技的快速发展,用户在使用电子产品时对产品的功能、体验和交互的要求也越来越高。有很多操作系统或者应用程序支持用户进行自定义的设置,以提升用户的使用体验。
发明概述
目前,在实现用户的自定义设置时采取的主要方法是,根据用户的设置进行资源的重新加载,以实现满足用户需求的更新。但是采用这种方案,一般都是通过应用程序或者操作系统的重启,来完成资源的重载,用户的设置不能够即时生效,影响用户的使用体验。
本申请实施例提供一种资源重载方法、装置、电子设备和存储介质,可以无需重启应用程序或者系统即完成资源的重载,改善用户的使用体验,实现资源重载的即时生效。
本申请实施例提供一种资源重载方法,包括:
响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
相应的,本申请实施例还提供一种资源重载装置,包括:
第一信息获取单元,用于响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
标识调整单元,用于基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
第二信息获取单元,用于获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
结果确定单元,用于基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
资源重载单元,用于当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
在一些可选的实施例中,所述当前配置信息中还包括原始配置子信息,所述历史配置信息中包括历史原始配置子信息;
所述结果确定单元,用于基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果;
对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果;
根据所述标识更改结果和所述信息更改结果,确定所述配置更新事件对应的配置更改结果。
在一些可选的实施例中,所述结果确定单元,用于以所述初始当前配置信息为调用参数,调用进程管理服务中的配置更新方法,所述配置更新方法中包括配置信息比较方法;
通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果。
在一些可选的实施例中,所述原始配置子信息中包括至少一种类型的原始设备配置特征,所述历史原始配置子信息中包括至少一种类型的历史原始设备配置特征,所述历史原始设备配置特征的类型与所述原始设备配置特征相同;
所述结果确定单元,用于通过所述配置信息比较方法,分别将所述原始配置子信息中的所述原始设备配置特征与类型相同的所述历史原始配置子信息中的所述历史原始设备配置特征进行对比,确定信息更改结果。
在一些可选的实施例中,所述结果确定单元,用于通过预设的程序探针,收集所述配置信息比较方法的调用信息;
基于所述调用信息,调用所述扩展配置子信息的扩展配置比较方法;
通过所述扩展配置比较方法,对所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识进行对比,确定所述配置更新事件对应的标识更改结果。
在一些可选的实施例中,所述标识调整单元,用于基于所述配置更新事件,确定所述配置更新事件对应的更新条件;
当所述更新条件属于预设的配置更改条件时,从预设的更改标识集合中,获取所述更新条件对应的目标更改标识;
将所述配置更改标识的属性值修改为所述目标更改标识,得到目标当前配置信息。
在一些可选的实施例中,所述配置数据包括目标显示数据,所述资源重载单元,用于当所述配置更改结果指示发生了配置更改时,获取所述配置更新事件对应的目标显示数据;
停止重启进程,基于所述目标显示数据对原始显示数据进行资源重载,以显示所述目标显示数据对应的目标显示效果。
相应的,本申请实施例还提供一种电子设备,包括存储器和处理器;所述存储器存储有应用程序,所述处理器用于运行所述存储器内的应用程序,以执行本申请实施例所提供的任一种资源重载方法中的步骤。
相应的,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行本申请实施例所提供的任一种资源重载方法中的步骤。
此外,本申请实施例还提供一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时实现本申请实施例所提供的任一种资源重载方法中的步骤。
有益效果
采用本申请实施例的方案,可以响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识,基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息,获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识,基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果,当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载;由于在本申请实施例中,通过额外设置的扩展配置子信息确定是否有配置发生改变,建立了根据配置更改标识即可确定是否需要进行资源重载的机制,因此,可以无需重启应用程序或者系统即完成资源的重载,改善用户的使用体验,实现资源重载的即时生效。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的资源重载方法的场景示意图;
图2是本申请实施例提供的资源重载方法的流程图;
图3是本申请实施例提供的配置信息的UML类图示意图;
图4是本申请实施例提供的配置更改触发应用更新的流程示意图;
图5是本申请实施例提供的资源重载装置的结构示意图;
图6是本申请实施例提供的电子设备的结构示意图。
本发明的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供一种资源重载方法、装置、电子设备和计算机可读存储介质。具体地,本申请实施例提供适用于资源重载装置的资源重载方法,该资源重载装置可以集成在电子设备中。
该电子设备可以为终端等设备,包括但不限于移动终端和固定终端,例如移动终端包括但不限于智能手机、智能手表、平板电脑、笔记本电脑、智能车载等,其中,固定终端包括但不限于台式电脑、智能电视等。
该电子设备还可以为服务器等设备,该服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器,但并不局限于此。
本申请实施例的资源重载方法,可以由服务器实现,也可以由终端和服务器共同实现。
下面以终端和服务器共同实现该资源重载方法为例,对该方法进行说明。
如图1所示,本申请实施例提供的资源重载系统包括终端10和服务器20等;终端10与服务器20之间通过网络连接,比如,通过有线或无线网络连接等,其中,终端10可以作为用户进行了自定义设置的终端存在。
其中,终端10可以用于响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识,基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息,获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识,基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果,当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
具体的,服务器20可以存储有配置更新事件的部分或者全部配置数据等。
以下分别进行详细说明。需要说明的是,以下实施例的描述顺序不作为对实施例优选顺序的限定。
本申请实施例将从资源重载装置的角度进行描述,该资源重载装置具体可以集成在终端中。
如图2所示,本实施例的资源重载方法的具体流程可以如下:
201、响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识。
其中,配置更新事件可以是任意的导致系统或者应用程序的配置发生变化的事件。通过配置更新事件可以通知相应的系统或者应用程序根据新的配置进行对应的操作。
例如,配置更新事件可以是用户对于应用程序颜色的设置、对于系统切换动画的设置等操作而生成的事件。
其中,初始当前配置信息为在当前时刻下配置参数未发生修改时的配置信息。例如,在安卓操作系统中,初始当前配置信息可以是AOSP(Android Open Source Project,Android 开放源代码项目)中原生Configuration类。
具体的,扩展配置子信息是本申请实施例中针对配置信息额外设置的一类信息。扩展配置子信息可以是技术人员进行自定义配置在初始当前配置信息或者目标当前配置信息中的子信息。
例如,扩展配置子信息可以是技术人员客制化的ConfigurationExt类,客制化ConfigurationExt类作为客制化的配置类,该类的实例作为AOSP原生Configuration类的成员变量。当AMS(ActivityManagerService,活动管理服务)触发配置更新时,会通过Configuration里面的一些成员方法判断配置是否更改,而客制化的ConfigurationExt作为原生Configuration的成员变量,会参与Configuration配置更改的判断,影响判断结果。而对判断结果的影响会导致系统认为配置发生了改变,通知到应用侧,引起应用资源的重载和界面更新。
例如,在实际应用过程中,技术人员客制化的ConfigurationExt类与原生的Configuration类之间的关系可以如图3提供的客制化配置的UML(Unified Modeling Language, 统一建模语言)类图所示。
具体的,类图显示了一组类、接口、协作以及他们之间的关系。类的属性、操作中的可见性使用+、#、-分别表示public、protected、private。接口在类图中通过<<interface>>来表示。
比如,在图3中,通过连接关系等,可以表示出接口类IConfigurationExt与Configuration类通过接口Comparable实现,接口类IConfigurationExt与Configuration类之间为聚合关系,ConfigurationExt类基于接口类IConfigurationExt实现。
在ConfigurationExt类中,存在extraData: Bundle和changedFlags: int的属性,通过ConfigurationExt类可以实现compareTo、diff等操作。
其中,配置更改标识为指示扩展配置子信息是否发生变化的标识信息。
例如,客制化的ConfigurationExt类定义的Bundle成员变量用于在配置更改时保存一些数据;该类的changedFlags作为配置更改的标记;该类的updateFlags方法用来更新标记。其中,changedFlags信息即为配置更改标识。
202、基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息。
其中,目标当前配置信息为在当前时刻下配置参数发生修改时的配置信息。例如,在安卓操作系统中,目标当前配置信息可以是ConfigurationExt类中的changedFlags发生变化后的Configuration类。
在一些可选的实施例中,步骤“基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息”,具体可以包括:
基于所述配置更新事件,确定所述配置更新事件对应的更新条件;
当所述更新条件属于预设的配置更改条件时,从预设的更改标识集合中,获取所述更新条件对应的目标更改标识;
将所述配置更改标识的属性值修改为所述目标更改标识,得到目标当前配置信息。
例如,在某些条件改变时,可以获取当前的Configuration,取出其中的ConfigurationExt类型成员变量,通过updateFlags方法改变ConfigurationExt里的changedFlags标记。
可以理解的是,不同的配置更改条件可以对应有不同的目标更改标识。例如,配置更改条件1可以对应有更改标识1,配置更改条件2可以对应有更改标识2。
或者,各种配置更改条件可以对应有相同的目标更改标识,即,只要发生了满足配置更改条件的配置更新事件,就将配置更改标识设置为特定的目标更改标识。
203、获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识。
其中,历史配置信息可以直接是初始当前配置信息。或者,历史配置信息可以是系统或者应用程序最初始的配置信息,等等。
204、基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果。
其中,配置更改结果可以是指示发生了配置更改,也可以是指示未发生配置更改。配置更改结果的形式和内容可以由技术人员自行设定,本申请实施例对此不作限定。
在一些可选的实施例中,当前配置信息中还包括原始配置子信息,所述历史配置信息中包括历史原始配置子信息,步骤“基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果”,具体可以包括:
基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果;
对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果;
根据所述标识更改结果和所述信息更改结果,确定所述配置更新事件对应的配置更改结果。
例如,当AMS(ActivityManagerService)触发配置更新时,会通过Configuration里面的一些成员方法判断配置是否更改,而客制化的ConfigurationExt作为原生Configuration的成员变量,会参与Configuration配置更改的判断,影响判断结果。而对判断结果的影响会导致系统认为配置发生了改变,通知到应用侧,引起应用资源的重载和界面更新。
在一些可选的实施例中,信息更改结果可以通过特定的比较方法对原始配置子信息和历史原始配置子信息进行对比得到,也就是说,步骤“基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果”,具体可以包括:
以所述初始当前配置信息为调用参数,调用进程管理服务中的配置更新方法,所述配置更新方法中包括配置信息比较方法;
通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果。
例如,可以将当前的Configuration当作参数,反射调用ActivityManagerService的updateConfiguration方法。
在一些可选的示例中,所述原始配置子信息中包括至少一种类型的原始设备配置特征,所述历史原始配置子信息中包括至少一种类型的历史原始设备配置特征,所述历史原始设备配置特征的类型与所述原始设备配置特征相同。
相应的,步骤“通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果”,具体可以包括:
通过所述配置信息比较方法,分别将所述原始配置子信息中的所述原始设备配置特征与类型相同的所述历史原始配置子信息中的所述历史原始设备配置特征进行对比,确定信息更改结果。
例如,Configuration的比较方法在对比时会对涉及到的配置项(屏幕密度、方向、语言…)一一对比。
AMS的updateConfiguration后续调用流程会对比当前Configuration和之前Configuration的差别,通过Configuration的一些比较方法(compareTo、diff..)用位标记的形式确认配置是否更改。
在一些可选的实施例中,通过插桩将我们自定义的ConfigurationExt也加入了对比,会调到ConfigurationExt的比较方法(compareTo、diff…),步骤“对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果”,具体可以包括:
通过预设的程序探针,收集所述配置信息比较方法的调用信息;
基于所述调用信息,调用所述扩展配置子信息的扩展配置比较方法;
通过所述扩展配置比较方法,对所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识进行对比,确定所述配置更新事件对应的标识更改结果。
其中,程序探针是通过插桩技术实现的程序代码。插桩(hook)指在保证原有程序逻辑完整性的基础上,在程序中插入探针,通过探针采集代码中的信息(方法本身、方法参数值、返回值等)在特定的位置插入代码段,从而收集程序运行时的动态上下文信息。
205、当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
在一些可选的实施例中,ConfigurationExt的比较方法会对新老配置的changedFlags进行对比,标记不一致则认为配置发生更改,由此影响Configuration比较方法的比较结果。比较结果改变,触发原生资源重载和界面重建的机制,实现应用资源的更新。
其中,进行资源重载的资源可以是指代码使用的附加文件和静态内容,例如位图、布局文件、字符串、动画、颜色、尺寸等。在运行时,Android 会根据当前配置使用合适的资源。例如,您可能需根据屏幕尺寸提供不同的界面布局,或根据语言设置提供不同的字符串。资源经过编译会生成资源ID和资源路径或资源值的映射关系,在应用时通过资源ID寻找对应资源定义界面元素的风格和属性。
具体的,配置数据可以是该类描述可能影响应用程序检索的资源的所有设备配置信息。这包括用户指定的配置选项(语言环境列表和缩放)以及设备配置(如输入模式、屏幕大小和屏幕方向)。
在一些示例中,步骤“配置数据包括目标显示数据,所述当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载”,具体可以包括:
当所述配置更改结果指示发生了配置更改时,获取所述配置更新事件对应的目标显示数据;
停止重启进程,基于所述目标显示数据对原始显示数据进行资源重载,以显示所述目标显示数据对应的目标显示效果。
如图4所示,在安卓操作系统中,上述流程会经过ResourcesManager阶段,在该阶段会对应用的资源进行更新。
例如,如果将本申请实施例应用在安卓系统的主题换肤场景,则可以基于用户的换肤操作,当操作系统检测到配置更改后,可以执行AMS.updateConfiguration方法,通知对应应用发生了配置的更改。进一步的,执行ActivityThread.applyConfigurationToResources方法,通知主题换肤所对应的资源对象类进行资源配置。
在ResourcesManager阶段可以管理主题换肤的相关配置资源,例如通过ResourcesManager.applyConfigurationToResourcesLocked方法,可以对主题包资源进行缓存更新。在后续的界面重建时,通过拦截资源的获取流程,就可以实现资源的覆盖。
通过调用Resources.updateSystemConfiguration方法,可以获取在进行主题换肤时需要更新的配置信息,通过Resourceslmpl.updateConfiguration方法,可以对主题换肤的应用程序的相关配置进行更新。通过调用ActivityThread.handleConfigurationChanged方法,确保获得了最新的配置信息,通过Activity.onConfigurationChanged方法,修改主题换肤的应用程序中与本次主题换肤直接关联的部分配置信息。
此创新可以解决该场景下无需杀进程、无需重启完成资源重载和界面重建,对提升用户体验有重要意义。除此之外,在一些需要根据配置使界面或者功能展现差异化效果的场景,现有配置无法满足需求的情况,通过该客制化配置实现定制也是一种很好的解决方案。
现有技术大多采用回调或者其他通知机制,具有适用场景小、覆盖面狭窄、可拓展性不高的缺点。该申请通过客制化配置,借用Android原生配置更改时资源重载的机制,解决了在交互过程中通过配置更改即时生效并传递到应用端实现相关界面刷新和资源运用的难题。机制更加健全、稳定,覆盖范围大、处理更加方便快捷,只需在系统侧做好插桩和处理,无需应用做过多适配。
市场已有产品大多采用通知、数据库监听回调、发布订阅等方式处理配置更改的通知和界面重启完成资源重载。本方法巧妙借用Android原生的Configuration配置机制,覆盖范围和可靠性更高。
由上可知,本申请实施例可以响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识,基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息,获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识,基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果,当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载;由于在本申请实施例中,通过额外设置的扩展配置子信息确定是否有配置发生改变,建立了根据配置更改标识即可确定是否需要进行资源重载的机制,因此,可以无需重启应用程序或者系统即完成资源的重载,改善用户的使用体验,实现资源重载的即时生效。
为了更好地实施以上方法,相应的,本申请实施例还提供一种资源重载装置。
参考图5,该装置包括:
第一信息获取单元501,用于响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
标识调整单元502,用于基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
第二信息获取单元503,用于获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
结果确定单元504,用于基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
资源重载单元505,用于当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
在一些可选的实施例中,所述当前配置信息中还包括原始配置子信息,所述历史配置信息中包括历史原始配置子信息;
所述结果确定单元504,用于基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果;
对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果;
根据所述标识更改结果和所述信息更改结果,确定所述配置更新事件对应的配置更改结果。
在一些可选的实施例中,所述结果确定单元504,用于以所述初始当前配置信息为调用参数,调用进程管理服务中的配置更新方法,所述配置更新方法中包括配置信息比较方法;
通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果。
在一些可选的实施例中,所述原始配置子信息中包括至少一种类型的原始设备配置特征,所述历史原始配置子信息中包括至少一种类型的历史原始设备配置特征,所述历史原始设备配置特征的类型与所述原始设备配置特征相同;
所述结果确定单元504,用于通过所述配置信息比较方法,分别将所述原始配置子信息中的所述原始设备配置特征与类型相同的所述历史原始配置子信息中的所述历史原始设备配置特征进行对比,确定信息更改结果。
在一些可选的实施例中,所述结果确定单元504,用于通过预设的程序探针,收集所述配置信息比较方法的调用信息;
基于所述调用信息,调用所述扩展配置子信息的扩展配置比较方法;
通过所述扩展配置比较方法,对所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识进行对比,确定所述配置更新事件对应的标识更改结果。
在一些可选的实施例中,所述标识调整单元502,用于基于所述配置更新事件,确定所述配置更新事件对应的更新条件;
当所述更新条件属于预设的配置更改条件时,从预设的更改标识集合中,获取所述更新条件对应的目标更改标识;
将所述配置更改标识的属性值修改为所述目标更改标识,得到目标当前配置信息。
在一些可选的实施例中,所述配置数据包括目标显示数据,所述资源重载单元505,用于当所述配置更改结果指示发生了配置更改时,获取所述配置更新事件对应的目标显示数据;
停止重启进程,基于所述目标显示数据对原始显示数据进行资源重载,以显示所述目标显示数据对应的目标显示效果。
由上可知,通过资源重载装置,可以响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识,基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息,获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识,基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果,当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载;由于在本申请实施例中,通过额外设置的扩展配置子信息确定是否有配置发生改变,建立了根据配置更改标识即可确定是否需要进行资源重载的机制,因此,可以无需重启应用程序或者系统即完成资源的重载,改善用户的使用体验,实现资源重载的即时生效。
此外,本申请实施例还提供一种电子设备,该电子设备可以为终端或者服务器等等,如图6所示,其示出了本申请实施例所涉及的电子设备的结构示意图,具体来讲:
该电子设备可以包括射频(RF,Radio Frequency)电路601、包括有一个或一个以上计算机可读存储介质的存储器602、输入单元603、显示单元604、传感器605、音频电路606、无线保真(WiFi,Wireless Fidelity)模块607、包括有一个或者一个以上处理核心的处理器608、以及电源609等部件。本领域技术人员可以理解,图6中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
RF电路601可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或者一个以上处理器608处理;另外,将涉及上行的数据发送给基站。通常,RF电路601包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(SIM,Subscriber Identity Module)卡、收发信机、耦合器、低噪声放大器(LNA,Low Noise Amplifier)、双工器等。此外,RF电路601还可以通过无线通信与网络和其他设备通信。无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GSM,Global System of Mobile communication)、通用分组无线服务(GPRS ,General Packet Radio Service)、码分多址(CDMA,Code Division Multiple Access)、宽带码分多址(WCDMA,Wideband Code Division Multiple Access)、长期演进(LTE,Long Term Evolution)、电子邮件、短消息服务(SMS,Short Messaging Service)等。
存储器602可用于存储软件程序以及模块,处理器608通过运行存储在存储器602的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器602可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器602可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器602还可以包括存储器控制器,以提供处理器608和输入单元603对存储器602的访问。
输入单元603可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,在一个具体的实施例中,输入单元603可包括触敏表面以及其他输入设备。触敏表面,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面上或在触敏表面附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器608,并能接收处理器608发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面。除了触敏表面,输入单元603还可以包括其他输入设备。具体地,其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元604可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元604可包括显示面板,可选的,可以采用液晶显示器(LCD,Liquid Crystal Display)、有机发光二极管(OLED,Organic Light-Emitting Diode)等形式来配置显示面板。进一步的,触敏表面可覆盖显示面板,当触敏表面检测到在其上或附近的触摸操作后,传送给处理器608以确定触摸事件的类型,随后处理器608根据触摸事件的类型在显示面板上提供相应的视觉输出。虽然在图6中,触敏表面与显示面板是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面与显示面板集成而实现输入和输出功能。
电子设备还可包括至少一种传感器605,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板的亮度,接近传感器可在电子设备移动到耳边时,关闭显示面板和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等; 至于电子设备还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路606、扬声器,传声器可提供用户与电子设备之间的音频接口。音频电路606可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路606接收后转换为音频数据,再将音频数据输出处理器608处理后,经RF电路601以发送给比如另一电子设备,或者将音频数据输出至存储器602以便进一步处理。音频电路606还可能包括耳塞插孔,以提供外设耳机与电子设备的通信。
WiFi属于短距离无线传输技术,电子设备通过WiFi模块607可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图6示出了WiFi模块607,但是可以理解的是,其并不属于电子设备的必须构成,完全可以根据需要在不改变申请的本质的范围内而省略。
处理器608是电子设备的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器602内的软件程序和/或模块,以及调用存储在存储器602内的数据,执行电子设备的各种功能和处理数据。可选的,处理器608可包括一个或多个处理核心;优选的,处理器608可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器608中。
电子设备还包括给各个部件供电的电源609(比如电池),优选的,电源可以通过电源管理系统与处理器608逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源609还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
尽管未示出,电子设备还可以包括摄像头、蓝牙模块等,在此不再赘述。具体在本实施例中,电子设备中的处理器608会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器602中,并由处理器608来运行存储在存储器602中的应用程序,从而实现各种功能,如下:
响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例提供一种计算机可读存储介质,其中存储有多条指令,该指令能够被处理器进行加载,以执行本申请实施例所提供的任一种资源重载方法中的步骤。例如,该指令可以执行如下步骤:
响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。
其中,该计算机可读存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
由于该计算机可读存储介质中所存储的指令,可以执行本申请实施例所提供的任一种资源重载方法中的步骤,因此,可以实现本申请实施例所提供的任一种资源重载方法所能实现的有益效果,详见前面的实施例,在此不再赘述。
根据本申请的一个方面,还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该电子设备执行上述实施例中的各种可选实现方式中提供的方法。
以上对本申请实施例所提供的一种资源重载方法、装置、电子设备和存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种资源重载方法,其中,包括:
    响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
    基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
    获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
    基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
    当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
  2. 根据权利要求1所述的资源重载方法,其中,所述当前配置信息中还包括原始配置子信息,所述历史配置信息中包括历史原始配置子信息;
    所述基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果,包括:
    基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果;
    对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果;
    根据所述标识更改结果和所述信息更改结果,确定所述配置更新事件对应的配置更改结果。
  3. 根据权利要求2所述的资源重载方法,其中,所述基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果,包括:
    以所述初始当前配置信息为调用参数,调用进程管理服务中的配置更新方法,所述配置更新方法中包括配置信息比较方法;
    通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果。
  4. 根据权利要求3所述的资源重载方法,其中,所述原始配置子信息中包括至少一种类型的原始设备配置特征,所述历史原始配置子信息中包括至少一种类型的历史原始设备配置特征,所述历史原始设备配置特征的类型与所述原始设备配置特征相同;
    所述通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果,包括:
    通过所述配置信息比较方法,分别将所述原始配置子信息中的所述原始设备配置特征与类型相同的所述历史原始配置子信息中的所述历史原始设备配置特征进行对比,确定信息更改结果。
  5. 根据权利要求3所述的资源重载方法,其中,所述对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果,包括:
    通过预设的程序探针,收集所述配置信息比较方法的调用信息;
    基于所述调用信息,调用所述扩展配置子信息的扩展配置比较方法;
    通过所述扩展配置比较方法,对所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识进行对比,确定所述配置更新事件对应的标识更改结果。
  6. 根据权利要求5所述的资源重载方法,其中,所述程序探针为通过插桩实现的程序代码,所述插桩指在保证原有程序逻辑完整性的基础上,在程序中插入探针。
  7. 根据权利要求1所述的资源重载方法,其中,所述基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息,包括:
    基于所述配置更新事件,确定所述配置更新事件对应的更新条件;
    当所述更新条件属于预设的配置更改条件时,从预设的更改标识集合中,获取所述更新条件对应的目标更改标识;
    将所述配置更改标识的属性值修改为所述目标更改标识,得到目标当前配置信息。
  8. 根据权利要求1所述的资源重载方法,其中,所述配置数据包括目标显示数据,所述当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载,包括:
    当所述配置更改结果指示发生了配置更改时,获取所述配置更新事件对应的目标显示数据;
    停止重启进程,基于所述目标显示数据对原始显示数据进行资源重载,以显示所述目标显示数据对应的目标显示效果。
  9. 根据权利要求1所述的资源重载方法,其中,所述配置更改标识为指示扩展配置子信息是否发生变化的标识信息,所述进行资源重载的资源包括代码使用的附加文件和静态内容。
  10. 一种资源重载装置,其中,包括:
    第一信息获取单元,用于响应于配置更新事件,获取初始当前配置信息,所述初始当前配置信息中包括扩展配置子信息,所述扩展配置子信息中包括配置更改标识;
    标识调整单元,用于基于所述配置更新事件,对所述配置更改标识进行调整,得到目标当前配置信息;
    第二信息获取单元,用于获取历史配置信息,所述历史配置信息中包括历史扩展配置子信息,所述历史扩展配置子信息中包括历史配置更改标识;
    结果确定单元,用于基于所述目标当前配置信息中的所述配置更改标识和所述历史配置更改标识,确定所述配置更新事件对应的配置更改结果;
    资源重载单元,用于当所述配置更改结果指示发生了配置更改时,基于所述配置更新事件的配置数据进行资源重载。
  11. 根据权利要求10所述的资源重载装置,其中,所述当前配置信息中还包括原始配置子信息,所述历史配置信息中包括历史原始配置子信息;
    所述结果确定单元,用于基于所述目标当前配置信息中的所述原始配置子信息和所述历史配置信息中的所述历史原始配置子信息,确定所述配置更新事件对应的信息更改结果;
    对比所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识,确定所述配置更新事件对应的标识更改结果;
    根据所述标识更改结果和所述信息更改结果,确定所述配置更新事件对应的配置更改结果。
  12. 根据权利要求11所述的资源重载装置,其中,所述结果确定单元,用于以所述初始当前配置信息为调用参数,调用进程管理服务中的配置更新方法,所述配置更新方法中包括配置信息比较方法;
    通过所述配置信息比较方法,对所述原始配置子信息和所述历史原始配置子信息进行对比,确定信息更改结果。
  13. 根据权利要求12所述的资源重载装置,其中,所述原始配置子信息中包括至少一种类型的原始设备配置特征,所述历史原始配置子信息中包括至少一种类型的历史原始设备配置特征,所述历史原始设备配置特征的类型与所述原始设备配置特征相同;
    所述结果确定单元,用于通过所述配置信息比较方法,分别将所述原始配置子信息中的所述原始设备配置特征与类型相同的所述历史原始配置子信息中的所述历史原始设备配置特征进行对比,确定信息更改结果。
  14. 根据权利要求12所述的资源重载装置,其中,所述结果确定单元,用于通过预设的程序探针,收集所述配置信息比较方法的调用信息;
    基于所述调用信息,调用所述扩展配置子信息的扩展配置比较方法;
    通过所述扩展配置比较方法,对所述目标当前配置信息中的所述配置更改标识和所述历史配置信息中的所述历史配置更改标识进行对比,确定所述配置更新事件对应的标识更改结果。
  15. 根据权利要求14所述的资源重载装置,其中,所述程序探针为通过插桩实现的程序代码,所述插桩指在保证原有程序逻辑完整性的基础上,在程序中插入探针。
  16. 根据权利要求10所述的资源重载装置,其中,所述标识调整单元,用于基于所述配置更新事件,确定所述配置更新事件对应的更新条件;
    当所述更新条件属于预设的配置更改条件时,从预设的更改标识集合中,获取所述更新条件对应的目标更改标识;
    将所述配置更改标识的属性值修改为所述目标更改标识,得到目标当前配置信息。
  17. 根据权利要求10所述的资源重载装置,其中,所述配置数据包括目标显示数据,所述资源重载单元,用于当所述配置更改结果指示发生了配置更改时,获取所述配置更新事件对应的目标显示数据;
    停止重启进程,基于所述目标显示数据对原始显示数据进行资源重载,以显示所述目标显示数据对应的目标显示效果。
  18. 根据权利要求10所述的资源重载装置,其中,所述配置更改标识为指示扩展配置子信息是否发生变化的标识信息,所述进行资源重载的资源包括代码使用的附加文件和静态内容。
  19. 一种电子设备,其中,包括存储器和处理器;所述存储器存储有应用程序,所述处理器用于运行所述存储器内的应用程序,以执行权利要求1至9任一项所述的资源重载方法中的步骤。
  20. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1至9任一项所述的资源重载方法中的步骤。
PCT/CN2024/082727 2023-04-14 2024-03-20 一种资源重载方法、装置、电子设备和存储介质 WO2024212776A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310438089.9 2023-04-14
CN202310438089.9A CN117407036A (zh) 2023-04-14 2023-04-14 一种资源重载方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2024212776A1 true WO2024212776A1 (zh) 2024-10-17

Family

ID=89498800

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/082727 WO2024212776A1 (zh) 2023-04-14 2024-03-20 一种资源重载方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN117407036A (zh)
WO (1) WO2024212776A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407036A (zh) * 2023-04-14 2024-01-16 深圳Tcl新技术有限公司 一种资源重载方法、装置、电子设备和存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1884871A1 (en) * 2006-07-26 2008-02-06 Research In Motion Limited System and method for adaptive theming of a mobile device
CN101551746A (zh) * 2009-05-08 2009-10-07 上海华勤通讯技术有限公司 移动通讯终端对ui界面配置方法
CN106843830A (zh) * 2016-12-13 2017-06-13 北京元心科技有限公司 主题修改方法及装置
CN107229470A (zh) * 2017-05-24 2017-10-03 努比亚技术有限公司 一种系统字体切换方法、移动终端以及计算机可读存储介质
CN111651178A (zh) * 2020-05-27 2020-09-11 平安普惠企业管理有限公司 容器配置更新方法、装置、计算机设备和存储介质
CN114579164A (zh) * 2022-01-19 2022-06-03 大连中科创达软件有限公司 一种应用程序用户界面的更新方法及装置
CN117407036A (zh) * 2023-04-14 2024-01-16 深圳Tcl新技术有限公司 一种资源重载方法、装置、电子设备和存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1884871A1 (en) * 2006-07-26 2008-02-06 Research In Motion Limited System and method for adaptive theming of a mobile device
CN101551746A (zh) * 2009-05-08 2009-10-07 上海华勤通讯技术有限公司 移动通讯终端对ui界面配置方法
CN106843830A (zh) * 2016-12-13 2017-06-13 北京元心科技有限公司 主题修改方法及装置
CN107229470A (zh) * 2017-05-24 2017-10-03 努比亚技术有限公司 一种系统字体切换方法、移动终端以及计算机可读存储介质
CN111651178A (zh) * 2020-05-27 2020-09-11 平安普惠企业管理有限公司 容器配置更新方法、装置、计算机设备和存储介质
CN114579164A (zh) * 2022-01-19 2022-06-03 大连中科创达软件有限公司 一种应用程序用户界面的更新方法及装置
CN117407036A (zh) * 2023-04-14 2024-01-16 深圳Tcl新技术有限公司 一种资源重载方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN117407036A (zh) 2024-01-16

Similar Documents

Publication Publication Date Title
CN108512695B (zh) 监控应用卡顿的方法及装置
WO2018188289A1 (zh) 信息显示方法、装置及终端
US10186244B2 (en) Sound effect processing method and device, plug-in unit manager and sound effect plug-in unit
US20170149700A1 (en) Message withdrawal method, apparatus and storage medium
CN108039963B (zh) 一种容器配置方法、装置及存储介质
CN106502834A (zh) 数据的备份方法、装置及系统
US20190213241A1 (en) Web page display method and apparatus, mobile terminal, and storage medium
CN104978176A (zh) 应用程序接口调用方法及装置
CN106708580A (zh) 应用程序免安装运行的方法、系统及智能终端
CN107168609A (zh) 状态栏显示方法、装置及终端
CN103491240B (zh) 一种闹钟响铃方法、装置及移动终端
CN107562539A (zh) 应用程序处理方法和装置、计算机设备、存储介质
CN107204989A (zh) 广告拦截方法、终端、服务器和存储介质
WO2014206138A1 (zh) 一种更新网页数据的方法、装置和终端设备
CN105955739A (zh) 一种图形界面的处理方法、装置和系统
WO2024212776A1 (zh) 一种资源重载方法、装置、电子设备和存储介质
CN111273955B (zh) 热修复插件优化方法、装置、存储介质及电子设备
CN116382776A (zh) 跨平台的api迁移方法、装置、介质及设备
CN114327087A (zh) 输入事件处理方法、装置、电子设备和存储介质
CN107463395B (zh) 组件调用方法及装置
CN115225966B (zh) 应用启动方法、装置、终端设备和存储介质
CN106454953A (zh) 流量控制方法、装置及终端
CN116594616A (zh) 一种组件配置方法、装置及计算机可读存储介质
CN108280798B (zh) 一种浏览器内核渲染显示的方法和装置
CN115589432A (zh) 消息推送管理方法、装置、介质及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24787882

Country of ref document: EP

Kind code of ref document: A1