Control methods, devices, electronic equipment and storage media for vehicle-to-everything (V2X) applications
By creating middleware classes in smart cars to manage events, configure and send events to the vehicle-to-car connectivity application, the problem of drivers being unable to operate conveniently while driving is solved, improving safety and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING CHANGAN AUTOMOBILE CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-30
AI Technical Summary
In existing smart cars, the in-vehicle system cannot perform high-frequency operations such as answering or hanging up calls without distracting the driver, which increases the risk to driving safety.
By creating middleware classes to manage and distribute events, the system can configure the events that the vehicle-to-grid application is allowed to respond to, obtain and send events to the vehicle-to-grid application, control its response to target events and terminate the corresponding processes, thus avoiding manual operation by the driver.
It improves driving safety, avoids process conflicts between the car's hands-free vehicle connection application and the vehicle's infotainment system, and enhances driving safety and user experience.
Smart Images

Figure CN122308957A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle assistance technology, specifically to a control method, device, electronic device, and storage medium for a vehicle-to-everything (V2X) application. Background Technology
[0002] Currently, with the continuous advancement of intelligent vehicle technology and the reduction in costs, intelligent vehicles are becoming increasingly widespread. However, in existing intelligent vehicle in-vehicle systems, modules such as in-vehicle navigation, music playback, and steering wheel controls typically only control limited functions, such as volume adjustment and song switching. For high-frequency needs like answering or hanging up calls, drivers often need to manually operate their phones, which increases safety risks during driving. Therefore, enabling drivers to conveniently and quickly operate connected car applications without distraction has become an urgent problem to be solved. Summary of the Invention
[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this application provides a control method, device, electronic device and storage medium for a vehicle interconnection application.
[0004] In a first aspect, this application provides a control method for a vehicle-to-everything (V2X) application, the method comprising: In response to the initialization of the distribution system, a middleware class is created; wherein the middleware class is used to manage and distribute events; Configure a first event corresponding to the vehicle-to-grid application in the middleware class; wherein, the first event is an event that the vehicle-to-grid application is allowed to respond to; Obtain a second event to be sent to the vehicle-to-grid application; wherein the second event is generated by a device or module other than the vehicle-to-grid application; The target event corresponding to the second event is determined from the first event, and the target event is sent to the vehicle-to-grid application through the middleware class; Control the vehicle-to-vehicle interconnection application to respond to the target event, and terminate the process corresponding to the target event in the vehicle system.
[0005] Optionally, the first event includes at least one of the following events: answering a call, hanging up a call, playing media, pausing media, playing the previous track, playing the next track, turning on the vehicle-to-grid connection, exiting the vehicle-to-grid connection, disconnecting the vehicle-to-grid connection, waking up the vehicle-to-grid connection third-party voice assistant, exiting the mobile phone connection third-party voice assistant, starting the mobile phone connection third-party navigation, and exiting the mobile phone connection third-party navigation.
[0006] Optionally, in response to the distribution system initialization, a middleware class is created, including: The distribution system is initialized when the vehicle is powered on and started. After the distribution system is initialized, the middleware class is created in the distribution system.
[0007] Optionally, acquiring a second event to be sent to the vehicle-to-grid application includes: In response to a registration request from a target module, a callback status is obtained; wherein the registration request is used for the target module to register a control channel with the middleware class; wherein the target module includes at least one of a traffic control module, a map module, and a music module; When the callback state indicates that the control channel has been successfully registered and connected, the connection status between the vehicle-to-grid application and the mobile terminal is obtained. When the connection status indicates that the vehicle-to-grid application is connected to the mobile terminal, the second event to be sent by the target module to the vehicle-to-grid application is obtained.
[0008] Optionally, after obtaining the second event that the target module is to send to the vehicle-to-grid application, the method further includes: Determine whether the second event is repeatedly acquired within a preset time period; If the second event is repeatedly acquired within the preset time period, the repeatedly acquired second event will be filtered out.
[0009] Optionally, controlling the vehicle-to-grid application to respond to the target event includes: Obtain the connection status between the vehicle-to-grid application and the mobile device; When the connection state indicates that the vehicle-to-grid application is connected to the mobile device, the vehicle-to-grid application is controlled to respond to the target event; If the connection status indicates that the vehicle-to-grid application is not connected to the mobile device, the vehicle-to-grid application is controlled not to respond to the target event.
[0010] Optionally, terminating the process corresponding to the target event in the vehicle system includes: When the connection status indicates that the vehicle-to-vehicle connectivity application is connected to the mobile terminal, it is determined whether there is a process corresponding to the target event in the vehicle system; If a process corresponding to the target event exists in the vehicle system, then the process corresponding to the target event in the vehicle system will be terminated.
[0011] Secondly, this application provides a control device for a vehicle-to-everything (V2X) application, the device comprising: A module is created to create middleware classes in response to the initialization of the distribution system; wherein, the middleware classes are used to manage and distribute events; A configuration module is used to configure a first event corresponding to the vehicle-to-grid application in the middleware class; wherein, the first event is an event that the vehicle-to-grid application is allowed to respond to; The acquisition module is used to acquire a second event to be sent to the vehicle-to-grid application; wherein the second event is generated by other devices or modules outside the vehicle-to-grid application; The determination module is used to determine the target event corresponding to the second event from the first event, and send the target event to the vehicle-to-grid application through the middleware class; The control module is used to control the vehicle-to-vehicle interconnection application to respond to the target event and to terminate the process corresponding to the target event in the vehicle system.
[0012] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in a memory, it implements the steps of the control method for the handcart interconnection application described in any embodiment of the first aspect.
[0013] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the control method for a vehicle-to-grid application as described in any embodiment of the first aspect.
[0014] The beneficial effects of this application are: The method provided in this application embodiment, in response to the initialization of the distribution system, creates a middleware class; wherein the middleware class is used to manage and distribute events; configures a first event corresponding to the vehicle-to-grid application in the middleware class; wherein the first event is an event that the vehicle-to-grid application is allowed to respond to; obtains a second event to be sent to the vehicle-to-grid application; wherein the second event is generated by other devices or modules outside the vehicle-to-grid application; determines the target event corresponding to the second event from the first event, and sends the target event to the vehicle-to-grid application through the middleware class; controls the vehicle-to-grid application to respond to the target event, and terminates the process corresponding to the target event in the vehicle system. This method creates a middleware class for managing and distributing events after the distribution system is initialized. The middleware class is configured with the first event that the vehicle-to-grid application is allowed to respond to. After obtaining a second event generated by other devices or modules besides the vehicle-to-grid application, the target event corresponding to the second event can be determined from the first event. The target event is then sent to the vehicle-to-grid application through the middleware class, thereby controlling the vehicle-to-grid application to respond to the target event and terminating the process corresponding to the target event in the vehicle system. During this process, the driver does not need to be distracted from operating the vehicle-to-grid application, which improves safety during driving and avoids conflicts between the corresponding processes of the vehicle-to-grid application and the vehicle system. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A system architecture diagram of a control method for a vehicle-to-everything (V2X) application provided in one embodiment of this application; Figure 2 A flowchart illustrating a control method for a vehicle-to-everything (V2X) application provided in one embodiment of this application; Figure 3 A schematic diagram illustrating a process of controlling a vehicle-to-everything (V2X) application via a steering wheel control system, as provided in one embodiment of this application; Figure 4 This is a schematic diagram of the structure of a control device for a vehicle interconnection application provided in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0018] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.
[0019] The first embodiment of this application provides a control method for a vehicle-to-everything (V2X) application, which can be applied to applications such as… Figure 1 The system architecture shown includes at least a data acquisition module 101 and a data processing module 102. These modules establish a communication connection. Specifically, the system architecture can be a vehicle, with no limitation on the type of vehicle, such as a gasoline-powered car, a pure electric vehicle, a hybrid electric vehicle, or a fuel cell vehicle. The vehicle includes a central control system with a hands-free vehicle connectivity application, a distribution system, and may also include steering wheel controls. The hands-free vehicle connectivity application supports connecting to the user's mobile device (such as a smartphone) and projecting the smartphone screen onto the vehicle's infotainment system. The distribution system can be implemented using the Android Interface Definition Language (AIDL), enabling the transmission of events from physical buttons and other modules in the vehicle's infotainment system to the hands-free vehicle connectivity application. The steering wheel controls can receive user operations, such as controlling phone calls, voice activation, music playback, navigation, and other custom buttons.
[0020] Next, based on this system architecture, the control method of this vehicle-to-grid interconnection application will be described in detail, such as... Figure 2 The control methods for this vehicle connectivity application include: Step 201: In response to the initialization of the distribution system, create a middleware class; the middleware class is used to manage and distribute events.
[0021] By creating middleware classes to manage and distribute events, it is possible to achieve a good ecological integration between modules such as steering wheel controls, navigation modules, and music modules in the vehicle system and vehicle-to-everything (V2X) applications.
[0022] In one embodiment, in response to the initialization of the distribution system, a middleware class is created, including: initializing the distribution system when the vehicle is powered on and started; and creating the middleware class in the distribution system after the initialization of the distribution system is completed.
[0023] In this embodiment, the distribution system is initialized when the vehicle is powered on and started. After the distribution system initialization is complete, a middleware class is created within the distribution system. Initializing the distribution system and recreating the middleware class each time the vehicle is powered on and started again ensures the normal operation of the middleware class every time the vehicle is used.
[0024] Step 202: Configure the first event corresponding to the vehicle-to-grid application in the middleware class; wherein, the first event is an event that the vehicle-to-grid application is allowed to respond to.
[0025] The first event can be a uniformly defined event through the AIDL interface, so that the event can be distributed between different modules.
[0026] In one embodiment, the first event includes at least one of the following events: answering a call, hanging up a call, playing media, pausing media, playing the previous track, playing the next track, turning on the vehicle-to-mobile connection, exiting the vehicle-to-mobile connection, disconnecting the vehicle-to-mobile connection, waking up the vehicle-to-mobile connection third-party voice assistant, exiting the mobile-to-mobile connection third-party voice assistant, starting the mobile-to-mobile connection third-party navigation, and exiting the mobile-to-mobile connection third-party navigation.
[0027] In this embodiment, events such as answering a call, hanging up a call, playing media, pausing media, playing the previous track, playing the next track, opening the vehicle-to-grid connection, exiting the vehicle-to-grid connection, disconnecting the vehicle-to-grid connection, waking up the vehicle-to-grid connection third-party voice assistant, exiting the mobile phone connection third-party voice assistant, starting the mobile phone connection third-party navigation, and exiting the mobile phone connection third-party navigation can be configured in the middleware class. These events can be multiple or all of the above events, and can also include other custom events without limitation.
[0028] Specifically, for telephone-related events, you can define events such as answering a call (CALL_ANSWER) and hanging up a call (CALL_HANG). For multimedia-related events, you can define events such as playing media (MEDIA_PLAY), pausing media (MEDIA_PAUSE), playing the previous track (MEDIA_LAST), and playing the next track (MEDIA_NEXT). For operation-related events, you can define events such as opening the car-to-car connection (CONTROLL_OPEN_LINK), exiting the car-to-car connection (CONTROLL_EXIT_LINK), disconnecting the car-to-car connection (CONTROLL_DISCOUNT_LINK), activating the car-to-car connection third-party voice assistant (CONTROLL_OPEN_VOICE), exiting the car-to-car connection third-party voice assistant (CONTROLL_EXIT_VOICE), starting the car-to-car connection third-party navigation (CONTROLL_OPEN_NAVI), and exiting the car-to-car connection third-party navigation (CONTROLL_EXIT_NAVI).
[0029] Step 203: Obtain the second event to be sent to the vehicle-to-grid application; wherein the second event is generated by other devices or modules outside the vehicle-to-grid application.
[0030] The second event can be generated by other devices or modules outside the vehicle-to-grid application, such as the user's mobile device, such as a mobile phone, or the steering wheel control module, the map module in the vehicle system, the music module in the vehicle system, etc. The steering wheel control module, map module, and music module can be called target modules. The second event is first sent to the middleware class, and then the middleware class sends it to the vehicle-to-grid application.
[0031] In one embodiment, obtaining the second event to be sent to the vehicle-to-grid application includes: in response to a registration request from a target module, obtaining a callback state; wherein the registration request is used for the target module to register with a control channel of a middleware class; wherein the target module includes at least one of a steering wheel control module, a map module, and a music module; if the callback state indicates that the control channel registration and connection are successful, obtaining the connection state between the vehicle-to-grid application and the mobile terminal; if the connection state indicates that the vehicle-to-grid application and the mobile terminal are connected, obtaining the second event to be sent by the target module to the vehicle-to-grid application.
[0032] In this embodiment, in response to the registration request of the target module, a callback status is obtained. If the callback status indicates that the control channel registration and connection are successful, the connection status between the vehicle-to-grid application and the mobile terminal is obtained. If the connection status indicates that the vehicle-to-grid application and the mobile terminal are connected, the second event to be sent by the target module to the vehicle-to-grid application is obtained.
[0033] Specifically, when a new interactive event occurs that requires reading the status of the vehicle-to-grid application or controlling the vehicle-to-grid application, the corresponding target modules, such as steering wheel controls, maps, and music modules, can be controlled through the AIDL control algorithm. The specific steps of the AIDL control algorithm are as follows: 1. Modules such as steering wheel controls, maps, and music first need to register in the vehicle-to-everything (V2X) application, for example, by sending a registration request. After registration, the system will receive a status callback from the listener interface (onStatusChange interface).
[0034] 2. If the callback status value of the onStatusChange interface is true, it means that the target module and the vehicle interconnection application have successfully registered and connected. If it is false, it means that the vehicle interconnection application cannot be controlled by the target module and needs to be re-registered.
[0035] 3. If the connection is successful, the isConnected() method can be used to determine if there is a mobile device (such as a smartphone) connected to the vehicle-to-grid application. isConnected()=false indicates that no mobile device is connected, and the vehicle-to-grid application will not respond to the corresponding event. In this case, other connected modules can respond to the interaction event according to the vehicle's existing priority settings.
[0036] 4. If the vehicle-to-grid application indicates that it is connected to a mobile device, i.e., isConnected()=true, then the desktop card or other modules can read the information of the currently connected mobile device, such as the mobile phone brand, mobile phone name, and additional information such as message, through getPhoneInfo().
[0037] 5. If the vehicle-to-grid application indicates that it is connected to a mobile device (i.e., isConnected()=true), then when a second event occurs, such as an incoming call or media playback, other modules such as steering wheel control and navigation can use the AIDL middleware class to dispatch this second event to the vehicle-to-grid application for corresponding operations via sendPhoneKey().
[0038] In one embodiment, after acquiring the second event to be sent to the vehicle-to-grid application by the target module, the method further includes: determining whether the second event is acquired repeatedly within a preset time period; if the second event is acquired repeatedly within the preset time period, then the repeatedly acquired second event is filtered out.
[0039] In this embodiment, debouncing can be introduced, which involves filtering the same event for a preset duration when the event is input, or filtering events of the same type but different functions. Specifically, a 200ms filter can be applied to the same second event, and the preset duration can be appropriately extended when filtering events of the same type but different functions, for example, a 500ms filter. This can effectively solve the system resource consumption caused by frequent event switching and keep event distribution and processing within a reasonable range.
[0040] Step 204: Determine the target event corresponding to the second event from the first event, and send the target event to the vehicle-to-grid application through the middleware class.
[0041] In this embodiment, the target event corresponding to the second event can be determined from the predefined first event, and the target event can be sent to the vehicle-to-grid application through a middleware class. It should be understood that the first event refers to the predefined event, the second event refers to the actual event to be sent to the vehicle-to-grid application, and the target event refers to the event found in the first event that is identical to the second event.
[0042] Specifically, a middleware class can use sendPhoneKey() to dispatch the target event to the vehicle-to-grid application for corresponding operations. The specific sending instructions for different target events can be as follows: a:sendPhoneKey(CALL_ANSWER) --> Answer the phone call; b:sendPhoneKey(CALL_HANG) --> Hang up the phone; c:sendPhoneKey(MEDIA_PLAY) --> Media playback; d:sendPhoneKey(MEDIA_PAUSE) --> Media pause; e:sendPhoneKey(MEDIA_LAST) --> Switch to the previous track; f:sendPhoneKey(MEDIA_NEXT) --> Switch to the next track; g:sendPhoneKey(CONTROLL_OPEN_LINK) --> Enables car-handling connectivity; h:sendPhoneKey(CONTROLL_EXIT_LINK) --> Exit the car-handling connection; i:sendPhoneKey(CONTROLL_DISCOUNT_LINK) --> Disconnect the phone from the network; j:sendPhoneKey(CONTROLL_OPEN_VOICE) --> Wakes up the third-party voice assistant connected to the phone; k:sendPhoneKey(CONTROLL_EXIT_VOICE) --> Exit the third-party voice assistant for mobile phone interconnection; l:sendPhoneKey(CONTROLL_OPEN_NAVI) ---> Starts third-party navigation for mobile phone interconnection; m:sendPhoneKey(CONTROLL_EXIT_NAVI)--->Exit third-party navigation for mobile phone interconnection.
[0043] Additionally, if the vehicle-to-car connectivity application indicates that the mobile device is connected (isConnected()=true), then the desktop card or other modules can directly disconnect the connection between the mobile phone and the vehicle's infotainment system using disConnectDevice(). This is commonly used in scenarios where the vehicle's infotainment system is in sleep mode or other high-priority scenarios where the mobile phone needs to be disconnected before proceeding with subsequent processes. Without this control algorithm, directly physically disconnecting the vehicle's infotainment system would severely impact the user experience and the next connection process.
[0044] If the target module ceases to exist after its lifecycle ends, it needs to be unregistered using the unRegisterPhoneCarListener() method. After unregistration, the target module will no longer receive changes in the connection status between the phone and the vehicle system, and will no longer be able to control the car-phone interconnection application.
[0045] Step 205: Control the vehicle-to-vehicle interconnection application to respond to the target event, and terminate the process corresponding to the target event in the vehicle system.
[0046] This method creates a middleware class for managing and distributing events after the distribution system is initialized. The middleware class is configured with the first event that the vehicle-to-grid application is allowed to respond to. After obtaining a second event generated by other devices or modules besides the vehicle-to-grid application, the target event corresponding to the second event can be determined from the first event. The target event is then sent to the vehicle-to-grid application through the middleware class, thereby controlling the vehicle-to-grid application to respond to the target event and terminating the process corresponding to the target event in the vehicle system. During this process, the driver does not need to be distracted from operating the vehicle-to-grid application, which improves safety during driving and avoids conflicts between the corresponding processes of the vehicle-to-grid application and the vehicle system.
[0047] In one embodiment, controlling the vehicle-to-grid application to respond to a target event includes: obtaining the connection status between the vehicle-to-grid application and the mobile device; if the connection status indicates that the vehicle-to-grid application and the mobile device are connected, controlling the vehicle-to-grid application to respond to the target event; if the connection status indicates that the vehicle-to-grid application and the mobile device are not connected, controlling the vehicle-to-grid application not to respond to the target event.
[0048] In this embodiment, during the vehicle-to-grid interconnection process, upon receiving a target event, the connection status between the vehicle-to-grid interconnection application and the mobile terminal can be determined again, i.e., whether isConnected() is true. If it is true, the vehicle-to-grid interconnection application is controlled to respond to the target event. If it is false, it means that the vehicle-to-grid interconnection application and the mobile terminal have been disconnected, and the target event is not responded to. In this case, other connected modules can respond according to priority.
[0049] In one embodiment, terminating the process corresponding to the target event in the vehicle system includes: when the connection state indicates that the vehicle-to-vehicle interconnection application is connected to the mobile terminal, determining whether there is a process corresponding to the target event in the vehicle system; if there is a process corresponding to the target event in the vehicle system, terminating the process corresponding to the target event in the vehicle system.
[0050] In this embodiment, when the connection status indicates that the vehicle-to-car connectivity application is connected to the mobile device, it is determined whether a process corresponding to the target event exists in the vehicle system. If a process corresponding to the target event exists in the vehicle system, the process corresponding to the target event in the vehicle system is terminated. For example, a user initially uses the vehicle's built-in navigation module for navigation, but after using it for a period of time, finds the vehicle navigation experience unsatisfactory and wants to switch to mobile phone navigation. At this time, the user can use voice control to start mobile phone navigation (the target event is starting third-party navigation via mobile phone connectivity). After the mobile phone navigation is started, it can be synchronously mapped in the vehicle-to-car connectivity application, and it can be determined that a process corresponding to the target event exists in the vehicle system, namely the vehicle navigation. At this time, the process of vehicle navigation needs to be terminated to avoid two navigation options on the vehicle system affecting the user's driving experience. By obtaining the connection status between the mobile phone and the vehicle-to-car connectivity application when mobile phone navigation is started, and then stopping vehicle navigation, the method of this embodiment can also be applied to other ecosystems such as mobile phone music. This embodiment can solve the problem of abnormal user interface (UI) and audio experience caused by untimely response of navigation, music, and voice status in vehicle navigation, vehicle music, vehicle voice, and mobile phone ecosystem.
[0051] In one specific embodiment, control of the vehicle-to-everything (V2X) application via steering wheel controls is illustrated as an example. A flowchart illustrating the control process via steering wheel controls for the V2X application is shown below. Figure 3 ,include: Upon receiving input from the steering wheel control physical button, the system first determines if the vehicle is running. If not, no action is required. If it is running, the steering wheel control processing module uses an integrated AIDL custom framework client to globally forward events. Specifically, it first checks if its own `isConnected()` function is true. If false, it indicates the vehicle-to-car connectivity has been disconnected, and no event is responded to. Other modules connected to this service respond according to their priority, such as pre-set priorities for in-vehicle media, Bluetooth, and video. If the vehicle-to-car connectivity receives steering wheel control events via an integrated AIDL custom framework server, event processing is then performed to control functions such as music playback and answering / hanging up calls.
[0052] In the embodiments described above, this application addresses user driving scenarios from both the data and App application perspectives. It establishes a unified cross-module data input, signal classification, and signal distribution processing architecture control method, integrating multiple modules for processing. The constructed AIDL distribution system unifies the data interface for multi-terminal interaction with the vehicle-to-grid interface, allowing deployment to other system modules. Any other module can also possess the atomic capability to operate the vehicle-to-grid application. This enables users to operate the vehicle-to-grid application more quickly and can be directly applied to the steering wheel control module to reduce the impact on driving safety when users control operations such as answering and hanging up calls, playing music, pausing music, and activating navigation within the vehicle-to-grid application, thus providing an excellent user experience for intelligent automotive products.
[0053] Based on the same technical concept, the second embodiment of this application provides a control device for a vehicle-to-everything (V2X) application, such as... Figure 4 The device includes: Module 401 is created to create a middleware class in response to the initialization of the distribution system; wherein the middleware class is used to manage and distribute events. Configuration module 402 is used to configure a first event corresponding to the vehicle-to-grid interconnection application in the middleware class; wherein, the first event is an event that the vehicle-to-grid interconnection application is allowed to respond to; The acquisition module 403 is used to acquire a second event to be sent to the vehicle-to-grid application; wherein the second event is generated by other devices or modules other than the vehicle-to-grid application. The determining module 404 is used to determine the target event corresponding to the second event from the first event, and send the target event to the vehicle-to-grid application through the middleware class; The control module 405 is used to control the vehicle-to-vehicle interconnection application to respond to the target event and to terminate the process corresponding to the target event in the vehicle system.
[0054] This device creates a middleware class for managing and distributing events after the distribution system is initialized. The middleware class is configured with a first event that the vehicle-to-grid application is allowed to respond to. After obtaining a second event generated by other devices or modules besides the vehicle-to-grid application, the device can determine the target event corresponding to the second event from the first event. The target event is then sent to the vehicle-to-grid application through the middleware class, thereby controlling the vehicle-to-grid application to respond to the target event and terminating the process corresponding to the target event in the vehicle system. During this process, the driver does not need to be distracted from operating the vehicle-to-grid application, which improves driving safety and avoids conflicts between the corresponding processes of the vehicle-to-grid application and the vehicle system.
[0055] like Figure 5As shown, the third embodiment of this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs; In one embodiment, when the processor 111 executes the program stored in the memory 113, it implements the control method for the vehicle-to-grid application provided in any of the foregoing method embodiments.
[0056] The memory and processor in the aforementioned electronic devices communicate with each other via a communication bus and communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.
[0057] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0058] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0059] The fourth embodiment of this application provides a computer-readable medium having processor-executable non-volatile program code.
[0060] Optionally, in embodiments of this application, the computer-readable medium is configured to store program code for a processor to execute the above-described methods.
[0061] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0062] In specific implementation, the embodiments of this application can be referred to the above embodiments and have corresponding technical effects.
[0063] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of this application, or combinations thereof.
[0064] For software implementation, the techniques described herein can be implemented through units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented within the processor or external to the processor.
[0065] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0066] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0067] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0068] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0069] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0070] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0071] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0072] The above embodiments are merely preferred embodiments provided to fully illustrate this application, and the scope of protection of this application is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on this application are all within the scope of protection of this application.
Claims
1. A control method of a handcart interworking application, characterized by, The method comprises: in response to the distribution system initialization, creating a middleware class; wherein the middleware class is used to manage and distribute events; configuring a first event corresponding to a hand-car interconnection application in the middleware class; wherein the first event is an event that the hand-car interconnection application allows to respond to; obtaining a second event to be sent to the hand-car interconnection application; wherein the second event is generated by other devices or modules other than the hand-car interconnection application; determining a target event corresponding to the second event from the first event, and sending the target event to the hand-car interconnection application through the middleware class; controlling the hand-car interconnection application to respond to the target event, and ending a process corresponding to the target event in the car machine system.
2. The method of claim 1, wherein, The first event includes at least one of the following events: answering a phone, hanging up a phone, playing media, pausing media, previous song, next song, opening hand-car interconnection, exiting hand-car interconnection, disconnecting hand-car interconnection, waking up hand-car interconnection three-party voice assistant, exiting hand-car interconnection three-party voice assistant, starting hand-car interconnection three-party navigation, and exiting hand-car interconnection three-party navigation.
3. The method of claim 1, wherein, In response to the distribution system initialization, a middleware class is created, including: in the case of starting up on the vehicle, initializing the distribution system; after the distribution system initialization is completed, the middleware class is created in the distribution system.
4. The method of claim 1, wherein, Obtaining a second event to be sent to the hand-car interconnection application, comprising: in response to a registration request of a target module, obtaining a callback state; wherein the registration request is used for the target module to register a control channel with the middleware class; wherein the target module at least includes one of a party control module, a map module and a music module; in the case where the callback state indicates that the control channel is registered and connected successfully, obtaining a connection state of the hand-car interconnection application and a mobile terminal; in the case where the connection state indicates that the hand-car interconnection application is connected with the mobile terminal, obtaining the second event to be sent to the hand-car interconnection application by the target module.
5. The method of claim 4, wherein, After obtaining the second event to be sent to the hand-car interconnection application by the target module, the method further comprises: determining whether the second event is repeatedly obtained within a preset time period; if the second event is repeatedly obtained within the preset time period, filtering the repeatedly obtained second event.
6. The method of claim 1, wherein, Controlling the hand-car interconnection application to respond to the target event, comprising: obtaining a connection state of the hand-car interconnection application and a mobile terminal; in the case where the connection state indicates that the hand-car interconnection application is connected with the mobile terminal, controlling the hand-car interconnection application to respond to the target event; in the case where the connection state indicates that the hand-car interconnection application is not connected with the mobile terminal, controlling the hand-car interconnection application not to respond to the target event.
7. The method of claim 6, wherein, Ending a process corresponding to the target event in the car machine system, comprising: in the case where the connection state indicates that the hand-car interconnection application is connected with the mobile terminal, determining whether there is a process corresponding to the target event in the car machine system; If a process corresponding to the target event exists in the vehicle system, then the process corresponding to the target event in the vehicle system will be terminated.
8. A control device for a handcart interconnection application, characterized by The device includes: A module is created to create middleware classes in response to the initialization of the distribution system; wherein, the middleware classes are used to manage and distribute events; A configuration module is used to configure a first event corresponding to the vehicle-to-grid application in the middleware class; wherein, the first event is an event that the vehicle-to-grid application is allowed to respond to; The acquisition module is used to acquire a second event to be sent to the vehicle-to-grid application; wherein the second event is generated by other devices or modules outside the vehicle-to-grid application; The determination module is used to determine the target event corresponding to the second event from the first event, and send the target event to the vehicle-to-grid application through the middleware class; The control module is used to control the vehicle-to-vehicle interconnection application to respond to the target event and to terminate the process corresponding to the target event in the vehicle system.
9. An electronic device, comprising: It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.