Function updating method and device, electronic equipment and computer readable storage medium
By customizing the feature attribute management service to receive target attributes and notify the local layer module, adjusting its functional switches, the problem of recompiling and restarting the functions of the local layer module in the existing technology is solved, and fast and efficient function updates are achieved, improving the user experience.
Patent Information
- Application Number
- CN202510210565.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-13
AI Technical Summary
When the existing technology updates the module functions written in C and C++ languages in the local strata, it is necessary to recompile and restart the user equipment, resulting in a long update time and low efficiency, which affects the user experience.
By customizing feature attribute management services, receiving target attributes and notifying registered local strata modules, adjusting the switches of module functions according to target attributes, and realizing function updates without recompiling or restarting the device.
It realizes the update of the local layer module functions without restarting the device, saving update time, improving update efficiency, and avoiding the impact on the user experience.
Smart Images

Figure CN120144150A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technologies, and more particularly, to a method and apparatus for function update, an electronic device, and a computer-readable storage medium. Background Art
[0002] C language and C++ language are static compilation languages. Once compiled, the code and data layout in the executable file are fixed and will not change during runtime. Therefore, if you want to update the functions of modules written in C language and C++ language in the native layer, you need to modify the code and recompile the module. If you want to update the functions of native layer modules that have been released to user devices, since user devices do not have a compilation environment, you can only perform system self-upgrade. During the upgrade process, the user device needs to be restarted, which is time-consuming and inefficient, seriously affecting the user experience. Summary of the Invention
[0003] Embodiments of the present application provide a method and apparatus for function update, an electronic device, and a computer-readable storage medium, which can update the functions of native layer modules without restarting the device.
[0004] In a first aspect, embodiments of the present application provide a method for function update, including:
[0005] In response to the customized feature attribute management service receiving a target attribute, notify the registered native layer module of the target attribute;
[0006] Determine whether the attributes of the native layer module are updated according to the target attribute; and
[0007] When the attributes of the native layer module are updated, update the functions of the native layer module.
[0008] In one embodiment, the step of updating the functions of the native layer module when the attributes of the native layer module are updated includes:
[0009] When the attributes of the native layer module are updated, adjust the switch of the functions of the native layer module according to the target attribute.
[0010] In one embodiment, before the step of responding to the customized feature attribute management service receiving a target attribute, the method further includes:
[0011] Obtain configuration data;
[0012] Parse the configuration data to obtain attribute configuration data;
[0013] Determine the target attribute from the attribute configuration data;
[0014] Send the target attribute to the customized feature attribute management service.
[0015] In one embodiment, determining the target attribute from the attribute configuration data includes:
[0016] Obtain the attribute name from the attribute configuration data;
[0017] Check whether the attribute name includes a target identifier;
[0018] When the attribute name includes the target identifier, determine the attribute corresponding to the attribute name as the target attribute.
[0019] In one embodiment, sending the target attribute to the customized feature attribute management service includes:
[0020] Obtain the process ID of the process where the customized feature attribute management service is located;
[0021] According to the process ID, send the target attribute to the customized feature attribute management service.
[0022] In one embodiment, obtaining the configuration data includes:
[0023] Obtain the configuration data sent by the cloud.
[0024] In one embodiment, before notifying the registered local layer module of the target attribute, the method further includes:
[0025] Register the local layer module with the customized feature attribute management service.
[0026] In a second aspect, an embodiment of the present application provides a function update device, including:
[0027] A response module, configured to notify the registered local layer module of the target attribute in response to the customized feature attribute management service receiving the target attribute;
[0028] A determination module, configured to determine whether the attribute of the local layer module is updated according to the target attribute; and
[0029] An update module, configured to update the function of the local layer module when the attribute of the local layer module is updated.
[0030] In one embodiment, the update module includes:
[0031] An adjustment unit, configured to adjust the switch of the function of the local layer module according to the target attribute when the attribute of the local layer module is updated.
[0032] In one embodiment, before the device receives the target attribute in response to the customized feature attribute management service, the device further includes:
[0033] An acquisition module, configured to acquire configuration data;
[0034] An analysis module, configured to analyze the configuration data to obtain attribute configuration data;
[0035] A target attribute determination module, configured to determine the target attribute from the attribute configuration data;
[0036] A sending module, configured to send the target attribute to the customized feature attribute management service.
[0037] In one embodiment, the target attribute determination module includes:
[0038] A name acquisition unit, configured to acquire an attribute name from the attribute configuration data;
[0039] An identifier acquisition unit, configured to check whether the attribute name includes a target identifier;
[0040] A target attribute determination unit, configured to, when the attribute name includes the target identifier, determine the attribute corresponding to the attribute name as the target attribute.
[0041] In one embodiment, the sending module includes:
[0042] A process number acquisition unit, configured to acquire the process number of the process where the customized feature attribute management service is located;
[0043] A target attribute sending unit, configured to send the target attribute to the customized feature attribute management service according to the process number.
[0044] In one embodiment, the acquisition module includes:
[0045] A cloud acquisition unit, configured to acquire the configuration data sent by the cloud.
[0046] In one embodiment, before notifying the registered local layer module of the target attribute, the device further includes:
[0047] A registration module, configured to register the local layer module in the customized feature attribute management service.
[0048] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps in the above-mentioned function update method are implemented.
[0049] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned function update method are implemented.
[0050] In a fifth aspect, an embodiment of the present application further provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various alternative implementation manners described in the embodiments of the present application.
[0051] In summary, in the embodiment of the present application, when the customized feature attribute management service receives a target attribute, it can notify the registered local layer module of the target attribute; the local layer module can determine whether the attribute of the local layer module needs to be updated according to the target attribute. When the attribute of the local layer module is updated, the function of the local layer module is updated. In this way, without recompiling the local layer module or restarting the device, the function of the local layer module can be updated, which can greatly save the update time, improve the update efficiency, and avoid affecting the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.
[0053] Figure 1 is a schematic diagram of the steps of the function update method provided by an embodiment of the present application;
[0054] Figure 2 is a schematic diagram of the architecture of the function update method provided by an embodiment of the present application;
[0055] Figure 3 is a flowchart of the function update method provided by an embodiment of the present application;
[0056] Figure 4 is a schematic diagram of the structure of the function update device provided by an embodiment of the present application;
[0057] Figure 5It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0058] Next, the technical solutions in the present application will be clearly and completely described in conjunction with the accompanying drawings in the present application. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
[0059] In one embodiment, as Figure 1 shown, a function update method is provided. Although the logical order is shown in the step schematic diagram, in some cases, the steps shown or described can be executed in an order different from that shown in the drawings. Specifically, the function update method can be applied to an electronic device, where the electronic device can include, but is not limited to, one or more of a smart phone, a tablet computer, a portable computer, a desktop computer, and a vehicle-mounted computer.
[0060] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the priority order of the embodiments.
[0061] According to Figure 1 the function update method shown, the method at least includes steps S110 to S130, which are introduced in detail as follows:
[0062] In step S110, in response to the custom feature attribute management service receiving the target attribute, the target attribute is notified to the registered local layer module.
[0063] The custom feature attribute management service is a service for managing the target attribute. The target attribute can include customized attributes and non-customized attributes. The custom feature attribute management service receiving the target attribute proves that the attribute has changed. This change may be because the customer has customized different attributes, or the developer has adjusted the attributes of the electronic device. The customized attribute is an attribute or feature that can be customized among the attributes of the electronic device; according to the needs of customers, users, or specific scenarios, the attributes or features of software, hardware, services, etc. can be customized to obtain the customized attribute.
[0064] Optionally, the target attribute can include attributes at multiple levels. The multiple levels can include, but are not limited to: software layer, hardware layer, and service layer.
[0065] Optionally, the target attributes of the software layer may include, but are not limited to: operating system attributes, pre-installed application attributes, user interface attributes, and security attributes. Customizing the operating system attributes may involve customizing different operating systems for different electronic devices. For example, some electronic devices may be customized to use the Android native system, while other electronic devices may be customized to use the iOS (Apple) operating system. Customizing the pre-installed application attributes may involve pre-installing different applications on different electronic devices. For example, some electronic devices may have a map application pre-installed, while other electronic devices may not. Customizing the user interface attributes may involve customizing different theme styles, fonts, and / or wallpapers for different electronic devices. For example, some electronic devices may be customized with a red wallpaper, while other electronic devices may be customized with a green wallpaper. Customizing the security attributes may involve customizing different permission management schemes and / or anti-harassment functions for different electronic devices. For example, some electronic devices may only intercept calls from restricted numbers, while other electronic devices may intercept both calls and text messages from restricted numbers.
[0066] Optionally, the target attributes of the hardware layer may include, but are not limited to: processor attributes, storage (ROM) attributes, and / or sensor attributes. Customizing the processor attributes may involve customizing different processors for different electronic devices. For example, the number of cores of the processor may be customized to 4 cores, 6 cores, or 8 cores, etc. When the number of cores of the processor is different, the task processing logic of the electronic device may also be different. Therefore, customizing the processor attributes of the hardware layer may cause the functions of the local layer modules of the electronic device to change accordingly. Customizing the storage attributes may involve customizing different storage capacities and / or interface types for different electronic devices. For example, the storage capacity may be customized to 512GB or 1TB; when the storage capacity of the electronic device is different, it may cause differences in the functions and performance of the electronic device, and may further cause the functions of the local layer modules of the electronic device to change accordingly. Customizing the sensor attributes may involve customizing different sensors for different electronic devices. For example, the sensor used to unlock the electronic device may be a fingerprint recognition sensor or a face recognition sensor, etc.; when the sensor attributes of the electronic device are different, it may cause the functions of the local layer modules of the electronic device to change accordingly.
[0067] Optionally, the service layer target attributes may include, but are not limited to: subscription attributes and / or cloud service attributes. Customizing the subscription attributes may involve customizing different subscription services for different electronic devices. For example, the subscription service of a first video platform and / or the subscription service of a second video platform may be customized, etc. When customizing different subscription services, the local layer module of the electronic device may need to implement the docking function with different video platforms. Customizing the cloud service attributes may involve customizing different cloud services for different electronic devices. For example, it may be customized to automatically store albums and / or memos in the cloud space. When customizing different cloud services, the local layer module of the electronic device may need to implement the function of obtaining files from different file storage paths.
[0068] The local layer module refers to the module developed in C and C++ languages in the native layer. The native layer is the lower layer of the system architecture, adjacent to the hardware driver layer and the operating system kernel. The native layer is mainly developed using C and C++ languages, which have high performance and the ability to directly access hardware. The local layer module can directly interact with the hardware driver layer and the operating system kernel, thereby reducing the overhead of the intermediate layer and significantly improving performance. Therefore, the native layer can undertake tasks with extremely high performance requirements, such as graphics rendering, multimedia processing (audio and video encoding and decoding, image recognition), etc. When the local layer module processes tasks with extremely high performance requirements such as graphics rendering and multimedia processing, it can quickly respond to and process data to ensure the smooth operation of the system.
[0069] Modules can be divided based on multiple dimensions such as module function, hardware access, or performance optimization. For example, based on module function, modules can be divided into graphics recognition modules or audio and video encoding and decoding modules, etc. Based on hardware access, modules can be divided into modules that interact with sensors or storage access modules, etc. Based on performance optimization, modules can be divided into high-performance computing modules or real-time processing modules, etc. A local layer module may be a graphics recognition module when divided based on module function, a storage access module when divided based on hardware access, and a high-performance computing module when divided based on performance optimization.
[0070] Optionally, the local layer module can be a graphics rendering module for rendering graphics. For example, through the graphics rendering module of the native layer, real-time rendering of complex scenes in 3D games can be achieved.
[0071] Optionally, the local layer module can be a multimedia processing module for processing image data and audio and video data. For example, through the multimedia processing module of the native layer, audio and video data can be encoded and decoded in real time during a video call to ensure smooth communication.
[0072] Optionally, the local layer module can be a module that interacts with the sensor for interacting with the sensor. For example, through the module that interacts with the sensor in the local layer, the data of the sensor can be read, and corresponding data processing can be performed according to the data of the sensor.
[0073] In one embodiment, before notifying the registered local layer module of the target attribute, the method further includes: registering the local layer module in the customized feature attribute management service.
[0074] The local layer module can be registered in the customized feature attribute management service in advance. The local layer module calls the registration function provided by the customized feature attribute management service in advance and passes its own information to the customized feature attribute management service. The customized feature attribute management service stores the received information of the local layer module to complete the registration.
[0075] The information passed by the local layer module to the customized feature attribute management service is information that helps the customized feature attribute management service identify, manage, and schedule the local layer module, and can include a module identifier, interface information, and a callback function. The module identifier can include a module name and / or a module ID; the customized feature attribute management service can accurately locate and call the local layer module according to the module identifier. The interface information can include the input / output data format of the local layer module and the interface definition provided by the local layer module. The interface definition provided by the local layer module can include a function name, a parameter list, and a return value type. The customized feature attribute management service can determine how to pass information into the local layer module according to the interface information. The callback function is used for event notification; the customized feature attribute management service can notify the registered local layer module through the callback function when receiving the target attribute.
[0076] Optionally, the information passed by the local layer module to the customized feature attribute management service can further include dependency relationships, parameter information, and / or description information, etc. The dependency information can include module dependency information and version dependency information. The customized feature attribute management service can ensure that the dependent module is correctly initialized first when loading and starting the module according to the module dependency information; the customized feature attribute management service can ensure the stability and compatibility of the system by using the correct dependency version according to the version dependency information. The parameter information can include the configuration parameters of the local layer module. The customized feature attribute management service can perform initialization processing on the local layer module according to the configuration parameters of the local layer module and determine that the local layer module starts in the correct state. The description information can include the description information of the function or attribute of the module. The customized feature attribute management can determine whether the received target attribute is an attribute in the local layer module according to the description information.
[0077] After receiving the information of the local layer module, the customized feature attribute management service can store the module identifier, interface information, and callback function of the local layer module to complete the registration. Optionally, the dependency relationship and / or parameter information of the local layer module can also be stored.
[0078] The electronic device can obtain configuration data from the cloud, local, or other storage devices. The configuration data is data used to configure the electronic device. The configuration data may include attribute configuration data for configuring attributes. The attribute configuration data is data related to attributes in the configuration data. After obtaining the configuration data, the electronic device can parse the configuration data to obtain the attribute configuration data.
[0079] After obtaining the attribute configuration data, the attribute configuration data can be passed to the Property_Service. The property service validates the attribute configuration data, and obtains each attribute and the name of each attribute from the attribute configuration data. The property service is used to check whether the attribute name includes a target identifier; when the attribute name includes the target identifier, the property service determines the attribute corresponding to the attribute name as the target attribute. Among them, the target identifier can be set according to actual needs; for example, a fixed character can be set as the target identifier in the prefix of the attribute name. The target attribute is an attribute whose name includes the target identifier. The target attribute is an attribute that has changed.
[0080] When an attribute changes, the function of the local layer module corresponding to the attribute will also change accordingly. In order to enable the customized feature attribute management service to notify the local layer module to adjust the function, after determining the target attribute, the property service sends the target attribute to the customized feature attribute management service. After receiving the target attribute, the customized feature attribute management service calls the callback function provided by the local layer module according to the information of the local layer module registered in the customized feature attribute management service, and actively sends a callback notification including the target attribute to these local layer modules. The local layer module receives the callback notification sent by the customized feature attribute management service and obtains the target attribute.
[0081] Optionally, as the sender of the callback notification, the customized feature attribute management service can determine the receiver of the callback notification according to the module identifier of the local layer module provided during registration. The receiver is the local layer module that has registered in the customized feature attribute management service and provided the module identifier. The customized feature attribute management service can determine how to send the callback notification to the local layer module according to the interface information and callback function of the local layer module provided during registration. Specifically, the callback notification can be sent by calling the corresponding callback function, and how to pass the callback notification into the corresponding local layer module can be determined through the interface information.
[0082] The target attribute is the content of the callback notification. The local layer modules registered in the customized feature attribute management service can include one or more. After receiving the target attribute, the customized feature attribute management service can notify each registered local layer module of the target attribute through a callback notification.
[0083] Optionally, the customized feature attribute management service can determine whether the received target attribute is an attribute corresponding to the local layer module according to the description information provided by the local layer module during registration. The attributes corresponding to a local layer module can include one or more. Optionally, the description information of the local layer module can include a description of the format of the attributes corresponding to the local layer module, or can include the names of the attributes corresponding to the local layer module, etc. After receiving the target attribute, the customized feature attribute management service matches the information of the target attribute with the description information of the attributes corresponding to each registered local layer module, so as to determine whether the target attribute is an attribute corresponding to the local layer module, and then only needs to notify the corresponding local layer module of the target attribute through a callback, avoiding the waste of transmission resources and computing resources caused by sending the target attribute to irrelevant local layer modules.
[0084] In this way, the local layer modules are pre-registered in the customized feature attribute management service. After receiving the target attribute, the customized feature attribute management service can notify the local layer modules of the target attribute through a callback according to the information of the pre-registered local layer modules.
[0085] In step S120, according to the target attribute, determine whether the attributes of the local layer module are updated.
[0086] In step S130, when the attributes of the local layer module are updated, update the functions of the local layer module.
[0087] The control of the functions of the local layer modules developed in C language and C++ language is achieved through the method of attributes. There is a corresponding relationship between the functions of the local layer modules and the attributes of the local layer modules. Before the electronic device is customized, the attributes of the local layer module are adapted to the configuration of the electronic device before customization; when the electronic device is customized differently, the target attributes of the electronic device (such as the software layer customization attributes, hardware layer customization attributes, and / or service layer customization attributes described above) will also change accordingly. Thus, the customized feature attribute management service receives the target attribute and notifies the local layer module of the target attribute through a callback. When the local layer module receives the target attribute, by comparing whether the target attribute is the same as the original attribute, it can determine whether the attributes of the local layer module are updated, and further determine whether the functions of the local layer module need to be changed to functions adapted to the configuration of the electronic device corresponding to the target attribute.
[0088] For example, the functions of the native layer module were originally applicable to the Android operating system, and accordingly, the operating system attributes of the native layer module were originally Android operating system attributes; when the operating system of the electronic device changes from the Android operating system to the iOS operating system and the operating system attributes of the electronic device change, the customized feature attribute management service can receive the changed iOS operating system attributes, and the customized feature attribute management service notifies the native layer module of the iOS operating system attributes through a callback. By comparing the received iOS operating system attributes with its original Android operating system attributes, the native layer module can learn that its attributes have been updated; in order to avoid compatibility issues and the like, the native layer module may adjust API interface functions and / or permission management functions, etc., to adapt to the changed iOS operating system.
[0089] When the pre-installed application attributes of the native layer module change, since the pre-installed application may have a dependency relationship with the native layer module, when the pre-installed application changes, the native layer module may adjust its dependency functions in response to the received changed pre-installed application attributes.
[0090] When the user interface attributes of the native layer module change, since the adjustment of the user interface may cause changes in the input / output format of data, in order to avoid interface rendering problems and the like, the native layer module may adjust its data processing functions in response to the received changed user interface attributes.
[0091] When the security attributes of the native layer module change, it may be that the encryption or authentication mechanism has changed. Therefore, the native layer module may adjust its data processing process in terms of security in response to the received changed security attributes.
[0092] When the hardware layer attributes of the native layer module change, since the change in the hardware layer directly affects the operating ability and performance of the native layer module, the native layer module may adjust its functions related to the hardware layer, such as processor architecture, storage capacity, and / or sensor data processing, in response to the received changed hardware layer attributes.
[0093] When the service layer attributes of the native layer module change, since the change in the service layer affects the external dependency and expansion ability of the native layer module, the native layer module may adjust its functions related to the service layer, such as subscription permissions, subscription content, cloud service APIs, and / or cloud service updates, in response to the received changed service layer attributes.
[0094] In one embodiment, the customized feature attribute management service notifies each registered native layer module of the target attributes through a callback. After receiving the target attributes, each native layer module determines whether the target attributes are its corresponding attributes.
[0095] The target attribute corresponding to the local layer module means that the target attribute affects the function of the local layer module. It can be understood that the local layer module itself originally has an attribute corresponding to the target attribute. As in the previous embodiment, the target attribute can be the iOS operating system attribute after change, while the local layer module originally has the Android operating system attribute.
[0096] When the target attribute is not the attribute corresponding to the local layer module, the target attribute can be directly ignored. When the target attribute is the attribute corresponding to the local layer module, the local layer module can compare whether the target attribute is consistent with the attribute corresponding to the target attribute in the local layer module to determine whether the attribute of the local layer module is updated. When the target attribute is consistent with the attribute corresponding to the target attribute in the local layer module, it is determined that the attribute of the local layer module has not been updated; when the target attribute is inconsistent with the attribute corresponding to the target attribute in the local layer module, it is determined that the attribute of the local layer module has been updated.
[0097] The data format of the target attribute can be a basic data type format (such as string, numerical value, boolean value, or enumeration, etc.), a structured data format (such as key-value pair, list, or nested structure), or a configuration file format (such as JSON file, XML file, or YAML file), and the embodiments of the present application do not make requirements on this. The formats of the target attribute and the attribute corresponding to the target attribute in the local layer module are the same, and it can be determined whether the target attribute is consistent with the attribute corresponding to the target attribute in the local layer module by comparing whether the text of the target attribute and the corresponding attribute is the same.
[0098] The target attribute can include one or more, and the local layer modules registered in the customized feature attribute management service can include one or more. After receiving each target attribute, the customized feature attribute management service can notify each registered local layer module of each target attribute through a callback notification, or only notify each local layer module corresponding to the target attribute of each target attribute through a callback.
[0099] In one embodiment, step S130 may include: when the attribute of the local layer module is updated, adjust the switch of the function of the local layer module according to the target attribute.
[0100] The update of the attribute of the local layer module is to update the original attribute to the target attribute. Therefore, the function of the local layer module can be updated according to the target attribute.
[0101] For the same type of attributes, the local layer module has functions corresponding to each attribute in this type of attributes, and the function corresponding to which attribute in this type of attributes can be controlled to take effect through the switch of the function. For example, the local layer module has functions corresponding to the Android operating system and functions corresponding to the iOS operating system. When the attribute of the local layer module is originally the Android operating system attribute, the function corresponding to the Android operating system is in the open state, and the function corresponding to the iOS operating system is in the closed state; when the attribute of the local layer module becomes the iOS operating system attribute, the function corresponding to the Android operating system is closed, and the function corresponding to the iOS operating system is opened.
[0102] In the local layer module, the adjustment of the function can be abstracted as the opening and closing of the switch. Behind each function in the local layer module, there is complex code implementation. By adjusting the switch, a simplified interface is provided for complex function operations. Therefore, the function of the local layer module can be updated by adjusting the switch of the function of the local layer module.
[0103] In this way, by adjusting the switch of the function of the local layer module, the function of the local layer module can be updated intuitively and flexibly.
[0104] In another embodiment, the function of the local layer module can also be adjusted by using function pointers to select different functions according to the target attributes of the local layer module at runtime to execute the functions of the local layer module.
[0105] Adopting the technical solution of the embodiment of the present application, when the customized feature attribute management service receives the target attribute, it can notify the registered local layer module of the target attribute; the local layer module can determine whether the attribute of the local layer module is updated according to the target attribute, and when the attribute of the local layer module is updated, update the function of the local layer module. In this way, without recompiling the local layer module and without restarting the device, the function of the local layer module can be updated, which can greatly save the update time, improve the update efficiency, and avoid affecting the user experience.
[0106] On the basis of the above technical solution, as an embodiment, as Figure 2 shown in the schematic architecture diagram of the function update method, before responding to the customized feature attribute management service receiving the target attribute, the method may further include: obtaining configuration data; parsing the configuration data to obtain attribute configuration data; determining the target attribute from the attribute configuration data; and sending the target attribute to the customized feature attribute management service.
[0107] The configuration data is data used to configure the electronic device, which may include attribute configuration data for configuring attributes, and the attribute configuration data may include the target attribute. The target attribute may include the attributes of one or more local layer modules.
[0108] In one embodiment, obtaining configuration data may include: obtaining configuration data sent by the cloud.
[0109] The configuration data may be configuration data sent by the cloud. When it is necessary to update the functions of the local layer modules of multiple electronic devices, it is only necessary to update the configuration data stored in the cloud, and then the cloud pushes the configuration data to multiple electronic devices at the same time, so as to quickly and conveniently modify the functions of the local layer modules of multiple electronic devices.
[0110] In this way, by pushing configuration data from the cloud, the efficiency of updating the functions of the local layer modules of electronic devices can be improved.
[0111] Optionally, it may be that after the cloud sends the configuration data, the corresponding method for updating the functions of the local layer modules is immediately executed; or it may be that after the cloud sends the configuration data, the configuration data is first saved locally, and when needed or when idle, the configuration data is obtained from the local, and the corresponding method for updating the functions of the local layer modules is executed according to the obtained configuration data.
[0112] In another embodiment, obtaining configuration data may be obtaining configuration data from a storage device. Configuration data is stored in the storage device, and the configuration data in the storage device is transmitted to the electronic device, so as to update the functions of the local layer modules of the electronic device.
[0113] After the electronic device obtains the configuration data, it can parse the configuration data to obtain attribute configuration data. The attribute configuration data is the data related to attributes in the configuration data. Optionally, it may be parsed by an application package (Android application package, APK) named ConfigProvider (global configuration). ConfigProvider is mainly used to interact with the cloud to implement the download of configuration data, and process and save the content.
[0114] Optionally, the FCM (Firebase Cloud Messaging) mechanism can be combined to update the attribute configuration files at different levels through the cloud, and the maintenance of the entire database is all relocated to the local layer. When it is necessary to update the attribute configuration files at different levels, the cloud can generate a message containing the updated attributes. For example, if it is necessary to adjust the attributes of the software layer, the cloud will prepare the configuration data containing the adjusted attributes of the software layer. Through the FCM service, the cloud sends the prepared package configuration data. FCM will accurately push the message to the corresponding client application according to the registration tokens of each electronic device. Among them, each electronic device installed with the FCM application will obtain a unique registration token when registering with FCM.
[0115] After the electronic device receives the configuration data pushed by FCM, it will pass the configuration data to the local layer. For example, in the iOS operating system, the received configuration data can be passed to the local layer module through a bridging mechanism.
[0116] After the local layer module receives the configuration data, it will directly interact with the database to save the configuration data into the database. The local layer module can perform database maintenance tasks. For example, when backing up the database regularly, the local layer module can call the backup interface of the database according to a predetermined policy (such as time interval, data volume threshold, etc.) to save the database data as a backup file.
[0117] After obtaining the attribute configuration data, the attribute configuration data can be passed to the attribute service. The attribute service validates the attribute configuration data, obtains each attribute and the name of each attribute from the attribute configuration data. The attribute service can determine the target attribute from each attribute included in the attribute configuration data.
[0118] Optionally, determining the target attribute from the attribute configuration data may include: obtaining the attribute name from the attribute configuration data; checking whether the attribute name includes the target identifier; when the attribute name includes the target identifier, determining the attribute corresponding to the attribute name as the target attribute.
[0119] The attribute service obtains each attribute and the attribute name of each attribute from the attribute configuration data. The attribute name of the target attribute may include a target identifier, where the target identifier can be set according to actual needs; for example, a fixed character can be set as the target identifier in the prefix of the attribute name.
[0120] The attribute service checks whether the attribute name includes the target identifier. When the attribute name includes the target identifier, the attribute corresponding to the attribute name is determined as the target attribute.
[0121] Optionally, the target identifier can be the fixed character [persist.tcl.feature] in the prefix of the attribute name. The attribute service checks whether the prefix of the attribute name of each attribute includes the fixed character [persist.tcl.feature]. When the prefix of the attribute name includes the fixed character [persist.tcl.feature], the attribute corresponding to the attribute name is determined as the target attribute.
[0122] In this way, by validating the attribute name, it is possible to determine whether the attribute is the target attribute, so as to send the target attribute to the customized feature attribute management service subsequently, and then update the function of the local layer module.
[0123] After determining the target attribute, the attribute service can send the target attribute to the customized feature attribute management service.
[0124] By adopting the technical solution of the embodiment of the present application, configuration data can be obtained, the configuration data can be parsed to determine the target attribute, and the target attribute can be sent to the customized feature attribute management service, so that when the customized feature attribute management service receives the target attribute, it can notify the registered local layer module of the target attribute, thereby realizing the update of the functions of the local layer module and improving the update efficiency of the functions of the local layer module.
[0125] On the basis of the above technical solution, as an embodiment, sending the target attribute to the customized feature attribute management service may include: obtaining the process ID of the process where the customized feature attribute management service is located; and sending the target attribute to the customized feature attribute management service according to the process ID.
[0126] The attribute service is used to extract the target attribute and pass the extracted target attribute to the customized feature attribute management service. The attribute service is located in the Initialization (Init) process, and the customized feature attribute management service is located in the Asynchronous Input / Output (Aio) process. In order to send the target attribute to the customized feature attribute management service in the Aio process, the attribute service in the Init process needs to perform cross-process communication.
[0127] The Init process can start a series of system services according to the system configuration file. The Aio process allows the program to continue to execute other tasks without waiting for the input / output operation to complete after initiating the input / output request. When the input / output operation is completed, the system notifies the program through mechanisms such as callbacks or events.
[0128] The communication between the Init process and the Aio process can be implemented by using the method of sending signals (Singal). A signal is a software interrupt mechanism used to transmit asynchronous event notifications between processes. In order to send the target attribute to the customized feature attribute management service in the Aio process, the attribute service in the Init process needs to know the process ID of the Aio process. The process ID is a character that uniquely identifies a process.
[0129] Optionally, the process ID of the Aio process where the customized feature attribute management service is located can be obtained by querying the target file. The Aio process can write its own process ID to the target file in advance when starting up; alternatively, the process ID of the Aio process can be obtained by querying the process registry. The target file is a specific file used to store the process ID of the Aio process, which can be a configuration file, a log file, or a custom data file. The target file can be used as a configuration file to record the process ID of the Aio process. The Aio process can write its own process ID to the log file when starting up, so the process ID of the Aio process can be obtained from the log file. Developers can set up a custom data file, and the Aio process can write its own process ID to this custom data file when starting up.
[0130] If the Init process obtains the process ID of the Aio process, it can use the corresponding functions provided by the system to send the target attribute to the Aio process, so as to ensure that the target attribute can be accurately sent to the customized feature attribute management service in the Aio process without being mis-sent to other processes, thereby realizing the communication between the Init process and the Aio process.
[0131] Adopting the technical solution of the embodiment of the present application, using the signal mechanism to realize cross-process sending of the target attribute to the customized feature attribute management service is simple and efficient; sending through the process ID of the process where the customized feature attribute management service is located can ensure that the target attribute can be accurately sent to the customized feature attribute management service in the Aio process.
[0132] Optionally, the attribute service sending the target attribute to the customized feature attribute management service across processes can be an instrumentation interception behavior in the HandlePropertySet (processing property setting) method in Aosp (the open-source version of the Android system).
[0133] The customized feature attribute management service can include a function interface module, a file parsing module, and a callback notification module. The function interface module can receive the target attribute, the file parsing module can analyze the target attribute, and the callback notification module can callback and notify the registered local layer module of the target attribute. Among them, the communication between the local layer module and the customized feature attribute management service can be carried out through the management interface. The local layer module sends information to the management interface, and the management interface then sends the information to the customized feature attribute management service.
[0134] Figure 3It is a schematic flowchart of a function update method provided by an embodiment of the present application. In step S301, configuration data is deployed in the cloud. In step S302, the ConfigProvider parses the configuration data. In step S303, the Property_Service checks the property name. In step S304, it is determined whether the property name includes a target identifier. When the property name does not include the target identifier, it jumps to step S305; when the property name includes the target identifier, it jumps to step S306. In step S305, the local layer module is normally loaded. In step S306, the customized feature property service is notified across processes. In step S307, the registered local layer modules are notified. In step S308, the local layer module determines whether the property is updated. When the property is not updated, it jumps to step S309; when the property is updated, it jumps to step S310. In step S309, no processing is performed. In step S310, the function of the local layer module changes between on and off.
[0135] To better implement the function update method of the present application, the present application also provides a function update device based on the above function update method. The meanings of the nouns are the same as those in the above function update method, and the specific implementation details can be referred to the description in the method embodiment.
[0136] Please refer to Figure 4 , Figure 4 It is a schematic structural diagram of a function update device provided by an embodiment of the present application. The function update device includes:
[0137] A response module 401, configured to notify the registered local layer modules of the target property in response to the customized feature property management service receiving the target property;
[0138] A determination module 402, configured to determine whether the property of the local layer module is updated according to the target property; and
[0139] An update module 403, configured to update the function of the local layer module when the property of the local layer module is updated.
[0140] In one embodiment, the update module 403 includes:
[0141] An adjustment unit, configured to adjust the on / off of the function of the local layer module according to the target property when the property of the local layer module is updated.
[0142] In one embodiment, before responding to the customized feature property management service receiving the target property, the device further includes:
[0143] An acquisition module, configured to acquire configuration data;
[0144] A parsing module, configured to parse the configuration data to obtain property configuration data;
[0145] A target attribute determination module, configured to determine a target attribute from attribute configuration data;
[0146] A sending module, configured to send the target attribute to a customized feature attribute management service.
[0147] In one embodiment, the target attribute determination module includes:
[0148] A name acquisition unit, configured to acquire an attribute name from the attribute configuration data;
[0149] An identifier acquisition unit, configured to check whether the attribute name includes a target identifier;
[0150] A target attribute determination unit, configured to, when the attribute name includes the target identifier, determine the attribute corresponding to the attribute name as the target attribute.
[0151] In one embodiment, the sending module includes:
[0152] A process number acquisition unit, configured to acquire the process number of the process where the customized feature attribute management service is located;
[0153] A target attribute sending unit, configured to send the target attribute to the customized feature attribute management service according to the process number.
[0154] In one embodiment, the acquisition module includes:
[0155] A cloud acquisition unit, configured to acquire configuration data sent by the cloud.
[0156] In one embodiment, before notifying the registered local layer module of the target attribute, the device further includes:
[0157] A registration module, configured to register the local layer module with the customized feature attribute management service.
[0158] By adopting the technical solution of the embodiment of the present application, when the customized feature attribute management service receives the target attribute, it can notify the registered local layer module of the target attribute; the local layer module can determine whether the attribute of the local layer module is updated according to the target attribute, and when the attribute of the local layer module is updated, update the function of the local layer module. In this way, without recompiling the local layer module and without restarting the device, the function of the local layer module can be updated, which can greatly save the update time, improve the update efficiency, and avoid affecting the user experience.
[0159] For the specific limitations of the function update device, reference may be made to the limitations of the function update method in the foregoing text, which will not be elaborated herein. Each module in the foregoing function update device may be implemented in whole or in part by software, hardware, and their combination. Each of the foregoing modules may be embedded in or independent of the processor in the computer device in the form of hardware, or may be stored in the memory in the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to each of the foregoing modules.
[0160] In addition, the present application also provides an electronic device, as Figure 5 shown, which shows a schematic structural diagram of the electronic device involved in the present application. Specifically:
[0161] The electronic device may include components such as a processor 501 with one or more processing cores and a memory 502 with one or more computer-readable storage media. Those skilled in the art can understand that Figure 5 the structural diagram of the electronic device shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them:
[0162] The processor 501 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 502, and calling the data stored in the memory 502, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 501.
[0163] The memory 502 can be used to store software programs and modules. The processor 501 executes various function applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. Among them, the program storage area may store the operating system, application programs 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. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0164] In one embodiment, the electronic device further includes a power supply 503 for powering each component. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage functions such as charging, discharging, and power consumption management through the power management system. The power supply 503 may also include any components such as one or more DC or AC power supplies, a recharge system, a power device debugging circuit, a power converter or inverter, and a power status indicator.
[0165] In one embodiment, the electronic device may further include an input unit 504, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0166] Although not shown, the electronic device may also include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 501 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 will run the application programs stored in the memory 502, so as to implement the steps in any one of the function update methods provided by the embodiments of the present application.
[0167] Those skilled in the art can understand that Figure 5 the structure shown in
[0168] In one embodiment, an electronic device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the method described in any embodiment of the present application is implemented.
[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present application is implemented.
[0170] In some embodiments, a computer program product is further proposed, including a computer program or instruction. When the computer program or instruction is executed by a processor, the method described in any embodiment of the present application is implemented.
[0171] For the specific implementation of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.
[0172] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0173] To this end, the present application provides a computer-readable storage medium on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any of the function update methods provided by the present application.
[0174] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.
[0175] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
[0176] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the function update methods provided by the present application, the beneficial effects achievable by any of the function update methods provided by the present application can be realized. For details, refer to the previous embodiments and will not be elaborated here.
[0177] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or terminal device comprising the element.
[0178] The above provides a detailed introduction to a function update method, device, electronic device, and computer-readable storage medium provided by the present application. Specific examples are used in this text to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A function update method, characterized in that: include: In response to the custom feature attribute management service receiving the target attribute, notifying the registered local layer module of the target attribute; Determining whether the attribute of the local layer module is updated according to the target attribute; as well as When the attributes of the local layer module are updated, the functions of the local layer module are updated.
2. The method according to claim 1, characterized in that When the attribute of the local layer module is updated, the function of the local layer module is updated, including: When the attributes of the local layer module are updated, the switch of the function of the local layer module is adjusted according to the target attributes.
3. The method according to claim 1, characterized in that Before the step of responding to the custom feature attribute management service receiving the target attribute, the method further comprises: Get configuration data; Parsing the configuration data to obtain attribute configuration data; Determining the target attribute from the attribute configuration data; The target attributes are sent to the custom feature attribute management service.
4. The method according to claim 3, characterized in that Determining the target attribute from the attribute configuration data includes: Obtaining an attribute name from the attribute configuration data; checking whether the attribute name includes a target identifier; When the attribute name includes the target identifier, the attribute corresponding to the attribute name is determined as the target attribute.
5. The method according to claim 3, characterized in that: The sending the target attribute to the customized feature attribute management service includes: Obtain the process ID of the process where the customized feature attribute management service is located; According to the process number, the target attribute is sent to the custom feature attribute management service.
6. The method according to claim 3, characterized in that The obtaining of configuration data includes: The configuration data sent by the cloud is obtained.
7. The method according to any one of claims 1 to 6, characterized in that: Before notifying the registered local layer module of the target attribute, the method further includes: Register the local layer module in the custom feature attribute management service.
8. A function updating device, characterized in that: include: A response module, configured to, in response to the custom feature attribute management service receiving the target attribute, notify the registered local layer module of the target attribute; A determination module, used to determine whether the attribute of the local layer module is updated according to the target attribute; as well as The updating module is used to update the function of the local layer module when the attribute of the local layer module is updated.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the function updating method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the function updating method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Function update method, electronic device and computer-readable storage medium
WO2026174977A1