Service component calling method of vehicle-mounted application and vehicle
By defining exclusive binding requirements and priorities in in-vehicle applications, and combining exclusive binding mechanisms and arbitration scenarios, the instability and uncontrollability of in-vehicle applications calling service components are resolved, achieving dynamic allocation and stability of resources.
Patent Information
- Application Number
- CN202511544779.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-27
AI Technical Summary
When in-vehicle applications call service components, there are issues with unstable and uncontrollable execution results.
By acquiring the target in-vehicle application that needs to be launched in the current business scenario, determining its exclusive binding requirements, and determining the priority based on the exclusive binding requirements, the system controls the service components to respond to service call requests in conjunction with the exclusive binding mechanism and arbitration scenario, thereby achieving dynamic allocation and stability of resources.
It improves resource utilization efficiency, ensures the stability and controllability of service components during execution, and solves the problems of unstable and uncontrollable execution results.
Smart Images

Figure CN121411902A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software architecture technology, and in particular to a method, device and vehicle for invoking service components of an in-vehicle application. Background Technology
[0002] In-vehicle SOA (Service-Oriented Architecture) services are characterized by loose coupling, statelessness, and self-containment. The software providing the service API (Application Programming Interface) does not distinguish the source of the caller.
[0003] Among related technologies, some methods involve mapping the same function to service components with different priorities, thereby differentiating priorities through these different service components. Other methods employ dynamic priority design, assigning priority values based on different weights, but these solutions are more complex to implement. Summary of the Invention This application provides a method, apparatus, and vehicle for invoking service components in vehicle applications, in order to solve the problems of unstable and uncontrollable execution results when invoking service components in vehicle applications in related technologies.
[0004] The first aspect of this application provides a method for invoking a service component of an in-vehicle application, comprising the following steps: obtaining a target in-vehicle application that needs to be started in the current business scenario; determining the exclusive binding requirement of the target in-vehicle application based on the current business scenario, wherein the exclusive binding requirement is whether the target in-vehicle application needs to exclusively bind to a target service component; determining the priority of the target in-vehicle application based on the exclusive binding requirement of the target in-vehicle application; and controlling the target service component to respond to the service invoking request of the target in-vehicle application based on the priority of the target in-vehicle application and the current scenario of the target service component, wherein the priority of the target in-vehicle application that needs to exclusively bind to the target service component is greater than the priority of the target in-vehicle application that does not need to exclusively bind to the target service component.
[0005] Optionally, the priority of the target vehicle application is determined based on its exclusive binding requirement, including: if the exclusive binding requirement of the target vehicle application is that it does not need to exclusively bind the target service component, then the priority of the target vehicle application that does not need to exclusively bind the target service component is determined as the preset priority; if the exclusive binding requirement of the target vehicle application is that it needs to exclusively bind the target service component, then the priority of the target vehicle application is determined based on the current business scenario.
[0006] Optionally, the priority of the target vehicle application can be determined based on the current business scenario, including: obtaining a pre-defined correspondence table between business scenarios and priorities; and querying the correspondence table using the current business scenario as an index to obtain the priority of the target vehicle application.
[0007] Optionally, based on the priority of the target in-vehicle application and the current scenario of the target service component, the target service component is controlled to respond to the service call request of the target in-vehicle application, including: identifying whether the current scenario of the target service component is an arbitration scenario, wherein an arbitration scenario is a scenario in which multiple in-vehicle applications call the target service component; if the current scenario of the target service component is a non-arbitration scenario, then the target service component is controlled to respond to the service call request of the target in-vehicle application according to the priority of the target in-vehicle application; if the target service component is an arbitration scenario, then the priority of the current in-vehicle application is obtained, and the target service component is controlled to respond to the service call request of the target in-vehicle application according to the priority of the current in-vehicle application and the priority of the target in-vehicle application.
[0008] Optionally, based on the priority of the target vehicle application, the target service component is controlled to respond to the service call request of the target vehicle application, including: if the priority of the target vehicle application is a preset priority, the target vehicle application is activated and the target service component is controlled to respond to the service call request of the target vehicle application; if the priority of the target vehicle application is greater than the preset priority, the target vehicle application is activated, the target vehicle application is exclusively bound to the target service component, and the target service component is controlled to respond to the service call request of the target vehicle application.
[0009] Optionally, based on the priority of the current in-vehicle application and the priority of the target in-vehicle application, the target service component is controlled to respond to the service call request of the target in-vehicle application, including: if the priority of the current in-vehicle application is a preset priority, then when the priority of the current in-vehicle application is equal to the priority of the target in-vehicle application, the service call request of the current in-vehicle application is disconnected, and the target service component is controlled to respond to the service call request of the target in-vehicle application; when the priority of the current in-vehicle application is less than the priority of the target in-vehicle application, the target in-vehicle application is activated, the target in-vehicle application is exclusively bound to the target service component, and the target service component is controlled to respond to the service call request of the target in-vehicle application; if the priority of the current in-vehicle application is greater than the preset priority, then when the priority of the current in-vehicle application is greater than the priority of the target in-vehicle application, the target service component is controlled to refuse to respond to the service call request of the target in-vehicle application; when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, the target service component is controlled to respond to the service call request of the target in-vehicle application.
[0010] Optionally, when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, the target service component is controlled to respond to the service call request of the target in-vehicle application, including: when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, activating the target in-vehicle application; after the target in-vehicle application completes the service call request of the current in-vehicle application, obtaining whether the previous in-vehicle application needs to support rollback operation; if the previous in-vehicle application does not need to support rollback operation, then exiting the current in-vehicle application, exclusively binding the target in-vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target in-vehicle application; if the current in-vehicle application needs to support rollback operation, after the target service component executes the service call request of the current in-vehicle application, triggering the current in-vehicle application to call the target service component to execute the rollback operation; after the current service component completes the rollback operation, releasing the exclusive binding between the current in-vehicle application and the target service component, exiting the current in-vehicle application, exclusively binding the target in-vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target in-vehicle application.
[0011] Optionally, after exclusively binding the target vehicle application to the target service component and controlling the target service component to respond to the service call request of the target vehicle application, the method further includes: obtaining whether the target vehicle application needs to support rollback operations; if the target vehicle application does not need to support rollback operations, then after the target service component completes the call action of the target vehicle application, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits; if the target vehicle application needs to support rollback operations, then after the target service component completes the service call request of the target vehicle application, the target vehicle application is triggered to call the target service component to perform rollback operations, and after the target service component completes the rollback operations, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits.
[0012] A second aspect of this application provides a service component invocation device for an in-vehicle application, comprising: an acquisition module for acquiring a target in-vehicle application that needs to be launched in the current business scenario; a determination module for determining the exclusive binding requirement of the target in-vehicle application based on the current business scenario, wherein the exclusive binding requirement is whether the target in-vehicle application needs to exclusively bind to a target service component; and a control module for determining the priority of the target in-vehicle application based on the exclusive binding requirement of the target in-vehicle application, and controlling the target service component to respond to the service invocation request of the target in-vehicle application based on the priority of the target in-vehicle application and the current scenario of the target service component, wherein the priority of the target in-vehicle application that needs to exclusively bind to the target service component is greater than the priority of the target in-vehicle application that does not need to exclusively bind to the target service component.
[0013] Optionally, the control module is further configured to: if the exclusive binding requirement of the target vehicle application is that it does not need to exclusively bind the target service component, then determine the priority of the target vehicle application that does not need to exclusively bind the target service component as the preset priority; if the exclusive binding requirement of the target vehicle application is that it does not need to exclusively bind the target service component, then determine the priority of the target vehicle application according to the current business scenario.
[0014] Optionally, the control module is further configured to: obtain a pre-defined correspondence table between business scenarios and priorities; and query the correspondence table using the current business scenario as an index to obtain the priority of the target vehicle application.
[0015] Optionally, the control module is further configured to: identify whether the current scenario of the target service component is an arbitration scenario, wherein the arbitration scenario is a scenario in which multiple vehicle applications call the target service component; if the current scenario of the target service component is a non-arbitration scenario, then control the target service component to respond to the service call request of the target vehicle application according to the priority of the target vehicle application; if the target service component is an arbitration scenario, then obtain the priority of the current vehicle application, and control the target service component to respond to the service call request of the target vehicle application according to the priority of the current vehicle application and the priority of the target vehicle application.
[0016] Optionally, the control module is further configured to: activate the target vehicle application if the priority of the target vehicle application is a preset priority, and control the target service component to respond to the service call request of the target vehicle application; if the priority of the target vehicle application is greater than the preset priority, activate the target vehicle application, exclusively bind the target vehicle application to the target service component, and control the target service component to respond to the service call request of the target vehicle application.
[0017] Optionally, the control module is further configured to: if the priority of the current in-vehicle application is a preset priority, then when the priority of the current in-vehicle application is equal to the priority of the target in-vehicle application, disconnect the service call request of the current in-vehicle application and control the target service component to respond to the service call request of the target in-vehicle application; when the priority of the current in-vehicle application is less than the priority of the target in-vehicle application, activate the target in-vehicle application, exclusively bind the target in-vehicle application to the target service component, and control the target service component to respond to the service call request of the target in-vehicle application; if the priority of the current in-vehicle application is greater than the preset priority, then when the priority of the current in-vehicle application is greater than the priority of the target in-vehicle application, control the target service component to refuse to respond to the service call request of the target in-vehicle application; when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, control the target service component to respond to the service call request of the target in-vehicle application.
[0018] Optionally, the control module is further configured to: activate the target vehicle application when the priority of the current vehicle application is less than or equal to the priority of the target vehicle application; after the target vehicle application completes the service call request of the current vehicle application, determine whether the previous vehicle application needs to support rollback operations; if the previous vehicle application does not need to support rollback operations, exit the current vehicle application, exclusively bind the target vehicle application to the target service component, and control the target service component to respond to the service call request of the target vehicle application; if the current vehicle application needs to support rollback operations, after the target service component executes the service call request of the current vehicle application, trigger the current vehicle application to call the target service component to perform rollback operations; after the current service component completes the rollback operations, release the exclusive binding between the current vehicle application and the target service component, exit the current vehicle application, exclusively bind the target vehicle application to the target service component, and control the target service component to respond to the service call request of the target vehicle application.
[0019] Optionally, the device further includes: a release module, configured to exclusively bind the target vehicle application to the target service component, and after the target service component responds to the service call request of the target vehicle application, determine whether the target vehicle application needs to support rollback operations; if the target vehicle application does not need to support rollback operations, then after the target service component completes the call action of the target vehicle application, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits; if the target vehicle application needs to support rollback operations, then after the target service component completes the service call request of the target vehicle application, the target vehicle application is triggered to call the target service component to perform rollback operations, and after the target service component completes the rollback operations, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits.
[0020] A third aspect of this application provides a vehicle, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the service component invocation method of the in-vehicle application as described in the above embodiments.
[0021] Therefore, this application has the following beneficial effects: This application's embodiments can determine the exclusive binding requirement of a target in-vehicle application based on the current business scenario, determine the priority of the target in-vehicle application based on the existence of an exclusive binding requirement, and combine the priority of the target in-vehicle application with the current scenario to realize service component invocation, thereby meeting the service component invocation requirements under the current business scenario. In conjunction with the exclusive binding service component mechanism, the response of the target service component to service invocation requests is controlled. Target in-vehicle applications that require exclusive binding and those that do not are assigned different priorities, and service component invocation is realized according to different priorities. This achieves dynamic allocation of resources under the current business scenario, improves resource utilization efficiency, and ensures the stability and controllability of service components during execution. Therefore, it solves the technical problems of unstable and uncontrollable execution results when in-vehicle applications call service components in related technologies.
[0022] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0023] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a service component invocation method for an in-vehicle application according to an embodiment of this application; Figure 2 This is an example diagram illustrating the calling relationship between arbitration software, in-vehicle applications, and service components according to an embodiment of this application. Figure 3 This is a schematic diagram of the application calling service components under the first condition provided in the embodiments of this application; Figure 4 This is a schematic diagram illustrating the process of an application invoking a service component under the second condition provided in the embodiments of this application; Figure 5 This is a schematic diagram illustrating the process of an application invoking a service component under the third condition provided in the embodiments of this application; Figure 6 This is an example diagram of a service component invocation device for an in-vehicle application according to an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a vehicle according to an embodiment of this application. Detailed Implementation
[0024] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0025] The following description, with reference to the accompanying drawings, outlines a method, apparatus, and vehicle for invoking service components in an in-vehicle application according to embodiments of this application. Addressing the issues of unstable and uncontrollable execution results when invoking service components in in-vehicle applications, as mentioned in the background section, this application provides a method for invoking service components in an in-vehicle application. This method determines the exclusive binding requirement of the target in-vehicle application based on the current business scenario and determines the priority of the target in-vehicle application. By employing a fixed priority rollback design for both arbitration and non-arbitration scenarios, combined with an exclusive binding service component mechanism, the method controls the target service component's response to service call requests. This achieves a priority arbitration strategy for fixed exclusive binding service components and dynamic resource allocation, improving resource utilization efficiency and ensuring the orderliness, logic, stability, and controllability of service components during execution. Therefore, it solves the problems of unstable and uncontrollable execution results when invoking service components in in-vehicle applications in related technologies.
[0026] Specifically, Figure 1 This is a flowchart illustrating a service component invocation method for an in-vehicle application provided in an embodiment of this application.
[0027] like Figure 1 As shown, the service component invocation method of this in-vehicle application includes the following steps: In step S101, the target vehicle application that needs to be launched in the current business scenario is obtained.
[0028] Understandably, the current business scenario refers to specific needs triggered by user behavior, environmental changes, or system status during vehicle operation; the target in-vehicle application refers to the in-vehicle application that needs to be launched in the current business scenario, such as in-vehicle navigation applications, in-vehicle music applications, and driver assistance applications. In actual use, users can input the target in-vehicle application to be launched through voice, in-vehicle system, etc. For example, if a user voice inputs "Please open the navigation application", then the target in-vehicle application to be launched in the current business scenario can be determined as the navigation application based on the user's voice command.
[0029] For example, in the current business scenario where the vehicle enters the highway and activates adaptive cruise control, the target in-vehicle application to be launched could be an advanced driver assistance system; in the current business scenario where the vehicle is traveling long distances with family, the target in-vehicle application could be an application with entertainment and care functions specifically for children; in the current business scenario where the vehicle's battery level is below 20%, the target in-vehicle application could be a charging reservation function; and in the current business scenario where the driver is fatigued or distracted, the target in-vehicle application could be an application with a refresher function and a recommendation of rest stops.
[0030] Therefore, the embodiments of this application can identify the current business scenario and determine the target vehicle application that needs to be launched under the current business scenario, thereby dynamically adjusting resources such as computing power and bandwidth according to the current business scenario to achieve dynamic resource allocation.
[0031] In step S102, the exclusive binding requirement of the target vehicle application is determined based on the current business scenario. The exclusive binding requirement is whether the target vehicle application needs to exclusively bind to the target service component.
[0032] Among them, the exclusive binding requirement refers to whether the target in-vehicle application needs to exclusively bind to the target service component.
[0033] It is understood that, based on the current business scenario obtained, the exclusive binding requirement of the target vehicle application can be determined, and the target server component for exclusive binding of the target vehicle application under the current business scenario can be determined. The target server component can be a service API.
[0034] For example, in in-vehicle applications, application A's exclusive binding of a service component means that application A obtains exclusive access to a specific service component through a protocol or mechanism, ensuring that during the binding period, the in-vehicle application can only be called by application A, and other applications cannot interfere.
[0035] Exclusive binding requires service components to be isolated from other applications at the logical or physical level through methods such as mutex locks, hardware isolation, and communication protocol restrictions. Exclusive binding is usually combined with priority policies through static priority allocation and dynamic priority adjustment to ensure that critical applications have priority in obtaining resources.
[0036] This application embodiment determines the exclusive binding requirement of the target vehicle application by obtaining the current business scenario. It can determine the components that the target vehicle application is exclusively bound to in the current business scenario, so as to achieve non-interference and uninterrupted execution of the target vehicle application, and improve the stability and controllability of the service components during the execution process.
[0037] In step S103, the priority of the target vehicle application is determined according to its exclusive binding requirement. Based on the priority of the target vehicle application and the current scenario of the target service component, the target service component is controlled to respond to the service call request of the target vehicle application. The priority of the target vehicle application that needs to exclusively bind to the target service component is greater than the priority of the target vehicle application that does not need to exclusively bind to the target service component.
[0038] Priority refers to the rules that rank tasks, requests, or goals according to their importance and urgency; a service call request is the process in a distributed software architecture where a service caller initiates a function or data request to another service callee.
[0039] Understandably, by determining the priority of a target in-vehicle application through its exclusive binding requirements, and by controlling the response of the target service component to the service call request of the target in-vehicle application based on the priority of the target in-vehicle application and the current scenario of the target service component, it is possible to achieve reasonable allocation and efficient scheduling of in-vehicle system resources, avoid resource competition and conflicts between multiple applications, ensure the priority response rights of critical applications, adapt to functional requirements under different scenarios, and ultimately improve the operational stability, functional security, and user experience coordination of the in-vehicle system.
[0040] For example, when a vehicle is in motion, the ADAS automatic emergency braking module needs to exclusively use sensor service components such as cameras and millimeter-wave radar to monitor obstacles in real time. Because of this exclusive binding requirement, this module has a higher priority than navigation applications that only need to call sensor data for background road condition analysis. The sensor service components will respond to the call of the automatic emergency braking module first to ensure that safety monitoring is not interfered with in emergency situations.
[0041] For example, when a vehicle is in reverse gear, the reversing camera application needs to exclusively use the rear camera and the in-vehicle display service component to display the reversing image in real time. Because of this exclusive binding requirement, the application has higher priority than audio-visual applications that only need to use the display to play entertainment videos. The display service component will pause the audio-visual content and prioritize responding to the call of the reversing camera to ensure the immediacy of the reversing operation.
[0042] Furthermore, in the embodiments of this application, determining the priority of the target vehicle application based on its exclusive binding requirement includes: if the exclusive binding requirement of the target vehicle application is that it does not need to exclusively bind the target service component, then the priority of the target vehicle application that does not need to exclusively bind the target service component is determined to be a preset priority; if the exclusive binding requirement of the target vehicle application is that it needs to exclusively bind the target service component, then the priority of the target vehicle application is determined based on the current business scenario.
[0043] Among them, the preset priority is a sorting rule that is pre-determined by analyzing factors such as business objectives, risk impact, and resource constraints before any task or request is generated.
[0044] Understandably, determining the priority of a target in-vehicle application based on its exclusive binding requirement, setting the target in-vehicle application that does not require exclusive binding to a preset priority, and setting the priority of the target in-vehicle application that requires exclusive binding according to the current business scenario, can accurately adapt to the in-vehicle scenario and ensure the driver's driving safety and the timeliness, accuracy, and anti-interference of in-vehicle application use.
[0045] Specifically, based on the user scenario on the C-end, the exclusive binding status of the in-vehicle application A to the service component is determined. If the in-vehicle application needs to continuously monitor the status of the service component during the activation process, then the in-vehicle application is bound to the service component, that is, the in-vehicle application A is exclusively bound to the service component, and the priority of A is determined to be n (n>0, n is a positive integer) according to the current business scenario. If the in-vehicle application does not need to continuously monitor the status of the service component during the activation process, then the in-vehicle application does not need to bind to the service component, that is, the in-vehicle application A is not exclusively bound to the service component, and the priority of A is determined to be 0, that is, the preset priority.
[0046] For example, urban road navigation applications need to continuously monitor the status of the monitoring service component and need to exclusively bind to the service component. Based on the current vehicle navigation scenario, the priority of the urban road navigation application is determined to be 1. Similarly, the energy management application, which controls charging, needs to continuously monitor the status of the monitoring service component and needs to exclusively bind to the service component. Based on the current vehicle charging scenario, the priority of the energy management application is determined to be 1. The child entertainment control application, which manages the rear-seat screen, needs to continuously monitor the status of the monitoring service component and needs to exclusively bind to the service component. Based on the current rear-seat screen scenario, the priority of the child entertainment control application is determined to be 1. Third-party video applications, in-car calculator applications, news push applications, and third-party music applications do not need to continuously monitor the status of the monitoring service component or exclusively bind to the target service component. These applications are given a priority of 0. This ensures that when a high-priority application needs resources, the above applications will be paused, restricted, or forcibly closed, prioritizing the release of resources to the high-priority application.
[0047] Furthermore, in the embodiments of this application, determining the priority of the target vehicle application based on the current business scenario includes: obtaining a pre-defined correspondence table between business scenarios and priorities; and querying the correspondence table using the current business scenario as an index to obtain the priority of the target vehicle application.
[0048] The correspondence table is a mapping table that shows how priorities change with pre-defined business scenarios.
[0049] Understandably, by obtaining and querying a pre-defined table of correspondence between business scenarios and priorities, the priority of the target in-vehicle application in the current business scenario is obtained, and the execution order of the in-vehicle application in the current business scenario is determined, ensuring that the execution of the in-vehicle application is consistent with expectations and improving the stability of the in-vehicle application service.
[0050] Specifically, a pre-defined table mapping business scenarios to priorities is stored in the vehicle. The priority of the target in-vehicle application in the current business scenario can be retrieved from this table. For example, in a weekday commuting scenario, the priority of the navigation map is 1, traffic updates are 2, news podcasts are 3, and phone calls are 4. In a long-distance highway driving scenario, the priority of the intelligent cruise assist status page is 1, the priority of the navigation map is 2, the priority of gas station / service area reminders is 2, and the long-distance music playlist is 3. In an electric vehicle low-battery emergency scenario, the priority of the low-battery warning card is 1, the priority of charging station search navigation is 1, and the priority of the air conditioning system is 5. In a rainy nighttime urban driving scenario, the priority of the rearview mirror / window defroster is 1, the priority of the navigation map is 2, and the priority of music / radio is 4. In a parking and waiting-to-pick-up scenario, the priority of the video player is 1, the priority of the air conditioning system is 2, and the priority of seat massage / ventilation is 3.
[0051] Furthermore, in the embodiments of this application, controlling the target service component to respond to the service call request of the target vehicle application based on the priority of the target vehicle application and the current scenario of the target service component includes: identifying whether the current scenario of the target service component is an arbitration scenario, wherein the arbitration scenario is a scenario in which multiple vehicle applications call the target service component; if the current scenario of the target service component is a non-arbitration scenario, then controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the target vehicle application; if the target service component is an arbitration scenario, then obtaining the priority of the current vehicle application, and controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the current vehicle application and the priority of the target vehicle application.
[0052] Arbitration is a scenario where two or more callers simultaneously request the use of a target service component, and the service component cannot meet all requests due to hardware limitations or logical constraints. In such cases, a neutral arbitrator or pre-defined rules are required to ultimately determine which service component to use.
[0053] Understandably, by identifying the arbitration scenario of the current scenario of the target service component, in non-arbitration scenarios, the application is executed directly according to the priority of the target vehicle application; in arbitration scenarios, the priorities of the target vehicle application and the current vehicle application are compared, and the application with higher priority is executed to dynamically allocate resources, ensure the core needs of driving safety, ensure that high-priority applications related to driving safety are executed first when there is a resource conflict, and maintain the stability and orderliness of the system.
[0054] Specifically, if a scenario without arbitration is obtained, it is only necessary to start the vehicle application A to call the target vehicle application of the service component; if a scenario with arbitration is obtained, it is necessary to start vehicle application A to call the service component first, and then vehicle application B to call the API.
[0055] For example, in a scenario where a vehicle is traveling at high speed, a high-priority ADAS application needs to broadcast an audio warning such as "The vehicle ahead is braking suddenly, please be careful." At the same time, if a low-priority music application is playing a song, arbitration needs to be triggered to compare the priorities of the ADAS application and the music application. If the ADAS application has a higher priority than the music application, the music application is forcibly paused, and the audio module is released to the ADAS to ensure that the driver can hear the safety warning as soon as possible.
[0056] Furthermore, in the embodiments of this application, controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the target vehicle application includes: if the priority of the target vehicle application is a preset priority, then activating the target vehicle application and controlling the target service component to respond to the service call request of the target vehicle application; if the priority of the target vehicle application is greater than the preset priority, then activating the target vehicle application, exclusively binding the target vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target vehicle application.
[0057] Among them, the exclusive binding target service component is an in-vehicle application or functional module that cannot be called, accessed or shared by any other application or module under specific business scenarios.
[0058] Understandably, by judging the relationship between the priority of the target in-vehicle application and the preset priority, it is determined whether the application should exclusively bind to the target service component after the target in-vehicle application is activated, and the target service component is controlled to respond to the call request. This ensures that high-priority applications that are strongly related to driving safety and vehicle control can exclusively occupy core service components, protect the security priority of core scenarios, optimize the efficiency of limited resource allocation, and maintain the stability and orderliness of the system.
[0059] Specifically, when vehicle application A calls a service component, A's priority is 0, which is the preset priority. Vehicle application A is active, and the service component is currently working. The service component executes according to the call from vehicle application A. When vehicle application A calls a service component, A's priority is n (n > 0, n is a positive integer). Vehicle application A is exclusively bound to the service component. Vehicle application A is active, and the service component is exclusively bound to the service component. The service component is currently working. The service component executes according to the call from vehicle application A.
[0060] For example, the weather query app has a preset priority. When a user manually checks today's weather, the weather query app is activated, displaying basic information such as temperature and precipitation probability. It controls the network module, screen notification components, and other target service components to respond to calls. The network module shares bandwidth with the navigation app, and weather data is only updated during idle periods such as the intervals between navigation traffic updates, without affecting the real-time performance of navigation. When the system detects an extreme weather warning, such as a heavy rainstorm within the next hour, and the weather query app has a higher priority than the preset priority, the weather query app is automatically activated. The network module and screen pop-up permissions of the weather app are exclusively bound to the target service components. The network module allocates 50% of its bandwidth to the weather app to ensure that warning data such as rainfall intensity and evacuation routes are updated in real time. The extreme weather warning full-screen pop-up window is locked to exclusive permissions, rejecting pop-up requests from other applications and only responding to the interactive commands of the weather app until the user confirms the warning or the weather risk is lifted.
[0061] Furthermore, in the embodiments of this application, controlling the target service component to respond to the service call request of the target vehicle application based on the priority of the current vehicle application and the priority of the target vehicle application includes: if the priority of the current vehicle application is a preset priority, then when the priority of the current vehicle application is equal to the priority of the target vehicle application, disconnecting the service call request of the current vehicle application and controlling the target service component to respond to the service call request of the target vehicle application; when the priority of the current vehicle application is less than the priority of the target vehicle application, activating the target vehicle application, exclusively binding the target vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target vehicle application; if the priority of the current vehicle application is greater than the preset priority, then when the priority of the current vehicle application is greater than the priority of the target vehicle application, controlling the target service component to refuse to respond to the service call request of the target vehicle application; when the priority of the current vehicle application is less than or equal to the priority of the target vehicle application, controlling the target service component to respond to the service call request of the target vehicle application.
[0062] Understandably, by judging the relationship between the current in-vehicle application's priority and the preset priority, if the current in-vehicle application's priority is the preset priority, the service call request of the current in-vehicle application is disconnected, and the target service component is controlled to respond to the service call request of the target in-vehicle application; if the current in-vehicle application's priority is greater than the preset priority, the target service component is controlled to refuse to respond to the service call request of the target in-vehicle application. Priority hierarchical management can be implemented to ensure the priority of core functions, balance the functional requirements of multiple scenarios, optimize the efficiency of dynamic resource allocation, and ensure the orderliness, logic, stability, and controllability of service components during execution.
[0063] Specifically, in the arbitration scenario, vehicle application A calls the service component first, followed by vehicle application B. A's priority is 0. When vehicle application B is not exclusively bound to the service component, B's priority equals A's priority, which is 0. However, since vehicle application B calls later than vehicle application A, under the same priority conditions, the later-arriving application interrupts the first-arriving. If no vehicle application exclusively binds to the service component, the service component is currently in an active state and executes actions according to vehicle application B's request. When vehicle application B exclusively binds to the service component, B's priority equals m (m > 0), which is higher than A's priority. Vehicle application B is in an active state, exclusively bound to the service component, and the service component is currently in an active state. The service component executes actions according to vehicle application B's request.
[0064] For example, if the current application is a car music application with a preset priority, and the target application is a car video application with a preset priority that is equal to the current car music application's priority, then the current application's priority is determined to be equal to the target application's priority. This triggers the disconnection of the current application's service call, controls the audio output module to disconnect from the music application, stops music playback, and turns off the music interface on the screen. The video application is then activated, and the audio output module and screen respond to the video application's call. Since both applications have preset low priorities, exclusive binding is not triggered. If the target application is a parking immersive cinema application with a higher priority than the current car music application, then the current application's priority is determined to be lower than the parking immersive cinema application's target priority. This triggers the activation of the target application and exclusive binding, disconnects the music application from the audio module, stops playback, activates the immersive cinema application, and exclusively binds it to the audio output module, preventing other applications from calling it, locking the rear entertainment screen to full-screen display, and controlling all bound components to only respond to cinema application commands until the user exits cinema mode.
[0065] Furthermore, in the embodiments of this application, when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, controlling the target service component to respond to the service call request of the target in-vehicle application includes: when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, activating the target in-vehicle application; after the target in-vehicle application completes the service call request of the current in-vehicle application, obtaining whether the current in-vehicle application needs to support rollback operation; if the current in-vehicle application does not need to support rollback operation, then exiting the current in-vehicle application, exclusively binding the target in-vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target in-vehicle application; if the current in-vehicle application needs to support rollback operation, after the target service component executes the service call request of the current in-vehicle application, triggering the current in-vehicle application to call the target service component to execute the rollback operation; after the current service component completes the rollback operation, releasing the exclusive binding between the current in-vehicle application and the target service component, exiting the current in-vehicle application, exclusively binding the target in-vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target in-vehicle application.
[0066] Rollback is a reverse operation that restores the object of an operation to a stable and usable baseline state before the operation when an operation fails, becomes abnormal, or does not meet expectations, or poses a risk to the system or data. This is done to eliminate the impact of the error and restore normal functionality.
[0067] Understandably, by determining whether the current in-vehicle application needs to support rollback operations when its priority is less than or equal to that of the target in-vehicle application, and exiting the current application if it does not need to support rollback operations, and triggering the current in-vehicle application to call the target service component to perform rollback operations after the target service component executes the service call request of the current in-vehicle application if it needs to support rollback operations, this ensures that the target application stably occupies core resources, reduces conflicts in component calls, achieves orderly resource handover, maintains the stable operation of the in-vehicle system, and improves system compatibility and flexibility.
[0068] Specifically, when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, the target in-vehicle application is activated. If the current in-vehicle application does not need to support rollback operations, the exit of in-vehicle application A is triggered directly. If the current in-vehicle application needs to support rollback operations, the exit of in-vehicle application A needs to support rollback, and the exit of in-vehicle application A is triggered to start executing the rollback.
[0069] For example, if the local music application does not require rollback, and the current application is a local music application used to play music from a USB drive with no state saving requirement, its priority is low. The target application is an online video application used by passengers in the back row to request the playback of variety shows, and its priority is low. In this case, the priority of the current application (local music application) is equal to the priority of the target application (online video application). The target application completes the service call request of the current application first, allows the local music application to finish playing the current song, detects that the current application (local music application) does not need to rollback, exits the local music application directly, does not retain the playlist and progress, and unbinds the local music application from the screen and audio modules. The online video application is exclusively bound, the screen switches to full-screen video display, the music channel is closed, the audio module only outputs video sound, and the network module prioritizes bandwidth allocation for video caching.
[0070] In a safety warning scenario, the current tire pressure monitoring application needs to roll back. The current application is a tire pressure monitoring application that monitors tire pressure and displays normal data, with a medium priority. The target application is an emergency collision warning application that detects a vehicle braking suddenly ahead, with a high priority. At this point, the priority of the current application's tire pressure monitoring application is lower than that of the target application's emergency collision warning application. The target application's emergency collision warning application completes the service call request of the current application first, allowing the tire pressure monitoring application to synchronize tire pressure data one last time to ensure data integrity. The current application's tire pressure monitoring application needs to roll back. The target service component first executes the remaining calls of the current application's tire pressure monitoring application, saves the latest tire pressure data to local storage, triggers the current application's emergency collision warning application to call the data status rollback interface, restores the screen display status and data refresh rate to the initial monitoring mode, and after the rollback is complete, unbinds the tire pressure monitoring application from the screen and radar interfaces and exits the application.
[0071] Furthermore, in the embodiments of this application, after exclusively binding the target vehicle application to the target service component and controlling the target service component to respond to the service call request of the target vehicle application, the method further includes: obtaining whether the target vehicle application needs to support rollback operations; if the target vehicle application does not need to support rollback operations, then after the target service component completes the call action of the target vehicle application, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits; if the target vehicle application needs to support rollback operations, then after the target service component completes the service call request of the target vehicle application, the target vehicle application is triggered to call the target service component to perform rollback operations, and after the target service component completes the rollback operations, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits.
[0072] Understandably, by determining whether the target in-vehicle application needs to support rollback operations, if the target in-vehicle application does not need to support rollback operations, the exclusive binding between the target in-vehicle application and the target service component is released after the target service component completes its call to the target in-vehicle application. If the target in-vehicle application needs to support rollback operations, the target in-vehicle application is triggered to call the target service component to perform a rollback operation after the target service component completes its service call request to the target in-vehicle application. Then, the exclusive binding between the target in-vehicle application and the target service component is released, and the target in-vehicle application exits. The rollback operation restores the system and device state to the initial state before the application started. After the task is completed, the exclusive binding with the service component is released and the application exits. This protects the user's usage state and scenario continuity, ensures that core service components are not occupied by applications that have completed their tasks for a long time, reduces resource waste, and maintains the stability of system operation.
[0073] Specifically, if the in-vehicle application does not need to support rollback operations, the in-vehicle application A is inactive, and the in-vehicle application A is unbound from the service component. No in-vehicle application exclusively binds to the service component, and the service component is currently idle. If the in-vehicle application needs to support rollback operations, the exit of in-vehicle application A requires rollback support. When the exit of in-vehicle application A is triggered, the rollback begins. During the rollback process, the in-vehicle application A is active, the in-vehicle application A exclusively binds to the service component, and the in-vehicle application A calls the service component to perform the rollback. The service component is currently active.
[0074] For example, if the target application is a one-click window lift application and does not require rollback, and the target service components are the vehicle body control module interface, motor drive signal channel, and status feedback module, and the user triggers a command to close all the windows, and the windows are stable after closing without needing to restore the initial state, it is determined that the target application, the one-click window lift application, does not need to support rollback. The target service components execute the call action, the vehicle body control module interface receives the window closing command, the motor drive signal controls the four windows to close synchronously, and the status feedback module confirms that all windows are closed and displays it. After execution, the exclusive binding between the application and the vehicle body control module interface and motor channel is released, and the application exits to avoid occupying vehicle body control resources.
[0075] The target application is a temporary navigation detour application that needs to be rolled back. The target service components are a GPS positioning module, a high-precision map interface, a route calculation engine, and a storage module. When a user triggers a temporary detour due to traffic congestion ahead, the user needs to restore the original planned route after completing the detour. Therefore, the target application needs to support rollback by saving the original route. The target service components execute the call action. The storage module saves the original route. The route calculation engine avoids congested sections and generates a detour route. The GPS and map interface work together to guide the user through the detour. After the vehicle leaves the congested section and completes the detour, the rollback operation is triggered. The application calls the route calculation engine, reads the stored original route data, and restores the main road navigation. After the rollback is completed, the exclusive binding between the application and GPS, map interface, and calculation engine is released, the application exits, and the main navigation application takes over.
[0076] This application embodiment can determine the priority of a target in-vehicle application by its exclusive binding requirements. By controlling the target service component to respond to the service call request of the target in-vehicle application based on the priority of the target in-vehicle application and the current scenario of the target service component, it is possible to achieve reasonable allocation and efficient scheduling of in-vehicle system resources, avoid resource competition and conflicts between multiple applications, ensure the priority response right of critical applications, adapt to functional requirements under different scenarios, and ultimately improve the operational stability, functional security and user experience coordination of the in-vehicle system.
[0077] According to the service component invocation method for in-vehicle applications proposed in this application, the exclusive binding requirement of the target in-vehicle application is determined through the current business scenario, and the priority of the target in-vehicle application is determined. By adopting a fixed priority rollback design for in-vehicle applications in both arbitration and non-arbitration scenarios, and in conjunction with the exclusive binding service component mechanism, the response of the target service component to service invocation requests is controlled. This realizes the priority arbitration strategy and dynamic allocation of resources for fixed exclusive binding service components, improves resource utilization efficiency, and ensures the orderliness, logic, stability, and controllability of service components during execution.
[0078] To better understand the solution of this application, the service component invocation method of the in-vehicle application of this application is described below through a specific embodiment. The invocation relationship between the arbitration software, the in-vehicle application, and the service component (provided by the service) is as follows: Figure 2 As shown, in a scenario without arbitration, the steps for only vehicle application A to call the service component are as follows: Figure 3 As shown.
[0079] Step 301: The initial state is as follows: the in-vehicle application A is inactive, the service component is not exclusively bound to any in-vehicle application, and the current working state of the service component is idle. Step 302: In-vehicle application A calls the service component. Based on the C-end user scenario, it is determined whether in-vehicle application A is exclusively bound to the service component. If the in-vehicle application needs to continuously monitor the status of the service component during activation, then the in-vehicle application is bound to the service component; otherwise, it is not bound to the service component. If in-vehicle application A is exclusively bound to the service component, then proceed to step 303; otherwise, proceed to step 303-a1. Step 303: In-vehicle application A is exclusively bound to the service component, i.e., A priority = n (n > 0, n is a positive integer), the activation status of in-vehicle application A is activated, in-vehicle application A is exclusively bound to the service component, the current working status of the service component is working, and the service component executes according to the calls made by in-vehicle application A. If in-vehicle application A needs to support rollback when exiting, then proceed to step 304; otherwise, if the exit of in-vehicle application A is triggered, then proceed to step 305. Step 303-a1: In-vehicle application A is not exclusively bound to the service component, that is, A priority = 0 (the priority of all in-vehicle applications that are not exclusively bound to the service component is 0). The current working state of the service component is working. The service component is executed according to the call of in-vehicle application A. After the service component is completed, step S305 is executed. Step 304: When vehicle application A exits, it needs to support rollback. Triggering the exit of vehicle application A, the rollback begins. During the rollback process, the activation state of vehicle application A is active, vehicle application A exclusively binds to the service component, vehicle application A calls the service component to perform the rollback, and the current working state of the service component is working. When the service component completes the rollback, step S305 is executed. Step 305: In-vehicle application A activation status = inactive, in-vehicle application A unbinds service component, no in-vehicle application exclusively binds to service component, service component current working status = idle; Step 306: End.
[0080] In a scenario involving arbitration, if in-vehicle application A calls the service component first, and in-vehicle application B calls the API later, the steps are as follows when A's priority is 0: Figure 4 As shown.
[0081] Step 401: Step 401 is the same as step 303-a1, A priority = 0, the service component does not exclusively bind to any in-vehicle application, and the current working status of the service component = working; Step 402: While the service component is executing the call of vehicle application A, vehicle application B calls the service component. Based on the C-end user scenario, determine whether vehicle application B is exclusively bound to the service component. If vehicle application B is exclusively bound to the service component, proceed to step 403; otherwise, proceed to step 403-a1. Step 403: B priority = m (m > 0), B priority is higher than A priority, arbitration passes, vehicle application B activation status = activated, vehicle application B exclusively binds to service component, service component current working status = working, service component starts executing actions according to vehicle application B's request. If vehicle application B exits and needs to support rollback, then proceed to step 404; otherwise, if triggering the exit of vehicle application B, then proceed to step 405. Step 403-a1: Priority B = Priority A = 0, but in-vehicle application B is called later than in-vehicle application A. Under the same priority, the later one interrupts the earlier one. Arbitration is successful. No in-vehicle application can exclusively bind the service component. The current working state of the service component is working. The service component starts to execute the action according to the request of in-vehicle application B. After the service component completes its execution according to the request of in-vehicle application B, step 405 is executed. Step 404: Step 404 is the same as step 304, except that in-vehicle application A is replaced with in-vehicle application B; Step 405: The difference between Step 406 and Step 405 is that in-vehicle application A is replaced with in-vehicle application B; Step 406: End.
[0082] In a scenario involving arbitration, where in-vehicle application A calls the service component first, followed by in-vehicle application B calling the API, and A's priority is n (n > 0), the steps are as follows: Figure 5 As shown, the details are as follows: Step 501: Step 501 is the same as step 503, A priority = n (n > 0), vehicle application A exclusively binds to the service component, and the current working status of the service component is working; Step 502: While the service component is executing the call of vehicle application A, vehicle application B calls the service component. The priority of vehicle application B is determined according to the C-end user scenario. If m≥n, then execute step 503; otherwise, execute step 503-a1. Step 503: m≥n, the arbitration of vehicle application B is successful, B priority=m (m>0), vehicle application B activation status=activated. Note: Although vehicle application B activation status=activated, it is still exclusively bound to the service component by vehicle application A and has not been switched to exclusively bound to the service component by vehicle application B. If vehicle application A needs to support rollback when exiting, triggering the start of exiting vehicle application A, then proceed to step 504. Otherwise, triggering the start of exiting vehicle application A, then proceed to step 505. Step 503-a1: Arbitration for in-vehicle application B fails. The request from in-vehicle application B is rejected. In-vehicle application B's activation status is deactivated. In-vehicle application A's activation status is activated. The exclusive binding of in-vehicle application A to the service component remains unchanged. The current working status of the service component is active. Step 504: Step 504 is exactly the same as step 304; Step 505: If vehicle application A needs to be rolled back, then perform exclusive binding switch after the rollback is completed. If vehicle application A does not need to be rolled back, then directly perform exclusive binding switch. Application B's activation status = activated, vehicle application A's activation status = inactive, service component exclusively binds to vehicle application B, service component's current working status = working, and service component starts executing actions according to vehicle application B's request.
[0083] Step 506: Step 506 is the same as step 304, except that in-vehicle application A is replaced with in-vehicle application B; Step 507: The difference between Step 507 and Step 305 is that in-vehicle application A is replaced with in-vehicle application B; Step 508: End.
[0084] In summary, the service component invocation method for in-vehicle applications proposed in this application can determine the exclusive binding requirement of the target in-vehicle application based on the current business scenario. The priority of the target in-vehicle application is determined based on the existence of an exclusive binding requirement. The service component invocation is then implemented by combining the priority of the target in-vehicle application with the current scenario, thereby satisfying the service component invocation requirements under the current business scenario. Combined with the exclusive binding service component mechanism, the response of the target service component to service invocation requests is controlled. Target in-vehicle applications requiring exclusive binding and those not requiring exclusive binding are assigned different priorities. Service component invocation is implemented according to these different priorities, achieving dynamic resource allocation under the current business scenario, improving resource utilization efficiency, and ensuring the stability and controllability of the service component during execution. Therefore, this solves the technical problems of unstable and uncontrollable execution results when in-vehicle applications call service components in related technologies.
[0085] Next, the service component invocation device for in-vehicle applications proposed according to the embodiments of this application is described with reference to the accompanying drawings.
[0086] Figure 6 This is a block diagram of a service component invocation device for an in-vehicle application according to an embodiment of this application.
[0087] like Figure 6 As shown, the service component invocation device 600 for the vehicle application includes: an acquisition module 601, a determination module 602, and a control module 603.
[0088] The module 601 is used to acquire the target vehicle application that needs to be launched in the current business scenario; the module 603 is used to determine the exclusive binding requirement of the target vehicle application based on the current business scenario, wherein the exclusive binding requirement is whether the target vehicle application needs to exclusively bind to the target service component; the module 603 is used to determine the priority of the target vehicle application based on the exclusive binding requirement of the target vehicle application, and control the target service component to respond to the service call request of the target vehicle application based on the priority of the target vehicle application and the current scenario of the target service component, wherein the priority of the target vehicle application that needs to exclusively bind to the target service component is greater than the priority of the target vehicle application that does not need to exclusively bind to the target service component.
[0089] Furthermore, in the embodiments of this application, the control module 603 is used to determine the priority of the target vehicle application based on the exclusive binding requirement of the target vehicle application, including: if the exclusive binding requirement of the target vehicle application is that it does not need to exclusively bind the target service component, then the priority of the target vehicle application that does not need to exclusively bind the target service component is determined to be a preset priority; if the exclusive binding requirement of the target vehicle application is that it needs to exclusively bind the target service component, then the priority of the target vehicle application is determined according to the current business scenario.
[0090] Furthermore, in the embodiments of this application, determining the priority of the target vehicle application based on the current business scenario includes: obtaining a pre-defined correspondence table between business scenarios and priorities; and querying the correspondence table using the current business scenario as an index to obtain the priority of the target vehicle application.
[0091] Furthermore, in the embodiments of this application, controlling the target service component to respond to the service call request of the target vehicle application based on the priority of the target vehicle application and the current scenario of the target service component includes: identifying whether the current scenario of the target service component is an arbitration scenario, wherein the arbitration scenario is a scenario in which multiple vehicle applications call the target service component; if the current scenario of the target service component is a non-arbitration scenario, then controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the target vehicle application; if the target service component is an arbitration scenario, then obtaining the priority of the current vehicle application, and controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the current vehicle application and the priority of the target vehicle application.
[0092] Furthermore, in the embodiments of this application, controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the target vehicle application includes: if the priority of the target vehicle application is a preset priority, then activating the target vehicle application and controlling the target service component to respond to the service call request of the target vehicle application; if the priority of the target vehicle application is greater than the preset priority, then activating the target vehicle application, exclusively binding the target vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target vehicle application.
[0093] Furthermore, in the embodiments of this application, controlling the target service component to respond to the service call request of the target vehicle application based on the priority of the current vehicle application and the priority of the target vehicle application includes: if the priority of the current vehicle application is a preset priority, then when the priority of the current vehicle application is equal to the priority of the target vehicle application, disconnecting the service call request of the current vehicle application and controlling the target service component to respond to the service call request of the target vehicle application; when the priority of the current vehicle application is less than the priority of the target vehicle application, activating the target vehicle application, exclusively binding the target vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target vehicle application; if the priority of the current vehicle application is greater than the preset priority, then when the priority of the current vehicle application is greater than the priority of the target vehicle application, controlling the target service component to refuse to respond to the service call request of the target vehicle application; when the priority of the current vehicle application is less than or equal to the priority of the target vehicle application, controlling the target service component to respond to the service call request of the target vehicle application.
[0094] Furthermore, in the embodiments of this application, when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, controlling the target service component to respond to the service call request of the target in-vehicle application includes: when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, activating the target in-vehicle application; after the target in-vehicle application completes the service call request of the current in-vehicle application, obtaining whether the previous in-vehicle application needs to support rollback operation; if the previous in-vehicle application does not need to support rollback operation, then exiting the current in-vehicle application, exclusively binding the target in-vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target in-vehicle application; if the current in-vehicle application needs to support rollback operation, then after the target service component executes the service call request of the current in-vehicle application, triggering the current in-vehicle application to call the target service component to execute the rollback operation; after the current service component completes the rollback operation, releasing the exclusive binding between the current in-vehicle application and the target service component, exiting the current in-vehicle application, exclusively binding the target in-vehicle application to the target service component, and controlling the target service component to respond to the service call request of the target in-vehicle application.
[0095] Furthermore, in this embodiment of the application, the apparatus 600 further includes a release module.
[0096] The release module is used to exclusively bind the target in-vehicle application to the target service component. After the target service component responds to the service call request of the target in-vehicle application, it determines whether the target in-vehicle application needs to support rollback operations. If the target in-vehicle application does not need to support rollback operations, the exclusive binding between the target in-vehicle application and the target service component is released after the target service component completes the call action of the target in-vehicle application, and the target in-vehicle application exits. If the target in-vehicle application needs to support rollback operations, the target in-vehicle application is triggered to call the target service component to perform rollback operations after the target service component completes the service call request of the target in-vehicle application. After the target service component completes the rollback operations, the exclusive binding between the target in-vehicle application and the target service component is released, and the target in-vehicle application exits.
[0097] It should be noted that the foregoing explanation of the service component invocation method embodiment for in-vehicle applications also applies to the service component invocation device for in-vehicle applications in this embodiment, and will not be repeated here.
[0098] According to the service component invocation device for vehicle applications proposed in this application embodiment, the exclusive binding requirement of the target vehicle application is determined through the current business scenario, and the priority of the target vehicle application is determined. By adopting the fixed priority of the vehicle application for rollback design in both arbitration and non-arbitration scenarios, and in conjunction with the exclusive binding service component mechanism, the target service component is controlled to respond to service invocation requests. This realizes the priority arbitration strategy of fixed exclusive binding service components and the dynamic allocation of resources, improves resource utilization efficiency, and ensures the orderliness, logic, stability and controllability of service components during execution.
[0099] Figure 7 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application. The vehicle 700 may include: The memory 701, the processor 702, and the computer program stored on the memory 701 and capable of running on the processor 702.
[0100] When the processor 702 executes the program, it implements the service component invocation method for the vehicle application provided in the above embodiments.
[0101] Furthermore, vehicle 700 also includes: Communication interface 703 is used for communication between memory 701 and processor 702.
[0102] The memory 701 is used to store computer programs that can run on the processor 702.
[0103] The memory 701 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0104] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0105] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.
[0106] The processor 702 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0107] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0108] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0109] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0110] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0111] Those skilled in the art will understand that all or part of the steps of the methods implementing the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0112] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method for invoking service components in an in-vehicle application, characterized in that, Includes the following steps: Obtain the target in-vehicle application that needs to be launched in the current business scenario; The exclusive binding requirement of the target vehicle application is determined based on the current business scenario. The exclusive binding requirement is whether the target vehicle application needs to exclusively bind to the target service component. The priority of the target vehicle application is determined based on its exclusive binding requirements. Based on the priority of the target vehicle application and the current scenario of the target service component, the target service component is controlled to respond to the service call request of the target vehicle application.
2. The method for invoking service components of an in-vehicle application according to claim 1, characterized in that, The priority of the target in-vehicle application that needs to be exclusively bound to the target service component is greater than the priority of the target in-vehicle application that does not need to be exclusively bound to the target service component.
3. The method for invoking service components of an in-vehicle application according to claim 1, characterized in that, The step of determining the priority of the target in-vehicle application based on its exclusive binding requirements includes: If the exclusive binding requirement of the target vehicle application is that it does not need to exclusively bind the target service component, then the priority of the target vehicle application that does not need to exclusively bind the target service component is determined to be the preset priority. If the exclusive binding requirement of the target in-vehicle application is that it does not need to exclusively bind the target service component, then the priority of the target in-vehicle application is determined according to the current business scenario.
4. The method for invoking service components of an in-vehicle application according to claim 3, characterized in that, Determining the priority of the target in-vehicle application based on the current business scenario includes: Obtain a pre-defined table showing the correspondence between business scenarios and priorities; Using the current business scenario as an index, the priority of the target vehicle application is obtained by querying the corresponding relationship table.
5. The method for invoking service components of an in-vehicle application according to claim 1, characterized in that, The step of controlling the target service component to respond to the service call request of the target vehicle application based on the priority of the target vehicle application and the current scenario of the target service component includes: Identify whether the current scenario of the target service component is an arbitration scenario, wherein the arbitration scenario is a scenario in which multiple in-vehicle applications call the target service component; If the current scenario of the target service component is a non-arbitration scenario, then the target service component is controlled to respond to the service call request of the target vehicle application according to the priority of the target vehicle application; If the target service component is the arbitration scenario, then the priority of the current in-vehicle application is obtained, and the target service component is controlled to respond to the service call request of the target in-vehicle application based on the priority of the current in-vehicle application and the priority of the target in-vehicle application.
6. The method for invoking service components of an in-vehicle application according to claim 5, characterized in that, The step of controlling the target service component to respond to the service call request of the target vehicle application according to the priority of the target vehicle application includes: If the priority of the target vehicle application is a preset priority, then the target vehicle application is activated, and the target service component is controlled to respond to the service call request of the target vehicle application. If the priority of the target vehicle application is greater than the preset priority, the target vehicle application is activated, and the target vehicle application is exclusively bound to the target service component, controlling the target service component to respond to the service call request of the target vehicle application.
7. The method for invoking service components of an in-vehicle application according to claim 5, characterized in that, The step of controlling the target service component to respond to the service call request of the target vehicle application based on the priority of the current vehicle application and the priority of the target vehicle application includes: If the priority of the current in-vehicle application is a preset priority, then when the priority of the current in-vehicle application is equal to the priority of the target in-vehicle application, the service call request of the current in-vehicle application is disconnected, and the target service component is controlled to respond to the service call request of the target in-vehicle application. When the priority of the current in-vehicle application is less than the priority of the target in-vehicle application, the target in-vehicle application is activated, the target in-vehicle application is exclusively bound to the target service component, and the target service component is controlled to respond to the service call request of the target in-vehicle application. If the priority of the current in-vehicle application is greater than the preset priority, then when the priority of the current in-vehicle application is greater than the priority of the target in-vehicle application, the target service component is controlled to refuse to respond to the service call request of the target in-vehicle application; when the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, the target service component is controlled to respond to the service call request of the target in-vehicle application.
8. The method for invoking service components of an in-vehicle application according to claim 7, characterized in that, When the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, controlling the target service component to respond to the service call request of the target in-vehicle application includes: When the priority of the current in-vehicle application is less than or equal to the priority of the target in-vehicle application, the target in-vehicle application is activated. After the target in-vehicle application completes the service call request of the current in-vehicle application, it is determined whether the current in-vehicle application needs to support rollback operation. If the current in-vehicle application does not need to support the rollback operation, then exit the current in-vehicle application, exclusively bind the target in-vehicle application to the target service component, and control the target service component to respond to the service call request of the target in-vehicle application. If the current in-vehicle application needs to support the rollback operation, after the target service component executes the service call request of the current in-vehicle application, the current in-vehicle application is triggered to call the target service component to execute the rollback operation. After the current service component completes the rollback operation, the exclusive binding between the current in-vehicle application and the target service component is released, the current in-vehicle application exits, the target in-vehicle application is exclusively bound to the target service component, and the target service component is controlled to respond to the service call request of the target in-vehicle application.
9. The method for invoking service components of an in-vehicle application according to any one of claims 6-8, characterized in that, After exclusively binding the target in-vehicle application to the target service component and controlling the target service component to respond to the service call requests of the target in-vehicle application, the method further includes: Determine whether the target in-vehicle application needs to support rollback operations; If the target vehicle application does not need to support the rollback operation, then after the target service component completes the call action of the target vehicle application, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits. If the target vehicle application needs to support the rollback operation, after the target service component completes the service call request of the target vehicle application, the target vehicle application is triggered to call the target service component to perform the rollback operation. After the target service component completes the rollback operation, the exclusive binding between the target vehicle application and the target service component is released, and the target vehicle application exits.
10. A vehicle, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the service component invocation method for an in-vehicle application as described in any one of claims 1-9.