Interface management methods, devices, new energy vehicles and storage media

By managing the lifecycle of active components on the vehicle-mounted display screen, the display anomaly issue when the vehicle-mounted system and smart terminal are interconnected is resolved, ensuring that the interface content is displayed normally, avoiding resource waste, and improving user experience and driving safety.

CN120653352BActive Publication Date: 2025-10-31CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511173673.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2025-10-31
Estimated Expiration
2045-08-21

AI Technical Summary

Technical Problem

When vehicle infotainment systems and smart terminals are interconnected, problems such as abnormal vehicle display, black screen or gray screen, are often encountered, which affect user experience and pose a potential threat to driving safety.

Method used

By managing the lifecycle of active components in the vehicle-mounted display, comparing component identifiers and deciding whether to send a data stream request based on the comparison results, the interface lifecycle can be kept chaotic, data streams can be maintained or stopped, and the interface content can be displayed normally.

Benefits of technology

This avoids display anomalies caused by chaotic interface lifecycles, saves vehicle system resources, and improves user experience and driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653352B_ABST
    Figure CN120653352B_ABST
Patent Text Reader

Abstract

This application relates to an interface management method, apparatus, new energy vehicle, and storage medium, and pertains to the field of automotive technology. The method includes: when a vehicle-mounted system establishes a connection with a smart terminal based on a target application, the interface of the smart terminal can be displayed on the vehicle-mounted screen; the interface displayed on the vehicle-mounted screen corresponds one-to-one with active components in the system; when the first interface on the vehicle-mounted screen exits, when the lifecycle exit function contained in the first active component is called, the component identifier of the first active component is compared with the latest component identifier; if the component identifier of the first active component is different from the latest component identifier, the data flow between the vehicle-mounted system and the smart terminal is maintained; if the component identifier of the first active component is the same as the latest component identifier, a request to stop the data flow is sent to the smart terminal. This method avoids lifecycle chaos leading to abnormal vehicle-mounted screen display and also avoids resource waste in the vehicle-mounted system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of new energy vehicle technology, and in particular to an interface management method, device, new energy vehicle, storage medium, and computer program product. Background Technology

[0002] With the continuous development of intelligent vehicle technology, some cars are equipped with related applications that can connect with smart terminals such as mobile phones. This allows the mobile terminal's screen to be displayed on the vehicle's display screen, enabling users to use multiple functions of the mobile terminal through the vehicle's display screen while driving. For example, users can operate the car's control devices such as voice, touch screen, knob, and button, and use the mobile phone's navigation or music playback functions.

[0003] However, in related technologies, the interconnection between vehicle-mounted systems and smart terminals often encounters problems such as abnormal display on the vehicle side, such as a black screen, which not only affects the user experience but also poses a potential threat to driving safety. Summary of the Invention

[0004] Therefore, it is necessary to provide an interface management method, device, new energy vehicle, computer-readable storage medium, and computer program product that can solve the display abnormalities when a car and a mobile terminal are interconnected, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides an interface management method applied to an in-vehicle infotainment system, the method comprising:

[0006] When a connection is established between the target application and the smart terminal, the interface of the smart terminal is displayed on the vehicle-mounted display screen; the interface displayed on the vehicle-mounted display screen corresponds one-to-one with the active components in the vehicle system.

[0007] When the first interface on the vehicle-mounted display screen is exited, the lifecycle exit function contained in the first active component corresponding to the first interface is called, and the component identifier of the first active component is compared with the latest component identifier; the latest component identifier is the identifier of the latest active component; the latest active component is the active component with the most recent creation time;

[0008] If the component identifier of the first active component is different from the latest component identifier, maintain the data flow with the smart terminal; otherwise, send a stop data flow request to the smart terminal.

[0009] According to one embodiment of this application, it further includes:

[0010] When the second interface is invoked on the vehicle-mounted display screen, a second active component corresponding to the second interface is created, and the latest component identifier is updated to the identifier corresponding to the second active component.

[0011] According to one embodiment of this application, creating the second activity component corresponding to the second interface includes:

[0012] The lifecycle creation function of the second activity component is invoked to determine whether there is a data flow between the vehicle system and the smart terminal at the current time;

[0013] If no data stream exists, send a data stream request to the smart terminal;

[0014] If a data stream already exists, check the value of the preset target variable. If the value of the target variable is not the default value and is different from the latest component identifier, send a data stream request to the smart terminal. If the value of the target variable is the default value or is the same as the latest component identifier, do not send a data stream request to the smart terminal.

[0015] The target variable is used to store the identifier of the most recent active component that requested to stop the video stream.

[0016] According to one embodiment of this application, the method further includes:

[0017] If the component identifier of the first active component is different from the latest component identifier, a keyframe request is sent to the smart terminal.

[0018] The keyframe data returned by the smart terminal is merged into the data stream received by the latest active component;

[0019] The merged data stream is provided to the decoder corresponding to the latest active component, and the corresponding interface content is displayed on the vehicle-mounted display screen based on the decoder's decoding output.

[0020] According to one embodiment of this application, the method further includes:

[0021] For the latest active component, if the decoder corresponding to the latest active component has not been initialized when the data stream transmitted by the smart terminal is received, the data stream is stored in a preset target queue;

[0022] After the decoder initialization is completed, the data stream stored in the target queue is merged into the data stream currently received by the latest active component, and the merged data stream is provided to the decoder. Based on the decoder's decoding output, the corresponding interface content is displayed on the vehicle-mounted display screen.

[0023] According to one embodiment of this application, the method further includes:

[0024] If the target application is restarted and the active component corresponding to the restart interface has been created, and a stop data stream callback is received from the smart terminal, at least one of the following checks is performed: whether the value of the preset target variable is the default value, whether the latest component identifier is empty, and whether the value of the target variable is the same as the latest component identifier; wherein, the target variable is used to store the identifier of the active component that requested to stop the video stream the most recently;

[0025] If any check result is yes, call the shutdown function to close the restart interface, set the latest component identifier to null, and set the target variable to its default value;

[0026] If all check results are negative, skip the shutdown function to maintain the restart interface.

[0027] According to one embodiment of this application, it further includes:

[0028] If the target application is exited and all active components corresponding to the target application are destroyed, the latest component identifier is set to null, and the target variable is set to a default value.

[0029] Secondly, an interface management device is also provided for use in vehicle infotainment systems, including:

[0030] The connection display module is used to display the interface of the smart terminal through the vehicle-mounted display screen when a connection is established between the target application and the smart terminal; the interface displayed on the vehicle-mounted display screen corresponds one-to-one with the active components in the vehicle system.

[0031] The exit management module is used to, when exiting the first interface on the vehicle-side display screen, call the lifecycle exit function contained in the first active component corresponding to the first interface, and compare the component identifier of the first active component with the latest component identifier; the latest component identifier is the identifier of the latest active component; the latest active component is the active component with the most recent creation time;

[0032] The data flow management module is used to maintain the data flow with the smart terminal if the component identifier of the first active component is different from the latest component identifier; otherwise, it sends a stop data flow request to the smart terminal.

[0033] Thirdly, an automobile is also provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described in any of the above embodiments.

[0034] Fourthly, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0035] Fifthly, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0036] The aforementioned interface management method, device, vehicle, storage medium, and computer program product, when the vehicle-mounted system establishes a connection with the smart terminal based on the target application, can display the smart terminal's interface on the vehicle-mounted display screen. The interface displayed on the vehicle-mounted system corresponds one-to-one with the active components in the vehicle-mounted system, and the lifecycle of each interface is managed through these active components. To avoid confusion in the lifecycle management of each interface, when the first interface exits on the vehicle-mounted display screen, the lifecycle exit function contained in the first active component is called, comparing the component identifier of the first active component with the latest component identifier. If the component identifier of the first active component differs from the latest component identifier, no stop data flow request is sent to the smart terminal, thus maintaining the data flow between the vehicle-mounted system and the smart terminal to prevent new interface content from failing to display correctly. If the component identifier of the first active component is the same as the latest component identifier, it indicates that the stopped interface is the new interface, and a stop data flow request is sent to the smart terminal to stop the data flow, thereby promptly recovering the corresponding data transmission and processing resources. This method avoids both interface lifecycle confusion leading to abnormal vehicle-mounted display interfaces and resource waste in the vehicle-mounted system, improving user experience and driving safety. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a schematic diagram illustrating the process of displaying a mobile terminal interface on a vehicle based on a target application in related technologies.

[0039] Figure 2 A flowchart illustrating the process of exiting the target application interface from the vehicle's perspective;

[0040] Figure 3 This is a schematic diagram illustrating the lifecycle management process of the target application interface in related technologies;

[0041] Figure 4A flowchart illustrating a vehicle-side interface management method provided in one embodiment;

[0042] Figure 5 A flowchart illustrating a vehicle-side interface management method provided in another embodiment;

[0043] Figure 6 A flowchart illustrating the vehicle-side interface management method provided in yet another embodiment;

[0044] Figure 7 This is a structural block diagram of an interface management device according to one embodiment;

[0045] Figure 8 This is a structural diagram of a new energy vehicle in one embodiment. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0047] Some cars are equipped with a connectivity technology that projects the functions of mobile devices such as smartphones onto the car's display screen. After the car's infotainment system connects to the smart terminal based on this technology, users can operate various functions of their mobile phones via voice control or through car control devices such as touch screens, knobs, and buttons. These functions include operating navigation, audio software, and conference call functions on the phone. This allows users to use various mobile terminal functions intelligently and safely while driving, thereby expanding the functionality of the car's infotainment system and improving driving safety by eliminating the need for users to directly operate their phones.

[0048] like Figure 1 The diagram illustrates a process for displaying a smart terminal interface on a vehicle based on a target application in related technologies. The display process includes: when the target application on the vehicle is triggered, determining whether a connection to the mobile terminal is currently established. If a connection to the mobile terminal cannot be established, the display ends. If a successful connection to the mobile terminal has been established, the vehicle's infotainment system can request a UI (User Interface) from the connected mobile terminal. Upon receiving the request, the mobile terminal transmits a data stream containing its UI information to the vehicle's infotainment system. The vehicle's infotainment system receives the data stream from the mobile terminal, decodes and renders the data, and finally displays the mobile terminal's interface and application information on the vehicle's display screen.

[0049] like Figure 2The diagram illustrates the process of exiting the target application's connected interface in a vehicle-side application, as described in related technologies. The exit process includes: the user exits the target application on the vehicle-side; the vehicle's infotainment system sends a message to the mobile terminal to stop the data stream; upon receiving the message, the mobile terminal stops sending data to the vehicle-side application (and exits the connected interface); and upon receiving the callback from the mobile terminal indicating the data stream has stopped, the vehicle-side application disables the decoder and exits the corresponding connected interface.

[0050] However, after the vehicle's infotainment system and the mobile device connect via the target application, the vehicle's display screen may exhibit a black screen or gray screen phenomenon. A black screen means the display screen cannot display any content, showing a completely black screen. A gray screen means that after connection, the display screen shows a gray or off-white color, but the vehicle's infotainment system is actually still running. Whether it's a black screen or a gray screen, the abnormal display on the vehicle's screen severely affects the user's normal operation.

[0051] Because Activities (a system component) possess excellent lifecycle management characteristics, in some implementations, Activities are used as the interface display carrier for the target application on the vehicle side, i.e., the activity component corresponding to the vehicle-side display interface (which can be represented as cpDisplayActivity). Furthermore, logic for requesting UI data from the mobile terminal can be set in the onCreate() lifecycle function of the activity component cpDisplayActivity to quickly obtain the data stream from the mobile terminal after the interface is launched and display the corresponding interface content; simultaneously, logic for sending a request to stop the data stream to the mobile terminal can be set in the onStop() lifecycle function to stop the transmission and decoding of the data stream after the interface exits the foreground, avoiding waste of system resources. Thus, the entire process of the interface of the target application on the vehicle side from "birth" to "death" is managed through the lifecycle functions of the Activity.

[0052] The following section introduces the lifecycle management functions of Activity:

[0053] onCreate() is generally called when an Activity is first created (only once) and is used to initialize the layout, bind controls, initialize data, register listeners, etc.

[0054] onStart() is typically called when an Activity becomes visible from "invisible" to "visible". It is used to perform some lightweight operations (such as startup animation or updating UI state), but the user cannot interact with it at this time.

[0055] onResume() is generally called when an Activity enters the "foreground interactive" state. It is used to restore resources (such as playing videos or activating sensors) and gain focus, at which point the user can interact with the interface.

[0056] onPause() is usually called when an Activity is about to lose focus (such as when a part of its area is covered by a new Activity). It is used to pause time-consuming operations (such as pausing video playback) and save temporary data to avoid wasting resources.

[0057] onStop() is typically called when an Activity is completely invisible (e.g., when it is covered by a full-screen Activity) to release unnecessary resources (e.g., stop network requests, unbind non-critical listeners).

[0058] onDestroy() is usually called (only once) before the Activity is destroyed, and is used to release resources (such as canceling network requests, unregistering broadcasts, and releasing memory).

[0059] onRestart() is typically called before an Activity returns to a visible state from a stopped state. It can be used to restore the previous state (such as reloading data).

[0060] Here are some examples of Activity-based lifecycle function call flows:

[0061] (1) When a user opens the target application and displays the initial interface, the call flow of the Activity lifecycle function corresponding to the initial interface is: onCreate() → onStart() → onResume(), so that the user can interact based on the initial interface.

[0062] (2) When a user operates on an application in the initial interface and enters the corresponding application interface, the call flow of the Activity lifecycle function corresponding to the initial interface is: onPause() → onStop(), thus the initial interface enters the "stopped state" and becomes invisible.

[0063] (3) When the user returns to the initial interface, the call flow of the Activity lifecycle function corresponding to the initial interface is: onRestart() → onStart() → onResume(), thus restoring the initial interface to the interactive state.

[0064] (4) When the user closes or exits the target application, the call flow of the Activity lifecycle function corresponding to the initial interface is: onPause() → onStop() → onDestroy(), thereby completely destroying the initial interface and its corresponding Activity.

[0065] The inventors discovered through research that the black screen phenomenon after the vehicle-mounted device connects to the mobile terminal via the target application may be due to the following reasons: When the corresponding activity component cpDisplayActivity has been created and is running in the foreground, if no data stream is received from the mobile terminal, the screen will display a black screen. This phenomenon may be caused by a disorder in the Activity lifecycle management. Figure 3 As shown, this illustrates a chaotic lifecycle management situation. The blue lifecycle belongs to the new `cpDisplayActivity`, while the black lifecycle belongs to the old `cpDisplayActivity`. The new `cpDisplayActivity` is created before the old `cpDisplayActivity`'s `onStop()` function is executed. As previously mentioned, the new `cpDisplayActivity`'s `onCreate()` lifecycle function requests the UI from the mobile terminal, while the old `cpDisplayActivity`'s `onStop()` lifecycle function sends a request to stop the data flow to the mobile terminal. This results in the mobile terminal stopping the data flow with the vehicle's infotainment system based on the old `cpDisplayActivity`'s request during the display of the new `cpDisplayActivity`. The mobile terminal is not actually transmitting any data to the vehicle's infotainment system, causing the vehicle's display to show a black screen.

[0066] In view of this, in the embodiments of this application, when the vehicle-mounted system establishes a connection with the smart terminal based on the target application, the interface of the smart terminal is displayed on the vehicle-mounted screen; and the interface displayed on the vehicle-mounted system is mapped one-to-one with the active components in the vehicle-mounted system, so that the lifecycle of each interface can be managed through the active components in the vehicle-mounted system. In order to avoid confusion in the lifecycle management of each interface, when the first interface on the vehicle-mounted screen exits, when the lifecycle exit function contained in the first active component is called, a judgment logic is added, that is, comparing the component identifier of the first active component with the latest component identifier; if the component identifier of the first active component is different from the latest component identifier, the lifecycle exit function does not send a stop data flow request to the smart terminal, that is, the data flow between the vehicle-mounted system and the smart terminal is maintained to avoid the new interface content not being displayed normally; if the component identifier of the first active component is the same as the latest component identifier, it indicates that the stopped interface is the new interface. At this time, the lifecycle exit function needs to send a stop data flow request to the smart terminal to stop the data flow between the two, so as to promptly recover the corresponding data transmission and processing resources. The interface management method in this application can avoid the abnormal display interface on the vehicle due to the chaos of the interface lifecycle, and also avoid the waste of vehicle system resources, thereby improving user experience and driving safety.

[0067] In one exemplary embodiment, such as Figure 4 As shown, an interface management method is provided. Taking the application of this method to an in-vehicle infotainment system as an example, the method includes the following steps S401 to S403. Wherein:

[0068] In step S401, after establishing a connection between the target application and the smart terminal, the interface of the smart terminal is displayed on the vehicle-mounted display screen; the interface displayed on the vehicle-mounted screen corresponds one-to-one with the active components in the system.

[0069] In this embodiment, the target application refers to an application that enables the vehicle's infotainment system to interconnect with smart terminals such as mobile phones. Upon successful connection, the vehicle's display screen can show the current mobile phone's interface, and users can operate the application within it just like operating a mobile phone, thereby expanding the vehicle's infotainment system's functionality. The connection between the vehicle's infotainment system and the smart terminal based on the target application can be triggered by user operation on the vehicle or the smart terminal; there is no limitation on which.

[0070] In this case, displaying the smart terminal's interface on the vehicle-mounted display screen can mean showing the entire current interface of the smart terminal, including application functions and interface operation controls. In this scenario, the user's operation logic for operating the vehicle-mounted display screen is consistent with the logic for directly operating the mobile terminal, eliminating the need for the user to relearn or adapt.

[0071] The activity component can be the aforementioned Activity component, which contains multiple lifecycle functions. This embodiment adjusts some of these functions to manage the interface's lifecycle, making the development cycle and complexity controllable. The activity component facilitates the management of the lifecycle of each interface.

[0072] As a specific example, the activity component corresponding to the interface displayed on the vehicle can be understood as an Activity instance. For ease of explanation, this application also refers to the Activity instance as an activity component, and in some places it is also abbreviated as Activity. Therefore, in relevant scenarios, both activity component and Activity refer to an Activity instance corresponding to an interface.

[0073] Different interfaces correspond to different Activity instances, and different Activity instances can be distinguished by their respective identifiers. In one embodiment, after the Activity instance is initialized, a hash value can be determined based on the object's memory address. The hash value of each object is usually unique, even if they belong to the same class. Therefore, the hash value of the Activity instance object can be used as an identifier to distinguish different Activity instances. In other words, the identifier of an activity component can be understood as the hash value of the memory address of the Activity instance object.

[0074] In this embodiment, the lifecycle of each interface includes at least initiation, running, exiting, and destruction. The lifecycle of the interface can be efficiently managed through the lifecycle functions contained in the corresponding activity component. Specifically, the creation of the activity component can initiate the corresponding interface, the visibility of the activity component makes the corresponding interface visible to the user, the exit of the activity component makes the corresponding interface invisible to the user, and the destruction of the activity component completely exits the corresponding interface.

[0075] In step S402, when the first interface on the vehicle display screen is exited, the lifecycle exit function contained in the first active component corresponding to the first interface is called to compare the component identifier of the first active component with the latest component identifier; the latest component identifier is the identifier of the latest active component; the latest active component is the active component with the latest creation time.

[0076] The first interface can be any interface within the target application. When a user swipes the screen to switch interfaces or triggers an application on the screen, the first interface may switch from being visible in the foreground to being invisible. At this time, the active component (i.e., an Activity instance) corresponding to the first interface can call its corresponding lifecycle fallback function, such as `onStop()`. Within this lifecycle fallback function, pre-set judgment logic is executed: comparing the component identifier of the first active component with the latest component identifier, and triggering different further logic based on the result of this judgment logic. In this embodiment, the next step logic corresponding to the result of this judgment logic may include:

[0077] Send a request to stop the data stream to the smart terminal;

[0078] Do not send a stop data stream request or a keyframe request to the smart terminal.

[0079] The latest component identifier can be recorded using a pre-defined variable, such as `mCpDisplayActivity`. When a new activity component is created, the value of `mCpDisplayActivity` will be updated to the identifier of the latest created activity component. For example, when the new activity component calls `onCreate()`, the value of `mCpDisplayActivity` will be updated to the hash value of the most recently created activity component.

[0080] Step S403: If the component identifier of the first active component is different from the latest component identifier, maintain the data flow with the smart terminal; otherwise, send a stop data flow request to the smart terminal.

[0081] In one embodiment, when the active component corresponding to the first interface calls the lifecycle return function, if it is determined that the component identifier of the first active component is different from the latest component identifier recorded in the variable mCpDisplayActivity, it indicates that there is another new interface currently running. At this time, a stop data flow request should not be sent to the smart terminal, and the data flow between the mobile terminal and the smart terminal will not stop, i.e., the data flow between the mobile terminal and the smart terminal will be maintained. Otherwise, it indicates that no other interface will be launched after the first interface. At this time, a stop data flow request can be sent to the smart terminal to instruct the mobile terminal to stop transmitting data flow to the vehicle system, so as to avoid unnecessary resource overhead caused by the background still needing to receive and process data flow after exiting the target application interface.

[0082] It should be noted that the data stream in this application can be one or a combination of video stream and audio stream. Through the transmission of the data stream, the UI interface of the smart terminal can be synchronously displayed on the vehicle display screen.

[0083] The interface management method based on the above embodiments records the identifier of a newly created active component. In `onCreate()`, logic is added to update the value of a preset variable to record the identifier of the latest active component. In `onStop()`, logic is added to compare the currently stopping active component with the recorded identifier of the latest active component. If they are the same active component, `onStop()` sends a request to stop the data flow. Otherwise, it indicates that the stopping component is an old interface active component, and a new active component has been created. In this case, `onStop()` should not instruct the mobile terminal to stop the data flow; that is, `onStop()` does not send a request to stop the data flow, maintaining the data flow between the mobile terminal and the smart terminal. This method, based on the logic settings of lifecycle functions, avoids both interface lifecycle chaos leading to abnormal vehicle-side display and resource waste in the vehicle system, improving user experience and driving safety.

[0084] In one embodiment, the updating of the latest component identifier in the present application embodiment is described, including: when the second interface is invoked on the vehicle-mounted display screen, creating a second active component corresponding to the second interface, and updating the latest component identifier to the identifier corresponding to the second active component.

[0085] The second interface refers to a newly displayed interface on the vehicle's screen, without specifying its content or the scenario in which it is displayed. Whenever a new interface is displayed, the vehicle's infotainment system will create a corresponding Activity instance, i.e., a corresponding activity component.

[0086] Optionally, during the creation of the second activity component corresponding to the second interface, the lifecycle creation function of the second activity component can be called. Based on the lifecycle creation function, it can be determined whether there is a data flow between the vehicle system and the smart terminal at the current time. If there is no data flow, a data flow request is sent to the smart terminal. If there is a data flow, a data flow request does not need to be sent to the smart terminal.

[0087] As an exemplary embodiment, a judgment logic can be added to the onCreate() method to determine whether there is a data stream between the vehicle system and the smart terminal at the current time; if there is no data stream, the onCreate() method sends a data stream request to the smart terminal; if there is a data stream, the onCreate() method can perform further judgments or exit without sending a data stream request to the smart terminal.

[0088] Based on the above embodiments, a judgment logic is added to the onCreate() method of the activity component to check whether a data stream for the mobile terminal already exists. If it does not exist, the onCreate() method requests the UI from the mobile terminal; if the data stream already exists, it does not need to request the data stream again. This reduces unnecessary operations and avoids the problem that when the mobile terminal invokes the interface through a voice assistant, the vehicle system's request for the UI causes the target application interface to fail to automatically exit after the voice assistant ends.

[0089] However, the inventors further discovered that when the lifecycle creation function determines that there is a data flow between the vehicle system and the smart terminal at the current time, although there is a data flow, the old Activity may have already sent a request to the mobile terminal to stop the data flow. However, due to the time difference in the interaction, the mobile terminal has not yet responded to the request. Therefore, it is possible that the mobile terminal will stop the data flow with the vehicle system in the future because it responds to the old Activity's request to stop the data flow, which will cause the vehicle to be unable to receive the data flow of the second interface, resulting in the newly created second interface displaying abnormally.

[0090] To address this issue, in some other embodiments, during the creation of the second active component corresponding to the second interface, the lifecycle creation function of the second active component is called. Based on this lifecycle creation function, it is determined whether a data stream exists between the vehicle-mounted system and the smart terminal at the current time. If no data stream exists, a data stream request is sent to the smart terminal. If a data stream already exists, the value of a preset target variable is further checked. If the value of the target variable is not the default value and is different from the latest component identifier, a data stream request also needs to be sent to the smart terminal. If the value of the target variable is the default value or is the same as the latest component identifier, a data stream request is not sent to the smart terminal. Here, the target variable is used to store the identifier of the active component whose time of requesting to stop the video stream is most recent.

[0091] In this way, a preset target variable stores the identifier of the most recently active component that requested the mobile terminal to stop the video stream; that is, it records the identifier of the active component that most recently sent a request to stop the data stream to the mobile terminal. As an example, this target variable can be represented as `mExitHashCode`, which has a default value when no active component requests to stop the data stream. Furthermore, if `onCreate()` determines that a data stream already exists, it needs to further check the value of the target variable `mExitHashCode`. If the value of `mExitHashCode` is not the default value and is also different from the latest component identifier, it indicates that another active component has already sent a data stream request to the smart terminal. In this case, a data stream request still needs to be sent to the smart terminal to avoid the second interface's data stream failing to be received due to the mobile terminal stopping transmission because of the interaction time difference, thus preventing abnormal vehicle-side display caused by the interaction time difference.

[0092] The inventors further discovered that when the Activity lifecycle becomes disordered—for example, in the `onStop()` method, it checks whether the Activity being stopped is the most recently created Activity. If not, it might not request to stop the data stream. This means that during the transition between two Activities, the mobile terminal's video stream doesn't actually stop and retransmit, so keyframes still exist at the beginning of the video stream. In this situation, the new Activity will become a gray screen due to the lack of keyframe data.

[0093] To address this issue, in one embodiment, if the lifecycle fallback function determines that the component identifier of the first active component is different from the latest component identifier, a stop data stream request is not sent to the smart terminal; instead, a keyframe request is sent to the smart terminal. Furthermore, the keyframe data returned by the smart terminal is merged into the data stream received by the latest active component. The merged data stream is then provided to the decoder corresponding to the latest active component, and based on the decoder's decoding output, the corresponding interface content is displayed on the vehicle-side display screen.

[0094] Based on this, in onStop(), the identifier of the current Activity is compared with that of the most recently created Activity (mCpDisplayActivity). If they are not the same Activity, onStop() does not need to send a request to stop the data stream to the mobile terminal, but it does need to request a keyframe from the mobile terminal; if they are the same Activity, then onStop() sends a request to stop the data stream to the mobile terminal. This achieves normal data stream stop management, preventing black screen issues, while also ensuring that newly launched interfaces can be displayed correctly, preventing gray screen issues.

[0095] The inventors' research also revealed that the reasons for missing keyframes include: when the target application interface is passively triggered, the vehicle system first receives the data stream from the mobile terminal before launching the corresponding Activity. During this process, because launching the Activity and initializing the corresponding decoder takes time, the first few frames of the data stream sent by the mobile terminal may be missed. Since keyframes are usually located at the beginning of the data stream, even if subsequent data streams are decoded correctly, the vehicle's display screen may still show a gray or white screen due to the lack of keyframes.

[0096] To address this situation, in one embodiment, the interface management method of this application further includes:

[0097] For the latest active component, if the decoder corresponding to the latest active component has not been initialized when the data stream transmitted from the smart terminal is received, the received data stream will be stored in a preset target queue. After the decoder is initialized, the data stream stored in the target queue will be merged into the currently received data stream, and the merged data stream will be provided to the decoder. Based on the decoder's decoding output, the corresponding interface content will be displayed on the vehicle-mounted display screen.

[0098] As a supplementary explanation, in this embodiment of the application, the target queue may be pre-set as a data stream buffer queue for temporary data storage. Under normal circumstances, the data stream received by the vehicle-mounted unit can be provided to the decoder through other queues or directly. The target queue in this embodiment of the application needs to be distinguished from the queues of data streams received in other situations.

[0099] Therefore, before the decoder is fully created, the vehicle's infotainment system can store the received data stream in a preset queue. Once the decoder is ready, these data streams are inserted into the header of the newly received data stream. This ensures that key frames of the data stream are preserved, allowing the decoder to output a normal interface on the vehicle's display screen, preventing gray screen issues caused by missing key frames.

[0100] The inventors' research also revealed that during the interaction between the vehicle's infotainment system and the mobile phone based on a target application, timing issues can easily cause display abnormalities due to the inherent interaction time delay. For example, when a user swipes right to exit the target application interface, the vehicle's system sends a request to the mobile phone to stop the data flow. However, if the user subsequently taps the application icon to restart the target application interface, the vehicle's system may only then receive the callback from the mobile phone confirming that the data flow has been stopped. This can cause the vehicle's system to incorrectly terminate the latest Activity, resulting in the target application interface crashing.

[0101] Based on this, in one embodiment, the interface management method of this application further includes: when the target application is restarted and the active component corresponding to the restarted interface has been created, if a stop data stream callback sent by the smart terminal is received, performing at least one of the following checks:

[0102] Is the preset value of the target variable the default value?

[0103] Is the latest component identifier null?

[0104] Is the value of the target variable the same as the latest component identifier?

[0105] The target variable is used to store the identifier of the most recent active component that requested to stop the video stream.

[0106] If any of the checks in (1) to (3) is true, the shutdown function is called to close the restart interface. At this time, the latest component identifier is also set to null, and the target variable is set to the default value.

[0107] If all the check results in (1) to (3) are negative, the shutdown function is skipped to keep the restart interface and avoid the problem of crashing.

[0108] To address the issue of app crashes, as described in the above embodiments, another variable (represented as `mExitHashCode`) can be introduced to record the hash value of the Activity that most recently requested to stop the video stream. In Java, all objects inherit from the `Object` class, which provides a default `hashCode()` method. This method is implemented based on the object's memory address, so each object's hash value is typically unique, even if they belong to the same class. Therefore, the hash value of an Activity can be used to determine if it's the same Activity instance. When the phone's callback to stop the data stream returns, the vehicle's system compares the hash code in the callback with the hash code of the Activity currently displayed in the foreground. If they match, the Activity can be safely terminated. If they differ, it means the Activity currently displayed in the foreground is not the Activity the user wanted to terminate. In this case, no callback processing is needed to maintain the operation of the currently displayed Activity, thus preventing app crashes.

[0109] Based on the above embodiments, the interface management method of this application will be illustrated below using the example of a vehicle-mounted infotainment system and a mobile phone connected via the target application CarPlay. After the vehicle-mounted infotainment system and the mobile phone are connected via CarPlay, the vehicle-mounted infotainment system requests the video stream of the UI from the mobile phone and decodes the received video stream based on the decoder, thereby displaying the mobile phone's interface on the vehicle's display screen.

[0110] In one embodiment, Figure 5 The diagram shown is a flowchart illustrating the process of displaying a target application interface on a vehicle-side device according to an embodiment of this application. Figure 5 As shown, the specific process of the interface management method includes:

[0111] When a user triggers CarPlay and enters the corresponding initial interface, the car's infotainment system first checks if a connection has been successfully established with the phone. If the connection is not established, the current interface is closed using the relevant close method / function (e.g., the system method `finish()`). If the connection is successfully established, the initial interface's Activity is created using `onCreate()`, and the latest component identifier `mCpDisplayActivity` is updated to the identifier of this Activity within `onCreate()`. Simultaneously, the `onCreate()` method executes the following checks: whether a video stream from the phone already exists; if no video stream exists, a UI request is sent to the phone; if a video stream already exists, the system further checks whether the preset target variable `mExitHashCode` is at its default value and whether its value matches the identifier of the latest Activity.

[0112] If the target variable mExitHashCode is not a default value, and its value differs from the identifier of the latest Activity, then a UI request is sent to the phone. If the target variable mExitHashCode is a default value, or its preset value is the same as the identifier of the latest Activity, it indicates that the user wants to close the current latest Activity; in this case, no UI request is sent to the phone.

[0113] After receiving the UI request from the vehicle's infotainment system, the mobile phone begins transmitting the corresponding video stream to the system.

[0114] The vehicle's infotainment system receives the video stream and provides it to the corresponding decoder. The decoder then outputs the decoded video to display the interface content.

[0115] In another embodiment, Figure 6 In another embodiment of this application, during the process of exiting a target application interface on the vehicle side, reference is made to... Figure 6 As shown, the specific process of the interface management method includes:

[0116] Users can swipe right or up on the car's display screen to exit the current CarPlay interface.

[0117] In the onStop() method of the current Activity, determine whether the Activity that is being stopped is the same as the latest Activity. If so, send a stop video stream request to the phone. If not, it means that the Activity being stopped is the old Activity and a new Activity has been created. In this case, a stop video stream request should be sent to the phone.

[0118] In this scenario, due to the switching between two Activities, the phone's video stream doesn't actually stop and retransmit during the switch. Therefore, the new Activity might miss the complete video stream due to the time difference, especially since keyframes are often at the beginning of the video stream and can easily be missed during the switch. Based on this, in a further embodiment, if the `onStop()` method of the current Activity determines that the currently stopping Activity is different from the latest Activity, `onStop()` will send a keyframe request to the phone; otherwise, `onStop()` will send a request to stop the video stream.

[0119] In this process, a keyframe request can be sent to the mobile phone by calling the keyframe request interface provided by the mobile phone. After receiving the keyframe request, the mobile phone transmits the keyframe data of the current UI to the vehicle's infotainment system. The vehicle's infotainment system adds the keyframe data to other video streams received by the current interface Activity, and then provides the merged video stream to the corresponding decoder, thereby realizing the normal rendering and display of the UI.

[0120] In relevant embodiments, if it is determined in the `onStop()` method of the current UI Activity that the currently stopping Activity is the same as the latest Activity, it is necessary not only to send a keyframe request to the phone, but also to update the value of the target variable `mExitHashCode` to the identifier of the current UI Activity in `onStop()`. Specifically, the value of the target variable can be updated to the hash value of the current UI Activity, as long as it can uniquely identify an Activity.

[0121] It should be noted that the steps of sending a keyframe request to the mobile phone and updating the value of the target variable can be executed in parallel, or the step of sending a keyframe request to the mobile phone can be executed first and then the value of the target variable can be updated, or the value of the target variable can be updated first and then the step of sending a keyframe request to the mobile phone can be executed.

[0122] After receiving the request to stop the video stream, the mobile phone stops sending video streams to the vehicle's infotainment system and returns a callback to stop the video stream.

[0123] After receiving the callback to stop the video stream, the vehicle's infotainment system shuts down the decoder accordingly. Furthermore, it checks whether the target variable `mExitHashCode` equals its default value, whether the identifier of the latest active component `mCpDisplayActivity` is null, and whether the value of the target variable `mExitHashCode` equals the identifier of the latest active component `mCpDisplayActivity`.

[0124] Alternatively, the judgment condition can be:

[0125] The target variable mExitHashCode == default value ||

[0126] The latest activity component mCpDisplayActivity==null ||

[0127] mExitHashCode== mCpDisplayActivity.hashCode().

[0128] If this condition is met, since the phone has already received a callback to stop the video stream, it usually means that the video stream can no longer continue or that resources need to be cleared. Therefore, the vehicle's infotainment system directly calls `finish()` to close the current target application interface, sets the target variable `mExitHashCode` to its default value, and updates the latest active component `mCpDisplayActivity` to an empty value. The default value can be -1.

[0129] If this condition is not met, there is no need to process the current stopped video stream callback to ensure that the interface that the user does not want to return to works normally.

[0130] Based on the judgment conditions:

[0131] mExitHashCode == -1|| mCpDisplayActivity==null||

[0132] `mExitHashCode==mCpDisplayActivity.hashCode()` can safely and reliably handle UI exit logic, for example, it can handle two different UI exit scenarios.

[0133] Scenario 1: The vehicle's infotainment system user actively exits the target application interface.

[0134] 1. Triggering exit intent: When a user actively leaves the target application interface, the system will call lifecycle methods (or functions) such as onStop().

[0135] 2. Record the exit target: At this point, the lifecycle method code records the hash code of the UI instance being exited and assigns it to the target variable mExitHashCode. This hash code acts like an "identity tag," marking "which specific UI instance is being exited."

[0136] 3. Sending a Stop Request & Handling a Callback: The vehicle will send a request to the mobile phone (or server) to stop the video stream. Upon receiving the stop video stream callback, it will first stop resources such as the decoder.

[0137] 4. Check the interface status:

[0138] Scenario A: After stopping the decoder, the target application interface may have been completely destroyed by the system. In this case, the latest active component mCpDisplayActivity can be set to null. mCpDisplayActivity can be understood as the "identity label" of the most recently invoked interface. The condition mCpDisplayActivity == null is true. In this case, it means that the previous exit operation has been completed, and the "label" of the target variable mExitHashCode is no longer needed. Therefore, the target variable mExitHashCode is reset to the default value of -1, indicating that "there is no interface currently exiting".

[0139] Scenario B: If the target application UI instance `mCpDisplayActivity` still exists when the decoder is stopped (the user may have simply switched to another Activity, but the UI was not destroyed), the code will compare the target variable `mExitHashCode` (the previously recorded "UI tag to exit") with the currently existing `mCpDisplayActivity.hashCode()`. If they are equal, it means that the currently existing UI is the one you wanted to exit. In this case, you can safely call `finish()` to completely close it, and also reset the target variable `mExitHashCode` to -1. If they are different, it means that although there was an intention to exit, a new UI instance now exists in the foreground. In this case, the new UI should not be closed; the `finish()` operation can be skipped, allowing the new UI to continue running normally.

[0140] Scenario 2: The vehicle's infotainment system passively receives a callback from the mobile phone to stop the video stream.

[0141] 1. Triggering conditions: This usually occurs when the vehicle itself does not actively send an exit signal, but receives a callback to stop the video stream due to a problem with the mobile phone.

[0142] 2. Check Exit Intent: At this point, the code checks if the target variable mExitHashCode is the default value of -1. When the vehicle's infotainment system passively receives a stop video stream callback from the phone, the target variable mExitHashCode is generally at its default value.

[0143] 3. Exit Execution: If the target variable mExitHashCode == -1, it means there is no previous user-initiated exit screen operation record. In this case, receiving the phone's stop video stream callback usually means the video stream can no longer continue or resources need to be cleared. Therefore, the car system directly calls finish() to close the current target application interface.

[0144] Based on the embodiments of interface display process control and interface exit process control described above, a context-aware resource management strategy based on activity component identifiers is proposed to address interface anomalies caused by timing issues in vehicle-to-mobile phone interaction. This strategy assigns a unique identifier to each Activity instance and tracks its state in real time, thereby achieving more refined resource control. This strategy is not only applicable to video streams but can also be extended to various resource types such as audio streams and data connections, effectively avoiding resource conflicts caused by context switching, improving system stability, and enhancing the reliability and robustness of integrating target applications such as CarPlay into the vehicle system.

[0145] Furthermore, by constructing an Activity lifecycle optimization framework centered on user experience, user experience is taken as the core optimization goal. By dynamically adjusting the Activity lifecycle and resource allocation strategy, the visible display anomalies of the vehicle user are minimized, the perceived performance and satisfaction of the user are improved, and the hidden danger of display failures distracting the driver's attention is eliminated.

[0146] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0147] Based on the same inventive concept, this application also provides an interface management device for implementing the interface management method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more interface management device embodiments provided below can be found in the limitations of the interface management method described above, and will not be repeated here.

[0148] In one embodiment, such as Figure 7 As shown, an interface management device is provided for use in an in-vehicle infotainment system. The device may include:

[0149] The connection display module 701 is used to display the interface of the smart terminal through the vehicle-mounted display screen when a connection is established between the target application and the smart terminal; the interface displayed on the vehicle-mounted display screen corresponds one-to-one with the active components in the vehicle system.

[0150] The exit management module 702 is used to, when exiting the first interface on the vehicle-side display screen, call the lifecycle exit function contained in the first active component corresponding to the first interface, and compare the component identifier of the first active component with the latest component identifier; the latest component identifier is the identifier of the latest active component; the latest active component is the active component with the latest creation time;

[0151] The data flow management module 703 is used to maintain the data flow with the smart terminal if the component identifier of the first active component is different from the latest component identifier; otherwise, it sends a stop data flow request to the smart terminal.

[0152] Based on this embodiment, the interface management device applicable to in-vehicle systems, under the function of the connection display module, if the in-vehicle system establishes a connection with the smart terminal based on the target application, the interface of the smart terminal can be displayed on the vehicle-mounted display screen. Simultaneously, the interface displayed on the vehicle-mounted screen corresponds one-to-one with the active components of the system. The lifecycle of each interface is managed through these active components within the in-vehicle system. To avoid confusion in the lifecycle management of each interface, when the first interface exits on the vehicle-mounted display screen, the exit management module calls the lifecycle exit function contained in the first active component. It then compares the component identifier of the first active component with the latest component identifier and passes the comparison result to the data flow management module. If the component identifier of the first active component is different from the latest component identifier, the data flow management module controls the data flow between the in-vehicle system and the smart terminal to prevent the new interface content from failing to display correctly. If the component identifier of the first active component is the same as the latest component identifier, it indicates that the stopped interface is the new interface. In this case, the data flow management module needs to send a stop data flow request to the smart terminal to stop the data flow between them, thereby promptly recovering the corresponding data transmission and processing resources. The above solution can avoid the abnormal display interface on the vehicle due to the chaos of the interface lifecycle, and also avoid the waste of vehicle system resources, thereby improving user experience and driving safety.

[0153] In one embodiment, the interface management device further includes: a creation management module, configured to create a second active component corresponding to the second interface when the vehicle-mounted display screen invokes the second interface, and update the latest component identifier to the identifier corresponding to the second active component.

[0154] In one specific embodiment, a management module is created, specifically used to call the lifecycle creation function of the second activity component to determine whether there is a data flow between the vehicle system and the smart terminal at the current time; if there is no data flow, a data flow request is sent to the smart terminal; if there is a data flow, no data flow request is sent to the smart terminal.

[0155] In another specific embodiment, a management module is created, specifically used to call the lifecycle creation function of the second activity component to determine whether there is a data flow between the vehicle system and the smart terminal at the current time;

[0156] If no data stream exists, send a data stream request to the smart terminal;

[0157] If a data stream already exists, check the value of the preset target variable. If the value of the target variable is not the default value and is different from the latest component identifier, send a data stream request to the smart terminal. If the value of the target variable is the default value or is the same as the latest component identifier, do not send a data stream request to the smart terminal.

[0158] The target variable is used to store the identifier of the active component whose time of requesting to stop the data stream is most recent.

[0159] In one embodiment, the aforementioned exit management module is further configured to send a keyframe request to the smart terminal when the component identifier of the first active component is different from the latest component identifier; in addition, the interface management device further includes: a decoding management module, configured to merge the keyframe data returned by the smart terminal into the data stream received by the latest active component; provide the merged data stream to the decoder corresponding to the latest active component, and display the corresponding interface content on the vehicle-mounted display screen based on the decoding output of the decoder.

[0160] In one embodiment, the interface management device further includes: a decoding management module, configured to, for the latest active component, if the decoder corresponding to the latest active component has not completed initialization when receiving the data stream transmitted by the smart terminal, store the data stream in a preset target queue; after the decoder initialization is completed, merge the data stream stored in the target queue into the data stream currently received by the latest active component, provide the merged data stream to the decoder, and display the corresponding interface content on the vehicle-mounted display screen based on the decoding output of the decoder.

[0161] In one embodiment, the interface management device further includes: a callback processing module, configured to, when the target application is restarted and the active component corresponding to the restarted interface has been created, perform at least one of the following checks if a stop data stream callback sent by the smart terminal is received: whether the value of a preset target variable is a default value, whether the latest component identifier is null, and whether the value of the target variable is the same as the latest component identifier; wherein, the target variable is used to store the identifier of the active component whose time of requesting to stop the video stream is most recent;

[0162] If any check result is yes, call the shutdown function to close the restart interface, set the latest component identifier to null, and set the target variable to its default value;

[0163] If all check results are negative, skip the shutdown function to maintain the restart interface.

[0164] In one embodiment, the exit management module is further configured to set the latest component identifier to a null value and set the target variable to a default value when the target application is exited and all active components corresponding to the target application are destroyed.

[0165] Each module in the aforementioned interface management device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the new energy vehicle in hardware form or independent of it, or stored in the memory of the new energy vehicle in software form, so that the processor can call and execute the operations corresponding to each module.

[0166] In one exemplary embodiment, a new energy vehicle is provided, the internal structure of which can be shown in the following diagram. Figure 8As shown, the new energy vehicle includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a vehicle braking control method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the new energy vehicle can be a touch layer covering the display screen, or it can be a button, trackball, or touchpad installed in the new energy vehicle.

[0167] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0168] In one exemplary embodiment, a new energy vehicle is provided, the structural diagram of which can be as follows: Figure 8 As shown, the new energy vehicle includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the foregoing embodiments.

[0169] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0170] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0171] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0172] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0173] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An interface management method, characterized in that, Applied to in-vehicle infotainment systems, the method includes: When a connection is established between the target application and the smart terminal, the interface of the smart terminal is displayed on the vehicle-mounted display screen; the interface displayed on the vehicle-mounted display screen corresponds one-to-one with the active components in the vehicle system. When the first interface on the vehicle-mounted display screen is exited, the lifecycle exit function contained in the first active component corresponding to the first interface is called, and the component identifier of the first active component is compared with the latest component identifier; the latest component identifier is the identifier of the latest active component; the latest active component is the active component with the most recent creation time; If the component identifier of the first active component is different from the latest component identifier, maintain the data flow with the smart terminal; otherwise, send a stop data flow request to the smart terminal. It also includes: sending a keyframe request to the smart terminal when the component identifier of the first active component is different from the latest component identifier; merging the keyframe data returned by the smart terminal into the data stream received by the latest active component; providing the merged data stream to the decoder corresponding to the latest active component; and displaying the corresponding interface content on the vehicle-mounted display screen based on the decoding output of the decoder.

2. The method according to claim 1, characterized in that, Also includes: When the second interface is invoked on the vehicle-mounted display screen, a second active component corresponding to the second interface is created, and the latest component identifier is updated to the identifier corresponding to the second active component.

3. The method according to claim 2, characterized in that, The creation of the second activity component corresponding to the second interface includes: The lifecycle creation function of the second activity component is invoked to determine whether there is a data flow between the vehicle system and the smart terminal at the current time; If no data stream exists, send a data stream request to the smart terminal; If a data stream already exists, do not send a data stream request to the smart terminal.

4. The method according to claim 2, characterized in that, The creation of the second activity component corresponding to the second interface includes: The lifecycle creation function of the second activity component is invoked to determine whether there is a data flow between the vehicle system and the smart terminal at the current time; If no data stream exists, send a data stream request to the smart terminal; If a data stream already exists, check the value of the preset target variable. If the value of the target variable is not the default value and is different from the latest component identifier, send a data stream request to the smart terminal. If the value of the target variable is the default value or is the same as the latest component identifier, do not send a data stream request to the smart terminal. The target variable is used to store the identifier of the active component whose time of requesting to stop the data stream is most recent.

5. The method according to claim 1, characterized in that, The method further includes: For the latest active component, if the decoder corresponding to the latest active component has not been initialized when the data stream transmitted by the smart terminal is received, the data stream is stored in a preset target queue; After the decoder initialization is completed, the data stream stored in the target queue is merged into the data stream currently received by the latest active component, and the merged data stream is provided to the decoder. Based on the decoder's decoding output, the corresponding interface content is displayed on the vehicle-mounted display screen.

6. The method according to claim 1, characterized in that, The method further includes: If the target application is restarted and the active component corresponding to the restart interface has been created, and a stop data stream callback is received from the smart terminal, at least one of the following checks is performed: whether the value of the preset target variable is the default value, whether the latest component identifier is empty, and whether the value of the target variable is the same as the latest component identifier; wherein, the target variable is used to store the identifier of the active component that requested to stop the video stream the most recently; If any check result is yes, call the shutdown function to close the restart interface, set the latest component identifier to null, and set the target variable to its default value; If all check results are negative, skip the shutdown function to maintain the restart interface.

7. The method according to claim 4 or 6, characterized in that, Also includes: If the target application is exited and all active components corresponding to the target application are destroyed, the latest component identifier is set to null, and the target variable is set to a default value.

8. An interface management device, characterized in that, Applications in in-vehicle infotainment systems include: The connection display module is used to display the interface of the smart terminal through the vehicle-mounted display screen when a connection is established between the target application and the smart terminal; the interface displayed on the vehicle-mounted display screen corresponds one-to-one with the active components in the vehicle system. The exit management module is used to, when exiting the first interface on the vehicle-side display screen, call the lifecycle exit function contained in the first active component corresponding to the first interface, and compare the component identifier of the first active component with the latest component identifier; the latest component identifier is the identifier of the latest active component; the latest active component is the active component with the most recent creation time; The data flow management module is used to maintain the data flow with the smart terminal if the component identifier of the first active component is different from the latest component identifier; otherwise, it sends a stop data flow request to the smart terminal. The exit management module is also used to send a keyframe request to the smart terminal when the component identifier of the first active component is different from the latest component identifier. The interface management device further includes: a decoding management module, used to merge the keyframe data returned by the smart terminal into the data stream received by the latest active component; provide the merged data stream to the decoder corresponding to the latest active component; and display the corresponding interface content on the vehicle-mounted display screen based on the decoding output of the decoder.

9. A new energy vehicle, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • Terminal screen projection display method, terminal and storage medium

    CN113485667A

  • Display screen blank screen processing method and system, electronic equipment and storage medium

    CN118386933A