User interface updating method, electronic equipment, vehicle and storage medium
By introducing a unified data change monitoring interface into the component base class in the user interface, dynamic data sources are automatically bound and updated, solving the problems of code duplication and inaccurate updates in traditional solutions. This achieves efficient and accurate user interface updates, making it suitable for dynamic user interface generation on smart devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional user interface update solutions suffer from high code duplication, inaccurate updates, and difficulty adapting to dynamically generated user interfaces due to artificial intelligence. This results in high development complexity, a high risk of errors, and inconsistencies between the displayed interface and the actual state.
Interactive components are created by using a component base class that implements a unified data change monitoring interface. These components automatically bind to dynamic data sources such as device function status or user operations and automatically update the user interface when the data source changes. The component base class is used to implement a unified monitoring and update mechanism, avoiding issues of duplicate monitoring and omissions.
It reduces development complexity and error risk, ensures that the user interface is closely related to the actual state, improves the accuracy of interface updates and system reliability, simplifies the management of listening logic, and improves maintenance efficiency.
Smart Images

Figure CN121742873A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a user interface updating method, an electronic device, a vehicle and a storage medium. BACKGROUND
[0002] In the intelligent generation of a user interface, the user interface description generated by artificial intelligence is rendered into an actual user interface, which improves the flexibility of user interface design and can provide more personalized and intelligent interactive experience for users according to the dynamic changes of device states and user needs. However, the traditional user interface updating scheme still has technical problems such as high code repetition, inaccurate updating and the like. SUMMARY
[0003] The present application provides a user interface updating method, an electronic device, a vehicle and a storage medium. The method creates each interactive component based on a component base class that uniformly implements a data change listening interface, automatically binds dynamic data sources reflecting device function states or user operations in the electronic device, and automatically updates the user interface when the data sources change, thereby realizing the automatic perception and response of each interactive component to the underlying data changes. Without separately writing listening and updating logic for each interactive component generated by artificial intelligence, the present application not only reduces the complexity and error risk in the development process, but also effectively avoids the problem of inconsistent interface display and actual situation caused by manual updating omission, thereby improving the reliability and maintenance efficiency of the system in the dynamic user interface generation scenario.
[0004] In a first aspect, a user interface updating method is provided, which is applied to an electronic device. The method comprises the following steps: determining data sources bound to each interactive component in a current user interface, each interactive component being created based on a component base class that implements a data change listening interface, and the data sources being information reflecting device function states and / or user operations in the electronic device; listening to each data source through the data change listening interface; and when a target data source that has changed is detected, updating the current user interface based on the target data source.
[0005] The beneficial effects brought by the technical solutions of the first aspect include at least: all interaction components are created based on a component base class that implements data change listening capability, so that any user interface interaction component dynamically generated by artificial intelligence naturally has the ability to listen to data changes when created, laying a foundation for subsequent unified implementation of data listening and updating mechanism, avoiding the tediousness of writing listening code for each unknown interaction component, and improving the maintainability and reusability of the code. At the same time, the data sources bound by each interaction component are determined, and these data sources are real-time device states or user operation feedbacks inside the electronic device, which can accurately obtain key data affecting the display of the user interface, so that the update of the user interface is closely related to the actual device state and user operation, ensuring the accuracy and pertinence of the content displayed on the user interface. Further, a standardized listening channel is established by using a unified data change listening interface, so that the system can monitor the state changes of multiple heterogeneous data sources in a consistent manner, and realize automatic data change detection. This unified listening method simplifies the management of listening logic, reduces the complexity of the code, and reduces the problems of missed listening or repeated listening that may occur due to manual management of listeners. Finally, once the underlying data source changes, the system immediately triggers the update process of the corresponding interaction component, updates the user interface based on the changed target data source, and realizes a responsive user interface update mechanism, which meets the requirements of the system for high-reliability and low-latency human-computer interaction.
[0006] In some possible implementations, the component base class further implements a session management list for managing session objects, and the method further includes: determining the multiple data sources corresponding to each interaction component when the interaction components are created, and binding the corresponding interaction components in the session objects corresponding to each data source; and listening to the data sources through the data change listening interface, including listening to the data sources corresponding to each session object in the session management list through the data change listening interface.
[0007] Through the technical solutions in the possible implementation manners above, the session management list for uniformly managing multiple session objects is also implemented in the component base class, each session object corresponds to a corresponding data source, and the interactive component is bound with the corresponding session object when the interactive component is created, so that the interactive component can conveniently determine and manage the multiple data sources corresponding thereto through the session management list. In this way, in a complex system, the data sources of different functional modules can be more effectively organized and managed, and the complexity of maintaining a listening relationship for each data source is avoided. Meanwhile, through the data change listening interface, the data sources corresponding to each session object in the session management list can be conveniently uniformly listened to, the unified listening manner simplifies the listening logic, improves the listening efficiency, and also facilitates subsequent more effective tracking and management of the life cycle of the component and the listening relationship of the data source.
[0008] In some possible implementation manners, the component base class further implements an automatic updating method, and the updating of the current user interface based on the target data source includes: determining a target session object corresponding to the target data source, calling the automatic updating method through the target session object, and updating the current user interface by taking the target data source as an updating parameter.
[0009] Through the technical solutions in the possible implementation manners above, the automatic updating method is preset in the component base class, which can be directly called by the target session object corresponding to the target data source when the target data source changes, and the updated target data source is taken as a parameter to ensure that interface updating can be triggered in a unified and reliable manner regardless of which data source changes, and the updating logic does not need to be repeatedly implemented in each interactive component. Meanwhile, since each data source has a corresponding session object, the automatic updating method is called through the corresponding target session object after the target data source changes, and the target data source is directly taken as an updating parameter, thereby avoiding the problem of inconsistent data transmission or updating error, and improving the response accuracy and development efficiency of the artificial intelligence dynamically generated user interface in a complex interactive environment.
[0010] In some possible implementation manners, the calling of the automatic updating method through the target session object includes: transmitting data change information to the data change listening interface through the target session object, and calling the automatic updating method based on the data change information received by the data change listening interface.
[0011] By the technical solutions in the possible implementation manners, the data change information is transmitted into the data change listening interface by the target session object, and the automatic updating method is triggered by the interface after receiving the change information, thereby constructing a decoupled, standardized and traceable data change notification link. The mechanism ensures that the updating behavior of the user interface is always uniformly scheduled by the data change listening interface, rather than directly operated by the data source or the session object, thereby avoiding the problems of callback confusion or scattered updating logic. Meanwhile, the data change information is explicitly transmitted as a trigger basis, so that the updating process has a clear data context, which is beneficial to error troubleshooting and debugging in the later stage. In addition, the "notification-response" mode strengthens the universality of the component base class, so that all interactive components depending on the base class do not need to care about the specific data change detection and updating trigger details, and only need to respond to the call of the standard interface to complete the refreshing of the user interface, thereby simplifying the updating trigger logic and reducing the development complexity.
[0012] In some possible implementation manners, the method further includes: after the data change listening interface receives the data change information, calling the automatic updating method to parse interface code corresponding to the current user interface, to obtain a variable position of the target interactive component in the interface code, the target interactive component being an interactive component bound to the target data source; updating the variable position according to the target data source, and displaying the user interface based on the updated interface code.
[0013] By the technical solutions in the possible implementation manners, after the data change listening interface receives the data change information, the automatic updating method is called to parse the interface code corresponding to the current user interface, so as to accurately locate the variable position of the target interactive component in the interface code. The accurate positioning ensures that only the component bound to the target data source is updated, thereby avoiding the false updating of irrelevant components and improving the accuracy of the user interface updating. Meanwhile, the target data source is used to dynamically replace the variable position, thereby avoiding the inefficient mode of whole redrawing or manual operation of specific control properties in the traditional scheme, and improving the rendering efficiency of the interface through the fine-grained and templated updating of the user interface content.
[0014] In some possible implementation manners, the method further includes: listening to each interactive component by a life cycle listening function; and when it is detected that a deleted component is separated from the current user interface, unbinding the deleted component in the session object corresponding to the deleted component.
[0015] By the technical solutions in the possible implementation manners above, the life cycle of each interactive component and resource release can be managed in a unified and concise manner by using the life cycle monitoring function and the session object management. When it is detected that a certain interactive component has been separated from the current user interface (i.e., destroyed or removed), the system can automatically release the binding relationship of the component in the session object associated with the component. This mechanism ensures that the released component can release the resources occupied in time, avoiding invalid callback, null pointer exception or memory leakage problems caused by the component continuing to receive data change notifications. Moreover, the binding relationship between the released component and the session object is released in time, so that the system can more effectively utilize limited resources, which can be redistributed to other components in need, thereby improving the overall performance and resource utilization of the system.
[0016] In some possible implementation manners, the method further includes: when the interactive component is created, checking whether each to-be-created interactive component corresponds to a data source identifier; and when the target to-be-created interactive component corresponds to the data source identifier, obtaining initial data through the data source identifier, and displaying a user interface based on the initial data.
[0017] By the technical solutions in the possible implementation manners above, when the interactive component is created, whether the interactive component contains a data source identifier can be checked to automatically identify each interactive component that needs to be bound to dynamic data. When the target to-be-created interactive component corresponds to the data source identifier, the system can immediately obtain corresponding initial data through the data source identifier, and display a user interface based on the initial data. This mechanism ensures that the initial data acquisition and the component creation process are seamlessly connected, so that the user interface generated by the artificial intelligence is consistent with the actual state of the device when initially rendered, avoiding visual flicker or information lag caused by displaying default values or blanks and then asynchronously refreshing, and improving the smoothness of the user experience and the completeness of the system response. This mechanism is suitable for interactive scenarios with high requirements for response consistency and real-time performance. Meanwhile, since the binding relationship between the data source and each interactive component is clear at the beginning of creation, and the initial data can be automatically loaded and displayed, the system can be more robust when facing data source changes or component additions or deletions. This clear data flow and component relationship also facilitates subsequent maintenance and extension work.
[0018] In a second aspect, an electronic device is provided, including a processor and a memory; wherein the memory stores a computer program, when the computer program is executed, causes the electronic device to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0019] In a third aspect, a vehicle is provided, comprising a memory for storing executable program code; and a processor for invoking and running the executable program code from the memory, so that the vehicle executes the method in the first aspect or any possible implementation manner of the first aspect.
[0020] In a fourth aspect, a computer program product is provided, comprising: computer program code which, when executed on a computer, causes the computer to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0021] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program, when the computer program is executed on a computer, causes the computer to execute the method in the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 is an exemplary system architecture diagram of a user interface updating method provided by an embodiment of the present application; Figure 2 is a schematic flowchart of a user interface updating method provided by an embodiment of the present application; Figure 3 is a schematic flowchart of a user interface updating method provided by an embodiment of the present application; Figure 4 is a schematic structural diagram of various functional modules in a user interface updating method provided by an embodiment of the present application; Figure 5 is a schematic flowchart of a user interface updating method provided by an embodiment of the present application; Figure 6 is a schematic flowchart of a user interface updating method provided by an embodiment of the present application; Figure 7 is a structural schematic diagram of a vehicle provided by an embodiment of the present application. DETAILED DESCRIPTION
[0023] The technical solutions in the present application will be described clearly and exhaustively below with reference to the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B: "and / or" in the text is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist together, and B exists alone, in addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0024] Hereinafter, the terms "first", "second", "third", "fourth", "fifth", "sixth", "seventh" and "eighth" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second", "third", "fourth", "fifth", "sixth", "seventh" and "eighth" can explicitly or implicitly include one or more of the features.
[0025] In the intelligent generation of user interfaces, the user interface description generated by artificial intelligence is dynamically parsed and rendered into an actual user interface. The system can generate the most suitable user interface layout and functional components in real time according to the user's intention, the device usage scenario or the environmental state, without the need to pre-compile all interfaces. This improves the flexibility and personalization ability of user interface design, so that the user interface can dynamically change according to the device state and user demand, providing a more personalized and intelligent interactive experience for the user.
[0026] However, the traditional user interface updating scheme has many limitations when facing the user interface dynamically generated by artificial intelligence. Specifically, first, the traditional user interface updating scheme needs to manually write data change listening code for each dynamically generated component, and each component needs to be individually registered as a listener. In the scenario of intelligent generation of user interfaces, since the components are dynamically generated and cannot be predicted, this way of manually writing listening code leads to a high degree of code repetition, increases the development workload, and is prone to errors. Second, when the data changes, the traditional scheme needs to manually call the user interface updating method of each component. Due to the large number of components and frequent changes, it is easy to miss the update of some components, leading to inconsistencies between the user interface display and the actual state, affecting user experience and operation safety. At the same time, the registration and deregistration of listeners need to be manually managed, making it difficult to track the life cycle of the components generated by artificial intelligence, and prone to problems such as memory leaks or invalid listeners. In addition, the interactive components generated by artificial intelligence may be bound to multiple different data sources, and the traditional scheme needs to maintain the listening relationship for each data source individually. When the number of data sources increases, the maintenance of the listening relationship becomes complex, and developers need to spend a lot of time managing and debugging these relationships, increasing development costs and risks.
[0027] Therefore, the embodiments of the present application provide a user interface updating method to solve the problems of high code repetition and inaccurate updating of existing user interface updating schemes.
[0028] Please refer to Figure 1 , Figure 1 An exemplary system architecture diagram of a user interface updating method provided by the embodiments of the present application.
[0029] As Figure 1As shown, the system architecture can include an electronic device 101, a network 102 and a server 103. The network 102 is used to provide a communication link medium between the electronic device 101 and the server 103. The network 102 can include various types of wireless communication link, for example: 3rd-generation (3G), 4th-generation (4G), 5th-generation (5G) and the like cellular network communication link.
[0030] In the embodiment of the present application, the electronic device 101 can further include at least a voice input device and a display screen, wherein the voice input device is used to obtain the natural language description input by the user; and the display screen is used to display the finally generated user interface. The electronic device 101 can interact with the server 103 through the network 102 to receive or send messages from / to the server 103, or the electronic device 101 can interact with the server 103 through the network 102 to receive the messages or data sent by other users to the server 103.
[0031] For example, the functional system of the electronic device 101 sends a data request to the server 103 through the network 102, and the server 103 receives the request and obtains corresponding data from its own database or external data source according to the request content, such as obtaining real-time weather data from a weather server and obtaining navigation route data from a map server. The server 103 sends the obtained data back to the electronic device 101 through the network 102. After receiving the data, the electronic device 101 listens to each data source according to the user interface updating method in the technical solution of the present application, and updates the current user interface when the data source changes.
[0032] The server 103 can be a service server providing various services. It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, used to provide distributed services), or as a single software or software module, which is not limited here.
[0033] Alternatively, the system architecture can also not include the server 103, in other words, the server 103 can be an optional device in the embodiments of the present specification, that is, the method provided in the embodiments of the present specification can be applied to a system structure including only the electronic device 101, and the embodiments of the present application do not limit this.
[0034] In the embodiment of the present application, the electronic device 101 first determines the data source bound to each interaction component in the current user interface, each interaction component is created based on the component base class that implements the data change listening interface, and the data source is information reflecting the device function state and / or user operation in the electronic device; further, the electronic device 101 listens to each data source through the data change listening interface; finally, when the target data source that has changed is listened to, the electronic device 101 updates the current user interface based on the target data source.
[0035] Optionally, the electronic device 101 executing the user interface updating method is not limited to a specific type of device, and can be widely applied to various types of devices with a user interface, including but not limited to smart cars, smart phones, tablet computers, smart televisions, smart home control panels, and the like. These devices have the ability to dynamically generate a user interface and need to update the interface content in real time according to the internal state or user operation. According to the implementation needs, any electronic device with corresponding processing capability can be included in the system architecture to execute the user interface updating method, and the electronic device 101 executing the user interface updating method provided in the embodiment of the present application should not limit the electronic device executing the user interface updating method.
[0036] It should be understood that Figure 1 The number of electronic devices, networks and servers in
[0037] Please refer to Figure 2 , Figure 2 A schematic flowchart of a user interface updating method provided in the embodiment of the present application. The execution subject of the embodiment of the present application can be a car machine system in a vehicle executing the user interface updating. For convenience of description, the specific execution process of the user interface updating method in the intelligent cockpit scenario is introduced below by taking the car machine system in the vehicle as an example.
[0038] As Figure 2 shown, the user interface updating method can at least include: S202, determining the data source bound to each interaction component in the current user interface, each interaction component is created based on the component base class that implements the data change listening interface, and the data source is information reflecting the device function state and / or user operation in the electronic device.
[0039] Optionally, in the traditional user interface development, the interaction components in the interface are pre-written by the developer, and this development method needs to independently implement listening registration, data analysis, user interface refreshing and the like for each interaction component, which not only has high code repetitiveness, but also is easy to cause inconsistent interface display (such as some components are updated in time and some are delayed) due to implementation differences.
[0040] Optionally, as the functions of intelligent vehicles become increasingly rich, the vehicle-mounted human-computer interaction interface is no longer limited to pre-set static pages. During the operation of the intelligent cockpit system, the vehicle system needs to generate new user interfaces in real time according to the natural language description or context of the user. Such interfaces often cannot be pre-developed and fixed, and must rely on large language models with semantic understanding and content generation capabilities to automatically generate structured user interface descriptions at runtime, based on which the user interfaces are parsed and instantiated. For example, the user requests to "display the air conditioner and seat status" through natural language, and the system will construct an interface layout containing temperature adjustment controls, air volume sliders, seat heating buttons, and other interactive components in real time. In this case, the type, number, and structure of the interactive components are dynamically determined at runtime, and cannot be predicted during the development stage, so the dynamically generated components may not respond to data changes due to the absence of registered listeners, resulting in inconsistencies between the user interface display and the actual state after data updates.
[0041] Optionally, the method of the embodiments of the present application considers that if a standardized and unified listening and updating entry can be provided through a base class, all subclass components reuse the same mechanism, not only can any newly generated interactive component naturally have the ability to respond to data changes without the need for separate coding for each unknown interactive component, reducing code redundancy, but also can ensure the consistency of the user interface display through a unified listening mechanism, greatly reducing the maintenance cost of the artificial intelligence generated user interface system. Based on this, the method of the embodiments of the present application provides a user interface dynamic updating method applied to a vehicle intelligent cockpit system, which realizes a unified data change listening mechanism through a component base class, automatically responds to changes in vehicle status and user operation information, and realizes real-time and accurate updating of the user interface.
[0042] Specifically, during the initialization stage of the user interface, the system scans the configuration information of all interactive components (such as buttons, instrument panels, navigation maps, etc.) in the current interface, identifies and binds the data sources associated with each interactive component. Among them, the data sources include vehicle function status (such as vehicle speed change, window control, air conditioner adjustment, etc.) and user operation information (such as voice instruction result, touch selection, etc.).
[0043] Optionally, in order to enable these dynamically generated interactive components to have the ability to respond to data changes, all components are designed to be created based on a unified component base class. The component base class has built-in data change sensing mechanisms at the system architecture level, i.e., it implements standardized data change listening interfaces. For example, a text component for displaying the remaining power and a knob component for controlling the angle of the rearview mirror, although they are different in function and appearance, can be constructed as subclasses of the component base class. Therefore, they automatically inherit the ability to listen to changes in vehicle data sources when they are created, without the need to write listening logic for each component separately.
[0044] S204, listen to each data source through the data change listening interface.
[0045] Optionally, when each interactive component in the user interface is created and the association with the corresponding data source is completed, the system then enters a running state, continuously monitoring all bound data sources in real time through the data change listening interface in the component base class. Once the state of any functional module inside the vehicle changes (such as the user adjusts the seat position through a voice command, or the window automatically retracts due to the anti-pinch function), the related data source will trigger a change signal. This signal will be captured by the data change listening interface, and it will be identified which interactive components have a binding relationship with the data source.
[0046] S206, when the target data source that has changed is listened to, update the current user interface based on the target data source.
[0047] Optionally, when any bound target data source changes in value or state, the system can pass the changed target data source to all associated interactive components through a pre-set communication protocol (such as CAN bus, Ethernet), and drive these interactive components to re-render their display content according to the target data source. Specifically, according to the converted data, dynamically modify the display properties of the interactive component (such as text content, color, icon). For example, if a temperature adjustment slider is bound to an air conditioner set temperature data source, when the user adjusts the temperature from 22°C to 25°C through voice, the system will automatically synchronize the changed target data source "25°C" to the slider, and update its user interface display. If the data change causes the layout of the interface to need to be adjusted (such as adding a navigation prompt box), the position of the interactive component will be recalculated through the layout algorithm, and the corresponding user interface will be generated.
[0048] In the embodiment of the present application, a user interface updating method is provided, data sources bound to each interactive component in the current user interface are determined, each interactive component is created based on a component base class that implements a data change listening interface, and the data sources are information reflecting device function states and / or user operations in the electronic device; each data source is listened to through the data change listening interface; when a target data source that has changed is listened to, the current user interface is updated based on the target data source. All interactive components are created based on a component base class that implements a data change listening capability, so that any user interface interactive component dynamically generated by artificial intelligence naturally has the capability of listening to data changes when it is created, laying a foundation for subsequent unified implementation of data listening and updating mechanisms, avoiding the tediousness of writing listening code for each unknown interactive component separately, and improving the maintainability and reusability of the code. At the same time, the data sources bound to each interactive component are determined, and these data sources are real-time device states or user operation feedbacks inside the electronic device, which can accurately obtain key data affecting the display of the user interface, so that the updating of the user interface is closely related to the actual device state and user operation, ensuring the accuracy and pertinence of the content displayed by the user interface; further, a standardized listening channel is established by using a unified data change listening interface, so that the system can monitor the state changes of multiple heterogeneous data sources in a consistent manner, and automatic data change detection is realized. This unified listening manner simplifies the management of listening logic, reduces the problems of missed listening or repeated listening that may occur due to manual management of listeners while reducing the code complexity; finally, once the underlying data source changes, the system immediately triggers the updating process of the corresponding interactive component, and updates the user interface based on the changed target data source, thereby realizing a responsive user interface updating mechanism that meets the requirements of high reliability and low delay human-computer interaction of the system. Through the method of the embodiment of the present application, each interactive component relies on the component base class that uniformly implements the data change listening interface, automatically binds to dynamic data sources reflecting device function states or user operations in the electronic device, and automatically updates the user interface when the data sources change, thereby realizing the automatic perception and response of each interactive component to the underlying data changes. Without separately writing listening and updating logic for each interactive component dynamically generated by artificial intelligence, the complexity and error risk in the development process are reduced, and the problem of inconsistent interface display and actual situation caused by manual updating omission is effectively avoided, thereby improving the reliability and maintenance efficiency of the system in the dynamic user interface generation scenario.
[0049] Please refer to Figure 3 , Figure 3 A schematic flowchart of a user interface updating method provided in the embodiment of the present application is shown.
[0050] As Figure 3 shown, the user interface updating method can at least include: S302, the automatic updating method is also implemented in the component base class; when creating an interactive component, it is checked whether each to-be-created interactive component corresponds to a data source identifier; when the target to-be-created interactive component corresponds to a data source identifier, initial data is obtained through the data source identifier, and a user interface is displayed based on the initial data.
[0051] Optionally, Figure 4 A schematic structural diagram of each functional module in a user interface updating method provided by an embodiment of the present application is as follows: Figure 4 As shown in the "component creation" module in the "component layer", the generation and initialization process of the user interface is mainly completed in the component layer, and in this process, the system first receives interface description information generated by artificial intelligence, and gradually constructs an actual interactive component according to the content. When a to-be-created interactive component is parsed, the system enters the component creation stage. In this stage, the system first performs the operation of checking the data source identifier, that is, it is judged whether the configuration information of the component contains a data source identifier for pointing to the internal information source of the vehicle. The identifier is used to clearly indicate which type of vehicle function state or user operation information the component needs to display or control.
[0052] Optionally, if it is detected that the target to-be-created interactive component indeed corresponds to a data source identifier, the system will initiate a request to the data source layer of the vehicle based on the identifier to obtain the initial data of the data source at present. For example, when a digital label for displaying the current temperature in the vehicle is created, the system will query the set temperature value of the air conditioning system through the bound data source identifier; when a car door status indicator light is created, the real-time state of the car door lock sensor will be obtained. After the initial data is successfully obtained, the system will use the data to perform the first rendering of the interactive component, so as to display the content consistent with the actual state of the vehicle on the user interface.
[0053] Optionally, as Figure 4 As shown in the "component base class" module in the "component layer", the automatic updating method is also implemented in the component base class. The method serves as a unified user interface refreshing entrance and is responsible for driving the dynamic update of the interface content after receiving data. The method plays a key role in the life cycle of the interactive component. On the one hand, after the creation of the interactive component is completed and the initial data is obtained, the system will immediately call the automatic updating method, and the initial data is transmitted as a parameter, so as to realize the first rendering of the user interface; on the other hand, when the target data source is changed subsequently, the system will also call the method again through the corresponding session object to drive the real-time update of the interface with the latest data.
[0054] Therefore, during the creation of interactive components, when the system detects that a target interactive component to be created has a data source identifier and successfully requests its corresponding initial data, it will trigger a call to the automatic update method in the component's base class. During execution, this method parses and processes the obtained initial data, binding it to the interactive component's display attributes according to predefined interface code parsing rules. For example, if the data source is vehicle speed information, the automatic update method will parse the obtained speed value and map it to the pointer angle attribute of the dashboard interactive component, thereby achieving the initial rendering of the user interface based on the initial data. This allows the user to see initial information related to the current vehicle status or user operation when the interface starts.
[0055] S304. The component base class also implements a session management list for managing session objects; when each interactive component is created, it determines multiple data sources corresponding to each interactive component and binds the corresponding interactive component to the session object corresponding to each data source.
[0056] Optionally, such as Figure 4 As shown in the "Session Management Layer," the system centrally manages multiple session objects through a unified session management list. Each session object corresponds to a specific data source interface and is responsible for communication, state synchronization, and change notifications with that data source. Furthermore, the component base class upon which each interactive component depends integrates access to the session management list, enabling it to coordinate the binding relationships between each interactive component and the session objects.
[0057] Optionally, when an interactive component is created, in addition to performing an initial rendering of the user interface based on the acquired initial data, it also queries the session management list to see if a session object corresponding to these data sources already exists. If it does not exist, a new session object is created for the current data source and added to the list; if it already exists, the existing resources are reused. Based on this, the system establishes a binding relationship between the interactive component and the corresponding session object. When the session object is first created, it registers a data change listener for the session object using the data change listener interface. That is, for each data source corresponding to the session object, the registration method of the data change listener interface is called to associate the listener callback function with the data source, so that it can subsequently receive state change notifications from that data source. This binding process is uniformly scheduled by the component base class, ensuring that all subclass components can automatically complete the connection with the data source upon creation, and all binding relationships are uniformly maintained through the session management list, avoiding duplicate creation or resource conflicts.
[0058] S306. Determine the data source bound to each interactive component in the current user interface. Each interactive component is created based on a component base class that implements the data change listening interface. The data source is information in the electronic device that reflects the device's functional status and / or user operations.
[0059] Optionally, as to step S306, please refer to the detailed description in step S202, which will not be repeated here.
[0060] S308, through the data change listening interface, listening to the data source corresponding to each session object in the session management list.
[0061] Optionally, since all interactive components depend on the same component base class, and the base class has deeply integrated the data change listening interface with the session management list, in the listening process of the data source, the system does not directly perform decentralized listening to the original data source, but through the data change listening interface, centralized monitoring of the data source corresponding to all session objects in the session management list.
[0062] S310, when the target data source that has changed is listened to, determining the target session object corresponding to the target data source, calling the automatic update method through the target session object, and updating the current user interface with the target data source as the update parameter.
[0063] Optionally, as shown in the "component layer" of the "component base class" module in Figure 4 When the target data source changes due to changes in the status of a certain car machine function or user operation information in the vehicle, the target session object associated with it will be immediately notified. After receiving the change notification, the target session object will immediately trigger the registered listening callback function through the data change listening interface. The listening callback function will locate the relevant interactive component according to the changed target data source, and actively call the automatic update method defined in the component base class, passing the updated target data source content as a parameter to update the current user interface.
[0064] In the embodiment of the present application, a user interface updating method is provided, and a session management list for uniformly managing multiple session objects is also implemented in the component base class, each session object corresponding to a corresponding data source, and when each interactive component is created, the interactive component is bound with the corresponding session object, so that each interactive component can conveniently determine and manage its corresponding multiple data sources through the session management list. In this way, in a complex vehicle intelligent cockpit system, the data sources of different functional modules can be more effectively organized and managed, and the complexity of maintaining a listening relationship for each data source is avoided. At the same time, through the data change listening interface, the data sources corresponding to each session object in the session management list can be conveniently uniformly listened to, and this uniform listening mode simplifies the listening logic and improves the listening efficiency, and also facilitates subsequent more effective tracking and management of the life cycle of the component and the listening relationship of the data source; the automatic updating method is preset in the component base class, which can be directly called by the corresponding target session object when the target data source changes, and the updated target data source is passed in as a parameter, so that no matter which data source changes, the interface can be updated in a unified and reliable way, and there is no need to repeatedly implement the updating logic in each interactive component. At the same time, since each data source has a corresponding session object, the automatic updating method is called through the corresponding target session object after the target data source changes, and the target data source is directly used as the update parameter, avoiding the problem of inconsistent data transmission or updating error, and improving the response accuracy and development efficiency of the artificial intelligence dynamically generated user interface in a complex vehicle environment; when creating an interactive component, whether it contains a data source identifier can be automatically identified to automatically identify each interactive component that needs to bind dynamic data, and when the target to-be-created interactive component corresponds to a data source identifier, the system can immediately obtain the corresponding initial data through the data source identifier, and display the user interface based on the initial data. This mechanism ensures that the initial data acquisition and component creation process are seamlessly connected, so that the user interface generated by artificial intelligence is consistent with the actual state of the vehicle at the initial rendering time, avoiding the problem of visual flicker or information lag caused by displaying default values or blanks and then refreshing asynchronously, improving the smoothness of user experience and the integrity of system response, and being suitable for intelligent cockpit scenarios with high requirements for response consistency and real-time performance. At the same time, since the binding relationship between the data source and each interactive component is clear at the beginning of creation, and the initial data can be automatically loaded and displayed, the system can be more robust when facing data source changes or component additions and deletions, and this clear data flow and component relationship also facilitates subsequent maintenance and extension work.
[0065] Referring to Figure 5 , Figure 5 a schematic flowchart of a user interface updating method provided in the embodiment of the present application.
[0066] As Figure 5As shown, the user interface updating method can at least include: S502, a session management list for managing session objects is also implemented in the component base class; when each interactive component is created, a plurality of data sources corresponding to each interactive component are determined, and the corresponding interactive component is bound in the session object corresponding to each data source.
[0067] Optionally, for step S502, please refer to the detailed description in step S304, which will not be repeated here.
[0068] S504, determine the data source bound to each interactive component in the current user interface, each interactive component is created based on the component base class that implements the data change listening interface, and the data source is information reflecting the device function state and / or user operation in the electronic device.
[0069] Optionally, for step S504, please refer to the detailed description in step S202, which will not be repeated here.
[0070] S506, through the data change listening interface, the data source corresponding to each session object in the session management list is listened to.
[0071] Optionally, for step S506, please refer to the detailed description in step S308, which will not be repeated here.
[0072] S508, an automatic updating method is also implemented in the component base class; when the target data source that has changed is listened to, the target session object corresponding to the target data source is determined; the data change information is transmitted into the data change listening interface through the target session object, and the automatic updating method is called based on the data change information received by the data change listening interface; the current user interface is updated with the target data source as the update parameter.
[0073] Optionally, the automatic updating method is also implemented in the component base class, which is a unified user interface refreshing entrance, responsible for driving the dynamic update of the interface content after receiving data. Based on this, when the target data source that has changed is listened to, the target session object corresponding to the target data source will be determined first, specifically, please refer to the detailed description in steps S302 and S310, which will not be repeated here.
[0074] Optionally, the method of the embodiment of the application further refines the internal data flow mechanism of the data change triggering user interface update, transmits the corresponding data change information into the data change listening interface through the target session object, and accordingly calls the automatic updating method.
[0075] Specifically, during the operation of the vehicle, when the value of a certain target data source changes, the target data source generates a data change information, which contains the data source identifier, the data values before and after the change, and the change time, etc. Subsequently, the target data source transmits the data change information to the data change listening interface through the associated target session object. Once the interface receives the data change information, it immediately parses the information, extracts the key fields, and passes them as update parameters to the automatic update method. After receiving the update parameters, the automatic update method updates the interactive components bound to the target data source in the current user interface according to the parameter content.
[0076] S510, listening to each interactive component through a lifecycle listening function; when it is detected that the deleted component is separated from the current user interface, the binding relationship between the deleted component and the corresponding session object is released.
[0077] Optionally, Figure 4 A schematic structural diagram of the functional modules in the user interface update method provided by the embodiment of the present application is shown in Figure 4 As shown in the "component destruction" module in the "component layer", the system listens to the lifecycle state of each interactive component in real time through a lifecycle listening function, which is registered when the component is created, and is used to perceive whether the component is separated from the current user interface or removed.
[0078] Specifically, when a certain interactive component is no longer displayed on the interface due to page switching, user operation, or artificial intelligence dynamic adjustment, the system captures the "separation" event of the component through the lifecycle listening function. At this time, the system first identifies all the data sources bound to the deleted component and their corresponding session objects, and then actively releases the binding relationship between the deleted component and these session objects, and cancels its identity as a listener, thereby stopping the reception of change notifications of the corresponding data sources, avoiding invalid data interaction and resource waste. In addition, this mechanism also supports further releasing the session resources related to the deleted component after the binding is completed, such as recycling temporary cache, to further optimize the system performance.
[0079] In the embodiment of the present application, a user interface updating method is provided, data change information is transmitted into a data change listening interface by a target session object, and an automatic updating method is triggered by the interface after receiving the change information, thereby constructing a decoupled, standardized and traceable data change notification link. The mechanism ensures that the updating behavior of the user interface is always uniformly scheduled by the data change listening interface, rather than directly operated by the data source or the session object, thereby avoiding the problems of callback confusion or scattered updating logic. Meanwhile, the data change information is explicitly transmitted as a trigger basis, so that the updating process has a clear data context, which is beneficial for error troubleshooting and debugging in the later stage. In addition, this "notification-response" mode enhances the universality of the component base class, so that all interactive components depending on the base class do not need to care about the specific data change detection and updating trigger details, and only need to respond to the call of the standard interface to complete the refresh of the user interface, thereby simplifying the logic of the updating trigger and reducing the development complexity; by using the lifecycle listening function and the session object management, the lifecycle and resource release of each interactive component can be managed in a unified and simple manner. When it is detected that a certain interactive component has been separated from the current user interface (i.e., destroyed or removed), the system can automatically release the binding relationship of the component in the session object associated with the component. This mechanism ensures that the released component can timely release the resources occupied by it, thereby avoiding the problems of invalid callback, null pointer exception or memory leakage caused by the released component continuing to receive data change notifications. Moreover, the binding relationship between the released component and the session object is released in time, so that the system can more effectively utilize the limited resources, which can be reallocated to other needed components, thereby improving the overall performance and resource utilization of the system.
[0080] Referring to Figure 6 , Figure 6 a schematic flowchart of a user interface updating method provided in the embodiment of the present application.
[0081] As Figure 6 shown, the user interface updating method can at least include: S602, a session management list for managing session objects is also implemented in the component base class; when each interactive component is created, a plurality of data sources corresponding to each interactive component are determined, and the corresponding interactive component is bound in the session object corresponding to each data source.
[0082] Optionally, for step S602, refer to the detailed description in step S304, which will not be repeated here.
[0083] S604, the data sources bound with each interactive component in the current user interface are determined, each interactive component is created based on the component base class which implements the data change listening interface, and the data source is information reflecting the device function state and / or user operation in the electronic device.
[0084] Optionally, for step S604, please refer to the detailed description in step S202, which will not be repeated here.
[0085] S606, through the data change monitoring interface, monitoring the data source corresponding to each session object in the session management list.
[0086] Optionally, for step S606, please refer to the detailed description in step S308, which will not be repeated here.
[0087] S608, the component base class also implements an automatic update method, when the target data source that has changed is monitored, the target session object corresponding to the target data source is determined, and the data change information is transmitted into the data change monitoring interface through the target session object.
[0088] Optionally, for step S608, please refer to the detailed description in step S508, which will not be repeated here.
[0089] S610, after receiving the data change information in the data change monitoring interface, calling the automatic update method to parse the interface code corresponding to the current user interface, obtaining the variable position of the target interactive component in the interface code, and the target interactive component is the interactive component bound by the target data source; update the variable position according to the target data source, and display the user interface based on the updated interface code.
[0090] Optionally, Figure 4 A schematic structural diagram of each functional module in a user interface updating method provided by the embodiment of the present application is shown in Figure 4 As shown in the "component base class" module in the "component layer", after receiving the data change information, the data change monitoring interface first performs data preprocessing, such as converting the received original data (such as Bundle format) into a unified data format (such as JsonObject) more suitable for subsequent processing, to adapt to the subsequent interface parsing and variable replacement process.
[0091] Further, after completing the data preprocessing, the data change monitoring interface will call the automatic update method, and parse the interface code corresponding to the current user interface based on the processed target data source. The interface code here is usually a structured description in the form of a declarative template, which indicates the content position required to be displayed by each interactive component through a placeholder or a variable identifier. This process is implemented through a special interface parsing tool (such as TemplateUtil), which can identify the template variables in the interface code and determine the specific position of these variables in the code.
[0092] Optionally, by parsing the interface code, the system can accurately locate the variable position corresponding to the target interactive component bound to the target data source. Subsequently, the automatic updating method traverses all variable positions that need to be updated and assigns new data values to these variables. After completing the variable update, the interface code is reconstructed to reflect the latest data state. Finally, the system re-renders the user interface based on the updated complete interface code, thereby presenting visual feedback consistent with the latest state of the vehicle.
[0093] In the embodiments of the present application, a user interface updating method is provided. After receiving data change information at a data change listening interface, the interface code corresponding to the current user interface is parsed by calling an automatic updating method to accurately locate the variable position of the target interactive component in the interface code. This accurate positioning ensures that only the components bound to the target data source are updated, avoiding the misupdate of irrelevant components and improving the accuracy of user interface updating. At the same time, the target data source is used to dynamically replace the variable position, avoiding the inefficient way of whole repainting or manual operation of specific control properties in the traditional scheme. The rendering efficiency of the interface is improved through fine-grained and templated updating of the user interface content.
[0094] Figure 7 is a structural schematic diagram of a vehicle provided by the embodiments of the present application.
[0095] As shown in the example of Figure 7 , the vehicle 700 includes at least one processor 701, at least one network interface 704, a user interface 703, a memory 705, and at least one communication bus 702.
[0096] The communication bus 702 is used to realize the connection and communication between the components.
[0097] The user interface 703 can include a display screen, a camera, a voice input device. Optionally, the user interface 703 can also include a standard wired interface and a wireless interface.
[0098] The network interface 704 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0099] The memory 705 stores executable program code: a user interface updating program. The processor 701 is configured to call and execute the executable program code to execute a user interface updating method.
[0100] In addition, the electronic device provided by the embodiment of the present application can be used to execute the user interface updating method provided by the embodiment of the present application.
[0101] The embodiment of the present application can divide the functional modules of the electronic device according to the above method examples, for example, each functional module can be divided, or two or more functions can be integrated in one processing module, and the integrated module can be realized in the form of hardware. It should be noted that the division of the modules in the embodiment is illustrative, and is only a logical function division. In actual implementation, another division mode can be used.
[0102] In the case of dividing each functional module according to each function, the electronic device can further include a component binding module, a listening module, an initial display module, and the like. It should be noted that all related contents of each step involved in the above method embodiment can be referred to the function description of the corresponding functional module, and will not be repeated here.
[0103] It should be understood that the electronic device provided by the embodiment of the present application is used to execute the above user interface updating method, and thus the same effect as the above implementation method can be achieved.
[0104] In the case of using an integrated unit, the electronic device can include a processing module, a storage module, an interface module, and a communication module. When the electronic device is applied to a vehicle, the processing module can be used to control and manage the actions of the vehicle. The storage module can be used to support the vehicle to execute related program codes and the like.
[0105] The processing module can be a processor or a controller, which can realize or execute various exemplary logical blocks, modules and circuits shown in combination with the disclosure of the present application. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of digital signal processing (digital signal processing, DSP) and microprocessors, and the like. The storage module can be a memory.
[0106] In addition, the electronic device provided by the embodiment of the present application can be a chip, a component or a module, the chip can include a connected processor and a memory; wherein the memory is used to store instructions, when the processor calls and executes the instructions, the chip can execute the user interface updating method provided by the above embodiment.
[0107] The embodiment further provides a computer readable storage medium, which stores computer program codes, and when the computer program codes are run on a computer, the computer is caused to execute the related method steps to realize the user interface updating method provided by the embodiment. Figure 7 As shown in the figure, the memory 705 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a user interface updating program.
[0108] The embodiment further provides a computer program product, which, when run on a computer, causes the computer to execute the related steps to realize the user interface updating method provided by the embodiment.
[0109] The electronic device, the computer readable storage medium, the computer program product or the chip provided by the embodiment are used to execute the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.
[0110] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above.
[0111] In the embodiments provided in the present application, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the electronic device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another electronic device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, and the indirect coupling or communication connection between the units or components can be electrical, mechanical or other forms.
[0112] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A user interface update method characterized by, Applied to an electronic device, the method comprises: determining data sources bound to each interaction component in a current user interface, each interaction component being created based on a component base class that implements a data change listening interface, the data sources being information reflecting device function states and / or user operations in the electronic device; listening to each data source through the data change listening interface; when a target data source that has changed is detected, updating the current user interface based on the target data source.
2. The method of claim 1, wherein, The component base class also implements a session management list for managing session objects, and the method further comprises: when each interaction component is created, determining a plurality of data sources corresponding to each interaction component, and binding the corresponding interaction component in the session object corresponding to each data source; the listening to each data source through the data change listening interface comprises: listening to the data sources corresponding to each session object in the session management list through the data change listening interface.
3. The method of claim 2, wherein, The component base class also implements an automatic update method, and the updating the current user interface based on the target data source comprises: determining a target session object corresponding to the target data source, calling the automatic update method through the target session object, and updating the current user interface with the target data source as an update parameter.
4. The method of claim 3, wherein, the calling the automatic update method through the target session object comprises: passing data change information into the data change listening interface through the target session object, and calling the automatic update method based on the data change information received by the data change listening interface.
5. The method of claim 4, wherein, the calling the automatic update method based on the data change information received by the data change listening interface, and updating the current user interface with the target data source as an update parameter comprises: after the data change listening interface receives the data change information, calling the automatic update method to parse the interface code corresponding to the current user interface, obtaining the variable position of the target interaction component in the interface code, the target interaction component being the interaction component bound to the target data source; updating the variable position according to the target data source, and displaying the user interface based on the updated interface code.
6. The method of claim 2, wherein, The method further comprises: listening to each interaction component through a life cycle listening function; when a deleted component is detected to be separated from the current user interface, unbinding the deleted component in the session object corresponding to the deleted component.
7. The method of claim 1, wherein, The method further comprises: when creating an interaction component, checking whether each to-be-created interaction component corresponds to a data source identifier; when a target to-be-created interaction component corresponds to the data source identifier, obtaining initial data through the data source identifier, and displaying the user interface based on the initial data.
8. An electronic device, comprising: comprises: a processor and a memory; wherein the memory stores a computer program, when the computer program is executed, the method as claimed in any one of claims 1 to 7 is implemented.
9. A vehicle characterized by comprising: The vehicle comprises: a memory for storing executable program code; a processor configured to call and run the executable program code from the memory, so that the vehicle performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program is executed, realizing the method according to any one of claims 1 to 7.