A configuration-driven vehicle dynamic layout adaptation method and related product
By adopting a configuration-driven in-vehicle dynamic layout adaptation method, the problems of high cost and long cycle of multi-vehicle interface adaptation in the existing technology are solved. It realizes flexible adaptation and online updates of interface layout, reduces development and maintenance costs, and supports multiple control combinations and real-time configuration changes.
Patent Information
- Application Number
- CN202611654387.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-26
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies cannot maintain the layout of multiple heterogeneous items on the same page at low cost. The adaptation of different models or platforms is coupled with the program code, the interface layout is bound to the application installation package, configuration changes cannot be hot-applied, and interactive events are scattered and hard-coded, resulting in high cost and long cycle for multi-model interface adaptation, making it difficult to meet the needs of rapid iteration and differentiated customization.
The system adopts a configuration-driven in-vehicle dynamic layout adaptation method, which decouples the layout description of the interface control from the program code and instead declares it in the configuration file. It achieves decoupling of layout and code through a three-level declarative layout rendering of atomic components, composite templates, and item references, and supports differentiated adaptation and online updates for interfaces of multiple vehicle models.
It enables atomic components to be freely combined and nested within the same entry, supports mixed layouts of various heterogeneous entries, reduces maintenance costs for multiple vehicle models, shortens the adaptation cycle, and allows the interface to be updated in real time during operation without recompiling and reinstalling the application.
Smart Images

Figure CN123157291A_ABST
Abstract
Description
Technical Field
[0001] This application generally relates to the field of computer technology. More specifically, this application relates to a configuration-driven in-vehicle dynamic layout adaptation method, system, storage medium, and electronic device. Background Technology
[0002] With the development of automotive intelligence, in-vehicle infotainment systems have become a core component of intelligent cockpits. These systems handle numerous human-machine interaction functions, including multimedia playback, navigation, vehicle settings, ambient lighting control, and climate control. The development quality and iteration efficiency of their interfaces directly impact user experience and the overall vehicle software development cost. Because a single automaker often has multiple models and hardware platforms, the interface differences between different models and platforms are becoming increasingly significant. Some models require both switches and sliders within the same setting item, while others only need a single switch for the same item. Still others require combining dropdown menus, buttons, radio buttons, and other controls within the same item.
[0003] Therefore, how to achieve differentiated adaptation and rapid updates of interfaces for multiple vehicle models at low cost has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a configuration-driven in-vehicle dynamic layout adaptation method, system, storage medium, and electronic device to partially solve the aforementioned problems existing in the prior art.
[0005] The embodiments of this application adopt the following technical solutions: In a first aspect, this application provides a configuration-driven in-vehicle dynamic layout adaptation method, the method comprising: scanning a configuration source to obtain a configuration directory corresponding to the current vehicle model, the configuration directory including configuration files, the configuration files including template configuration files and page configuration files; the template configuration file declaring a component combination list in units of templates, and each entry in the page configuration file specifying the template used by the entry through a template reference attribute; when the page is opened, obtaining the page configuration file; traversing each entry in the page configuration file, reading the template reference attribute of each entry, determining the component combination list in the template configuration file according to the template reference attribute, indexing the corresponding layout resource file through a preset naming convention between component type and layout resource file, each layout resource file corresponding to an atomic component, instantiating the layout of the atomic components one by one and adding them sequentially to the entry container, assembling them into an entry view, and loading the assembled entry view into a list control for display according to the binding data obtained from the key-value dataset according to the data keys declared by each component.
[0006] In some embodiments, scanning configuration sources to obtain the configuration directory corresponding to the current vehicle model specifically includes: constructing a configuration source priority chain, wherein the configuration source priority chain includes a cloud overlay directory, a system partition pre-built directory, and an application built-in resource directory, each configuration source is used to store configuration files, and each configuration source also has a configuration directory corresponding to the vehicle model identifier, wherein the configuration directory stores incremental configuration files that differ from the basic configuration; and scanning each configuration source sequentially according to the configuration source priority chain to obtain the configuration directory corresponding to the current vehicle model.
[0007] In some embodiments, each component in the component combination list declares at least its component type, width, height, weight, data key, and style attributes. The style attributes are used to define the display appearance of the component under different interactive states. The component combination list records the hierarchical relationship between components. The hierarchical relationship is declared through nested container components. The container component is used to declare the combination order, arrangement direction, and hierarchical relationship of its contained sub-components. The atomic component layout is instantiated one by one and added to the item container in sequence. Specifically, when the container component exists, the container layout is instantiated, and each sub-component declared in the container component is recursively instantiated according to the nesting level and added to the container layout.
[0008] In some embodiments, obtaining the page configuration file specifically includes: obtaining the page configuration file and template table corresponding to the vehicle model identifier from the configuration center according to the vehicle model identifier of the current vehicle model; the configuration center pre-caches the configuration parsing after the basic configuration and the vehicle model overriding configuration in the configuration directory are overridden and merged, wherein the overriding and merging includes: templates with the same name as the basic configuration in the configuration directory overriding templates with the same name by name, merging entries with the same name by name, appending newly added entries, and using the basic configuration for the uncovered parts.
[0009] In some embodiments, the naming convention is a mapping rule between component types and layout resource file names; the method further includes: when a new component type is added, a new layout resource file named according to the naming convention is added.
[0010] In some embodiments, the method further includes: encapsulating the user interaction operation of the component into an event object, the event object carrying the index of the component that triggered the interaction in its respective entry, the component name, and at least one piece of information in its respective entry; the event object is distributed in two levels in the following manner: dispatched to a page layer listener for processing; if the page layer listener returns that the event has been consumed, the default behavior is not executed; otherwise, the event value is written back and the entry to which the component belongs is refreshed in conjunction with the event.
[0011] In some embodiments, the method further includes: monitoring file changes in the configuration directories of each configuration source using a file observer, wherein the file changes include the completion of downloading and unzipping the cloud configuration package to the cloud overwrite directory, and / or the configuration file being manually replaced; performing debouncing processing on the file changes, updating the configuration parsing of the configuration center, and re-rendering the page.
[0012] In some embodiments, atomic components include at least one of title, status text, icon, switch, slider, drop-down box, button, radio button group, separator, and nested container, and each atomic component is pre-encapsulated as an independent layout resource file.
[0013] In a second aspect, this application provides a configuration-driven in-vehicle dynamic layout adaptation system, the system comprising: an atomic component layer, used to encapsulate interface controls into independent layout resource files to form atomic components, wherein the layout resource files and component types are associated according to a naming convention; a template layer, used to provide template configuration files, wherein the template configuration files declare a list of component combinations on a template-by-template basis, wherein each component in the component combination list declares at least component type, width, height, weight, data key, and style attributes, and components can be nested through container components; and a page configuration layer, used to provide page configuration files, wherein each entry in the page configuration file is configured through... The template reference attribute specifies the template used for this entry, and provides binding data through a key-value dataset. The rendering engine iterates through each entry in the page configuration file, reads the template reference attribute of each entry, determines the component combination list in the template configuration file according to the template reference attribute, indexes the corresponding layout resource file through the preset naming convention between the component type and the layout resource file, and each layout resource file corresponds to an atomic component. The atomic component layouts are instantiated one by one and added to the entry container in sequence, assembled into an entry view, and the binding data obtained from the key-value dataset according to the data keys declared by each component is loaded into the list control for display.
[0014] In some embodiments, the system further includes a configuration source priority chain; the configuration source priority chain includes a cloud overlay directory, a system partition pre-built directory and an application built-in resource directory arranged in descending order of priority, and the configuration file is read from the highest priority configuration source at the file granularity. If the current configuration source does not provide the file, it automatically falls back to the next priority configuration source.
[0015] In some embodiments, the system further includes a parsing engine; the parsing engine is used to scan each configuration source, discover the configuration directory, and overwrite and merge the differential incremental configuration files and the basic configuration in the configuration directory into a configuration parsing cache in the configuration center. In this configuration, templates with the same name as those in the basic configuration are overwritten by name, and entries with the same name are merged by name. During the merging, the template reference attribute of the entry is overwritten, and the key-value dataset is overwritten and merged. New entries are appended, and the uncovered parts use the basic configuration.
[0016] In some embodiments, the system further includes an event dispatch engine; the event dispatch engine is used to encapsulate the user interaction operation of the component into an event object, the event object carrying the index of the component that triggered the interaction in its respective entry, the component name, and at least one piece of information in its respective entry; the event object is dispatched in two levels: dispatched to the page layer listener, if the page layer listener returns that it has been consumed, then the default behavior is not executed, otherwise the event value is written back and the entry to which the component belongs is refreshed in conjunction.
[0017] In some embodiments, the system further includes a hot update engine; the hot update engine is used to monitor file changes in the configuration directories of each configuration source through a file observer, the file changes including the completion of downloading and unzipping the cloud configuration package to the cloud overwrite directory, and / or the configuration file being manually replaced; the file changes are debounced, the configuration parsing in the configuration center is updated, and the page is re-rendered.
[0018] In a third aspect, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described configuration-driven vehicle dynamic layout adaptation method.
[0019] In a fourth aspect, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the above-described configuration-driven vehicle dynamic layout adaptation method.
[0020] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: Using the configuration-driven in-vehicle dynamic layout adaptation method provided above, this embodiment obtains the configuration directory corresponding to the current vehicle model by scanning the configuration source. The configuration directory includes configuration files, which include template configuration files and page configuration files. The template configuration file declares a list of component combinations in units of templates. Each entry in the page configuration file specifies the template used by the entry through a template reference attribute. When the page is opened, the page configuration file is obtained. Each entry in the page configuration file is traversed, and the template reference attribute of each entry is read. The component combination list is determined in the template configuration file according to the template reference attribute. The corresponding layout resource file is indexed through the preset naming convention between the component type and the layout resource file. Each layout resource file corresponds to an atomic component. The atomic component layout is instantiated one by one and added to the entry container in sequence to assemble into an entry view. The bound data obtained from the key-value dataset according to the data keys declared by each component is loaded into the list control for display. This enables atomic components to be freely combined and nested within the same item, supports mixed layouts of multiple heterogeneous items on the same page, and can express any number and any arrangement direction of controls within a single item. It solves the problem that the one-to-one mapping of item type to fixed layout cannot express the combination relationship, and improves the layout expression capability from limited enumeration to free combination.
[0021] Furthermore, in this application, components are maintained with independent layout resource files, which can be previewed directly in the development tools. Adding a new component type only requires adding a layout resource file named according to the convention, with zero changes to the rendering engine and list adapter code, which helps to shorten the development cycle and reduce the scope of regression testing.
[0022] Furthermore, this application adopts a configuration organization method that combines basic configuration with incremental differences in the vehicle model catalog. When adding a new vehicle model, only the configuration catalog needs to be added and the incremental difference configuration file needs to be written. The application code does not need to be modified. The vehicle model adaptation work is reduced from modifying code and testing concurrent versions to modifying configuration, which can significantly reduce the maintenance cost of multiple vehicle models and shorten the adaptation cycle. Attached Figure Description
[0023] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, and the same or corresponding reference numerals denote the same or corresponding parts, wherein: Figure 1 This application provides an overall architecture diagram of a configuration-driven vehicle dynamic layout adaptation system. Figure 2 Two page layout diagrams provided for embodiments of this application; Figure 3This is a schematic diagram of the configuration loading and overwrite merging process provided in the embodiments of this application; Figure 4 This application provides a schematic diagram of an entry rendering process. Figure 5 This application provides a schematic diagram of a configuration hot update process. Figure 6 A flowchart of a configuration-driven vehicle dynamic layout adaptation method provided in this application embodiment; Figure 7 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] 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, not all, of the embodiments of this application. 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.
[0025] Currently, the interface development of in-vehicle infotainment systems mainly adopts the following methods.
[0026] The first approach is the fixed layout development method. This method pre-writes a fixed layout file for each page and maps each item type to a fixed layout in the list adapter code via type branching (e.g., `when` or `switch` statements). Under this method, one item can only correspond to one fixed layout. When a car model needs to combine multiple controls within the same item (e.g., a switch and slider in the same row, a dropdown and a button in the same row), or when the same item for different car models requires different control combinations, a new layout file must be added, the adapter branch code modified, and the entire project recompiled and released. As the number of car models and platforms increases, the layout files and code branches grow exponentially, resulting in extremely high maintenance costs. This method provides coarse-grained layout descriptions and cannot maintain multiple heterogeneous item layouts on the same page at low cost.
[0027] The second approach is a template-based software development system. This system distributes template code via a backend server, and the terminal parses the code to extract the complete interface from a pre-built interface library for redirection and display. The drawback of this approach is that the template granularity is the entire page, the control combinations for each list item within the page are still pre-fixed, and the template configuration and distribution depend on the communication protocol between the terminal and the backend, making it impossible to take effect offline.
[0028] The third approach is a dynamic layout scheme based on Android. This scheme determines the displayable functional items based on user permission parameters and generates view units on the main interface in sequence. The drawback of this scheme is that it only addresses the display and sorting of functional items at the functional item level. Its granularity is limited to whether a single functional item is displayed or not. The control structure of each view unit remains fixed, and it does not involve the free combination of multiple controls within a single item, nor does it involve the overlay and merging of multiple configuration sources or hot updates.
[0029] In summary, existing technologies suffer from the following problems: First, the layout description is coarse-grained, making it impossible to freely combine multiple controls within the same item, or to maintain the layout of multiple heterogeneous items on the same page at low cost. Second, vehicle model or platform differentiation adaptation is coupled with the program code; adapting to new vehicle models requires code modification and a new release. Third, the interface layout is bound to the application installation package, and configuration changes cannot be hot-applied without restarting the application. Fourth, the interaction events of various controls are scattered and hard-coded in the code, making it impossible for the page layer to receive and manage interaction events in a unified way. These problems result in high costs and long cycles for multi-vehicle interface adaptation, making it difficult to meet the needs of rapid vehicle model iteration and differentiated customization.
[0030] In view of this, embodiments of this application provide a configuration-driven in-vehicle dynamic layout adaptation system and method, applicable to the rapid development, differentiated adaptation, and online updates of interfaces in multi-vehicle infotainment (IVI) systems across multiple vehicle models and platforms. This application decouples the layout description of interface controls from the program code, replacing it with configuration file declarations. The rendering engine dynamically assembles the interface according to the configuration file declarations, thereby achieving decoupling between layout and code, i.e., configuration-driven. Under this overall concept, this application achieves differentiated adaptation and online updates of multi-vehicle interface through three mechanisms: a three-level declarative layout rendering of atomic components, combined templates, and item references; the overriding and merging of incremental differences between basic configurations and vehicle model catalogs; a multi-level configuration source priority chain; and a rollback mechanism for missing file granularity.
[0031] In this application, configuration-driven refers to the generation and modification of the interface layout being driven by the content of the configuration file, rather than by type branches or hard-coded logic in the program code. Configuration-driven is the opposite of code-driven. In configuration-driven mode, the layout description is concentrated in the configuration file, and the program is only responsible for performing rendering according to the configuration declaration. Adding, deleting, or modifying the layout does not involve code modification, nor does it require recompiling and re-releasing.
[0032] In-vehicle dynamic layout adaptation refers to the automatic adaptation of the interface layout to differences in vehicle model, platform, and configuration version within an in-vehicle infotainment system. In this application, "dynamic" is reflected on two levels: firstly, spatial dynamics, meaning different vehicle models present different layout structures on the same page container; secondly, temporal dynamics, meaning the interface can be updated instantly after configuration changes during operation. Neither scenario requires recompiling and reinstalling the application.
[0033] This application uses an in-vehicle infotainment system on the Android platform as an example for illustration, but the technical solution of this application is not limited to the Android platform. It is also applicable to the development of in-vehicle interfaces on other operating system platforms, as well as other terminal scenarios with multiple configuration and different adaptation requirements.
[0034] The specific embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0035] Figure 1 This is a general architecture diagram of a configuration-driven vehicle dynamic layout adaptation system provided in an embodiment of this application. Figure 1 As shown, the configuration-driven in-vehicle dynamic layout adaptation system, from top to bottom, includes a configuration source priority chain and vehicle configuration directory, a parsing engine, a configuration center, a rendering engine and event dispatch engine, and a page layer. In addition, the system also includes an atomic component layer, a template layer, a page configuration layer, and a hot update engine.
[0036] In this application, the configuration source priority chain is located at the top layer of the system and serves as the input for configuration. It consists of three types of configuration sources: cloud overlay directory, system partition pre-built directory, and application built-in resource directory, arranged in descending order of priority. A configuration directory corresponding to the vehicle model identifier is established under each configuration source.
[0037] The cloud overlay directory refers to the highest priority configuration source, storing overlay configurations distributed from the cloud. After downloading, the cloud configuration package is extracted to the cloud overlay directory, and its contents take precedence over configurations with the same name in the system partition's pre-built directory and the application's built-in resource directory. A cloud configuration package is a compressed file containing one or more configuration files, distributed by the cloud service. Once the cloud configuration package is downloaded and extracted to the cloud overlay directory, the file change is considered complete, triggering the hot update process. To ensure security, the extraction process may include path traversal verification and validity checks; if verification fails, the configuration package is discarded, and the original configuration is reused.
[0038] The system partition pre-built directory refers to the configuration source with medium priority, storing the configurations pre-built with the system partition. The configurations in the system partition pre-built directory take effect when the cloud overwrite directory does not provide corresponding files.
[0039] The application's built-in resource directory refers to the lowest priority fallback configuration source, storing configurations built into the application installation package and distributed along with the application. The configurations in the application's built-in resource directory serve as a final safety net, ensuring that the interface always has usable configurations.
[0040] The configuration directory refers to the directory where configurations are stored under the configuration source, organized by vehicle model or platform. It corresponds to the vehicle model identifier, such as config / modelA / or config / modelB / . The configuration directory stores incremental configuration files that differ from the basic configuration for that vehicle model. Scanning the configuration source and discovering the configuration directory is a prerequisite for obtaining the current vehicle model's configuration.
[0041] Configuration files are files written in structured text formats (such as XML and JSON) used to declare interface layout and data. The configuration files in this application include two categories: template configuration files and page configuration files. These are responsible for declaring how components are combined, which entries a page contains, which template each entry references, and what data it is bound to.
[0042] Incremental configuration files are those stored in the vehicle configuration directory that only record the differences from the basic configuration. Incremental configuration files can contain only the templates or entries that need to be covered for that vehicle model. For example, if vehicle model B only needs to cover the template reference for the ambient lighting entry, then only the differential configuration for that entry will be written to its configuration directory; other configurations will automatically use the basic configuration. Incremental configuration files minimize vehicle model adaptation; when adding a new vehicle model, only the differential parts need to be written, eliminating the need to copy and maintain the entire configuration.
[0043] A template configuration file is a configuration file that declares a list of component combinations using templates as units. A single template configuration file can declare multiple templates, each declaring a list of component combinations. Templates are independent of each other; the same template can be referenced by multiple entries and can be overridden by configuration catalogs for multiple vehicle models. Template configuration files are typically written in XML format. A template is a declaration unit that describes the compositional relationships of components within an entry. A template describes which components an entry consists of, in what order and hierarchy, and serves as the carrier of the component combination list. The relationship between templates and entries is that of a class and an instance; that is, the template defines the composition structure, entries reference the template through template reference attributes, and can provide specific data for the components in the composition through key-value pairs.
[0044] Rollback refers to the behavior of automatically switching to the next priority configuration source to read the file with the same name when the current priority configuration source does not provide a certain logical configuration file or the file is missing or abnormal. After clearing the cloud overwrite directory, the interface will automatically revert to the layout corresponding to the system partition's pre-built configuration or the application's built-in configuration.
[0045] The parsing engine is located under the configuration source. When the application starts, it scans each configuration source, automatically discovers the vehicle directory containing page configuration files, reads the basic configuration and vehicle overriding configuration at the file granularity according to priority, performs overriding merging, and parses the configuration into a memory model, which is then cached in the configuration center.
[0046] The configuration center acts as a memory cache layer, storing the parsing results of basic configurations and configurations for each vehicle model. When the page is opened, the page configuration file and template table are retrieved directly by the vehicle model identifier, without the need for repeated parsing.
[0047] The rendering engine and the event dispatch engine reside side-by-side under the configuration center. The rendering engine is responsible for assembling the interface according to the configuration declaration and loading the item view into the list control for display. The event dispatch engine is responsible for encapsulating component interactions into unified event objects and performing two-level dispatch. The hot update engine works in conjunction with the file observer to listen for changes in the configuration directory and drive the parsing engine to re-parse and drive the page to re-render.
[0048] A list control is a control used to display a list of item views, arranging the assembled item views sequentially and displaying them on the page, supporting interactive elements such as scrolling. Unlike existing list adapters, the adapter for the list control in this application no longer uses type branch mapping to fix the layout, but instead uniformly executes a configuration-driven process of reading template references, indexing according to naming conventions, and instantiating and assembling the list.
[0049] The page layer is located at the bottom of the system and contains page containers and list controls. The business logic code in the page layer is independent of the vehicle model; it only loads the corresponding configuration using the vehicle model identifier, allowing the same page container to present completely different layout structures. The page layer receives component interaction events uniformly through page layer listeners.
[0050] The atomic component layer, template layer, and page configuration layer are formed during development. The atomic component layer encapsulates UI controls as independent layout resource files; the template layer declares a list of component combinations using template configuration files; and the page configuration layer declares entries, template references, and key-value datasets using page configuration files. After being loaded by the parsing engine, they are assembled into the UI by the rendering engine at runtime.
[0051] Among the components mentioned above, the configuration source priority chain and vehicle configuration catalog solve the problem of where the configuration comes from; the parsing engine and configuration center solve the problem of how the configuration is organized and cached; the rendering engine solves the problem of how the configuration is transformed into the interface; the event dispatch engine solves the problem of how the interface interaction is handled uniformly; and the hot update engine solves the problem of how configuration changes take effect immediately. Together, these five parts constitute the complete link of configuration-driven vehicle dynamic layout adaptation.
[0052] The following is a detailed explanation of each component.
[0053] Figure 2These are schematic diagrams illustrating two page layouts provided in embodiments of this application.
[0054] In this application, the atomic component layer is used to encapsulate interface controls into independent layout resource files to form atomic components, and a correspondence is established between layout resource files and component types according to naming conventions.
[0055] An atomic component refers to the smallest visual unit in an interface that cannot be further subdivided, i.e., a control, for example... Figure 2 The text title control corresponding to the words "ambient light" includes a switch button, volume progress bar, etc. Each type of atomic component is encapsulated as an independent layout resource file during development. Atomic components are the most basic building blocks of the system; all complex items are composed of combinations of atomic components. Those skilled in the art can extend the interface with new component types as needed.
[0056] A layout resource file is an independent file that stores the layout definition of a single atomic component. It can define the component's size, position, background, text style, and other appearance and layout attributes.
[0057] During development, developers first define the types of atomic components required for the interface. In some embodiments of this application, atomic component types may include titles, status text, icons, switches, sliders, dropdown lists, buttons, radio buttons, separators, and nested containers, etc. Each type of atomic component is encapsulated as an independent layout resource file. Because components are maintained with independent layout resource files, the display effect of each component can be directly previewed in the development tools. Modifications to the appearance of a component only require modification of the corresponding layout resource file, without affecting other components.
[0058] The naming convention between layout resource files and component types refers to the mapping rules between component types and layout resource file names. Based on the naming convention, the rendering engine directly derives the name of the layout resource file from the component type, thereby completing indexing and instantiation. Naming conventions are one of the key mechanisms enabling configurable rendering; as long as the files are named according to the convention, the rendering engine can find and instantiate new components without any code modifications.
[0059] In some embodiments of this application, atomic components are not limited to single controls; multiple controls can be pre-combined into a reusable component and encapsulated into a layout resource file. For example, Figure 2 The four buttons for previous track, play / pause, next track, and mute required for media control are encapsulated into a horizontal container component. This component can be copied and used in different entries and different vehicle configurations just like a normal component. The four buttons move with the component as a whole, realizing component-level reuse.
[0060] In this application, the same layout resource file can be referenced by the configurations of multiple vehicle models. When two vehicle models have the same component structure but different display content, it is not necessary to copy two layout resource files. Simply provide different values in the key-value datasets configured on their respective pages, or provide different style attributes in the template declaration.
[0061] In this application, the template layer is used to provide template configuration files, which declare a list of component combinations on a template-by-template basis.
[0062] A component composition list is an ordered collection of all components and their properties declared in a template that make up an entry. Each item in the component composition list corresponds to a component, and must at least declare the component type, width, height, weight, data key, and style properties. Components can also be nested within container components to form a hierarchical relationship. The component composition list is the basis for the rendering engine to determine which components are in an entry and how they are arranged.
[0063] The functions of each declared attribute in the component composition list are as follows: Component type is used to index the layout resource file according to the naming convention; width and height determine the space occupied by the component; weight is used to allocate the remaining space within the same container; data key is used to declare which key value the component is bound to from the entry key-value dataset; style attribute is used to define the display appearance of the component in different interactive states, such as a button normally having a transparent background and an orange background when pressed, and a switch displaying different colors when it is on and off.
[0064] In this application, the template only declares what data key the component is bound to, and the specific value corresponding to the data key is provided by the key-value dataset in the page configuration; the template and data are separated, and the same template can be reused for different items, different pages, and different vehicle models.
[0065] In this application, the page configuration layer is used to provide page configuration files. Each entry in the page configuration file specifies the template used by that entry through a template reference attribute, provides binding data through a key-value dataset, and the entry itself does not describe the layout structure.
[0066] Page configuration refers to the configuration data that describes the items that make up a page. Page configuration is carried out in a page configuration file. Each item in the page configuration file specifies a template through a template reference attribute and provides bound data through a key-value dataset.
[0067] A page configuration file is a configuration file that stores page-level item configurations. The page configuration file lists each item contained in the page, and each item includes template reference attributes and key-value pairs. The page configuration file and template configuration file have separate responsibilities: the template configuration file describes how components are combined, while the page configuration file describes what items the page has, which template each item references, and what data is bound to it.
[0068] An item refers to a unit of interface elements on a page, composed of multiple components; that is, a setting or list item on the interface, such as... Figure 2 The ambient lighting settings (including title text, on / off switch, slider, etc.) are considered as a single item. Each item can be viewed as a smaller container, and multiple items arranged sequentially constitute the larger container of the page. Items are the objects of template references and key-value data; an item specifies the template it uses through its template reference attribute.
[0069] The template reference attribute is an attribute on an entry that specifies the template it uses. Each entry in the page configuration file declares the template it references through the template reference attribute. The rendering engine reads the template reference attribute of an entry to determine the corresponding list of templates and component combinations in the template configuration file (or template table).
[0070] A key-value set refers to a collection of key-value pairs provided in the page configuration file for binding entries. The keys in the key-value set correspond to the data keys declared in the component composition list, and the values can be text, numbers, booleans, or other data types. Key-value sets allow the same template to display different content on different entries, achieving the effects of structure reuse and data isolation.
[0071] A data key is a field declared by a component in the component composition list of the template, used to bind data; it's the key in a key-value pair. The rendering engine uses the declared data key to find the corresponding value from the key-value dataset of the entries and binds it to the component. For example, if a slider component declares a data key, during rendering, it reads the value corresponding to that key (e.g., 40%) and displays it as the slider position. The data key associates the component structure with the component data and is the basis for obtaining the bound data.
[0072] Binding data refers to the data retrieved from the key-value dataset according to the data key declared by the component and mapped to the content displayed by the component. Each component declares a data key in the component composition list of the template, and the entries provide corresponding values in the key-value dataset of the page configuration file. The rendering engine retrieves the value according to the data key and completes the binding. Binding data can be the initial value of static configuration or the dynamic value updated by the data model at runtime.
[0073] Since entries do not describe the layout structure, the page configuration layer's responsibility is limited to entry organization and data binding. The page configuration file describes which entries exist, which template each references, and what data is bound. The layout is entirely determined by the component combination list of the referenced templates. Modifying an entry's template reference attribute changes its layout structure, without the page configuration file itself needing to handle any layout details. Conversely, modifying the key-value dataset changes the entry's displayed content and initial state without altering the template.
[0074] In this application, the configuration source priority chain includes a cloud overlay directory, a system partition pre-built directory, and an application built-in resource directory, arranged in descending order of priority. Each configuration source is used to store configuration files, and each configuration source also has a configuration directory corresponding to the vehicle model identifier, which stores the incremental configuration files that differ from the basic configuration for that vehicle model.
[0075] Configuration files are read from the highest priority configuration source at the file granularity: for the same logical configuration file, it first attempts to read from the cloud overlay directory; if the file is not provided in the cloud overlay directory, it falls back to the system partition prefab directory; if it is still not provided, it falls back to the application's built-in resource directory. Each file is judged and fallbacked independently, so the absence of a file in a high-priority configuration source does not affect the reading of other files, thus avoiding the failure of the entire configuration due to the absence of some files.
[0076] Figure 3 This is a schematic diagram of the configuration loading and overwrite merging process provided in an embodiment of this application.
[0077] like Figure 3 As shown, the configuration loading and overwrite merging process is as follows: when the application starts, a configuration source priority chain is built; the parsing engine scans each configuration source and automatically discovers the vehicle configuration directory containing page configuration files; the basic configuration and vehicle overwrite configuration are read at the file granularity according to the priority chain; and the overwrite merging is performed to obtain the complete configuration of the vehicle model.
[0078] Override merging refers to a mechanism that merges the incremental configuration differences in the vehicle configuration catalog with the basic configuration into the final configuration of the vehicle. In some embodiments of this application, the rules for override merging may include: templates with the same name as the basic configuration override templates with the same name; entries with the same name are merged by name, and the template reference attribute of the entry is overridden during merging; key-value datasets are overridden and merged (data keys with the same name take the value in the vehicle configuration, and data keys that only exist in the basic configuration are retained); new entries are appended; and the uncovered parts use the basic configuration.
[0079] For example, Figure 2 The ambient lighting entry in the first model uses a simple template. In the configuration directory of another model, only an ambient lighting entry with the same name needs to be declared, and its template reference attribute changed to a complex template. All other entries use the basic configuration. New equalizer entries for another model are simply appended. Thus, model adaptation changes from full copy maintenance to incremental difference maintenance. This means that adding a new model only requires writing the differences, without copying the entire configuration. Multiple model configurations evolve independently without interference.
[0080] The complete configuration is parsed into an in-memory model and cached in the configuration center. Configuration parsing refers to the process of parsing configuration files (e.g., XML format) into an in-memory model. Configuration parsing is performed by the parsing engine. After the overwrite and merging are completed, the parsing engine parses the merged configuration into an in-memory object and caches it in the configuration center. The in-memory model refers to the in-memory object model generated after the configuration file is parsed. It expresses configuration information such as templates, component combination lists, entries, and key-value datasets in object form, which can be directly read by modules such as the rendering engine. The in-memory model resides in memory and is directly read when the page is opened, without the need for repeated parsing. The data model is an object in the in-memory model that carries single-entry data, such as a structure that records information such as entry name, progress value, and current identifier. The configuration center refers to the in-memory transfer layer that caches the configuration parsing results. The configuration center pre-caches the in-memory model after the basic configuration and vehicle model overwrite configuration are merged and parsed, and indexed by vehicle model identifier; when the page is opened, the page configuration file and template table are directly retrieved by vehicle model identifier, realizing direct reading and avoiding repeated disk reads and XML parsing. The template table refers to the collection of templates cached in the configuration center, indexed by template name. The rendering engine queries the template table for the corresponding list of templates and component combinations based on the template reference attribute of the entry.
[0081] Simultaneously, directory monitoring is initiated via a file observer. This process is completed during the application startup initialization phase (e.g., the Application initialization phase in Android); for system applications, the parsing can be completed in the background immediately after booting, so the configuration is ready when the user opens the application, and the cache is used directly when the page is opened.
[0082] In this application, vehicle model catalog isolation refers to establishing an independent configuration catalog for each vehicle model / platform, with each model's configuration evolving independently and without affecting others. When different vehicle models have different combinations of interface elements but roughly the same layout, two sets of configuration catalogs can be established, each maintaining its own incremental difference files, reusing available common components, and distributing or deploying the corresponding catalogs as needed.
[0083] In this application, the parsing engine scans various configuration sources, discovers the configuration directory, merges the differential incremental configuration files in the configuration directory with the basic configuration, and parses the merged configuration into an in-memory model, which is then cached in the configuration center. The parsing engine executes during the application startup initialization phase, its input is the configuration files from each configuration source, and its output is the configuration parsing result cached in the configuration center.
[0084] The parsing engine works as follows: scan each configuration source and automatically discover the vehicle configuration directory containing page configuration files; read the basic configuration and vehicle overriding configuration at the file granularity according to the configuration source priority chain; perform overriding merging; parse the merged configuration into a memory model; cache the memory model in the configuration center; and start directory listening.
[0085] The configuration center cache consists of a merged and parsed in-memory model of basic configuration and vehicle model coverage configuration, indexed by vehicle model identifier. The cache includes the page configuration (entry list, template reference attributes, key-value dataset) and template table (a collection of templates indexed by template name) for that vehicle model. When a page is opened, the corresponding page configuration file and template table are directly retrieved from the configuration center based on the current vehicle model identifier. This eliminates the need for repeated disk reads and XML parsing, and page opening performance is not significantly affected by the increase in the number of configuration files.
[0086] In this application, the rendering engine is used to traverse each entry in the page configuration file, read the template reference attribute of each entry, determine the component combination list in the template configuration file (template table) according to the template reference attribute, index the corresponding layout resource file through the preset naming convention between the component type and the layout resource file, each layout resource file corresponds to an atomic component, the atomic component layout is instantiated one by one and added to the entry container in sequence, assembled into an entry view, and the binding data is obtained from the key-value dataset according to the data key declared by each component to complete the binding, and the assembled entry view is loaded into the list control for display.
[0087] Figure 4 This is a schematic diagram of an entry rendering process provided in an embodiment of this application.
[0088] like Figure 4 As shown, the item rendering process is as follows: A page container is created; the page configuration file and template table are retrieved from the configuration center using the vehicle model identifier; each item in the page configuration file is traversed; the template reference attributes of the items are read; a component combination list is retrieved from the template table based on the template reference attributes; for each component in the component combination list, the layout resource file is indexed according to its component type using naming conventions; atomic component layouts are instantiated one by one, and the width, height, weight, and style attributes declared by the component are applied; these components are added to the item container in sequence; after all components are instantiated and assembled, data binding is completed by retrieving values from the item key-value dataset according to the data keys declared by each component; and the item view is loaded into the list control for display.
[0089] When a container component exists in the component composition list, the rendering engine first instantiates the container layout, then recursively instantiates each child component declared within the container component according to the nesting level, and adds them to the container layout in sequence, thereby achieving hierarchical assembly of the nested structure. This solution does not limit the number of nesting levels; container components can be nested at multiple levels as needed.
[0090] The rendering engine and the adapter for the list control do not contain any branching logic from item type to fixed layout. Its traversal logic is consistent for all items; that is, every item follows the same path: reading template references, obtaining the component composition list, indexing by naming convention, instantiating, assembling, binding, and loading. Therefore, adding a new component type only requires adding a layout resource file named according to the naming convention and declaring the component type in the template configuration file; the rendering engine code requires zero modification.
[0091] Instantiation refers to the process of generating view objects from layout resource files, corresponding to the inflate operation in the Android platform. After reading the layout resource file, the rendering engine creates the corresponding view objects according to the layout definitions declared therein, and then applies the width, height, weight, and style attributes declared by the components in the template, and adds them to the item container.
[0092] In this application, the event dispatch engine is used to encapsulate user interaction operations of components into event objects. All user interaction operations of components (e.g., clicks, toggles, slider drags, dropdown selections, radio button selections, etc.) are uniformly encapsulated into event objects. Each event object carries the index of the component that triggered the interaction within its respective entry, the component name, and at least one piece of information from the entry. In a preferred embodiment, the event object carries a complete data model of the respective entry. The data model is an object that records information about the interface element, such as the entry name, current value (e.g., the new value after the progress value changes from 40% to 50%), and current identifier (id), and resides in memory. By carrying the index, component name, and data model, the page layer can accurately identify which component of which entry underwent an interaction and what the complete data state is after the interaction.
[0093] Event objects are dispatched in two levels. Level 1: Event objects are dispatched to page-level listeners for processing. Page-level listeners can register to handle interaction events of any component, such as intercepting the toggling of a switch to perform additional validation, or simply logging. Level 2: If the page-level listener returns "consumed," the default behavior is not executed; otherwise, the default behavior is executed, i.e., the event value is written back to the data model, and the corresponding entries for the component are refreshed.
[0094] Page-level listeners refer to the event listening entry points registered at the page layer. The event dispatch engine first dispatches the event object to the page-level listener, and the page-level listener decides whether to handle the event according to business needs. For example, it may intercept the switching of a switch to perform additional validation, or simply log without intervention.
[0095] "Consumed" indicates that the event has been processed, as returned by the page-level listener. In one implementation, the page-level listener's callback returns true to indicate consumption and false to indicate unconsumed. When the page-level listener returns "consumed," the event dispatch engine no longer executes the default behavior; otherwise, it executes the default behavior. The default behavior refers to the action the event dispatch engine takes when an event has not been consumed by the page-level listener: writing the event value back to the data model and refreshing the entries belonging to the component. The default behavior ensures that the component's interaction results are still effective and correctly presented even without business logic intervention.
[0096] Linked refresh refers to the process where the item view is automatically updated after data changes. After the event value is written back to the data model, the item to which the component belongs is re-rendered based on the latest data, presenting an interface state consistent with the interaction result.
[0097] Since all component interactions are uniformly encapsulated as event objects, the page layer only needs one listener entry point to receive all interaction events. There is no need to write separate callback code for buttons, switches, sliders, dropdowns, and radio buttons. The business logic is decoupled from the layout engine. The page layer can either take over all interactions uniformly or simply listen without interfering.
[0098] In this application, the hot update engine is used to monitor file changes in the configuration directories of each configuration source through a file observer, perform debouncing on the file changes, update the configuration parsing results cached in the configuration center, and notify the page to re-render, thereby enabling the configuration to take effect immediately without restarting the application.
[0099] The file observer is a file monitoring interface provided by the system. It triggers a callback when content is written to, replaced, or deleted from a file in the configuration directory. File changes come from two sources: first, the cloud configuration package is downloaded, unzipped, and placed in the cloud overwrite directory; second, the configuration file is manually replaced (e.g., during development and debugging, by pushing the configuration file via adb push). Both sources share the same hot update link.
[0100] Debouncing is used to merge multiple file changes within a short period of time: a debouncing time window is set (e.g., 500ms), and multiple changes occurring within the window only trigger a rescan and parsing once. For example, during the decompression of a cloud configuration package, multiple files are written sequentially, or multiple consecutive writes are made to the same file, all of which are processed uniformly only once after the debouncing window ends. This avoids the performance overhead of repeated parsing and also prevents program errors caused by parsing files that are only partially written.
[0101] Figure 5 This is a schematic diagram of a configuration hot update process provided in an embodiment of this application.
[0102] like Figure 5As shown, the configuration hot update sequence is as follows: the configuration package is distributed from the cloud or the configuration file is manually replaced; the configuration package is downloaded and decompressed to the cloud overwrite directory (the decompression process may include path traversal verification); the file observer detects changes in the configuration directory files; the debouncing window is entered, and multiple changes are merged; after the debouncing window ends, the configuration source priority chain is re-scanned; the overwrite merging and parsing are re-executed; the memory cache of the configuration center is atomically replaced with the new configuration parsing result; the registered page listeners are notified; the page re-executes the rendering process, and the interface is updated in real time.
[0103] The key to hot updates lies in completing configuration updates and UI refreshes without restarting the application. After changes to the configuration directory files, the changes are debouncing, rescanning and parsing, atomically replacing the configuration center cache, and notifying registered pages to re-render, resulting in an instant display of the new layout. Even after clearing the cloud overwrite directory, the file observer still detects the changes, and the system automatically reverts to the system partition's pre-built configuration or the application's built-in configuration, restoring the default UI layout.
[0104] Based on the configuration-driven vehicle dynamic layout adaptation system provided above, this application also provides a configuration-driven vehicle dynamic layout adaptation method.
[0105] Figure 6 A flowchart of a configuration-driven vehicle dynamic layout adaptation method provided in this application embodiment may specifically include the following steps: S610: Scan the configuration source to obtain the configuration catalog corresponding to the current vehicle model; S620: When the page is opened, obtain the page configuration file; S630: Traverse each entry in the page configuration file, read the template reference attribute of each entry, determine the component combination list in the template configuration file according to the template reference attribute, index the corresponding layout resource file through the preset naming convention between the component type and the layout resource file, each layout resource file corresponds to an atomic component, instantiate the layout of the atomic components one by one and add them to the entry container in sequence, assemble them into an entry view, and load the assembled entry view into the list control for display according to the binding data obtained from the key-value dataset according to the data key declared by each component.
[0106] In step S610, the configuration directory includes configuration files, which include template configuration files and page configuration files. The template configuration file declares a list of component combinations on a template-by-template basis, and each entry in the page configuration file specifies the template used by that entry through a template reference attribute.
[0107] In some embodiments of this application, when scanning the configuration source to obtain the configuration directory corresponding to the current vehicle model, a configuration source priority chain can be constructed. The configuration source priority chain includes a cloud overlay directory, a system partition pre-built directory, and an application built-in resource directory. Each configuration source is used to store configuration files. Each configuration source also has a configuration directory corresponding to the vehicle model identifier. The configuration directory stores incremental configuration files that differ from the basic configuration. According to the configuration source priority chain, each configuration source is scanned in sequence to obtain the configuration directory corresponding to the current vehicle model.
[0108] In some embodiments of this application, each component in the component combination list declares at least its component type, width, height, weight, data key, and style attributes. The style attributes are used to define the display appearance of the component in different interactive states. The component combination list records the hierarchical relationship between components. The hierarchical relationship is declared through nested container components. The container component is used to declare the combination order, arrangement direction, and hierarchical relationship of its contained sub-components. When instantiating atomic component layouts one by one and adding item containers in sequence, when a container component exists, the container layout is instantiated, and each sub-component declared within the container component is recursively instantiated according to the nesting level and added to the container layout.
[0109] In step S620, when obtaining the page configuration file, the page configuration file and template table corresponding to the vehicle model identifier can be obtained from the configuration center according to the vehicle model identifier of the current vehicle model. The configuration center pre-caches the configuration parsing after the basic configuration and the vehicle model overriding configuration in the configuration catalog are overridden and merged. The overriding and merging includes: templates with the same name as the basic configuration in the configuration catalog overriding templates with the same name by name, entries with the same name merging by name, appending newly added entries, and using the basic configuration for the uncovered parts.
[0110] In some embodiments of this application, the naming convention is a mapping rule between component types and layout resource file names; when a new component type is added, a new layout resource file named according to the naming convention is added.
[0111] In some embodiments of this application, the user interaction operation of the component is encapsulated as an event object. The event object carries the index of the component that triggered the interaction in its respective entry, the component name, and at least one piece of information in its respective entry. The event object is distributed in two levels in the following manner: it is dispatched to the page layer listener for processing. If the page layer listener returns that the event has been consumed, the default behavior is not executed; otherwise, the event value is written back and the entry to which the component belongs is refreshed in conjunction with the event.
[0112] In some embodiments of this application, a file observer monitors file changes in the configuration directories of each configuration source. File changes include the completion of downloading and unzipping the cloud configuration package to the cloud overwrite directory, and / or the configuration file being manually replaced. Debouncing is performed on the file changes, the configuration parsing of the configuration center is updated, and the page is re-rendered.
[0113] In some embodiments of this application, atomic components include at least one of title, status text, icon, switch, slider, drop-down box, button, radio button group, separator line and nested container, and each atomic component is pre-encapsulated as an independent layout resource file.
[0114] Based on the above, this application achieves the following beneficial effects: First, zero-code vehicle adaptation. By organizing the configuration using a combination of basic configuration and incremental differences in the vehicle catalog, adding a new vehicle only requires adding a new configuration catalog and writing incremental difference configuration files. No application code needs to be modified. Vehicle adaptation work is reduced from modifying code and testing concurrent versions to modifying configurations, which can significantly reduce the maintenance cost of multiple vehicle models and shorten the adaptation cycle.
[0115] Second, it has strong layout expression capabilities. Atomic components can be freely combined and nested within the same item, and the same page supports mixed layouts of multiple heterogeneous items. It can express any number of controls in any arrangement direction within a single item, solving the problem that the one-to-one mapping of item type to fixed layout cannot express the combination relationship. The layout expression capability has been improved from limited enumeration to free combination.
[0116] Third, development efficiency is high. Components are maintained with independent layout resource files, which can be previewed directly in the development tools; adding a new component type only requires adding a layout resource file named according to the convention, with zero changes to the rendering engine and list adapter code, which helps to shorten the development cycle and reduce the scope of regression testing.
[0117] Fourth, updates take effect immediately. Configuration changes are processed via a hot update link with file observer and debouncing, completing the re-parsing of configuration and interface refresh within the debouncing window. No application restart or re-release is required, and cloud-based distribution and manual replacement share the same effective path.
[0118] Fifth, it boasts excellent performance. The configuration is parsed once and resides in memory when the application starts. When a page is opened, it is directly read from the memory cache, avoiding the overhead of repeated XML parsing. Therefore, the page loading speed is not significantly affected by the increase in the number of configuration files.
[0119] Sixth, interactions can be uniformly managed. A unified event object carries component position information and a data model, allowing a single point in the page layer to take over or listen to all component interactions, which is beneficial for decoupling business code from the layout engine.
[0120] Seventh, reliable compatibility and rollback. The multi-configuration source priority chain supports rollback at the file level. When cloud configuration is missing or abnormal, it can automatically roll back to the system partition's pre-built configuration or the application's built-in configuration, ensuring that the interface remains available under any working conditions.
[0121] This application also provides a computer-readable storage medium storing a computer program that can be used to execute the configuration-driven vehicle dynamic layout adaptation method provided above.
[0122] This application also provides a computer program product, which includes a computer program or computer-executable instructions, and is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the configuration-driven vehicle dynamic layout adaptation method provided above.
[0123] Based on the configuration-driven vehicle dynamic layout adaptation method provided above, this application also proposes... Figure 7 The diagram shows a schematic structural representation of the electronic device. Figure 7 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the configuration-driven vehicle dynamic layout adaptation method provided above.
[0124] Of course, in addition to software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0125] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0126] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0127] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0128] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.
[0129] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0130] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0131] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0132] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 Figure 1 The steps of the function specified in one or more boxes.
[0133] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0134] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0135] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0136] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0137] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0139] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0140] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims in this specification.
Claims
1. A configuration-driven in-vehicle dynamic layout adaptation method, characterized in that, The method includes: Scan the configuration source to obtain the configuration directory corresponding to the current vehicle model. The configuration directory includes configuration files, which include template configuration files and page configuration files. The template configuration file declares a list of component combinations based on templates. Each entry in the page configuration file specifies the template used by that entry through a template reference attribute. When the page is opened, the page configuration file is retrieved; Iterate through each entry in the page configuration file, read the template reference attribute of each entry, determine the component combination list in the template configuration file according to the template reference attribute, index the corresponding layout resource file through the preset naming convention between component type and layout resource file, each layout resource file corresponds to an atomic component, instantiate the layout of the atomic components one by one and add them to the entry container in sequence, assemble them into an entry view, and load the assembled entry view into the list control for display according to the data keys declared by each component to obtain the binding data from the key-value dataset.
2. The method according to claim 1, characterized in that, Scanning the configuration source yields the configuration catalog corresponding to the current vehicle model, specifically including: A configuration source priority chain is constructed, which includes a cloud overlay directory, a system partition pre-built directory, and an application built-in resource directory. Each configuration source is used to store configuration files. Each configuration source also has a configuration directory corresponding to the vehicle model identifier. The configuration directory stores incremental configuration files that differ from the basic configuration. According to the configuration source priority chain, each configuration source is scanned sequentially to obtain the configuration catalog corresponding to the current vehicle model.
3. The method according to claim 1, characterized in that, Each component in the component combination list declares at least its component type, width and height, weight, data key, and style attributes. The style attributes are used to define the display appearance of the component in different interactive states. The component combination list records the hierarchical relationship between components. The hierarchical relationship is declared through nested container components. The container component is used to declare the combination order, arrangement direction and hierarchical relationship of the child components it contains. Instantiate the atomic component layout one by one and add them to the item container in sequence, specifically including: When the container component exists, instantiate the container layout, and recursively instantiate each child component declared within the container component according to the nesting level, and add them to the container layout.
4. The method according to claim 1, characterized in that, Obtaining the page configuration file specifically includes: Based on the vehicle model identifier of the current vehicle model, obtain the page configuration file and template table corresponding to the vehicle model identifier from the configuration center; The configuration center pre-caches the configuration parsing after the basic configuration and the vehicle model coverage configuration in the configuration catalog are covered and merged. The coverage and merging includes: templates with the same name as the basic configuration in the configuration catalog overwriting templates with the same name by name, merging entries with the same name by name, appending newly added entries, and using the basic configuration for the uncovered parts.
5. The method according to claim 1, characterized in that, The naming convention is a mapping rule between component types and layout resource file names; The method further includes: when a new component type is added, a new layout resource file named according to the naming convention is added.
6. The method according to claim 1, characterized in that, The method further includes: The user interaction operation of the component is encapsulated as an event object, and the event object carries the index of the component that triggered the interaction in the corresponding entry, the component name, and at least one piece of information in the corresponding entry; The event objects are distributed in a two-level manner as follows: The event is dispatched to the page layer listener for processing. If the page layer listener returns that the event has been consumed, the default behavior is not executed; otherwise, the event value is written back and the entries belonging to the component are refreshed in conjunction with the event.
7. The method according to claim 4, characterized in that, The method further includes: The file observer monitors file changes in the configuration directories of each configuration source, including the completion of downloading and unzipping the cloud configuration package to the cloud overwrite directory, and / or the configuration file being manually replaced. The file changes are debouncing, the configuration parsing in the configuration center is updated, and the page is re-rendered.
8. The method according to any one of claims 1-7, characterized in that, Atomic components include at least one of the following: title, status text, icon, switch, slider, drop-down list, button, radio button group, separator, and nested container. Each atomic component is pre-packaged as an independent layout resource file.
9. A configuration-driven in-vehicle dynamic layout adaptation system, characterized in that, The system includes: The atomic component layer is used to encapsulate UI controls into independent layout resource files to form atomic components. The layout resource files and component types are associated according to naming conventions. The template layer provides template configuration files, which declare a list of component combinations on a template-by-template basis. Each component in the component combination list declares at least its type, width, height, weight, data key, and style attributes. Components can be nested through container components. The page configuration layer provides page configuration files. Each entry in the page configuration file specifies the template used by the entry through a template reference attribute and provides binding data through a key-value dataset. The rendering engine iterates through each entry in the page configuration file, reads the template reference attribute of each entry, determines the component combination list in the template configuration file according to the template reference attribute, indexes the corresponding layout resource file through the preset naming convention between component type and layout resource file, each layout resource file corresponds to an atomic component, instantiates the layout of atomic components one by one and adds them to the entry container in sequence, assembles them into an entry view, and loads the assembled entry view into the list control for display according to the binding data obtained from the key-value dataset according to the data key declared by each component.
10. The system according to claim 9, characterized in that, The system also includes configuring a source priority chain; The configuration source priority chain includes a cloud overlay directory, a system partition pre-built directory, and an application built-in resource directory, arranged in descending order of priority. Configuration files are read from the highest priority configuration source at the file granularity. If the current configuration source does not provide the file, it automatically falls back to the next priority configuration source.
11. The system according to claim 9, characterized in that, The system also includes a parsing engine; The parsing engine is used to scan each configuration source, discover the configuration directory, and overwrite and merge the differential incremental configuration files and basic configurations in the configuration directory into a configuration parsing cache in the configuration center. Templates with the same name as those in the basic configuration are overwritten by name, and entries with the same name are merged by name. During the merging, the template reference attribute of the entry is overwritten, and the key-value dataset is overwritten and merged. New entries are appended, and the uncovered parts continue to use the basic configuration.
12. The system according to claim 9, characterized in that, The system also includes an event dispatch engine; The event dispatch engine is used to encapsulate the user interaction operation of the component into an event object. The event object carries the index of the component that triggered the interaction in its respective entry, the component name, and at least one piece of information in its respective entry. The event object is dispatched in two levels: dispatched to the page layer listener. If the page layer listener returns that the event has been consumed, the default behavior is not executed. Otherwise, the event value is written back and the entry to which the component belongs is refreshed in conjunction with the event.
13. The system according to claim 9, characterized in that, The system also includes a hot update engine; The hot update engine is used to monitor file changes in the configuration directories of each configuration source through a file observer. These file changes include the completion of downloading and unzipping the cloud configuration package to the cloud overwrite directory, and / or the configuration file being manually replaced. The engine then performs debouncing on the file changes, updates the configuration parsing in the configuration center, and re-renders the page.
14. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-8.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1-8.
