UI style changing method, device, apparatus, and storage medium

By receiving voice skinning commands and using reflection technology to determine control objects, the style data can be directly replaced in the UI style package, solving the problem of low efficiency in UI style modification in existing technologies and achieving more efficient UI style replacement.

CN119440699BActive Publication Date: 2026-05-15CHENGDU CELIS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU CELIS TECH CO LTD
Filing Date
2024-10-16
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, modifying UI styles requires re-modifying the source code and recompiling and releasing it, resulting in low modification efficiency.

Method used

By receiving voice skinning commands, the system uses reflection technology to identify control objects and determines style replacement data from multiple UI style packages, directly replacing the style data of the control objects and avoiding the need to modify the source code.

Benefits of technology

It improves the efficiency of UI style modification, simplifies the modification process, and reduces tedious steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440699B_ABST
    Figure CN119440699B_ABST
Patent Text Reader

Abstract

The application relates to a UI style replacement method, device and equipment and a storage medium. The method comprises the following steps: receiving a voice skin replacement instruction triggered by a voice assistant, wherein the voice skin replacement instruction comprises a style package identifier of a UI style package to be used; determining at least one control object according to a reflection technology and all controls in the voice assistant; determining a target control object whose corresponding style can be replaced according to each control object; determining style replacement data of the target control object in a plurality of UI style packages according to the target control object and the style package identifier; and replacing style data of the target control object by using the style replacement data of the target control object. The method can improve the modification efficiency of the UI style.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for changing UI styles. Background Technology

[0002] To make vehicle control more convenient for drivers, voice assistants can be installed, allowing them to perform certain operations via voice commands. When writing the voice assistant's source code, engineers configure the UI (User Interface) style (such as background color, images, and font color) to enhance its appearance. This source code is then compiled to create the voice assistant's APK file, which is subsequently published to a server for drivers to download and install.

[0003] The above solution sets the UI style in the source code. If the UI style needs to be modified, the source code must be modified again, and then the modified source code must be compiled and released. The whole process is time-consuming and cumbersome, resulting in low efficiency in modifying UI styles. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for changing UI styles, which can improve the efficiency of UI style modification.

[0005] Firstly, this application provides a method for changing UI styles, the method comprising:

[0006] Receive a voice skinning command triggered by a voice assistant, wherein the voice skinning command includes a style package identifier of the UI style package to be used;

[0007] Based on reflection technology and all controls in the voice assistant, determine at least one control object;

[0008] For each control object, determine the target control object whose style can be changed;

[0009] Based on the target control object and the style package identifier, determine the style replacement data of the target control object from multiple UI style packages;

[0010] The style replacement data of the target control object is replaced using the style replacement data of the target control object.

[0011] Optionally, determining at least one control object based on reflection technology and all controls in the voice assistant includes:

[0012] Among all the controls in the voice assistant, identify at least one UI control used to build the user interface;

[0013] Using reflection technology, at least one UI control is reflected to obtain the control object corresponding to each UI control.

[0014] Optionally, determining the target control object whose style can be changed based on each control object includes:

[0015] Get the properties of each control object;

[0016] In at least one control object, check if there exists a control object with the target property.

[0017] When a control object with the attribute of the target attribute is detected, the control object is determined as the target control object whose corresponding skin can be changed.

[0018] Optionally, determining the style replacement data for the target control object from multiple UI style packages based on the target control object and the style package identifier includes:

[0019] Based on the style package identifier, determine the UI style package to be used from among multiple UI style packages;

[0020] Based on the target control object, determine the style replacement data of the target control object in the UI style package to be used.

[0021] Optionally, determining the style replacement data of the target control object in the UI style package to be used, based on the target control object, includes:

[0022] Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant;

[0023] Based on the target control identifier, find the attribute value corresponding to the target control identifier in the UI style package to be used;

[0024] The attribute value corresponding to the target control identifier is determined as the style replacement data for the target control object.

[0025] Optionally, the UI style package further includes attributes and types corresponding to the control identifier. Before searching for the attribute value corresponding to the target control identifier in the UI style package to be used based on the target control identifier, the method further includes:

[0026] Based on the target control object, determine the target attribute and target type corresponding to the target control object in the APK file of the voice assistant;

[0027] Based on the target control identifier, determine the reference attribute and reference type corresponding to the target control identifier in the UI style package to be used;

[0028] Detect whether the target attribute is consistent with the reference attribute, and whether the target type is consistent with the reference type;

[0029] When the two match, the attribute value corresponding to the target control identifier is searched in the UI style package to be used, based on the target control identifier.

[0030] Optionally, replacing the style data of the target control object using the style replacement data of the target control object includes:

[0031] Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant;

[0032] Based on the target control identifier, determine the style data corresponding to the target control identifier in the APK file of the voice assistant;

[0033] The style replacement data of the target control object is used to replace the style data corresponding to the target control identifier.

[0034] Secondly, this application provides a UI style changing device, the device comprising:

[0035] A receiving unit is configured to receive a voice skinning command triggered by a voice assistant, wherein the voice skinning command includes a style package identifier of the UI style package to be used;

[0036] The first determining unit is used to determine at least one control object based on reflection technology and all controls in the voice assistant;

[0037] The second determining unit is used to determine the target control object whose style can be changed based on each control object;

[0038] The third determining unit is used to determine the style replacement data of the target control object from multiple UI style packages based on the target control object and the style package identifier.

[0039] The replacement unit is used to replace the style data of the target control object with the style replacement data of the target control object.

[0040] Optionally, the first determining unit is configured to:

[0041] Among all the controls in the voice assistant, identify at least one UI control used to build the user interface;

[0042] Using reflection technology, at least one UI control is reflected to obtain the control object corresponding to each UI control.

[0043] Optionally, the second determining unit is used for:

[0044] Get the properties of each control object;

[0045] In at least one control object, check if there exists a control object with the target property.

[0046] When a control object with the attribute of the target attribute is detected, the control object is determined as the target control object whose corresponding skin can be changed.

[0047] Optionally, the third determining unit is used for:

[0048] Based on the style package identifier, determine the UI style package to be used from among multiple UI style packages;

[0049] Based on the target control object, determine the style replacement data of the target control object in the UI style package to be used.

[0050] Optionally, the third determining unit is used for:

[0051] Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant;

[0052] Based on the target control identifier, find the attribute value corresponding to the target control identifier in the UI style package to be used;

[0053] The attribute value corresponding to the target control identifier is determined as the style replacement data for the target control object.

[0054] Optionally, the UI style package further includes attributes and types corresponding to control identifiers, and the device further includes a detection unit, the detection unit being used for:

[0055] Based on the target control object, determine the target attribute and target type corresponding to the target control object in the APK file of the voice assistant;

[0056] Based on the target control identifier, determine the reference attribute and reference type corresponding to the target control identifier in the UI style package to be used;

[0057] Detect whether the target attribute is consistent with the reference attribute, and whether the target type is consistent with the reference type;

[0058] When the two match, the attribute value corresponding to the target control identifier is searched in the UI style package to be used, based on the target control identifier.

[0059] Optionally, the replacement unit is used for:

[0060] Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant;

[0061] Based on the target control identifier, determine the style data corresponding to the target control identifier in the APK file of the voice assistant;

[0062] The style replacement data of the target control object is used to replace the style data corresponding to the target control identifier.

[0063] Thirdly, this application provides a UI style changing device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to:

[0064] Receive a voice skinning command triggered by a voice assistant, wherein the voice skinning command includes a style package identifier of the UI style package to be used;

[0065] Based on reflection technology and all controls in the voice assistant, determine at least one control object;

[0066] For each control object, determine the target control object whose style can be changed;

[0067] Based on the target control object and the style package identifier, determine the style replacement data of the target control object from multiple UI style packages;

[0068] The style replacement data of the target control object is replaced using the style replacement data of the target control object.

[0069] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described UI style changing method.

[0070] The technical solutions provided in this application have the following advantages compared with the prior art:

[0071] In this embodiment, when a voice-activated skinning command triggered by a voice assistant is received, at least one control object is determined based on reflection technology and all controls in the voice assistant. For each control object, a target control object whose style can be changed is determined. Based on the target control object and a style package identifier, style replacement data for the target control object is determined from multiple UI style packages. The style replacement data of the target control object is then used to replace the style data of the target control object. The voice-activated skinning command includes the style package identifier of the UI style package to be used. Therefore, this application can change the style of controls that need to have their style changed upon receiving a voice-activated skinning command, without needing to re-execute the processes of modifying, compiling, and publishing the source code, thus avoiding these cumbersome processes and improving the efficiency of modifying UI styles. Attached Figure Description

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

[0073] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0074] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0075] Figure 1 A flowchart illustrating a UI style changing method provided in an embodiment of this application;

[0076] Figure 2 A flowchart illustrating a method for determining a target control object provided in an embodiment of this application;

[0077] Figure 3 A flowchart illustrating a method for determining style replacement data provided in an embodiment of this application;

[0078] Figure 4 A flowchart illustrating another method for determining style replacement data provided in an embodiment of this application;

[0079] Figure 5 A flowchart illustrating a data detection method provided in an embodiment of this application;

[0080] Figure 6A flowchart illustrating a data replacement method provided in an embodiment of this application;

[0081] Figure 7 A flowchart illustrating a method for determining a control object provided in an embodiment of this application;

[0082] Figure 8 This is a flowchart illustrating a UI style changing device provided in an embodiment of this application.

[0083] Figure 9 This is a schematic diagram of a UI style changing device provided in an embodiment of this application. Detailed Implementation

[0084] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0085] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0086] To make vehicle control more convenient for drivers, voice assistants can be installed, allowing drivers to perform certain operations via voice. When writing the source code for a voice assistant, engineers often customize the UI style (such as background color, images, and font color) to enhance its appearance. This source code is then compiled to create an APK file, which is subsequently published to a server for drivers to download and install. However, this approach involves setting the UI style within the source code. If modifications to the UI style are needed, the source code must be modified again, and then the modified code must be compiled and published. This entire process is time-consuming and cumbersome, resulting in inefficient UI style modification.

[0087] Therefore, to solve the above problems, this application provides a UI style changing method, which can improve the efficiency of UI style modification, such as... Figure 1 As shown, the specific steps include:

[0088] Step 101: Receive the voice skin-changing command triggered by the voice assistant.

[0089] The voice assistant is an application installed in the vehicle to execute voice commands input by the driver. Voice skinning commands include a style package identifier for the UI style package to be used. The UI style package contains the UI style data to be used. The style package identifier uniquely identifies the UI style package; this identifier can be a unique name set by a technician for the UI style package, or other data, which is not limited here.

[0090] In this step, the vehicle is equipped with a voice assistant. When the driver needs to operate the voice assistant, they can activate it using a preset voice command. After activating the voice assistant, the driver can change its skin. Specifically, the driver can control the voice assistant using a skin-changing voice command, displaying at least one icon, each icon corresponding to a style pack identifier. When the voice assistant receives a voice trigger operation for a specific icon, it retrieves the style pack identifier corresponding to that icon and generates a voice skin-changing command based on that identifier.

[0091] Before proceeding with this step, technical personnel need to create UI style packages and upload various UI style packages via the upload page. Specifically, the process involves creating an application project containing the necessary resource files using the Android Studio IDE. Then, the control attributes in the voice assistant's layout file and the resource files related to UI styles can be analyzed to create a UI style file that meets the requirements. For example, the attribute names and corresponding data types in this UI style file will be identical to those in the voice assistant.

[0092] After obtaining the required UI style file, it can be packaged into a UI style package in APK format. Using the same method, various UI style packages are obtained. To facilitate identification, technicians can assign different names to these packages based on experience. Then, the created UI style packages are uploaded to the server via the resource upload page, allowing the voice assistant client to download the required UI style package. Simultaneously, technicians can also upload the package name, poster, and MD5 value of each UI style package to the server system. The poster is created by technicians based on the corresponding UI style of the UI style package, and the MD5 value is obtained by processing the UI style package using a message digest algorithm.

[0093] Afterwards, the voice assistant's client can obtain relevant information about various UI style packages via an HTTPS interface, such as the package name, download address, corresponding poster download address, and MD5 value. Once the voice assistant client obtains the download addresses for the corresponding posters of various UI style packages, it can download and display the posters for these UI style packages, allowing drivers to understand the UI style corresponding to each package and select the most suitable one. The download address for the most suitable UI style package can then be obtained and downloaded. This download address includes the package name, allowing users to find the desired UI style package by name. To ensure the integrity of the data in the UI style package, its MD5 value can be used to verify the data. If the verification passes, the data in the UI style package is complete, and the UI style package can be used; if the verification fails, the data in the UI style package is incomplete, and the UI style package cannot be used. In cases where the UI style package cannot be used, you can re-download the UI style package from its download address.

[0094] Step 102: Based on reflection technology and all controls in the voice assistant, determine at least one control object.

[0095] In this step, since Android's interface uses the LayoutInflater utility class to recursively parse and create control objects from the controls declared in the XML layout file, then adds them to the top-level ViewGroup control, and performs subsequent measurement, layout, and drawing before finally displaying them on the screen, the voice assistant can use reflection technology to obtain the control object of each control. Then, through each control object, it can retrieve the control-related data of each control object from the voice assistant's APK file. Specifically, the voice assistant determines the XML layout file in the APK file, and uses the LayoutInflater utility class to recursively parse the controls declared in the XML layout file, creating control objects and obtaining the control object of each control.

[0096] Furthermore, since this application only changes the UI style of the UI controls, the voice assistant can find the UI controls among all the controls in the voice assistant, and use reflection technology to reflect these UI controls to obtain the control objects of these UI controls.

[0097] UI controls are used to construct the user interface and are unit components related to interface operations, such as computer input boxes and buttons. The APK file mentioned above is the file used by the voice assistant during runtime. This file includes an XML layout file, which stores data related to the voice assistant's layout, such as the control identifier, attributes, attribute values, and attribute value types for each UI control. Control attributes indicate the elements within the control; for example, attributes can be text color (textColor) or background (background). Attribute values ​​can be the storage path of the corresponding element, color values, etc. The attribute value type, for example, can be image or link, indicating whether the attribute value is an image or a link.

[0098] Step 103: For each control object, determine the target control object whose style can be changed.

[0099] The target control is the control whose style can be changed, and the control object of that control is determined as the target control object.

[0100] In this step, the voice assistant can determine whether the style of a control object can be changed by checking its properties. Specifically, when the control object's property is a target property, the voice assistant determines that the control's style can be changed and identifies the control as the target control. When the control's property is not a target property, the voice assistant determines that the control's style cannot be changed and cannot identify the control as the target control.

[0101] Furthermore, the voice assistant can locate the properties of a control object in the XML layout file. Then, for each control object, the voice assistant checks if its property is a target property. If it is, the voice assistant identifies that control object as the target control object. After checking all control objects, the voice assistant obtains all target control objects in the voice assistant.

[0102] Step 104: Based on the target control object and style package identifier, determine the style replacement data for the target control object from multiple UI style packages.

[0103] The UI style package includes style replacement data for multiple controls, which are then used for replacement.

[0104] In this step, the voice assistant can find and load the UI style package to be used based on the style package identifier in the voice skinning command and the correspondence between UI style packages and style package identifiers. Then, based on the target control object, it can find the style replacement data of the target control object in the UI style package.

[0105] When a UI style package needs to be loaded into memory, the voice assistant creates a Resources object using reflection. This Resources class is provided by Android specifically for managing various application resources. To enable the Resources object to load the UI style package, the voice assistant uses reflection to access the addAssetPath function in AssetManager. This function sets the path of the skin package to the resource management path of Resources, allowing the Resources object to load the UI style package through this path.

[0106] Step 105: Replace the style data of the target control object with the style replacement data.

[0107] The style data refers to the data related to the style of the target control in the APK file.

[0108] In this step, the voice assistant can locate the style data of the target control object in the XML layout file and replace it with the style replacement data of the target control object. When the style data of all target control objects is replaced with the style replacement data, the voice assistant's skin can be updated.

[0109] In this embodiment, when a voice-activated skinning command triggered by a voice assistant is received, at least one control object is determined based on reflection technology and all controls in the voice assistant. For each control object, a target control object whose style can be changed is determined. Based on the target control object and a style package identifier, style replacement data for the target control object is determined from multiple UI style packages. The style replacement data of the target control object is then used to replace the style data of the target control object. The voice-activated skinning command includes the style package identifier of the UI style package to be used. Therefore, this application can change the style of controls that need to have their style changed upon receiving a voice-activated skinning command, without needing to re-execute the processes of modifying, compiling, and publishing the source code, thus avoiding these cumbersome processes and improving the efficiency of modifying UI styles.

[0110] In this embodiment, when step 103 needs to be executed, the voice assistant can find the attributes of each control object in the voice assistant's XML layout file, and then determine whether the style of each control object can be changed based on its attributes. Therefore, this embodiment provides a method for determining target control objects, such as... Figure 2 As shown, the specific steps include:

[0111] Step 201: Obtain the properties of each control object.

[0112] In this step, for each control object, the voice assistant can look up the properties of that control object in the voice assistant's XML layout file.

[0113] Step 202: In at least one control object, detect whether there exists a control object with the target property.

[0114] In this step, for each control object, the voice assistant can detect whether the property of the control object is the target property. When the property of the control object is the target property, it is determined that there is a control object with the target property. When the property of the control object is not the target property, it is determined that there is no control object with the target property.

[0115] Step 203: When a control object with the target attribute is detected, the control object is identified as the target control object whose corresponding skin can be changed.

[0116] In this step, when a control object with the target attribute is detected, the voice assistant identifies it as the target control object whose corresponding skin can be changed. Based on this, the voice assistant finds all the target control objects among these control objects.

[0117] In this embodiment, the voice assistant stores not only each UI style package but also a style package identifier for each UI style package. This allows the voice assistant to determine the UI style package to be used based on the style package identifier in the voice skinning command, and then determine the style replacement data for the target control object within that UI style package. Therefore, this embodiment provides a method for determining style replacement data, such as... Figure 3 As shown, it specifically includes:

[0118] Step 301: Based on the style package identifier, determine the UI style package to be used from among multiple UI style packages.

[0119] In this step, since the voice assistant stores the style package identifier for each UI style package and each UI style package point, the voice assistant can determine the UI style package to be used based on the style package identifier in the voice skinning command.

[0120] Step 302: Based on the target control object, determine the style replacement data of the target control object in the UI style package to be used.

[0121] The UI style package to be used includes style replacement data for multiple controls.

[0122] In this step, when it is necessary to change the UI style of a certain control, the voice assistant can determine the style replacement data of the control object in the UI style package to be used, based on the target control object.

[0123] This application provides another method for determining style replacement data, which further limits step 302, such as... Figure 4 As shown, it specifically includes:

[0124] Step 401: Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant.

[0125] Among them, the control identifier is a unique identifier that indicates the control; for example, the control identifier is the control ID.

[0126] In this step, the UI style package includes multiple control identifiers and style replacement data corresponding to each control identifier. Therefore, if the voice assistant needs to determine the style replacement data of the target control object, it must first determine the target control identifier of the target control object. The voice assistant's XML layout file stores the control identifier for each control, allowing the voice assistant to determine the target control identifier of the target control object within the voice assistant's APK file.

[0127] Step 402: Based on the target control identifier, find the attribute value corresponding to the target control identifier in the UI style package to be used.

[0128] In this step, since the UI style package includes multiple control identifiers and style replacement data corresponding to each control identifier, the voice assistant searches in the UI style package to be used based on the target control identifier to find the attribute value corresponding to the target control identifier.

[0129] Step 403: Determine the attribute value corresponding to the target control identifier as the style replacement data for the target control object.

[0130] In this step, the voice assistant determines the attribute value corresponding to the target control as the style replacement data for the target control object.

[0131] Furthermore, if the attribute value of a control in the UI style package does not match the attribute and type in the XML layout file, it indicates that the attribute value of the control in the UI style package is incorrect and cannot be used for replacement. If the attribute value of a control in the UI style package matches the attribute and type in the APK file, it indicates that the attribute value of the control in the UI style package is correct and can be used for replacement. Therefore, this application embodiment provides a data detection method, which is as follows: Figure 5As shown, the specific steps include:

[0132] Step 501: Based on the target control object, determine the target attributes and target type corresponding to the target control object in the APK file of the voice assistant.

[0133] Among them, the target attribute is the attribute corresponding to the target control object, and the target type is the type corresponding to the target control object.

[0134] In this step, the voice assistant determines the XML layout file in the APK file of the voice assistant, and finds the target attribute and target type corresponding to the target control object in the XML layout file according to the target control object.

[0135] Step 502: Based on the target control identifier, determine the reference attributes and reference types corresponding to the target control identifier in the UI style package to be used.

[0136] In this step, the voice assistant searches within the UI style package to be used based on the target control identifier, looking for the reference attributes and reference types corresponding to the target control identifier.

[0137] Step 503: Check whether the target attribute is consistent with the reference attribute and whether the target type is consistent with the reference type.

[0138] In this step, the voice assistant can compare the target attribute and the reference attribute to detect whether the target attribute and the reference attribute are consistent, and compare the target type and the reference type to detect whether the target type and the reference type are consistent.

[0139] Step 504: When the two match, search for the attribute value corresponding to the target control identifier in the UI style package to be used, based on the target control identifier.

[0140] In this step, if the two match, it means that the attribute value of the target control identifier is correct. The voice assistant can then search for the corresponding attribute value of the target control identifier in the UI style package to be used.

[0141] After determining the style replacement data of the target control object, this embodiment of the application also needs to determine the style data of the target control object, and then replace the style data according to the style replacement data of the target control object. Therefore, this embodiment of the application provides a data replacement method, which is as follows: Figure 6 As shown, the specific steps include:

[0142] Step 601: Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant.

[0143] In this step, the voice assistant determines the XML layout file in the APK file, and then, based on the target control object, searches for the target control object's target control identifier in the XML layout file.

[0144] Step 602: Based on the target control identifier, determine the style data corresponding to the target control identifier in the APK file of the voice assistant.

[0145] The style data can be attribute values. The APK file includes at least one control identifier and the attribute value corresponding to each control identifier.

[0146] In this step, after the voice assistant determines the target control identifier, it can determine the style data corresponding to the target control identifier in the APK file based on the target control identifier.

[0147] Step 603: Replace the style data corresponding to the target control identifier with the style replacement data of the target control object.

[0148] In this step, after the voice assistant determines the style data corresponding to the target control identifier in the APK file, it uses the style replacement data of the target control object to replace its style data.

[0149] In this embodiment, when step 102 needs to be executed, the voice assistant can first find the UI control among all the controls in the voice assistant, and use the control object of the UI control as at least one control object obtained. Therefore, this embodiment provides a method for determining control objects, specifically as follows: Figure 7 As shown, the specific steps include:

[0150] Step 701: Among all the controls of the voice assistant, identify at least one UI control for building the user interface.

[0151] In this step, technicians can tag the UI controls in the voice assistant and then determine whether a control is a UI control by whether it has a tag. Alternatively, the voice assistant can store an identifier for each UI control, allowing the identification of at least one UI control used to construct the user interface from all the identifiers. Other methods can also be used to identify UI controls in this step; this is not limited to these specific methods.

[0152] Step 702: Using reflection technology, reflect at least one UI control to obtain the control object corresponding to each UI control.

[0153] In this application embodiment, a UI style changing device is also provided, which corresponds to the method embodiment, specifically as follows: Figure 8 As shown, it includes:

[0154] The receiving unit 801 is used to receive a voice skinning command triggered by the voice assistant, wherein the voice skinning command includes a style package identifier of the UI style package to be used;

[0155] The first determining unit 802 is used to determine at least one control object based on reflection technology and all controls in the voice assistant;

[0156] The second determining unit 803 is used to determine the target control object whose corresponding style can be changed based on each control object;

[0157] The third determining unit 804 is used to determine the style replacement data of the target control object from multiple UI style packages based on the target control object and the style package identifier.

[0158] The replacement unit 805 is used to replace the style data of the target control object with the style replacement data of the target control object.

[0159] Optionally, the first determining unit 802 is configured to:

[0160] Among all the controls in the voice assistant, identify at least one UI control used to build the user interface;

[0161] Using reflection technology, at least one UI control is reflected to obtain the control object corresponding to each UI control.

[0162] Optionally, the second determining unit 803 is used for:

[0163] Get the properties of each control object;

[0164] In at least one control object, check if there exists a control object with the target property.

[0165] When a control object with the attribute of the target attribute is detected, the control object is determined as the target control object whose corresponding skin can be changed.

[0166] Optionally, the third determining unit 804 is used for:

[0167] Based on the style package identifier, determine the UI style package to be used from among multiple UI style packages;

[0168] Based on the target control object, determine the style replacement data of the target control object in the UI style package to be used.

[0169] Optionally, the third determining unit 804 is used for:

[0170] Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant;

[0171] Based on the target control identifier, find the attribute value corresponding to the target control identifier in the UI style package to be used;

[0172] The attribute value corresponding to the target control identifier is determined as the style replacement data for the target control object.

[0173] Optionally, the UI style package further includes attributes and types corresponding to control identifiers, and the device further includes a detection unit 806, which is used for:

[0174] Based on the target control object, determine the target attribute and target type corresponding to the target control object in the APK file of the voice assistant;

[0175] Based on the target control identifier, determine the reference attribute and reference type corresponding to the target control identifier in the UI style package to be used;

[0176] Detect whether the target attribute is consistent with the reference attribute, and whether the target type is consistent with the reference type;

[0177] When the two match, the attribute value corresponding to the target control identifier is searched in the UI style package to be used, based on the target control identifier.

[0178] Optionally, the replacement unit 805 is used for:

[0179] Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant;

[0180] Based on the target control identifier, determine the style data corresponding to the target control identifier in the APK file of the voice assistant;

[0181] The style replacement data of the target control object is used to replace the style data corresponding to the target control identifier.

[0182] like Figure 8 As shown in the figure, this application embodiment provides a UI style changing device, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0183] Memory 803 is used to store computer programs;

[0184] In one embodiment of this application, when the processor 801 executes a program stored in the memory 803, it implements the UI style changing method provided in any of the foregoing method embodiments, including:

[0185] Receive a voice skinning command triggered by a voice assistant, wherein the voice skinning command includes a style package identifier of the UI style package to be used;

[0186] Based on reflection technology and all controls in the voice assistant, determine at least one control object;

[0187] For each control object, determine the target control object whose style can be changed;

[0188] Based on the target control object and the style package identifier, determine the style replacement data of the target control object from multiple UI style packages;

[0189] The style replacement data of the target control object is replaced using the style replacement data of the target control object.

[0190] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the UI style changing method provided in any of the foregoing method embodiments.

[0191] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0192] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0193] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

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

Claims

1. A method for changing UI styles, characterized in that, The method includes: Receive a voice skinning command triggered by a voice assistant, the voice skinning command including a style package identifier of the UI style package to be used, the voice assistant being an application installed on the vehicle for executing voice commands input by the driver; Based on reflection technology and all controls in the voice assistant, determine at least one control object, including finding a UI control among all controls in the voice assistant and using reflection technology to reflect the UI control to obtain the control object of the UI control; For each control object, determine the target control object whose style can be changed; Based on the target control object and the style package identifier, determining the style replacement data of the target control object from multiple UI style packages includes: determining the UI style package to be used from multiple UI style packages based on the style package identifier; determining the target control identifier of the target control object in the APK file of the voice assistant based on the target control object; determining the target attribute and target type corresponding to the target control object in the APK file of the voice assistant based on the target control object; determining the reference attribute and reference type corresponding to the target control identifier in the UI style package to be used based on the target control identifier; detecting whether the target attribute is consistent with the reference attribute and whether the target type is consistent with the reference type; when they are consistent, searching for the attribute value corresponding to the target control identifier in the UI style package to be used based on the target control identifier; and determining the attribute value corresponding to the target control identifier as the style replacement data of the target control object. The process of replacing the style data of the target control object using style replacement data includes: finding the style data of the target control object in the XML layout file using the target control object, and replacing the corresponding style data in the XML layout file with the style replacement data of the target control object.

2. The method according to claim 1, characterized in that, The step of determining at least one control object based on reflection technology and all controls in the voice assistant includes: Among all the controls in the voice assistant, identify at least one UI control used to build the user interface; Using reflection technology, at least one UI control is reflected to obtain the control object corresponding to each UI control.

3. The method according to claim 1, characterized in that, The step of determining the target control object whose style can be changed based on each control object includes: Get the properties of each control object; In at least one control object, check if there exists a control object with the target property. When a control object with the attribute of the target attribute is detected, the control object is determined as the target control object whose corresponding skin can be changed.

4. The method according to claim 1, characterized in that, The step of replacing the style data of the target control object using the style replacement data includes: Based on the target control object, determine the target control identifier of the target control object in the APK file of the voice assistant; Based on the target control identifier, determine the style data corresponding to the target control identifier in the APK file of the voice assistant; The style replacement data of the target control object is used to replace the style data corresponding to the target control identifier.

5. A UI style changing device, characterized in that, The device includes: The receiving unit is used to receive a voice skinning command triggered by the voice assistant. The voice skinning command includes a style package identifier of the UI style package to be used. The voice assistant is an application installed on the vehicle and is used to execute the voice commands input by the driver. The first determining unit is configured to determine at least one control object based on reflection technology and all controls in the voice assistant, including finding a UI control among all controls in the voice assistant and using reflection technology to reflect the UI control to obtain the control object of the UI control; The second determining unit is used to determine the target control object whose style can be changed based on each control object; The third determining unit is configured to determine style replacement data for the target control object from multiple UI style packages based on the target control object and the style package identifier, including: determining the UI style package to be used from multiple UI style packages based on the style package identifier; determining the target control identifier of the target control object in the APK file of the voice assistant based on the target control object; determining the target attribute and target type corresponding to the target control object in the APK file of the voice assistant based on the target control object; determining the reference attribute and reference type corresponding to the target control identifier in the UI style package to be used based on the target control identifier; detecting whether the target attribute is consistent with the reference attribute and whether the target type is consistent with the reference type; when they are consistent, searching for the attribute value corresponding to the target control identifier in the UI style package to be used based on the target control identifier; and determining the attribute value corresponding to the target control identifier as the style replacement data for the target control object. The replacement unit is used to replace the style data of the target control object with the style replacement data of the target control object, including: finding the style data of the target control object in the XML layout file through the target control object, and replacing the corresponding style data in the XML layout file with the style replacement data of the target control object.

6. A UI style changing device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; At least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: Receive a voice skinning command triggered by a voice assistant, the voice skinning command including a style package identifier of the UI style package to be used, the voice assistant being an application installed on the vehicle for executing voice commands input by the driver; Based on reflection technology and all controls in the voice assistant, determine at least one control object, including finding a UI control among all controls in the voice assistant and using reflection technology to reflect the UI control to obtain the control object of the UI control; For each control object, determine the target control object whose style can be changed; Based on the target control object and the style package identifier, determining the style replacement data of the target control object from multiple UI style packages includes: determining the UI style package to be used from multiple UI style packages based on the style package identifier; determining the target control identifier of the target control object in the APK file of the voice assistant based on the target control object; determining the target attribute and target type corresponding to the target control object in the APK file of the voice assistant based on the target control object; determining the reference attribute and reference type corresponding to the target control identifier in the UI style package to be used based on the target control identifier; detecting whether the target attribute is consistent with the reference attribute and whether the target type is consistent with the reference type; when they are consistent, searching for the attribute value corresponding to the target control identifier in the UI style package to be used based on the target control identifier; and determining the attribute value corresponding to the target control identifier as the style replacement data of the target control object. The process of replacing the style data of the target control object using style replacement data includes: finding the style data of the target control object in the XML layout file using the target control object, and replacing the corresponding style data in the XML layout file with the style replacement data of the target control object.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the UI style changing method according to any one of claims 1 to 4.